<template>
  <div class="eContainer">
    <c-function-btn
      :handleSubmit="handleSubmit"
      :handleCheck="handleCheck"
      :handleStash="handleStash"
    >
      <el-button size="small">流程附言</el-button>
      <el-button size="small">交易历史</el-button>
      <el-button size="small">备忘录</el-button>
      <el-button size="small">影像信息</el-button>
      <!-- <el-button size="small">保存模板</el-button> -->
      <!-- <el-button size="small">使用模板</el-button> -->
      <el-button size="small">制裁信息</el-button>
      <!-- <el-button size="small">拆分报文</el-button> -->
      <el-button size="small">智能提示</el-button>
    </c-function-btn>
    <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">
        
             <!--PD001291 -->
           <el-tab-pane  label="开立方式" name="opnp">
                <m-opnp :model="model" :codes="codes"/>
           </el-tab-pane>
          
            <!-- <el-tab-pane v-if="model.gitp.swiftflg=='Y'" label="world" name="world">
                <c-content>
                    <m-world :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>
            <el-tab-pane v-if="model.gitp.swiftflg=='N'" label="hello" name="hello">
                <c-content>
                    <m-hello :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane> -->
            <!-- <el-tab-pane v-if="model.gitp.swiftflg==''" label="Overview" name="ovwp">
                <c-content>
                     <m-ovwp :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane> -->

          <!--PD000002 -->
          <!-- <el-tab-pane v-if="model.gitp.swiftflg=='Y'" label="Overview" name="ovwp20">
                <c-content>
                     <m-ovwp20 :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane> -->
           
           <el-tab-pane label="Overview" name="ovwp">
                <c-content>
                    <m-ovwp :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane>

           
           <!--PD000043 -->
           <el-tab-pane label="Parties" name="ptyp">
            <c-content>
                <m-ptyp :model="model" :codes="codes"/>
            </c-content>   
           </el-tab-pane>

            <!--PD000761 -->
            <!-- <el-tab-pane v-if="model.gitp.swiftflg==''" label="Presentation/Delivery" name="preperp">
                <c-content>
                     <m-preperp :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane> -->
 

           <el-tab-pane v-if="model.gitp.swiftflg=='Y'||model.gitp.swiftflg==''" label="Presentation/Delivery" name="preperp">
                <c-content>
                     <m-preperp :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane>
 
            <!--PD000389 -->
           <el-tab-pane label="Details" name="detp">
                <c-content>
                    <m-detp :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane>
 
            <!-- PD000785 -->
           <!-- <el-tab-pane label="PD000785" name="gidtxtpc">
                <c-content>
                    <m-gidtxtpc :model="model" :codes="codes"/>
                </c-content>  
           </el-tab-pane> -->
 
           <el-tab-pane label="Undertaking Text" name="gidtxtp">
                <c-content>
                    <m-gidtxtp :model="model" :codes="codes"/>
                </c-content>
           </el-tab-pane>


            <el-tab-pane v-if="model.gitp.swiftflg=='N'&&model.gidgrp.rec.drpreflg=='R'" label="Declaration of Readiness" name="decrea">
                <c-content>
                    <m-decrea :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane v-if="model.gitp.swiftflg=='N'&&model.gidgrp.rec.drpreflg=='R'" label="Liability" name="liability">
                <c-content>
                    <m-engp :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane label="settlement" name="setpan">
                <c-content>
                    <m-setpan :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>
            
            <el-tab-pane label="Completion" name="comletion">
                <c-content>
                    <m-coninfp :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane label="Messages" name="messages">
                <c-content>
                    <m-docpan :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane label="Attachments" name="attachments">
                <c-content>
                    <m-doctre :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane v-if="model.gitp.swiftflg=='N'&&model.gidgrp.ghd.segtyp=='02'" label="汇总征税" name="detpp">
                <c-content>
                    <m-detpp :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane label="统一授信" name="limitbody">
                <c-content>
                    <m-limitbody :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane v-if="model.gidgrp.rec.purpos=='ISCO'||model.gidgrp.rec.purpos=='ICCO'" label="Seq C : Overview" name="ovwpc">
                <c-content>
                    <m-ovwpc :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane v-if="model.gidgrp.rec.purpos=='ISCO'||model.gidgrp.rec.purpos=='ICCO'" label="Seq C : Parties" name="ptypc">
                <c-content>
                    <m-ptypc :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>

            <el-tab-pane v-if="model.gidgrp.rec.purpos=='ISCO'||model.gidgrp.rec.purpos=='iCCO'" label="Seq C : Presentation/Delivery" name="preperpc">
                <c-content>
                    <m-preperpc :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>
            <el-tab-pane v-if="model.gidgrp.rec.purpos=='ISCO'||model.gidgrp.rec.purpos=='ICCO'" label="Seq C : Details" name="detpc">
                <c-content>
                    <m-detpc :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>
             <el-tab-pane v-if="model.gidgrp.rec.purpos=='ISCO'||model.gidgrp.rec.purpos=='ICCO'" label="Seq C : Undertaking Text" name="gidtxtpc">
                <c-content>
                    <m-gidtxtpc :model="model" :codes="codes"/>
                </c-content>
            </el-tab-pane>
       </c-tabs>
    
    </el-form>
      <c-grid-ety-prompt-dialog ref="etyDialog" :promptData="promptData" v-on:select-ety="selectEty">
    </c-grid-ety-prompt-dialog>
  </div>

