index.vue 3.95 KB
Newer Older
1
<template>
2 3
    <div class="eContainer">
        <c-page title="保证金收取">
4
            <el-form :model="model" :rules="rules" ref="modelForm" label-width="120px" label-position="right" size="small" :validate-on-rule-change="false">
潘际乾 committed
5 6
            <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="myTabClick">
                    <!--PD000002 -->
7
                <el-tab-pane label="概要" name="opnp1">
潘际乾 committed
8 9 10 11 12 13 14 15 16 17 18
                    <c-content>
                        <m-opnp1 :model="model" :codes="codes"/>
                    </c-content> 
                </el-tab-pane>
            </c-tabs>
                <c-grid-ety-prompt-dialog
                    ref="etyDialog"
                    :promptData="promptData"
                    v-on:select-ety="selectEty"
                >
                </c-grid-ety-prompt-dialog>
19 20 21 22 23 24
                <c-function-btn
                    :handleSubmit="handleSubmit"
                    :handleCheck="handleCheck"
                    :handleStash="handleStash"
                >
                </c-function-btn>
潘际乾 committed
25
            </el-form>
26 27
        </c-page>
    </div>
28 29 30 31 32
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Fctopn from "~/model/Fctopn"
wangren committed
33
import commonProcess from "~/mixin/commonProcess"
潘际乾 committed
34
import commonFuncs from "~/mixin/commonFuncs"
35 36 37
import Check from "~/model/Fctopn/Check"
import Default from "~/model/Fctopn/Default"
import Pattern from "~/model/Fctopn/Pattern"
潘际乾 committed
38
import Opnp1 from "./Opnp1"
39 40 41


export default {
潘际乾 committed
42
    name: "Fctopn",
43
    components:{
潘际乾 committed
44
        "m-opnp1" : Opnp1,
45 46 47 48 49 50
    },
    provide() {
        return {
            root: this
        }
    },
潘际乾 committed
51
    mixins: [commonProcess, commonFuncs],    // 里面包含了Default、Check等的公共处理
52 53
    data(){
        return {
潘际乾 committed
54
            tabVal: "opnp1",
55 56 57 58 59 60 61
            trnName: "fctopn",
            model: new Fctopn().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            codes: {
潘际乾 committed
62
                cashcur: [],
63 64
                trmtyp: [],
                ...CodeTable,
65 66 67 68
            },
        }
    },
    methods:{
潘际乾 committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82
        myTabClick(tab){
            this.tabClick(tab)
            /**
            *  do it yourself
            **/
        },
        async handleSave() {
            let result = await this.save();
            if (result.respCode == SUCCESS && Object.keys(result.fieldErrors).length == 0) {
                this.$notify({
                    title: "成功",
                    message: "保存成功",
                    type: "success",
                });
83 84
                this.$store.dispatch("TagsView/delView", this.$route)
                this.$router.go(-1)
潘际乾 committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
            } else if(result.fieldErrors && Object.keys(result.fieldErrors).length > 0 ){
                const tab = this.showBackendErrors(result.fieldErrors)
                if (tab) {
                    // tab切换之后,需出发tab-click的事件
                    this.tabClick(tab);
                }
                this.$notify({
                    title: "错误",
                    message: "检核失败!",
                    type: "error",
                });
            } else{
                this.$notify({
                    title: "失败",
                    message: "保存失败",
                    type: "error",
                });
            }
103 104 105 106 107 108 109
        }
    },
    created:async function(){
        console.log("进入fctopn交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
潘际乾 committed
110
           this.updateModel(rtnmsg.data)
111
           //TODO 处理数据逻辑
潘际乾 committed
112 113
            this.codes.cashcur = rtnmsg.codeSet.cashcur
            this.codes.trmtyp = rtnmsg.codeSet.trmtyp
114 115 116
            if (this.isInDisplay) {
                this.restoreDisplay();
            }
117 118 119 120 121 122 123 124 125 126 127
        }
        else
        {
            this.$notify.error({title: '错误',message: '服务请求失败!'});
        }
    }
}
</script>
<style>

</style>