|
@@ -673,12 +673,24 @@
|
|
|
...this.searchForm,
|
|
...this.searchForm,
|
|
|
isEnabled: 1
|
|
isEnabled: 1
|
|
|
});
|
|
});
|
|
|
- this.tableData = data.list;
|
|
|
|
|
|
|
+ this.tableData = data.list.map(item => {
|
|
|
|
|
+ const measure = Number(item.measureQuantity) || 0;
|
|
|
|
|
+ const lock = Number(item.lockQuantity) || 0;
|
|
|
|
|
+ const result = (measure * 100 - lock * 100) / 100;
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ availableQuantity: Math.round(result * 100) / 100
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
this.total = data.count;
|
|
this.total = data.count;
|
|
|
} else if (this.dimension == 2) {
|
|
} else if (this.dimension == 2) {
|
|
|
// 批次维度
|
|
// 批次维度
|
|
|
const data = await storageApi.getBatchList(this.searchForm);
|
|
const data = await storageApi.getBatchList(this.searchForm);
|
|
|
for (let i = 0; i < data.list.length; i++) {
|
|
for (let i = 0; i < data.list.length; i++) {
|
|
|
|
|
+ const measure = Number(item.measureQuantity) || 0;
|
|
|
|
|
+ const lock = Number(item.lockQuantity) || 0;
|
|
|
|
|
+ const result = (measure * 100 - lock * 100) / 100;
|
|
|
|
|
+ data.list[i].availableQuantity = Math.round(result * 100) / 100;
|
|
|
data.list[i].outboundNum = data.list[i].availableQuantity;
|
|
data.list[i].outboundNum = data.list[i].availableQuantity;
|
|
|
}
|
|
}
|
|
|
this.tableData = data.list;
|
|
this.tableData = data.list;
|
|
@@ -688,12 +700,24 @@
|
|
|
const data = await storageApi.getMaterialList({
|
|
const data = await storageApi.getMaterialList({
|
|
|
...this.searchForm
|
|
...this.searchForm
|
|
|
});
|
|
});
|
|
|
- this.tableData = data.list;
|
|
|
|
|
|
|
+ this.tableData = data.list.map(item => {
|
|
|
|
|
+ const measure = Number(item.measureQuantity) || 0;
|
|
|
|
|
+ const lock = Number(item.lockQuantity) || 0;
|
|
|
|
|
+ const result = (measure * 100 - lock * 100) / 100;
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ availableQuantity: Math.round(result * 100) / 100
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
this.total = data.count;
|
|
this.total = data.count;
|
|
|
} else {
|
|
} else {
|
|
|
// 包装维度
|
|
// 包装维度
|
|
|
const data = await storageApi.getPackingList(this.searchForm);
|
|
const data = await storageApi.getPackingList(this.searchForm);
|
|
|
for (let i = 0; i < data.list.length; i++) {
|
|
for (let i = 0; i < data.list.length; i++) {
|
|
|
|
|
+ const measure = Number(item.measureQuantity) || 0;
|
|
|
|
|
+ const lock = Number(item.lockQuantity) || 0;
|
|
|
|
|
+ const result = (measure * 100 - lock * 100) / 100;
|
|
|
|
|
+ data.list[i].availableQuantity = Math.round(result * 100) / 100;
|
|
|
data.list[i].outboundNum = data.list[i].packingQuantity;
|
|
data.list[i].outboundNum = data.list[i].packingQuantity;
|
|
|
}
|
|
}
|
|
|
this.tableData = data.list;
|
|
this.tableData = data.list;
|
|
@@ -715,7 +739,7 @@
|
|
|
(product) => product.categoryId === item.categoryId
|
|
(product) => product.categoryId === item.categoryId
|
|
|
);
|
|
);
|
|
|
let num = matchedProduct.reduce(
|
|
let num = matchedProduct.reduce(
|
|
|
- (pre, cur) => pre + cur.availableQuantity,
|
|
|
|
|
|
|
+ (pre, cur) => pre + cur.measureQuantity,
|
|
|
0
|
|
0
|
|
|
);
|
|
);
|
|
|
// console.log(matchedProduct);
|
|
// console.log(matchedProduct);
|
|
@@ -738,7 +762,7 @@
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if (matchedProduct) {
|
|
if (matchedProduct) {
|
|
|
- this.$set(item, 'outboundNum', matchedProduct.availableQuantity);
|
|
|
|
|
|
|
+ this.$set(item, 'outboundNum', matchedProduct.measureQuantity);
|
|
|
}
|
|
}
|
|
|
const isSelection = this.selectionList.find(
|
|
const isSelection = this.selectionList.find(
|
|
|
(product) => product.id === item.id
|
|
(product) => product.id === item.id
|
|
@@ -906,6 +930,7 @@
|
|
|
|
|
|
|
|
item.availableQuantity = Math.round(result * 100) / 100;
|
|
item.availableQuantity = Math.round(result * 100) / 100;
|
|
|
});
|
|
});
|
|
|
|
|
+ console.log('dimension == 1~~~', data.list);
|
|
|
this.updateProductOutboundNums(data.list);
|
|
this.updateProductOutboundNums(data.list);
|
|
|
return data;
|
|
return data;
|
|
|
}
|
|
}
|