Commit 2b917d75 by wangzhihui

fixed

1 parent 4087e77c
...@@ -132,7 +132,7 @@ export default { ...@@ -132,7 +132,7 @@ export default {
relateStoreVisible: { relateStoreVisible: {
handler(val) { handler(val) {
if (val) { if (val) {
this.selectedData = this.storeSelected this.selectedData = JSON.parse(JSON.stringify(this.storeSelected))
this.recoverySelection() this.recoverySelection()
} }
...@@ -144,7 +144,6 @@ export default { ...@@ -144,7 +144,6 @@ export default {
clearData() { clearData() {
this.storeSearchForm.staffName = "" this.storeSearchForm.staffName = ""
this.currentPage = 1 this.currentPage = 1
console.log(this.storeSearchForm.staffPhone)
}, },
checkSelectable(row, index) { checkSelectable(row, index) {
const obj = this.selectingList.find((v) => v.staffPhone == row.staffPhone) const obj = this.selectingList.find((v) => v.staffPhone == row.staffPhone)
...@@ -199,14 +198,20 @@ export default { ...@@ -199,14 +198,20 @@ export default {
}, },
handleAll(selection) { handleAll(selection) {
console.log(selection) console.log(selection)
let arr = [...this.selectedData, ...this.selectingList]
console.log(arr)
this.selectingData.forEach((item) => { this.selectingData.forEach((item) => {
var isExit = this.selectedData.findIndex( var isExit = arr.findIndex(
(subItem) => subItem.staffPhone === item.staffPhone (subItem) => subItem.staffPhone === item.staffPhone
) )
if (selection.length && isExit === -1) { if (selection.length && isExit === -1) {
this.selectedData.push(item) this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) { } else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1) this.selectedData.forEach((third, index) => {
if (third.staffPhone === item.staffPhone) {
this.selectedData.splice(index, 1)
}
})
} }
}) })
}, },
......
...@@ -325,7 +325,6 @@ export default { ...@@ -325,7 +325,6 @@ export default {
this.selectingList = [] this.selectingList = []
}, },
confirmStaff(val) { confirmStaff(val) {
console.log(val)
this.selectingList = [] this.selectingList = []
this.form.configList[this.configIndex].staffList = val this.form.configList[this.configIndex].staffList = val
this.groupVisible = false this.groupVisible = false
...@@ -350,7 +349,6 @@ export default { ...@@ -350,7 +349,6 @@ export default {
this.selectingList.push(item1) this.selectingList.push(item1)
}) })
}) })
console.log(this.selectingList)
}, },
addConfig() { addConfig() {
if (this.form.configList.length >= 9) { if (this.form.configList.length >= 9) {
...@@ -478,6 +476,7 @@ export default { ...@@ -478,6 +476,7 @@ export default {
// console.log(item, field) // console.log(item, field)
let value = item[field] let value = item[field]
value = parseInt(value) || "" value = parseInt(value) || ""
value = isNaN(value) || ""
// 限制最大值 // 限制最大值
if (parseInt(value) > maxLimit) { if (parseInt(value) > maxLimit) {
value = "" value = ""
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!