Commit 1f75a873 by zhangxw

bug修改

1 parent c22777c7
...@@ -374,6 +374,33 @@ export default { ...@@ -374,6 +374,33 @@ export default {
} }
}, },
watch: {
sellerMerchantStaffList: {
handler() {
this.checkSelectOption()
},
deep: true
},
serviceBossList: {
handler() {
this.checkSelectOption()
},
deep: true
},
supervisionOptionsList: {
handler() {
this.checkSelectOption()
},
deep: true
},
residentManagerOptionsList: {
handler() {
this.checkSelectOption()
},
deep: true
},
},
components: {}, components: {},
computed: {}, computed: {},
...@@ -414,6 +441,8 @@ export default { ...@@ -414,6 +441,8 @@ export default {
if (!this.form.shopMerchantConfig) { if (!this.form.shopMerchantConfig) {
this.form.shopMerchantConfig = { boutiqueDirectorUserId: '', quotationDirectorUserId: '', boutiqueSunshineInspiration: '', quotationSunshineInspiration: '', boutiqueMarketInspiration: '', quotationMarketInspiration: '', boutiqueServiceDirectorUserId: '', quotationServiceDirectorUserId: '' } this.form.shopMerchantConfig = { boutiqueDirectorUserId: '', quotationDirectorUserId: '', boutiqueSunshineInspiration: '', quotationSunshineInspiration: '', boutiqueMarketInspiration: '', quotationMarketInspiration: '', boutiqueServiceDirectorUserId: '', quotationServiceDirectorUserId: '' }
} }
// 对比下拉框是否存在已选的选择项 不存在清空
this.checkSelectOption()
console.log(this.form) console.log(this.form)
if (this.form.list && this.form.list.length > 0) { if (this.form.list && this.form.list.length > 0) {
this.form.list = this.form.list.map(item => { this.form.list = this.form.list.map(item => {
...@@ -429,6 +458,27 @@ export default { ...@@ -429,6 +458,27 @@ export default {
}) })
}, },
checkSelectOption() {
let _form = this.form
let selectItemKey = [
{ item: 'areaSupervision', optionsList: 'supervisionOptionsList', key: 'userId'},
{ item: 'residentManager', optionsList: 'residentManagerOptionsList', key: 'userId'},
{ item: 'boutiqueServiceDirectorUserId', optionsList: 'serviceBossList' },
{ item: 'quotationServiceDirectorUserId', optionsList: 'serviceBossList' },
{ item: 'boutiqueDirectorUserId', optionsList: 'sellerMerchantStaffList' },
{ item: 'quotationDirectorUserId', optionsList: 'sellerMerchantStaffList' }
]
selectItemKey.map(val => {
if (typeof _form[val.item] == 'object') {
let index = this[val.optionsList]?.findIndex(subV => subV.userId == _form[val.item]?.userId)
if (index < 0) this.$set(this.form, val.item, {})
} else {
let index = this[val.optionsList]?.findIndex(subV => subV.userId == _form?.shopMerchantConfig?.[val.item])
if (index < 0) this.$set(this.form.shopMerchantConfig, val.item, '')
}
})
},
handleAddMerchant() { handleAddMerchant() {
this.options = [] this.options = []
this.form.list.push({ this.form.list.push({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!