|
@@ -254,11 +254,17 @@ export default {
|
|
},
|
|
},
|
|
// 刷新当前页面
|
|
// 刷新当前页面
|
|
resetCurForm () {
|
|
resetCurForm () {
|
|
|
|
+ this.selectedRowKeys = []
|
|
|
|
+ this.selectedRows = []
|
|
this.$refs.table.refresh()
|
|
this.$refs.table.refresh()
|
|
},
|
|
},
|
|
// 添加
|
|
// 添加
|
|
handleAdd (row) {
|
|
handleAdd (row) {
|
|
- this.$emit('addProduct', [row.salesBillDetailSn])
|
|
|
|
|
|
+ if (row.stockQty > 0) { // 可用库存大于0才可添加
|
|
|
|
+ this.$emit('addProduct', [row.salesBillDetailSn])
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning('库存为0,不可添加!')
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 批量添加
|
|
// 批量添加
|
|
handlePlAdd () {
|
|
handlePlAdd () {
|
|
@@ -269,9 +275,14 @@ export default {
|
|
}
|
|
}
|
|
const obj = []
|
|
const obj = []
|
|
_this.selectedRows.map(item => {
|
|
_this.selectedRows.map(item => {
|
|
- obj.push(item.salesBillDetailSn)
|
|
|
|
|
|
+ if (item.stockQty > 0) {
|
|
|
|
+ obj.push(item.salesBillDetailSn)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ if (obj.length < 1) {
|
|
|
|
+ this.$message.warning('所选产品库存为0,不可添加!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '确认要批量添加到待下推列表吗?',
|
|
content: '确认要批量添加到待下推列表吗?',
|