<template>
  <div class="eContainer">
    <el-form
      :model="model"
      :rules="rules"
      ref="modelForm"
      tokenKey="modelForm"
      :validate-on-rule-change="false"
      label-width="150px"
      size="small"
    >
      <!-- <el-tabs ref="elment" type="card" @tab-click="tabClick">
                <el-tab-pane label="复核夹查询"> -->
      <!-- <c-content> -->
        <m-inftrnps :model="model" :codes="codes" ref="inftrnps" />
      <!-- </c-content> -->
      <!-- </el-tab-pane>
            </el-tabs> -->
    </el-form>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Trnrel from "~/Model/Trnrel";
import commonProcess from "~/mixin/commonProcess";
import Pattern from "~/Model/Trnrel/Pattern";
import Default from "~/model/Trnrel/Default";
import Check from "~/model/Trnrel/Check";
import Inftrnps from "./Inftrnps";
import Trnp0 from "./Trnp0";
import Trnpwfm from "./Trnpwfm";
import Trnpevt from "./Trnpevt";
import Trnpack from "./Trnpack";
import Trnptro from "./Trnptro";
import Prtgle from "./Prtgle";
import Prtpan from "./Prtpan";
import Prtswtp from "./Prtswtp";
import Xmldoc from "./Xmldoc";
import Prtswtrp from "./Prtswtrp";
import Prtp from "./Prtp";
import Utils from "~/utils/index";

// import * as poinMessage from '@/util/poin-common/messageManage.js'
import {
  TabPane,
  Col,
  Table,
  Form,
  FormItem,
  Upload,
  TableColumn,
  Card,
  Input,
  Button,
  Dialog,
  Select,
  Tabs,
  Option,
  DatePicker,
  Row,
} from "element-ui";
import Event from "~/model/Trnrel/Event";

export default {
  name: "Trnrel",
  components: {
    "m-inftrnps": Inftrnps,
  },
  mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
  // computed: {},
  provide() {
    return {
      root: this,
    };
  },
  data() {
    return {
      trnName: "trnrel",
      model: new Trnrel().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      rules: null,
      codes: {
        dflg: CodeTable.dflg,
        bchtyp: CodeTable.bchtyp,
        usrsort: CodeTable.usrsort,
      },
      // reload:false,
    };
  },
  created() {
    const that = this;
      that.init(that.model).then((res) => {
        //TODO 处理数据逻辑

        that.model = Utils.copyValueFromVO(that.model, res.data);
        //  that.$refs.inftrnps.stmData.columns=res.data.trncorco_trnstm.rows
        this.$refs.inftrnps.handleSearch();
      });
  },
  methods: {

  },
  computed: {
    reload: function(){
      return this.$store.state.Status.loading.freshReview;
    }
  },
  watch:{
    reload: function(val, oldVal){
      if(val){
        const that = this;
        that.init(that.model).then((res) => {
          //TODO 处理数据逻辑

          that.model = Utils.copyValueFromVO(that.model, res.data);
          //  that.$refs.inftrnps.stmData.columns=res.data.trncorco_trnstm.rows
          this.$refs.inftrnps.handleSearch();
          //刷新页面后重置刷新状态为不刷新
          this.$store.commit("setLoadingFreshReview", false)
        });

      
      }
    },
  },
};
</script>
<style>
</style>
