Cnyp.vue 1.74 KB
Newer Older
1 2
<template>
  <div class="eibs-tab">
Wuyuqiu committed
3 4 5 6 7 8 9 10
    <el-collapse v-model="activeNames" @change="handleChange">
    <el-collapse-item title="跨境人民币申报" name="cnyp1">
      <m-cnyp1 :model="model" :codes="codes" />
    </el-collapse-item>
    <el-collapse-item title="2122跨境担保登记业务信息" name="voup" v-if="model.cnybop.vouflg == '1'">
      <m-voup :model="model" :codes="codes" />
    </el-collapse-item>
  </el-collapse>
11 12 13
  </div>
</template>
<script>
liyixun committed
14
import Api from "~/service/Api";
15
import commonProcess from "~/mixin/commonProcess";
liyixun committed
16 17
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Gitopn/Event";
Wuyuqiu committed
18 19
import Cnyp1 from "./Cnyp1";
import Voup from "./Voup";
20

21 22 23 24
const tabNameToRulePathMapping = {
  "voup": "cnybop.voup",
}

25
export default {
Wuyuqiu committed
26 27 28 29
  components: {
    "m-cnyp1": Cnyp1,
    "m-voup": Voup,
  },
liyixun committed
30 31 32 33
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [commonProcess],
  data() {
Wuyuqiu committed
34 35 36
    return {
      activeNames: ["cnyp1"],
    };
liyixun committed
37
  },
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
  methods: {
    ...Event,
    handleChange(names){
      // console.log(names);//激活的(展开的)面板的name数组集合
      if (this.isInDisplay) {
        return
      }
      const arr = []
      for (let i = 0; i < names.length; i++) {
        const n = names[i];
        const path = tabNameToRulePathMapping[n]//取出激活/展开面板name对应的rulePath
        if (path) {
          arr.push(path)
        }
      }
      let rulePath = arr.join(",");//把arr数组加入逗号分割,变成字符串
      if (!!rulePath) {//rulePath不为空串
        this.executeRule(rulePath).then((res) => {
          if (res.respCode == SUCCESS) {
            this.updateModel(res.data);
          }
        });
      }
    },
  },
liyixun committed
63 64
  created: function () {},
};
65 66 67
</script>
<style>
</style>