<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">
        
            <!--PD000017 -->
           <el-tab-pane label="PD000017" name="ovwp">
                <m-ovwp :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000405 -->
           <el-tab-pane label="PD000405" name="detp">
                <m-detp :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000494 -->
           <el-tab-pane label="PD000494" name="detp1">
                <m-detp1 :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000525 -->
           <el-tab-pane label="PD000525" name="detp2">
                <m-detp2 :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000548 -->
           <el-tab-pane label="PD000548" name="stament">
                <m-stament :model="model" :codes="codes"/>
           </el-tab-pane>
 
            <!--PD000001 -->
           <el-tab-pane label="PD000001" name="aamp">
                <m-aamp :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 Detame from "~/model/Detame"
import CommonProcess from "~/mixin/CommonProcess"
import Check from "~/model/Detame/Check"
import Default from "~/model/Detame/Default"
import Pattern from "~/model/Detame/Pattern"
import Ovwp from "./Ovwp"
import Detp from "./Detp"
import Detp1 from "./Detp1"
import Detp2 from "./Detp2"
import Stament from "./Stament"
import Aamp from "./Aamp"


export default {
    name: "Detame",
    components:{
        "m-ovwp" : Ovwp,
        "m-detp" : Detp,
        "m-detp1" : Detp1,
        "m-detp2" : Detp2,
        "m-stament" : Stament,
        "m-aamp" : Aamp,
    },
    provide() {
        return {
            root: this
        }
    },
    mixins: [CommonProcess],    // 里面包含了Default、Check等的公共处理
    data(){
        return {
            tabVal: "",
            trnName: "detame",
            model: new Detame().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            codes: {
            },
        }
    },
    methods:{
        myTabClick(tab){
            this.tabClick(tab)
            /**
            *  do it yourself
            **/
        }
    },
    created:async function(){
        console.log("进入detame交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
           this.updateModel(rtnmsg.data)
           //TODO 处理数据逻辑

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

</style>
