<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"
        label-position="left"
        size="small"
        :validate-on-rule-change="false"
      >
        <c-tabs v-model="tabVal" ref="elment" type="card" @tab-click="tabClick">
          <!--PD000009 -->
          <el-tab-pane label="明细" name="betdcrs">
            <c-content>
              <m-betdcrs :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000026 -->
          <el-tab-pane label="概况" name="betdcrd">
            <c-content>
              <m-betdcrd :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000027 -->
          <el-tab-pane label="或有" name="engp">
            <c-content>
              <m-engp :model="model" :codes="codes" />
            </c-content> 
          </el-tab-pane>

          <!--PD000020 -->
          <el-tab-pane label="信用证详情" name="detp">
            <c-content>
              <m-detp :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000000 -->
          <el-tab-pane label="账务" name="setpan">
            <c-content>
              <m-setpan :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000001 -->
          <el-tab-pane label="分录" name="glepan">
            <c-content>
              <m-glepan :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

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

          <!--PD000529 -->
          <el-tab-pane label="报文及面函" name="docpan">
            <c-content>
              <m-docpan :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000546 -->
          <el-tab-pane label="附件" name="doctre">
            <c-content>
              <m-doctre :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>
        </c-tabs>
      </el-form>
    </div>
  </c-page>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Betdcr from "~/model/Betdcr";
import commonProcess from "~/mixin/commonProcess";
import Check from "~/model/Betdcr/Check";
import Default from "~/model/Betdcr/Default";
import Pattern from "~/model/Betdcr/Pattern";
import Betdcrd from "./Betdcrd";
//import Engp from "./Engp"
import Detp from "./Detp";
//import Setpan from "./Setpan"
//import Glepan from "./Glepan"
//import Coninfp from "./Coninfp"
//import Docpan from "./Docpan"
import Doctre from "./Doctre";
import Betdcrs from "./Betdcrs";

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

export default {
  components: {
    "m-betdcrd": Betdcrd,
    "m-engp": Engp,
    "m-detp": Detp,
    "m-setpan": Setpan,
    "m-glepan": Glepan,
    "m-coninfp": Coninfp,
    "m-docpan": Docpan,
    "m-doctre": Doctre,
    "m-betdcrs": Betdcrs,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "betdcrs",
      trnName: "betdcr",
      model: new Betdcr().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules: null,
      codes: { ...CodeTable },
    };
  },
  methods: {
    tabClick() {},
  },
  created: async function () {
    console.log("进入betdcr交易");
    let rtnmsg = await this.init({});
    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>