</template>
<script>
import Api from "~/service/Api"
import CodeTable from "~/config/CodeTable"
import Gitpop from "~/model/Gitpop"
import commonProcess from "~/mixin/commonProcess"
import commonFuncs from "~/mixin/commonFuncs";
import Check from "~/model/Gitpop/Check"
import Default from "~/model/Gitpop/Default"
import Pattern from "~/model/Gitpop/Pattern"

import Detp from "./Detp"
import Opnp from "./Opnp"
import Ovwp from "./Ovwp"
import Ovwp20 from "./Ovwp20"
import Ptyp from "./Ptyp"
import Preperp from "./Preperp"
import Gidtxtp from "./Gidtxtp"
import Decrea from "./Decrea"
import Detpp from "./Detpp"
import Ovwpc from "./Ovwpc"
import Ptypc from "./Ptypc"
import Preperpc from "./Preperpc"
import Detpc from "./Detpc"
import Gidtxtpc from "./Gidtxtpc"

import Setpan from "~/views/Public/Setpan";
import Coninfp from "~/views/Public/Coninfp";
import Docpan from "~/views/Public/Docpan";
import Doctre from "~/views/Public/Doctre";
import Limitbody from "~/views/Public/Limitbody";
import Engp from "~/views/Public/Engp"

export default {
    name: "Gitpop",
    components:{
        "m-detp" : Detp,
        // "m-gidtxtpc" : Gidtxtpc,
        "m-opnp" : Opnp,
        "m-ovwp" : Ovwp,
        "m-ptyp" : Ptyp,
        "m-preperp" : Preperp,
        "m-gidtxtp" : Gidtxtp,
        "m-setpan" : Setpan,
        "m-coninfp" : Coninfp,
        "m-docpan" : Docpan,
        "m-doctre" :Doctre,
        "m-limitbody" : Limitbody,
        "m-ovwp20" : Ovwp20,
        "m-decrea" : Decrea,
        "m-engp" :Engp,
        "m-detpp" :Detpp,
        "m-ovwpc" :Ovwpc,
        "m-ptypc" : Ptypc,
        "m-preperpc" :Preperpc,
        "m-detpc" :Detpc,
        "m-gidtxtpc" :Gidtxtpc,
    },
    provide() {
        return {
            root: this
        }
    },
    mixins: [commonProcess,commonFuncs],    // 里面包含了Default、Check等的公共处理
    data(){
        return {
            tabVal: "opnp",
            trnName: "gitpop",
            model: new Gitpop().data,
            checkRules: Check,
            defaultRules: Default,
            pattern: Pattern,
            rules: null,
            codes: {
               ...CodeTable,
            },
        }
    },
    methods:{
        myTabClick(tab){
            this.tabClick(tab)
            /**
            *  do it yourself
            **/
        }
    },
    created:async function(){
        console.log("进入gitpop交易");
        let rtnmsg = await this.init({})
        if(rtnmsg.respCode == SUCCESS)
        {
           this.updateModel(rtnmsg.data)
           //TODO 处理数据逻辑

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

</style>
