Commit 1a6b99ad by chenwq

选择客户

1 parent becf5bbc
......@@ -183,22 +183,24 @@ export default {
},
recoverySelected() {
this.selectedCustomerList.forEach(row => {
var idx = this.tableList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
}
})
// 找到不符合条件的,变为不可选
this.tableParams.checkSelectVal = []
if (this.selectedCustomerList.length) {
this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
this.$nextTick(() => {
this.selectedCustomerList.forEach(row => {
var idx = this.tableList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
}
})
}
// 找到不符合条件的,变为不可选
this.tableParams.checkSelectVal = []
if (this.selectedCustomerList.length) {
this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
}
})
}
})
},
dealCondLimit(val) {
......@@ -215,9 +217,16 @@ export default {
if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0])
}
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val))
var selectIds = this.selectedCustomerList.map(item => item.id)
currentList.forEach(item => {
if (!selectIds.includes(item.id) && !tableIds.includes(item.id)) {
this.selectedLabelList.push(item)
}
})
this.recoverySelected()
// console.log(this.selectedCustomerList)
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!