|
|
@@ -141,7 +141,7 @@
|
|
|
:reserve-selection="true"
|
|
|
style="width: 100%"
|
|
|
@select-all="handleSelectAll"
|
|
|
- @selection-change="handleSelectChange"
|
|
|
+ @select="handleSelectChange"
|
|
|
>
|
|
|
<el-table-column type="selection"></el-table-column>
|
|
|
<el-table-column prop="deptId" label="部门编码"></el-table-column>
|
|
|
@@ -273,7 +273,7 @@ export default {
|
|
|
that.selectedLength = res.data.totalSize
|
|
|
if(that.agentDataList.length>0) {
|
|
|
that.agentDataList.forEach(item => {
|
|
|
- that.$refs.multipleTable.toggleRowSelection(item)
|
|
|
+ that.$refs.multipleTable.toggleRowSelection(item, true)
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
@@ -282,7 +282,7 @@ export default {
|
|
|
list.forEach(item => {
|
|
|
let arrayItem = that.agentDataList.find(sub => sub.id === item.id)
|
|
|
if(arrayItem) {
|
|
|
- that.$refs.multipleTable.toggleRowSelection(arrayItem)
|
|
|
+ that.$refs.multipleTable.toggleRowSelection(arrayItem, true)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -314,7 +314,9 @@ export default {
|
|
|
},
|
|
|
// 选择代理人取消
|
|
|
handleCancel() {
|
|
|
- this.selectList = [...this.myList]
|
|
|
+ // this.selectList = [...this.myList]
|
|
|
+ this.selectedList = [...this.selectList]
|
|
|
+ this.selectedLength = this.selectedList.length
|
|
|
this.agentTableShow = false
|
|
|
},
|
|
|
// 代理选择
|
|
|
@@ -323,36 +325,39 @@ export default {
|
|
|
this.selectedLength = this.total
|
|
|
return;
|
|
|
}
|
|
|
- if(rows.length>0) {
|
|
|
- let list = [...this.selectedList]
|
|
|
- if(this.selectedList.length>0){
|
|
|
- list.forEach((item, index) => {
|
|
|
- this.agentDataList.forEach(sub => {
|
|
|
- if(sub.id === item.id) {
|
|
|
- list.splice(index,1)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- this.selectedList = this.uniqueItems([...list, ...rows])
|
|
|
- this.selectedLength = this.selectedList.length
|
|
|
+ let list = [...this.selectedList]
|
|
|
+ if(list.length>0){
|
|
|
+ if(rows.length>0) {
|
|
|
+ let arr = list.filter(item1 => !this.agentDataList.some(item2 => item1.id === item2.id))
|
|
|
+ this.selectedList = this.uniqueItems([...arr, ...rows])
|
|
|
} else {
|
|
|
+ this.selectedList = this.uniqueItems([...list])
|
|
|
+ }
|
|
|
+ this.selectedLength = this.selectedList.length
|
|
|
+ } else {
|
|
|
+ if(rows.length>0) {
|
|
|
this.selectedList = [...rows]
|
|
|
- this.selectedLength = this.selectedList.length
|
|
|
+ } else {
|
|
|
+ this.selectedList = []
|
|
|
}
|
|
|
+ this.selectedLength = this.selectedList.length
|
|
|
}
|
|
|
},
|
|
|
// 手动点击全选
|
|
|
handleSelectAll(rows) {
|
|
|
- console.log(123, rows)
|
|
|
- console.log(456, this.selectedList)
|
|
|
+ let list = [...this.selectedList]
|
|
|
if(rows.length===0) {
|
|
|
- let list = [...this.selectedList]
|
|
|
if(list.length>0){
|
|
|
let arr = list.filter(item1 => !this.agentDataList.some(item2 => item1.id === item2.id))
|
|
|
this.selectedList = this.uniqueItems([...arr])
|
|
|
this.selectedLength = this.selectedList.length
|
|
|
- console.log(789, this.selectedList)
|
|
|
+ } else {
|
|
|
+ this.selectedList = [...rows]
|
|
|
}
|
|
|
+ } else {
|
|
|
+ let arr = [...rows], brr = [...list], crr = brr.concat(arr)
|
|
|
+ this.selectedList = this.uniqueItems([...crr])
|
|
|
+ this.selectedLength = this.selectedList.length
|
|
|
}
|
|
|
},
|
|
|
// 数组去重
|
|
|
@@ -398,7 +403,8 @@ export default {
|
|
|
list.push('3')
|
|
|
}
|
|
|
this.$set(this.quoteForm, 'quoteLimit', list)
|
|
|
- this.selectedList = res.data.proxyList
|
|
|
+ this.selectedList = [...res.data.proxyList]
|
|
|
+ this.selectedLength = res.data.proxyList.length
|
|
|
this.selectList = [...res.data.proxyList]
|
|
|
this.myList = [...res.data.proxyList]
|
|
|
} else {
|
|
|
@@ -467,6 +473,7 @@ export default {
|
|
|
this.agentTableShow = true
|
|
|
this.countDetailForm = {}
|
|
|
this.pageNum = 1
|
|
|
+ this.checkType = ''
|
|
|
this.initAgentUser()
|
|
|
this.initOrganization()
|
|
|
},
|
|
|
@@ -479,11 +486,11 @@ export default {
|
|
|
}
|
|
|
if(this.checkType === 'all') {
|
|
|
this.selectedLength = this.total
|
|
|
+ this.selectedList = []
|
|
|
}
|
|
|
if(this.checkType === 'cur') {
|
|
|
- this.selectedLength = 0
|
|
|
- let list = [...this.selectedList, ...this.agentDataList]
|
|
|
- this.selectedList = this.uniqueItems(list)
|
|
|
+ let list = [...this.selectedList], arr = [...this.agentDataList]
|
|
|
+ this.selectedList = this.uniqueItems(list.concat(arr))
|
|
|
this.selectedLength = this.selectedList.length
|
|
|
}
|
|
|
},
|
|
|
@@ -502,6 +509,7 @@ export default {
|
|
|
})
|
|
|
this.selectList = [...list]
|
|
|
this.selectedList = [...list]
|
|
|
+ this.selectedLength = this.selectedList.length
|
|
|
this.myList = [...list]
|
|
|
}
|
|
|
},
|