<template>
  <c-page title="汇出汇款">
    <div class="eContainer">
      <el-form
        :model="model"
        :rules="rules"
        ref="modelForm"
        label-width="200px"
        size="small"
        :validate-on-rule-change="false"
      >
        <el-tabs :value="tabVal" ref="elment" type="card" @tab-click="tabClick">
          <el-tab-pane label="Overview" name="opnp1">
            <!--PD000020 -->
            <m-opnp1 :model="model" :codes="codes" />
          </el-tab-pane>

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

          <el-tab-pane label="Bookings" name="glepan">
            <!--PD000001 -->
            <m-glepan :model="model" :codes="codes" ref="glepan"/>
          </el-tab-pane>

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

          <el-tab-pane label="Messages" name="docpan">
            <!--PD000529 -->
            <m-docpan :model="model" :codes="codes" />
          </el-tab-pane>

          <el-tab-pane label="Attachments" name="doctre">
            <!--PD000546 -->
            <m-doctre :model="model" :codes="codes" />
          </el-tab-pane>

          <el-tab-pane label="Finance" name="finp">
            <!--PD000218 -->
            <m-finp :model="model" :codes="codes" />
          </el-tab-pane>

          <el-tab-pane label="外管信息" name="wg">
            <!--PD000009 -->
            <m-wg :model="model" :codes="codes"/>
          </el-tab-pane>
          
          <el-tab-pane label="境内汇款申请书-基础信息" name="dbe" v-if="model.bopmod.szflg === '2' && model.bopmod.basflg">
            <m-dbe :model="model" :codes="codes"></m-dbe>
          </el-tab-pane>
          <el-tab-pane label="境外汇款申请书-基础信息" name="dbb" v-if="model.bopmod.szflg === '1' && model.bopmod.basflg">
            <m-dbb :model="model" :codes="codes"></m-dbb>
          </el-tab-pane>

          <el-tab-pane label="跨境人民币申报" name="cnyp">
            <!--PD000002 -->
            <m-cnyp :model="model" :codes="codes"/>
          </el-tab-pane>
          <el-tab-pane label="2111跨境支出信息" name="outp" v-if="model.cnybop.outflg==='1'">
            <m-outp :model="model" :codes="codes"></m-outp>
          </el-tab-pane>
        </el-tabs>
        <c-bus-button :$pntvm="this"></c-bus-button>
      </el-form>
    </div>
    
    <c-grid-ety-prompt-dialog ref="etyDialog" :promptData="promptData" v-on:select-ety="selectEty"></c-grid-ety-prompt-dialog>
  </c-page>
</template>
<script>
import Api from "~/service/Api";
import Utils from "~/utils/index"
import CodeTable from "~/config/CodeTable";
import Cptopn from "~/model/Cptopn";
import CommonProcess from "~/mixin/CommonProcess";
import Pattern from "~/model/Cptopn/Pattern";
import Default from "~/model/Cptopn/Default";
import Check from "~/model/Cptopn/Check";
import Opnp1 from "./Opnp1";
import Coninfp from "./Coninfp";
import Doctre from "./Doctre";
import Finp from "./Finp";
import Wg from "./Wg";
import Cnyp from "./Cnyp";
import Dbe from "./Dbe.vue"
import Dbb from "./Dbb.vue"
import Outp from "./Outp.vue"

import Glepan from "~/views/Public/Glepan"
import Setpan from "~/views/Public/Setpan"
import Docpan from "~/views/Public/Docpan"

export default {
  name: 'Cptopn',
  components: {
    "m-opnp1": Opnp1,
    "m-setpan": Setpan,
    "m-glepan": Glepan,
    "m-coninfp": Coninfp,
    "m-docpan": Docpan,
    "m-doctre": Doctre,
    "m-finp": Finp,
    "m-wg": Wg,
    "m-cnyp": Cnyp,
    "m-dbe": Dbe,
    "m-dbb": Dbb,
    "m-outp": Outp
  },
    provide() {
        return {
            root: this
        }
    },
  mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal:"opnp1",
      trnName:"cptopn",
      model: new Cptopn().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules:null,
      codes: {...CodeTable},
    };
  },
  methods:{
  },
  created: async function () {
    console.log("进入cptopn交易");
    let rtnmsg = await Api.post("cptopn/init", { params: {} });
    if (rtnmsg.respCode == SUCCESS) {
      Utils.copyValueFromVO(this.model,rtnmsg.data)
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败！" });
    }
  },
};
</script>
<style>
</style>
