<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-content>
                    <m-infsea v-show="!showPanel" :model="model"
                         :codes="codes" ref="infsea" />
               </c-content>
               <c-tabs v-model="tabVal" v-show="showPanel" ref="elment" type="card" @tab-click="myTabClick">

                    <!--PD000006 -->
                    <el-tab-pane label="infsea" name="infsea">
                         <m-infsea :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000262 -->
                    <el-tab-pane label="ovwp" name="ovwp">
                         <m-ovwp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000266 -->
                    <el-tab-pane label="ptyp" name="ptyp">
                         <m-ptyp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000280 -->
                    <el-tab-pane label="instrecp" name="instrecp">
                         <m-instrecp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000049 -->
                    <el-tab-pane label="inst" name="inst">
                         <m-inst :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000000 -->
                    <el-tab-pane label="coninfp" name="coninfp">
                         <m-coninfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000013 -->
                    <el-tab-pane label="trnpan" name="trnpan">
                         <m-trnpan :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000019 -->
                    <el-tab-pane label="cbsinfp" name="cbsinfp">
                         <m-cbsinfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000028 -->
                    <el-tab-pane label="cbeinfp" name="cbeinfp">
                         <m-cbeinfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000111 -->
                    <el-tab-pane label="fepinfp" name="fepinfp">
                         <m-fepinfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000162 -->
                    <el-tab-pane label="sepinfp" name="sepinfp">
                         <m-sepinfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000177 -->
                    <el-tab-pane label="gleinfp" name="gleinfp">
                         <m-gleinfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000119 -->
                    <el-tab-pane label="smhinfp" name="smhinfp">
                         <m-smhinfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000130 -->
                    <el-tab-pane label="peninfp" name="peninfp">
                         <m-peninfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000147 -->
                    <el-tab-pane label="liainfp" name="liainfp">
                         <m-liainfp :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000005 -->
                    <el-tab-pane label="prtpan" name="prtpan">
                         <m-prtpan :model="model" :codes="codes" />
                    </el-tab-pane>

                    <!--PD000185 -->
                    <el-tab-pane label="ordpan" name="ordpan">
                         <m-ordpan :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 Infbod from "~/model/Infbod"
import commonProcess from "~/mixin/commonProcess"
import Check from "~/model/Infbod/Check"
import Default from "~/model/Infbod/Default"
import Pattern from "~/model/Infbod/Pattern"
import Infsea from "./Infsea"
import Ovwp from "./Ovwp"
import Ptyp from "./Ptyp"
import Instrecp from "./Instrecp"
import Inst from "./Inst"
import Coninfp from "./Coninfp"
import Trnpan from "./Trnpan"
import Cbsinfp from "./Cbsinfp"
import Cbeinfp from "./Cbeinfp"
import Fepinfp from "./Fepinfp"
import Sepinfp from "./Sepinfp"
import Gleinfp from "./Gleinfp"
import Smhinfp from "./Smhinfp"
import Peninfp from "./Peninfp"
import Liainfp from "./Liainfp"
import Prtpan from "./Prtpan"
import Ordpan from "./Ordpan"


export default {
     name: "Infbod",
     components: {
          "m-infsea": Infsea,
          "m-ovwp": Ovwp,
          "m-ptyp": Ptyp,
          "m-instrecp": Instrecp,
          "m-inst": Inst,
          "m-coninfp": Coninfp,
          "m-trnpan": Trnpan,
          "m-cbsinfp": Cbsinfp,
          "m-cbeinfp": Cbeinfp,
          "m-fepinfp": Fepinfp,
          "m-sepinfp": Sepinfp,
          "m-gleinfp": Gleinfp,
          "m-smhinfp": Smhinfp,
          "m-peninfp": Peninfp,
          "m-liainfp": Liainfp,
          "m-prtpan": Prtpan,
          "m-ordpan": Ordpan,
     },
     provide() {
          return {
               root: this
          }
     },
     mixins: [commonProcess],    // 里面包含了Default、Check等的公共处理
     data() {
          return {
               tabVal: "infsea",
               trnName: "infbod",
               model: new Infbod().data,
               checkRules: Check,
               defaultRules: Default,
               pattern: Pattern,
               rules: null,
               showPanel:false,
               codes: {
                    ...CodeTable
               },
          }
     },
     methods: {
          myTabClick(tab) {
               this.tabClick(tab)
               /**
               *  do it yourself
               **/
          }
     },
     created: async function () {
          console.log("进入infbod交易");
          let rtnmsg = await this.init({})
          if (rtnmsg.respCode == SUCCESS) {
               this.updateModel(rtnmsg.data)
               // TODO 处理数据逻辑

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