|
@@ -332,41 +332,37 @@ export default {
|
|
this.getOrderDetail(true)
|
|
this.getOrderDetail(true)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 已选产品 销售数量 blur
|
|
|
|
- qtyBlur (val, record) {
|
|
|
|
|
|
+ // 非下级创建的单据,修改数量时校验库存
|
|
|
|
+ validStock (val, record) {
|
|
const _this = this
|
|
const _this = this
|
|
- this.dataSource = record || []
|
|
|
|
- if (val && val != record.qtyBackups) {
|
|
|
|
- this.spinning = true
|
|
|
|
- // 校验库存
|
|
|
|
- stockByProductSn({ productSn: record.productSn }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- if (res.data && (!res.data.currentStockQty || val <= res.data.currentStockQty)) {
|
|
|
|
- _this.changeQty(record)
|
|
|
|
- } else {
|
|
|
|
- this.$confirm({
|
|
|
|
- title: '提示',
|
|
|
|
- content: '库存不足,确认添加为急件吗?',
|
|
|
|
- centered: true,
|
|
|
|
- closable: true,
|
|
|
|
- onOk () {
|
|
|
|
- _this.changeQty(record)
|
|
|
|
- },
|
|
|
|
- onCancel () {
|
|
|
|
- record.qty = record.qtyBackups
|
|
|
|
- _this.spinning = false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ this.spinning = true
|
|
|
|
+ // 校验库存
|
|
|
|
+ stockByProductSn({ productSn: record.productSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ if (res.data && (!res.data.currentStockQty || val <= res.data.currentStockQty)) {
|
|
|
|
+ _this.changeQty(record)
|
|
} else {
|
|
} else {
|
|
- this.spinning = false
|
|
|
|
- record.qty = record.qtyBackups
|
|
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '库存不足,确认添加为急件吗?',
|
|
|
|
+ centered: true,
|
|
|
|
+ closable: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.changeQty(record)
|
|
|
|
+ },
|
|
|
|
+ onCancel () {
|
|
|
|
+ record.qty = record.qtyBackups
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- record.qty = record.qtyBackups
|
|
|
|
- }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ this.spinning = false
|
|
|
|
+ record.qty = record.qtyBackups
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
|
|
+ // 修改已选产品数量
|
|
changeQty (record) {
|
|
changeQty (record) {
|
|
salesDetailUpdateQty({
|
|
salesDetailUpdateQty({
|
|
id: record.id,
|
|
id: record.id,
|
|
@@ -383,7 +379,21 @@ export default {
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 已选产品 售价 blur
|
|
|
|
|
|
+ // 已选产品 销售数量 input 输入框 blur
|
|
|
|
+ qtyBlur (val, record) {
|
|
|
|
+ this.dataSource = record || []
|
|
|
|
+ if (val && val != record.qtyBackups) {
|
|
|
|
+ // 非下级创建的单据,修改数量时校验库存
|
|
|
|
+ if (!this.isSuperEdit) {
|
|
|
|
+ this.validStock(val, record)
|
|
|
|
+ } else {
|
|
|
|
+ this.changeQty(record)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ record.qty = record.qtyBackups
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 已选产品 售价 input 输入框 blur
|
|
priceBlur (val, record) {
|
|
priceBlur (val, record) {
|
|
this.dataSource = record || []
|
|
this.dataSource = record || []
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
@@ -550,7 +560,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 库存不足时
|
|
// 库存不足时
|
|
- if (row.currentQty < row.salesNums) {
|
|
|
|
|
|
+ if (row.currentQty < row.salesNums && !this.isSuperEdit) {
|
|
_this.$confirm({
|
|
_this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
content: '库存不足,确认添加为急件吗?',
|
|
content: '库存不足,确认添加为急件吗?',
|