<template>
  <div class="eContainer">
    <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">
        
            <!--Ovweview -->
           <el-tab-pane label="Ovweview" name="opnp1">
                <m-opnp1 :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--Parties -->
           <el-tab-pane label="Parties" name="pardet">
                <m-pardet :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--Settlements -->
           <el-tab-pane label="Settlements" name="setpan">
                <m-setpan :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--Completion -->
           <el-tab-pane label="Completion" name="coninfp">
                <m-coninfp :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000018 -->
           <el-tab-pane label="PD000018" name="addinf">
                <m-addinf :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--Attachments -->
           <el-tab-pane label="Attachments" name="doctre">
                <m-doctre :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--Messages -->
           <el-tab-pane label="Messages" name="docpan">
                <m-docpan :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000006 -->
           <el-tab-pane label="PD000006" name="wg">
                <m-wg :model="model" :codes="codes"/>
           </el-tab-pane>
       </c-tabs>
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Cptati from "~/model/Cptati"
import commonProcess from "~/mixin/commonProcess"
import Check from "~/model/Cptati/Check"
import Default from "~/model/Cptati/Default"
import Pattern from "~/model/Cptati/Pattern"
import Opnp1 from "./Opnp1"
import Pardet from "./Pardet"
import Setpan from "./Setpan"
import Coninfp from "./Coninfp"
import Addinf from "./Addinf"
import Doctre from "./Doctre"
import Docpan from "./Docpan"
import Wg from "./Wg"


export default {
    name: "Cptati",
    components:{
        "m-opnp1" : Opnp1,
        "m-pardet" : Pardet,
        "m-setpan" : Setpan,
        "m-coninfp" : Coninfp,
        "m-addinf" : Addinf,
        "m-doctre" : Doctre,
        "m-docpan" : Docpan,
        "m-wg" : Wg,
    },
    provide() {
        return {
            root: this
        }
    },
    mixins: [commonProcess],    // 里面包含了Default、Check等的公共处理
    data(){
        return {
            tabVal: "",
            trnName: "cptati",
            model: new Cptati().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            codes: {
            },
        }
    },
    methods:{
        myTabClick(tab){
            this.tabClick(tab)
            /**
            *  do it yourself
            **/
        }
    },
    created:async function(){
        console.log("进入cptati交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
           this.updateModel(rtnmsg.data)
           //TODO 处理数据逻辑

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

</style>
