|
@@ -146,15 +146,13 @@ export default {
|
|
|
},
|
|
|
confirm(selected) {
|
|
|
console.log(selected)
|
|
|
- // console.log(this.$refs.dia)
|
|
|
- // return
|
|
|
this.dataList = selected
|
|
|
this.$refs.header.screenForm.customerName = this.dataList[0].customerName
|
|
|
this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
|
|
|
this.$refs.header.screenForm.stockType = this.dataList[0].stockType
|
|
|
this.customerNumber = this.dataList[0].customerNumber
|
|
|
this.dialogVisible = false
|
|
|
-
|
|
|
+ this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.$refs.tableView.clearSelection()
|
|
|
},
|
|
|
handleDel(item, index) {
|
|
|
this.dataList.splice(index, 1)
|
|
@@ -168,23 +166,17 @@ export default {
|
|
|
// })
|
|
|
// }
|
|
|
},
|
|
|
+ //去掉相同数据
|
|
|
+ resArr(arr1, arr2) {
|
|
|
+ return arr1.filter(v => arr2.every(val => val.id != v.id))
|
|
|
+ },
|
|
|
delChange() {
|
|
|
|
|
|
- if (this.dataList.length) {
|
|
|
- this.dataList.forEach((k, i) => {
|
|
|
- this.selection.forEach((l, e) => {
|
|
|
- if (k.id === l.id) {
|
|
|
- this.dataList.splice(i, 1)
|
|
|
- this.selection.splice(e, 1)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- // if (this.dataList.length == 1) {
|
|
|
- // this.$nextTick(() => {
|
|
|
- // Object.assign(this.$refs.header.$data, this.$refs.header.$options.data())
|
|
|
- // this.customerNumber = ''
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if (this.dataList.length){
|
|
|
+ this.dataList = this.resArr(this.dataList,this.selection)
|
|
|
+ if (!this.dataList.length){
|
|
|
+ this.customerNumber = ''
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|