<template>
  <c-page title="出口信用证通知">
    <div class="eContainer">
      <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">
          <!--PD000017 -->
          <el-tab-pane label="内容" name="ovwp">
            <c-content>
              <m-ovwp :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

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

          <!--PD000042 -->
          <el-tab-pane label="银行信息" name="ptyp">
            <c-content>
              <m-ptyp :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

          <!--PD000055 -->
          <el-tab-pane label="货物说明" name="dogp">
            <m-dogp :model="model" :codes="codes" />
          </el-tab-pane>

          <!--PD000057 -->
          <el-tab-pane label="单据要求" name="dorp">
            <m-dorp :model="model" :codes="codes" />
          </el-tab-pane>

          <!--PD000060 -->
          <el-tab-pane label="其他条款" name="adcp">
            <c-content>
              <m-adcp :model="model" :codes="codes" />
            </c-content>
          </el-tab-pane>

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

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

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

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

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

          <!--PD000546 -->
          <el-tab-pane label="附件" name="doctre">
            <m-doctre :model="model" :codes="codes" />
          </el-tab-pane>
        </c-tabs>
        <c-bus-button :$pntvm="this"></c-bus-button>
      </el-form>
      <c-grid-ety-prompt-dialog
        ref="etyDialog"
        :promptData="promptData"
        v-on:select-ety="selectEty"
      ></c-grid-ety-prompt-dialog>
    </div>
  </c-page>
</template>
<script>
import Api from "~/service/Api";
import Utils from "~/utils/index";
import CodeTable from "~/config/CodeTable";
import Letnot from "~/model/Letnot";
import commonProcess from "~/mixin/commonProcess";
import Check from "~/model/Letnot/Check";
import Default from "~/model/Letnot/Default";
import Pattern from "~/model/Letnot/Pattern";
import Ovwp from "./Ovwp";
import Detp from "./Detp";
import Ptyp from "./Ptyp";
import Dogp from "./Dogp";
import Dorp from "./Dorp";
import Adcp from "./Adcp";
import Notcha from "./Notcha";
// import Detp from "./Detp";
// import Setpan from "./Setpan";
// import Coninfp from "./Coninfp";
// import Docpan from "./Docpan";
import Doctre from "./Doctre";

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

export default {
  name: "Letnot",
  components: {
    "m-ovwp": Ovwp,
    "m-detp": Detp,
    "m-ptyp": Ptyp,
    "m-dogp": Dogp,
    "m-dorp": Dorp,
    "m-adcp": Adcp,
    "m-notcha": Notcha,
    // "m-detp": Detp,
    "m-setpan": Setpan,
    "m-coninfp": Coninfp,
    "m-docpan": Docpan,
    "m-doctre": Doctre,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "ovwp",
      trnName: "letnot",
      model: new Letnot().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules: null,
      codes: { ...CodeTable },
    };
  },
  methods: {
    tabClick() {},
  },
  created: async function () {
    console.log("进入letnot交易");
    let rtnmsg = await this.init({});
    if (rtnmsg.respCode == SUCCESS) {
      //更新数据
      Utils.copyValueFromVO(this.model, rtnmsg.data);
      if (this.isInDisplay) {
        this.restoreDisplay();
      }
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败！" });
    }
  },
};
</script>
<style>
</style>
