index.vue 3.88 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">
                
                    <!--PD000002 -->
                <el-tab-pane label="PD000002" 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 Fctopn from "~/model/Fctopn"
wangren committed
32
import commonProcess from "~/mixin/commonProcess"
潘际乾 committed
33
import commonFuncs from "~/mixin/commonFuncs"
34 35 36
import Check from "~/model/Fctopn/Check"
import Default from "~/model/Fctopn/Default"
import Pattern from "~/model/Fctopn/Pattern"
潘际乾 committed
37
import Opnp1 from "./Opnp1"
38 39 40


export default {
潘际乾 committed
41
    name: "Fctopn",
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
            trnName: "fctopn",
            model: new Fctopn().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            codes: {
潘际乾 committed
61 62
                cashcur: [],
                trmtyp: []
63 64 65 66
            },
        }
    },
    methods:{
潘际乾 committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80
        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",
                });
81 82
                this.$store.dispatch("TagsView/delView", this.$route)
                this.$router.go(-1)
潘际乾 committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
            } 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",
                });
            }
101 102 103 104 105 106 107
        }
    },
    created:async function(){
        console.log("进入fctopn交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
潘际乾 committed
108
           this.updateModel(rtnmsg.data)
109
           //TODO 处理数据逻辑
潘际乾 committed
110 111
            this.codes.cashcur = rtnmsg.codeSet.cashcur
            this.codes.trmtyp = rtnmsg.codeSet.trmtyp
112 113 114 115 116 117 118 119 120 121 122
        }
        else
        {
            this.$notify.error({title: '错误',message: '服务请求失败!'});
        }
    }
}
</script>
<style>

</style>