Commit 23a97856 by chenwq

处理库存为0的券

1 parent 0ac6b609
...@@ -280,8 +280,9 @@ export default { ...@@ -280,8 +280,9 @@ export default {
// 恢复选择 // 恢复选择
addSelected() { addSelected() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.selectedGiftList[this.activeName].list && this.selectedGiftList[this.activeName].list.length) { var list = JSON.parse(JSON.stringify(this.selectedGiftList[this.activeName].list))
this.selectedGiftList[this.activeName].list.forEach(row => { if (list && list.length) {
list.forEach(row => {
var idx = this.giftList.findIndex(k => k.id == row.id) var idx = this.giftList.findIndex(k => k.id == row.id)
if (idx != -1 && row.status != '3') { if (idx != -1 && row.status != '3') {
this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.giftList[idx], true) this.$refs[this.activeName + 'Ref'].$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.giftList[idx], true)
...@@ -354,6 +355,9 @@ export default { ...@@ -354,6 +355,9 @@ export default {
list.forEach(item => { list.forEach(item => {
if (item.status == '3') { if (item.status == '3') {
this.selectedGiftList[this.activeName].list.push(item) this.selectedGiftList[this.activeName].list.push(item)
} else if (this.giftList.findIndex(k => k.id == item.id) == '-1') {
// 没有库存的券
this.selectedGiftList[this.activeName].list.push(item)
} }
}) })
this.recoveryTotal() this.recoveryTotal()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!