zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<template>
  <div class="apply-info">
    <div class="dialog-form">
      <p class="dialog-form-title">产品额度详情</p>
      <CommForm
        :inline="true"
        :list="formList"
        @updateValue="updateValue"
        ref="editMarkForm"
        :column="2"
        :key="key"
        formType="text"
      ></CommForm>
      <div class="dialog-form-buttons">
        <p>
          <el-button class="comm-button" @click="$emit('close')">关闭</el-button>
        </p>
      </div>
    </div>
  </div>
</template>
 
<script>
import CommForm from "@/components/CommForm";
 
import quotaControlProductList from "@/controller/quotaControlProductList";
 
export default {
  components: {
    CommForm
  },
  props: {
    tempRecord: {
      type: Object,
      default: () => {}
    },
    isShow: {
      type: Boolean,
      default: false
    }
  },
  created() {
    this.init();
  },
  data() {
    return {
      key: 0,
      model: null,
      formList: []
    };
  },
  methods: {
    init() {
      const { tempRecord } = this;
      const { quotaControlType } = tempRecord;
      this.model = quotaControlProductList({ search:'detail' });
      this.getFormList();
    },
    getFormList() {
      const { model, tempRecord, detail } = this;
      // const { controlSerialNo, serialNo } = tempRecord;
      // const info = await model.request({ controlSerialNo, serialNo });
      this.formList = model.getFormList(tempRecord);
    },
    // 更新表单数据
    updateValue(index, info) {
      const { formList } = this;
      if (isNaN(index)) {
        // index is name
        index = formList.findIndex(({ name }) => name === index);
      }
      if (!isNaN(index) && index > -1) {
        const preInfo = formList[index];
        this.$set(formList, index, { ...preInfo, ...info });
      }
    }
  },
  watch: {
    isShow() {
      const { isShow, key } = this;
      this.key = key + 1;
      if (isShow) {
        this.init();
      }
    }
  }
};
</script>
 
<style lang="postcss" scoped>
.dialog-form {
  & .dialog-form-buttons {
    display: flex;
    justify-content: center;
    padding: 50px 0 10px 0;
    & p {
      margin: 0 40px 0 0;
    }
    & p:last-child {
      margin-right: 0;
    }
  }
}
</style>