|
@@ -132,7 +132,11 @@
|
|
|
import timeDialog from '@/components/timeDialog/index.vue';
|
|
import timeDialog from '@/components/timeDialog/index.vue';
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
import { levelList, pricingWayList, quoteTypeOp } from '@/enum/dict.js';
|
|
import { levelList, pricingWayList, quoteTypeOp } from '@/enum/dict.js';
|
|
|
- import { getInventoryTotalAPI } from '@/api/wms';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getInventoryTotalAPI,
|
|
|
|
|
+ buildInventoryTotalQueryKey,
|
|
|
|
|
+ matchInventoryTotal
|
|
|
|
|
+ } from '@/api/wms';
|
|
|
import { getSummaries } from '@/utils/util.js';
|
|
import { getSummaries } from '@/utils/util.js';
|
|
|
import { getAllQuantity } from '@/BIZComponents/setProduct.js';
|
|
import { getAllQuantity } from '@/BIZComponents/setProduct.js';
|
|
|
|
|
|
|
@@ -540,10 +544,18 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
minWidth: 160,
|
|
minWidth: 160,
|
|
|
- prop: 'availableCountBase',
|
|
|
|
|
|
|
+ prop: 'stockCountBase',
|
|
|
label: '库存数量',
|
|
label: '库存数量',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
|
|
+ isNone: !this.isWms
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ minWidth: 160,
|
|
|
|
|
+ prop: 'availableCountBase',
|
|
|
|
|
+ label: this.isWms ? '可用数量' : '库存数量',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ align: 'center',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
minWidth: 140,
|
|
minWidth: 140,
|
|
@@ -1077,22 +1089,27 @@
|
|
|
}
|
|
}
|
|
|
if (this.isWms) {
|
|
if (this.isWms) {
|
|
|
let codeList = this.form.datasource
|
|
let codeList = this.form.datasource
|
|
|
- .filter((item) => item.productCode)
|
|
|
|
|
- .map((item) => item.batchNo ? [item.productCode, item.batchNo].join(',') : item.productCode);
|
|
|
|
|
|
|
+ .filter((item) => item.productCode)
|
|
|
|
|
+ .map((item) => buildInventoryTotalQueryKey(item));
|
|
|
//获取仓库库存
|
|
//获取仓库库存
|
|
|
let inventoryTotalList = await getInventoryTotalAPI(codeList);
|
|
let inventoryTotalList = await getInventoryTotalAPI(codeList);
|
|
|
this.form.datasource
|
|
this.form.datasource
|
|
|
.filter((item) => item.productCode)
|
|
.filter((item) => item.productCode)
|
|
|
- .forEach((item, index) => {
|
|
|
|
|
|
|
+ .forEach((item) => {
|
|
|
let find =
|
|
let find =
|
|
|
- inventoryTotalList.find(
|
|
|
|
|
- (key) => (key.code + ',' + key.batchNo == item.productCode+','+item.batchNo)
|
|
|
|
|
- ) || {};
|
|
|
|
|
|
|
+ inventoryTotalList.find((key) =>
|
|
|
|
|
+ matchInventoryTotal(item, key)
|
|
|
|
|
+ ) || {};
|
|
|
this.form.datasource;
|
|
this.form.datasource;
|
|
|
this.$set(
|
|
this.$set(
|
|
|
- this.form.datasource[index],
|
|
|
|
|
|
|
+ item,
|
|
|
|
|
+ 'stockCountBase',
|
|
|
|
|
+ find.stockCountBase == null ? 0 : find.stockCountBase
|
|
|
|
|
+ );
|
|
|
|
|
+ this.$set(
|
|
|
|
|
+ item,
|
|
|
'availableCountBase',
|
|
'availableCountBase',
|
|
|
- find.availableCountBase
|
|
|
|
|
|
|
+ find.availableCountBase == null ? 0 : find.availableCountBase
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|