<template>
  <c-page title="汇入汇款">
    <div class="eContainer">
      <c-bus-button :$pntvm="this"></c-bus-button>
      <el-form
        :model="model"
        :rules="rules"
        ref="modelForm"
        label-width="150px"
        size="small"
      >
        <c-tabs ref="elment" :value="tabVal" type="card" @tab-click="tabClick">
          <el-tab-pane label="Overview" name="opnp1">
            <!--PD000020 -->
            <c-content>
            <m-opnp1 :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>
          <el-tab-pane label="账务" name="setpan">
            <!--PD000006 -->
            <m-setpan :model="model" :codes="codes" />
          </el-tab-pane>
          <el-tab-pane label="附言" name="coninfp">
            <!--PD000000 -->
            <m-coninfp :model="model" :codes="codes" />
          </el-tab-pane>
          <el-tab-pane label="报文及面函" name="docpan1">
            <!--PD000000 -->
            <m-docpan :model="model" :codes="codes" />
          </el-tab-pane>
          <el-tab-pane label="附件" name="doctre">
            <!--PD000529 -->
            <m-doctre :model="model" :codes="codes" />
          </el-tab-pane>
          <el-tab-pane label="收账通知" name="docpan2">
            <!--PD000001 -->
            <m-docpan :model="model" :codes="codes" />
          </el-tab-pane>
          <el-tab-pane label="外管信息" name="wg">
            <!--PD000546 -->
            <m-wg :model="model" :codes="codes" />
          </el-tab-pane>
          <el-tab-pane label="跨境人民币申报" name="cnyp">
            <!--PD000002 -->
            <m-cnyp :model="model" :codes="codes" />
          </el-tab-pane>
        </c-tabs>
      </el-form>
    </div>
  </c-page>
</template>
<script>
import Api from "~/service/Api";
import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable";
import Cptadv from "~/model/Cptadv";
import CommonProcess from "~/mixin/CommonProcess";
import Pattern from "~/model/Cptadv/Pattern";
import Opnp1 from "./Opnp1";
import Wg from "./Wg";
// import Setpan from "./Setpan";
// import Coninfp from "./Coninfp";
// import Docpan from "./Docpan";
import Doctre from "./Doctre";
import Cnyp from "./Cnyp";

import Setpan from "~/views/Public/Setpan";
import Coninfp from "~/views/Public/Coninfp";
import Docpan from "~/views/Public/Docpan";
import Ptap from "~/views/Public/Ptap";

export default {
  name: "Cptadv",
  components: {
    "m-opnp1": Opnp1,
    "m-wg": Wg,
    "m-setpan": Setpan,
    "m-coninfp": Coninfp,
    "m-docpan": Docpan,
    "m-doctre": Doctre,
    "m-cnyp": Cnyp,
    "m-ptap": Ptap,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "opnp1",
      trnName: "cptadv",
      model: new Cptadv().data,
      // defaultRule:Default,
      // rules:this.mergeRules(Pattern,Check),
      rules: Pattern,
      codes: { ...CodeTable },
    };
  },
  methods: {},
  created: async function () {
    console.log("进入cptadv交易");
    // let rtnmsg = await Api.post("cptadv/init",{params:{}});
    let rtnmsg = await this.init(this.$route.query);
    if (rtnmsg.respCode == SUCCESS) {
      //TODO 处理数据逻辑
      Utils.copyValueFromVO(this.model, rtnmsg.data);
      if (this.isInDisplay) {
        this.restoreDisplay();
      }
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败！" });
    }
  },
};
</script>
<style>
</style>
