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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        <!--PD000001 -->
        <el-tab-pane label="PD000001" name="glepan">
          <m-glepan :model="model" :codes="codes" />
        </el-tab-pane>
      </c-tabs>
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Letrsv from "~/model/Letrsv";
import CommonProcess from "~/mixin/CommonProcess";
import Check from "~/model/Letrsv/Check";
import Default from "~/model/Letrsv/Default";
import Pattern from "~/model/Letrsv/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 Setpan from "./Setpan";
import Coninfp from "./Coninfp";
import Docpan from "./Docpan";
import Doctre from "./Doctre";
import Engp from "./Engp";
import Revp from "./Revp";
import Aamp from "./Aamp";
import Spcbenp from "./Spcbenp";
import Spcrcvp from "./Spcrcvp";
import Glepan from "./Glepan";

export default {
  components: {
    "m-ovwp": Ovwp,
    "m-detp": Detp,
    "m-ptyp": Ptyp,
    "m-dogp": Dogp,
    "m-dorp": Dorp,
    "m-adcp": Adcp,
    "m-setpan": Setpan,
    "m-coninfp": Coninfp,
    "m-docpan": Docpan,
    "m-doctre": Doctre,
    "m-engp": Engp,
    "m-revp": Revp,
    "m-aamp": Aamp,
    "m-spcbenp": Spcbenp,
    "m-spcrcvp": Spcrcvp,
    "m-glepan": Glepan,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [CommonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "ovwp",
      trnName: "letrsv",
      model: new Letrsv().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules: null,
      codes: {},
    };
  },
  methods: {
    tabClick() {},
  },
  created: async function () {
    console.log("进入letrsv交易");
    let rtnmsg = await this.init({});
    if (rtnmsg.respCode == SUCCESS) {
      //TODO 处理数据逻辑
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败！" });
    }
  },
};
</script>
<style>
</style>
