|
@@ -149,6 +149,11 @@
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
|
default: false
|
|
default: false
|
|
|
},
|
|
},
|
|
|
|
|
+ // 是否同时显示库存数量和可用数量
|
|
|
|
|
+ showStockCount: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false
|
|
|
|
|
+ },
|
|
|
//是否显示订单编码
|
|
//是否显示订单编码
|
|
|
isOrderNo: {
|
|
isOrderNo: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -378,12 +383,20 @@
|
|
|
isNone: this.quoteType === 2,
|
|
isNone: this.quoteType === 2,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- width: 160,
|
|
|
|
|
- prop: 'availableCountBase',
|
|
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ prop: 'stockCountBase',
|
|
|
label: '库存数量',
|
|
label: '库存数量',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- isNone: this.quoteType === 2,
|
|
|
|
|
|
|
+ isNone: this.quoteType === 2 || !this.showStockCount
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ prop: 'availableCountBase',
|
|
|
|
|
+ label: this.showStockCount ? '可用数量' : '库存数量',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ isNone: this.quoteType === 2
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
width: 200,
|
|
width: 200,
|
|
@@ -923,6 +936,25 @@
|
|
|
.add(addDay, dateType)
|
|
.add(addDay, dateType)
|
|
|
.format('YYYY-MM-DD');
|
|
.format('YYYY-MM-DD');
|
|
|
},
|
|
},
|
|
|
|
|
+ // 兼容未返回 stockCountBase 的旧库存接口
|
|
|
|
|
+ getStockCount(item) {
|
|
|
|
|
+ if (item.stockCountBase !== undefined && item.stockCountBase !== null) {
|
|
|
|
|
+ return Number(item.stockCountBase);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (
|
|
|
|
|
+ item.measureQuantity !== undefined &&
|
|
|
|
|
+ item.measureQuantity !== null
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return Number(item.measureQuantity);
|
|
|
|
|
+ }
|
|
|
|
|
+ return Number(item.availableCountBase || 0);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 可用数量统一按库存余额扣减锁库数量计算
|
|
|
|
|
+ getAvailableStockCount(item) {
|
|
|
|
|
+ const availableCount =
|
|
|
|
|
+ this.getStockCount(item) - Number(item.lockQuantity || 0);
|
|
|
|
|
+ return Number(availableCount.toFixed(4));
|
|
|
|
|
+ },
|
|
|
//修改回显
|
|
//修改回显
|
|
|
async putTableValue(data) {
|
|
async putTableValue(data) {
|
|
|
let productList =
|
|
let productList =
|
|
@@ -956,10 +988,19 @@
|
|
|
(key) => (key.code + ',' + key.batchNo == item.productCode+','+item.batchNo)
|
|
(key) => (key.code + ',' + key.batchNo == item.productCode+','+item.batchNo)
|
|
|
) || {};
|
|
) || {};
|
|
|
this.form.datasource;
|
|
this.form.datasource;
|
|
|
|
|
+ if (this.showStockCount) {
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ this.form.datasource[index],
|
|
|
|
|
+ 'stockCountBase',
|
|
|
|
|
+ this.getStockCount(find)
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
this.$set(
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
this.form.datasource[index],
|
|
|
'availableCountBase',
|
|
'availableCountBase',
|
|
|
- find.availableCountBase
|
|
|
|
|
|
|
+ this.showStockCount
|
|
|
|
|
+ ? this.getAvailableStockCount(find)
|
|
|
|
|
+ : find.availableCountBase
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|