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
105
106
107
108
<template>
  <div>
    <CreateForms
      ref="financeForms"
      :isReset="true"
      :isView="isView"
      :screenWidth="screenWidth"
      :isShowBorder="isShowBorder"
      :formItems="formItems"
      :defValues="defValues"
      :formRules="formRules"
      @handleSelOnChange="handleSelOnChange"
      @handleInputChange="handleInputChange"
    />
  </div>
</template>
 
<script>
import CreateForms from "@/views/components/CreateForms";
 
import { getDictionaryList } from "@/http/api.js";
 
import { individualCusFundInfo } from "../config/formItem.config";
import { modifyRemarkInfoDefault } from "../config/defValues.config";
import { stockInfoRules } from "../config/rules.config";
export default {
  components: {
    CreateForms
  },
  props: {
    formItems: {
      type: Array,
      default: () => []
    },
    defValues: {
      type: Object,
      default: () => {}
    },
    formRules: {
      type: Object,
      default: () => {}
    },
    isView: {
      type: String,
      default: ""
    },
    isShowBorder: {
      type: String,
      default: ""
    },
    addorupdate: {
      type: [String],
      default: ""
    },
    screenWidth: {
      type: Number,
      default: () => {
        return 1280;
      }
    },
  },
  data() {
    return {
      // formItems: [...individualCusFundInfo],
      // defValues: {...modifyRemarkInfoDefault},
      // formRules: {...stockInfoRules}
    };
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      const { formItems } = this;
      formItems.forEach(({ name }) => {
        if (name === "customerType" || name === 'certType') {
          this.getDictionaryList(name);
        }
      });
    },
    async getDictionaryList(name) {
      const codeNo = name.substring(0, 1).toUpperCase() + name.substring(1);
      const { result } = await getDictionaryList({ codeNo });
      const list = result.map(item => {
        return {
          label: item.itemname,
          value: item.itemno
        }
      })
      this.updateValue(name, {options:list});
    },
    updateValue(index, info) {
      const { formItems } = this;
      const nameIndex = formItems.findIndex(({name}) => name === index)
      if (nameIndex > -1) {
        const preInfo = formItems[nameIndex]
 
        this.$set(formItems,nameIndex,{...preInfo,...info})
      }
    },
    handleSelOnChange(){},
    handleInputChange(){}
  }
};
</script>
 
<style scoped>
</style>