<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>
    </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="tabClick">
        <!--PD000001 -->
        <el-tab-pane label="amep" name="amep">
          <c-content>
            <m-amep :model="model" :codes="codes" />
          </c-content>
        </el-tab-pane>
        <!--PD000001 -->
        
        <el-tab-pane label="ovwp" name="ovwp">
          <c-content>
          <m-ovwp :model="model" :codes="codes" />
          </c-content>
        </el-tab-pane>

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

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

        <!--PD000077 -->
        <el-tab-pane label="detp" name="detp">
          <c-content>
          <m-detp :model="model" :codes="codes" />
          </c-content>
        </el-tab-pane>

        <!--PD000328 -->
        <el-tab-pane label="dogpame" name="dogpame">
          <!-- <m-dogpame :model="model" :codes="codes" /> -->
          <c-content>
            <m-doxpame
              :model="model"
              :codes="codes"
              :recgrp="'ltdgrp'"
              :ametyp="'lcrgod'"
            />
          </c-content>
        </el-tab-pane>

        <!--PD000324 -->
        <el-tab-pane label="dorpame" name="dorpame">
          <c-content>
            <m-doxpame
              :model="model"
              :codes="codes"
              :recgrp="'ltdgrp'"
              :ametyp="'lcrdoc'"
            />
          </c-content>
        </el-tab-pane>

        <!--PD000332 -->
        <el-tab-pane label="adcpame" name="adcpame">
          <c-content>
            <m-doxpame
              :model="model"
              :codes="codes"
              :recgrp="'ltdgrp'"
              :ametyp="'adlcnd'"
            />
          </c-content>
        </el-tab-pane>

        <!--PD000169 -->
        <el-tab-pane label="lttinf" name="lttinf">
          <c-content>
          <m-lttinf :model="model" :codes="codes" />
          </c-content>
        </el-tab-pane>

        <!--PD000400 -->
        <el-tab-pane
          v-if="model.ltdgrp.rec.spcrcbflg"
          label="Spc.Pay Conditions for Ban"
          name="sprpame"
        >
          <c-content>
            <m-doxpame
              :model="model"
              :codes="codes"
              :recgrp="'ltdgrp'"
              :ametyp="'spcrcb'"
            />
          </c-content>
        </el-tab-pane>

        <!--PD000396 -->
        <el-tab-pane
          v-if="model.ltdgrp.rec.spcbenflg"
          label="Spc.Pay Conditions for Ben"
          name="spbpame"
        >
          <c-content>
            <m-doxpame
              :model="model"
              :codes="codes"
              :recgrp="'ltdgrp'"
              :ametyp="'spcben'"
            />
          </c-content>
        </el-tab-pane>
      </c-tabs>
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Lttame from "~/model/Lttame";
import CommonProcess from "~/mixin/CommonProcess";
import CommonFuncs from "~/mixin/CommonFuncs";
import Check from "~/model/Lttame/Check";
import Default from "~/model/Lttame/Default";
import Pattern from "~/model/Lttame/Pattern";
import Ovwp from "./Ovwp";
import Amep from "./Amep";
import Aamp from "./Aamp";
import Ptyp from "./Ptyp";
import Detp from "./Detp";
import Dogpame from "./Dogpame";
import Dorpame from "./Dorpame";
import Adcpame from "./Adcpame";
import Lttinf from "./Lttinf";
import Doxpame from "~/views/Public/Doxpame";

export default {
  name: "Lttame",
  components: {
    "m-amep": Amep,
    "m-ovwp": Ovwp,
    "m-aamp": Aamp,
    "m-ptyp": Ptyp,
    "m-detp": Detp,
    "m-dogpame": Dogpame,
    "m-dorpame": Dorpame,
    "m-adcpame": Adcpame,
    "m-lttinf": Lttinf,
    "m-doxpame": Doxpame,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [CommonProcess, CommonFuncs], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "amep",
      trnName: "lttame",
      model: new Lttame().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules: null,
      codes: { ...CodeTable },
    };
  },
  methods: {
    tabClick() {},
  },
  created: async function () {
    console.log("进入lttame交易");
    let rtnmsg = await this.init({});
    if (rtnmsg.respCode == SUCCESS) {
      this.updateModel(rtnmsg.data);
      Utils.copyValueFromVO(this.model, rtnmsg.data);
      if (this.isInDisplay) {
        this.restoreDisplay();
      }
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败！" });
    }
  },
};
</script>
<style>
</style>
