Commit 0c6a3c0e by chenwq

选择弹窗

1 parent 49aa3ff7
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
this.selectedSum = 0 this.selectedSum = 0
this.orderShow.forEach(itme => { this.orderShow.forEach(itme => {
this.selectedGiftList[itme].list.forEach(subItem => { this.selectedGiftList[itme].list.forEach(subItem => {
this.selectedSum = this.selectedSum + parseInt(subItem.couponAmount) this.selectedSum = this.selectedSum + 1
}) })
}) })
}, },
...@@ -338,7 +338,18 @@ export default { ...@@ -338,7 +338,18 @@ export default {
// 选择/取消 // 选择/取消
handleSelectionTable(val) { handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.selectedGiftList[this.activeName].list)) var list = JSON.parse(JSON.stringify(this.selectedGiftList[this.activeName].list))
this.selectedGiftList[this.activeName].list = [] var count = 0
var currentIdList = this.giftList.map(item => item.id)
val
.map(item => item.id)
.forEach(k => {
if (currentIdList.indexOf(k) != -1) {
count = count + 1
}
})
if (count == this.giftList.length || count == 0 || !val.length) {
this.selectedGiftList[this.activeName].list = []
}
val.forEach(item => { val.forEach(item => {
let isSelected = list.find(k => k.id == item.id) let isSelected = list.find(k => k.id == item.id)
if (this.selectedGiftList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') { if (this.selectedGiftList[this.activeName].list.findIndex(k => k.id == item.id) == '-1') {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!