|
@@ -236,16 +236,17 @@ export default {
|
|
comCode: ''
|
|
comCode: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ watch: {
|
|
|
|
+ 'dataL': (val, oval) => {
|
|
|
|
+ console.log(val, oval)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
this.comCode = this.code
|
|
this.comCode = this.code
|
|
if (this.comCode) {
|
|
if (this.comCode) {
|
|
this.getCond()
|
|
this.getCond()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- updated() {
|
|
|
|
- this.comCode = this.code
|
|
|
|
- console.log(this.code, 'kkkkk')
|
|
|
|
- },
|
|
|
|
methods: {
|
|
methods: {
|
|
getList() {
|
|
getList() {
|
|
this.getCrList()
|
|
this.getCrList()
|
|
@@ -259,7 +260,6 @@ export default {
|
|
}
|
|
}
|
|
// 获取经销商列表
|
|
// 获取经销商列表
|
|
getCrList(customerParams).then((res) => {
|
|
getCrList(customerParams).then((res) => {
|
|
- this.dataL = res.data.records
|
|
|
|
for (let j = 0; j < this.custoList.length; j++) {
|
|
for (let j = 0; j < this.custoList.length; j++) {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
if (res.data.records[i].id === this.custoList[j].customerId) {
|
|
if (res.data.records[i].id === this.custoList[j].customerId) {
|
|
@@ -267,6 +267,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.dataL = res.data.records
|
|
for (let k = 0; k < this.dataL.length; k++) {
|
|
for (let k = 0; k < this.dataL.length; k++) {
|
|
(this.dataL[k].customerId = this.dataL[k].id),
|
|
(this.dataL[k].customerId = this.dataL[k].id),
|
|
(this.dataL[k].customerName = this.dataL[k].name),
|
|
(this.dataL[k].customerName = this.dataL[k].name),
|
|
@@ -288,14 +289,14 @@ export default {
|
|
},
|
|
},
|
|
// 提交筛选表单
|
|
// 提交筛选表单
|
|
submitScreenForm() {
|
|
submitScreenForm() {
|
|
- this.currentPages = 1;
|
|
|
|
- this.getCrList();
|
|
|
|
|
|
+ this.currentPages = 1
|
|
|
|
+ this.getCrList()
|
|
},
|
|
},
|
|
// 重置筛选表单
|
|
// 重置筛选表单
|
|
resetScreenForm() {
|
|
resetScreenForm() {
|
|
this.keyword = ''
|
|
this.keyword = ''
|
|
- this.currentPages = 1;
|
|
|
|
- this.getCrList();
|
|
|
|
|
|
+ this.currentPages = 1
|
|
|
|
+ this.getCrList()
|
|
},
|
|
},
|
|
// 去掉相同数据
|
|
// 去掉相同数据
|
|
resArr(arr1, arr2) {
|
|
resArr(arr1, arr2) {
|
|
@@ -341,11 +342,10 @@ export default {
|
|
console.log(
|
|
console.log(
|
|
this.cpolicyId,
|
|
this.cpolicyId,
|
|
this.comCode,
|
|
this.comCode,
|
|
- this.cpolicyId == this.comCode
|
|
|
|
|
|
+ this.cpolicyId === this.comCode
|
|
)
|
|
)
|
|
},
|
|
},
|
|
getCond() {
|
|
getCond() {
|
|
- console.log(this.code, 'hhjkhkj', this.comCode, '999999')
|
|
|
|
this.listLoading = true
|
|
this.listLoading = true
|
|
const custoParams = {
|
|
const custoParams = {
|
|
pageNum: this.currentPages,
|
|
pageNum: this.currentPages,
|
|
@@ -390,7 +390,7 @@ export default {
|
|
*/
|
|
*/
|
|
selectable: function(row, index) {
|
|
selectable: function(row, index) {
|
|
// row.disabled == undefined 才能被选中
|
|
// row.disabled == undefined 才能被选中
|
|
- if (row.disabled == undefined || row.disabled == false) {
|
|
|
|
|
|
+ if (row.disabled === undefined || row.disabled === false) {
|
|
return true
|
|
return true
|
|
} else {
|
|
} else {
|
|
return false
|
|
return false
|
|
@@ -422,10 +422,10 @@ export default {
|
|
this.type = 2
|
|
this.type = 2
|
|
},
|
|
},
|
|
handleAllAdd() {
|
|
handleAllAdd() {
|
|
- if (this.type == 1 && this.leftData.length) {
|
|
|
|
|
|
+ if (this.type === 1 && this.leftData.length) {
|
|
for (let i = 0; i < this.dataL.length; i++) {
|
|
for (let i = 0; i < this.dataL.length; i++) {
|
|
for (let j = 0; j < this.leftData.length; j++) {
|
|
for (let j = 0; j < this.leftData.length; j++) {
|
|
- if (this.dataL[i].id == this.leftData[j].id) {
|
|
|
|
|
|
+ if (this.dataL[i].id === this.leftData[j].id) {
|
|
this.dataL[i].disabled = true
|
|
this.dataL[i].disabled = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -446,8 +446,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- const arr = this.resArr(this.custoList, this.rightData)
|
|
|
|
- this.custoList = arr
|
|
|
|
|
|
+ this.custoList = this.resArr(this.custoList, this.rightData)
|
|
|
|
+ this.$refs.multipleTable.clearSelection()
|
|
} else {
|
|
} else {
|
|
this.$errorMsg('请选择要删除的经销商')
|
|
this.$errorMsg('请选择要删除的经销商')
|
|
}
|
|
}
|
|
@@ -478,8 +478,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- const arr = this.resArr(this.custoList, this.rightData)
|
|
|
|
- this.custoList = arr
|
|
|
|
|
|
+ this.custoList = this.resArr(this.custoList, this.rightData)
|
|
|
|
+ this.$refs.multipleTable.clearSelection()
|
|
} else {
|
|
} else {
|
|
this.$errorMsg('请选择要删除的经销商')
|
|
this.$errorMsg('请选择要删除的经销商')
|
|
}
|
|
}
|