|
@@ -662,7 +662,11 @@ export default {
|
|
if (row.stockQty > 0) { // 可用库存大于0才可添加
|
|
if (row.stockQty > 0) { // 可用库存大于0才可添加
|
|
this.$emit('addProduct', [row.salesBillDetailSn])
|
|
this.$emit('addProduct', [row.salesBillDetailSn])
|
|
} else {
|
|
} else {
|
|
- this.$message.warning('库存为0,不可添加!')
|
|
|
|
|
|
+ if (row && row.productEntity && row.productEntity.productBrandName == '箭冠' && row.productEntity.productTypeName3 == '轮胎') {
|
|
|
|
+ this.$message.warning('锁定库存不足!')
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning('库存为0,不可添加!')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 批量转采购额
|
|
// 批量转采购额
|
|
@@ -711,22 +715,33 @@ export default {
|
|
_this.$message.warning('请先选择产品!')
|
|
_this.$message.warning('请先选择产品!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ // 可添加产品
|
|
const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.stockQty > 0)
|
|
const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.stockQty > 0)
|
|
|
|
+ // 库存为0的产品
|
|
const noStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.stockQty)
|
|
const noStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.stockQty)
|
|
- console.log(noStockRow)
|
|
|
|
|
|
+ // 冻结库存为0的产品
|
|
|
|
+ const noLockStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.productEntity && item.productEntity.productBrandName == '箭冠' && item.productEntity.productTypeName3 == '轮胎' && !item.lockStockQty)
|
|
|
|
+
|
|
|
|
+ // 可添加产品sn列表
|
|
const obj = []
|
|
const obj = []
|
|
- const noObj = []
|
|
|
|
chooseRow && chooseRow.map(item => {
|
|
chooseRow && chooseRow.map(item => {
|
|
obj.push(item.salesBillDetailSn)
|
|
obj.push(item.salesBillDetailSn)
|
|
})
|
|
})
|
|
|
|
+ // 库存为0产品编码列表
|
|
|
|
+ const noObj = []
|
|
noStockRow && noStockRow.map(item => {
|
|
noStockRow && noStockRow.map(item => {
|
|
noObj.push(item.productCode)
|
|
noObj.push(item.productCode)
|
|
})
|
|
})
|
|
|
|
+ // 冻结库存为0的产品
|
|
|
|
+ const noLockObj = []
|
|
|
|
+ noLockStockRow && noLockStockRow.map(item => {
|
|
|
|
+ noLockObj.push(item.productCode)
|
|
|
|
+ })
|
|
|
|
|
|
if (obj.length) {
|
|
if (obj.length) {
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确认要批量添加到待下推列表吗?</div>{noObj.length ? <div><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可添加。</div><div> 产品 ({noObj.toString()}) 因库存为0不可添加!</div></div> : ''}</div>,
|
|
|
|
|
|
+ content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确认要批量添加到待下推列表吗?</div>{(noObj.length || noLockObj.length) ? <div><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可添加。</div><div> {noObj.length ? <div>产品 ({noObj.toString()}) 因库存为0不可添加!</div> : noLockObj.length ? <div>产品 ({noLockObj.toString()}) 因锁定库存不足不可添加!</div> : ''}</div></div> : ''}</div>,
|
|
centered: true,
|
|
centered: true,
|
|
closable: true,
|
|
closable: true,
|
|
class: 'confirm-center',
|
|
class: 'confirm-center',
|