|
@@ -188,7 +188,9 @@ const loadOrderItems = async (oid: string) => {
|
|
|
|
|
|
|
|
// 重新匹配库存并更新数量
|
|
// 重新匹配库存并更新数量
|
|
|
const list = inventoryList.value;
|
|
const list = inventoryList.value;
|
|
|
- replenishItems.value = list.filter((it: any) => it.product_id || it.productId).map((it: any) => {
|
|
|
|
|
|
|
+ replenishItems.value = list.map((it: any) => {
|
|
|
|
|
+ const hasProduct = it.product_id || it.productId;
|
|
|
|
|
+ if (!hasProduct) return { productId: null, productCode: '', productName: '', quantity: 0, shelfNum: null, position: null };
|
|
|
const code = (it.product_code || it.productCode || '').trim();
|
|
const code = (it.product_code || it.productCode || '').trim();
|
|
|
const m = items.find((oi: any) => oi.productCode.toUpperCase() === code.toUpperCase());
|
|
const m = items.find((oi: any) => oi.productCode.toUpperCase() === code.toUpperCase());
|
|
|
return {
|
|
return {
|
|
@@ -314,7 +316,9 @@ onMounted(async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- replenishItems.value = list.filter((it: any) => it.product_id || it.productId).map((it: any) => {
|
|
|
|
|
|
|
+ replenishItems.value = list.map((it: any) => {
|
|
|
|
|
+ const hasProduct = it.product_id || it.productId;
|
|
|
|
|
+ if (!hasProduct) return { productId: null, productCode: '', productName: '', quantity: 0, shelfNum: null, position: null };
|
|
|
const code = (it.product_code || it.productCode || '').trim();
|
|
const code = (it.product_code || it.productCode || '').trim();
|
|
|
const m = orderItems.find((oi: any) => oi.productCode.toUpperCase() === code.toUpperCase());
|
|
const m = orderItems.find((oi: any) => oi.productCode.toUpperCase() === code.toUpperCase());
|
|
|
return {
|
|
return {
|