|
@@ -71,7 +71,9 @@
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
+ :readonly="hasChecked(record.id)"
|
|
|
v-model="record.replenishQty"
|
|
|
+ @change="changeNums(record)"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
placeholder="请输入"
|
|
@@ -151,6 +153,7 @@ export default {
|
|
|
productName: '', // 产品名称
|
|
|
stockStateList: []
|
|
|
},
|
|
|
+ allData: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.spinning = true
|
|
@@ -168,10 +171,12 @@ export default {
|
|
|
const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
const cur = row.find(item => item.id == data[i].id)
|
|
|
data[i].replenishQty = cur ? cur.replenishQty : (data[i].replenishBillWaitQty || 1)
|
|
|
+ data[i].checked = !cur
|
|
|
}
|
|
|
this.disabled = false
|
|
|
}
|
|
|
this.spinning = false
|
|
|
+ this.allData = data
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
@@ -192,6 +197,19 @@ export default {
|
|
|
rowSelectionFun (obj) {
|
|
|
this.rowSelectionInfo = obj || null
|
|
|
},
|
|
|
+ hasChecked: function (value) {
|
|
|
+ const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
+ const cur = row.find(item => item.id == value)
|
|
|
+ return !cur
|
|
|
+ },
|
|
|
+ changeNums (data) {
|
|
|
+ const row = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
+ const cur = row.find(item => item.id == data.id)
|
|
|
+ if (cur) {
|
|
|
+ cur.replenishQty = data.replenishQty
|
|
|
+ }
|
|
|
+ row.splice()
|
|
|
+ },
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
this.queryParam = {
|
|
@@ -199,8 +217,6 @@ export default {
|
|
|
productName: '', // 产品名称
|
|
|
stockStateList: []
|
|
|
}
|
|
|
- this.showChecked = false
|
|
|
- this.$refs.table.clearSelected()
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 确认补货
|
|
@@ -248,6 +264,8 @@ export default {
|
|
|
} else {
|
|
|
this.$nextTick(() => {
|
|
|
this.resetSearchForm()
|
|
|
+ this.$refs.table.clearSelected()
|
|
|
+ this.showChecked = false
|
|
|
})
|
|
|
}
|
|
|
}
|