index.vue 3.02 KB
Newer Older
niewei committed
1 2
<template>
  <div class="eContainer">
3 4 5 6 7 8 9 10 11
    <el-form
      :model="model"
      :rules="rules"
      ref="modelForm"
      label-width="110px"
      label-position="right"
      size="small"
      :validate-on-rule-change="false"
    >
wangna committed
12

13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
      <c-content>
        <m-infsea
          v-show="!showPanel"
          @updateShowPanel="updateShowPanel($event)"
          :model="model"
          :codes="codes"
          ref="infsea"
        />
      </c-content>
      <c-tabs
        v-model="tabVal"
        v-show="showPanel"
        ref="elment"
        type="card"
        @tab-click="tabClick"
      >
        <!--PD000017 -->
        <el-tab-pane label="内容" name="ovwp">
          <m-ovwp :model="model" :codes="codes" />
        </el-tab-pane>

      </c-tabs>
niewei committed
35 36
    </el-form>

37 38 39 40 41 42 43 44 45 46 47
    <c-button
      v-show="showPanel"
      style="margin-left: 75%; bottom: 10%; position: sticky"
      size="small"
      @click="goBack()"
    >
      <!-- @click="getDitSelInfo(scope.$index, scope.row)" -->
      返回
    </c-button>
  </div>
  <!-- </c-page> -->
niewei committed
48 49
</template>
<script>
niewei committed
50
import Utils from "~/utils/index";
51 52 53 54 55 56 57 58
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Infdet from "~/model/Infdet";
import commonProcess from "~/mixin/commonProcess";
import Check from "~/model/Infdet/Check";
import Default from "~/model/Infdet/Default";
import Pattern from "~/model/Infdet/Pattern";
import Infsea from "./Infsea";
wangna committed
59

niewei committed
60 61

export default {
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
  name: "Infdet",
  components: {
    "m-infsea": Infsea,
  },
  provide() {
    return {
      root: this,
    };
  },
  mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
  data() {
    return {
      tabVal: "",
      trnName: "infdet",
      model: new Infdet().data,
      checkRules: Check,
      defaultRules: Default,
      pattern: Pattern,
      showPanel: false,
      rules: null,
      codes: { ...CodeTable },
      showflg: true,
    };
  },
  methods: {
    tabClick(tab) {
      const name = tab.name;
      let rulePath;
niewei committed
90

91 92 93 94 95 96
      if (name === "fepinfp") {
        rulePath = "infcon.fepinfp";
      }
      if (name === "coninfp") {
        rulePath = "coninf.coninfp";
      }
niewei committed
97

98 99 100 101
      if (!!rulePath) {
        this.executeRule(rulePath).then((res) => {
          if (res.respCode == SUCCESS) {
            this.updateModel(res.data);
niewei committed
102
          }
103 104 105
        });
      }
    },
niewei committed
106

107 108 109 110 111 112 113 114 115 116 117
    initPanel(val) {
      if (val) {
        this.tabVal = "ovwp";
        //
      } else {
        this.tabVal = "";
      }
    },
    async updateShowPanel(value) {
      this.showPanel = value;
      this.initPanel(value);
niewei committed
118
    },
119 120
    goBack() {
      this.showPanel = false;
niewei committed
121
    },
122 123 124 125 126 127 128 129 130 131
  },
  created: async function () {
    console.log("进入infdet交易");
    let rtnmsg = await this.init({});
    if (rtnmsg.respCode == SUCCESS) {
      //TODO 处理数据逻辑
      Utils.copyValueFromVO(this.model, rtnmsg.data);
      this.$refs.infsea.handleSearch();
    } else {
      this.$notify.error({ title: "错误", message: "服务请求失败!" });
niewei committed
132
    }
133 134 135
  },
  watch: {},
};
niewei committed
136
</script>
niewei committed
137
<style scoped>
niewei committed
138
</style>