OwnCusCom.vue
2.02 KB
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
<!-- 所属客户群体 - 组件 -->
<template>
<div class="flex">
<el-select
v-model="form[targetItem.firstVal]"
:placeholder="'请选择'"
@change="handleFirstChange('')"
>
<el-option
v-for="subItem in optionList"
:key="subItem[targetItem.optionId]"
:label="subItem[targetItem.optionLabel]"
:value="subItem[targetItem.optionId]"
></el-option>
</el-select>
<!-- <el-input
v-show="[3].includes(form[targetItem.firstVal])"
v-model="subVal.input"
placeholder="请输入商户/门店ID"
@change="handleFirstChange"
></el-input> -->
<el-select
v-show="[1, 2, 4].includes(form[targetItem.firstVal])"
v-model="form[targetItem.secondVal]"
:multiple="targetItem.multiple || false"
@change="handleFirstChange"
>
<el-option
v-for="subItem in baseData[attrToList[form[targetItem.firstVal]]]"
:key="subItem.dictValue"
:label="subItem.dictLabel"
:value="subItem.dictValue"
></el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'OwnCusCom',
data() {
return {
// subVal: {
// input: '',
// mutiSelect: []
// },
// 下拉框对应List
attrToList: {
'1': 'accounTypetList',
'2': 'accountLevelList',
'4': 'accountRoleList'
}
}
},
props: {
targetItem: {
type: Object,
default: () => { }
},
form: {
type: Object,
default: () => { }
},
optionList: {
type: Array,
default: () => []
},
baseData: {
type: Object,
default: () => { }
}
},
mounted() {
// console.log(this.targetItem)
},
methods: {
handleFirstChange(val) {
// if (!val) {
// this.subVal = {
// input: '',
// mutiSelect: []
// }
// }
this.$emit('changeSecond', { val: val, targetItem: this.targetItem })
}
}
}
</script>
<style scoped>
.flex {
display: flex;
}
</style>