Commit 1a6b99ad by chenwq

选择客户

1 parent becf5bbc
...@@ -183,22 +183,24 @@ export default { ...@@ -183,22 +183,24 @@ export default {
}, },
recoverySelected() { recoverySelected() {
this.selectedCustomerList.forEach(row => { this.$nextTick(() => {
var idx = this.tableList.findIndex(k => k.id == row.id) this.selectedCustomerList.forEach(row => {
if (idx != -1) { var idx = this.tableList.findIndex(k => k.id == row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true) 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.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) { dealCondLimit(val) {
...@@ -215,9 +217,16 @@ export default { ...@@ -215,9 +217,16 @@ export default {
if (!this.selectedCustomerList.length) { if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0]) 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)) 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() 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!