index.vue 3.62 KB
Newer Older
1
<template>
潘际乾 committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
    <c-page title="保证金注销">
        <div class="eContainer">
            <div class="bus-button">
                <c-button type="primary" v-on:click="handleSave">{{ $t("buttons.save") }}</c-button>
                <c-button type="primary" v-on:click="handleCheck">{{ $t("buttons.check") }}</c-button>
            </div>
            <el-form :model="model" :rules="rules" ref="modelForm" label-width="150px" label-position="right" size="small" :validate-on-rule-change="false">
            <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="myTabClick">
                
                    <!--PD000001 -->
                <el-tab-pane label="PD000001" name="opnp1">
                    <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>
            </el-form>
        </div>
    </c-page>
27 28 29 30 31
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Fctcan from "~/model/Fctcan"
wangren committed
32
import commonProcess from "~/mixin/commonProcess"
潘际乾 committed
33
import commonFuncs from "~/mixin/commonFuncs"
34 35 36
import Check from "~/model/Fctcan/Check"
import Default from "~/model/Fctcan/Default"
import Pattern from "~/model/Fctcan/Pattern"
潘际乾 committed
37
import Opnp1 from "./Opnp1"
38 39 40


export default {
潘际乾 committed
41
    name: "Fctcan",
42
    components:{
潘际乾 committed
43
        "m-opnp1" : Opnp1,
44 45 46 47 48 49
    },
    provide() {
        return {
            root: this
        }
    },
潘际乾 committed
50
    mixins: [commonProcess, commonFuncs],    // 里面包含了Default、Check等的公共处理
51 52
    data(){
        return {
潘际乾 committed
53
            tabVal: "opnp1",
54 55 56 57 58 59 60 61 62 63 64
            trnName: "fctcan",
            model: new Fctcan().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            codes: {
            },
        }
    },
    methods:{
潘际乾 committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
        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",
                });
            } 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",
                });
            }
97 98 99 100 101 102 103
        }
    },
    created:async function(){
        console.log("进入fctcan交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
潘际乾 committed
104
           this.updateModel(rtnmsg.data)
105 106 107 108 109 110 111 112 113 114 115 116 117
           //TODO 处理数据逻辑

        }
        else
        {
            this.$notify.error({title: '错误',message: '服务请求失败!'});
        }
    }
}
</script>
<style>

</style>