diff --git a/src/components/StockIssue/SearchPage.tsx b/src/components/StockIssue/SearchPage.tsx index 608dc31..dad5252 100644 --- a/src/components/StockIssue/SearchPage.tsx +++ b/src/components/StockIssue/SearchPage.tsx @@ -150,7 +150,7 @@ const SearchPage: React.FC = ({ dataList }) => { { name: "itemDescription", label: t("Item") }, { name: "lotNo", label: t("Lot No.") }, { name: "storeLocation", label: t("Location") }, - { name: "missQty", label: t("Miss Qty") }, + { name: "issueQty", label: t("Miss Qty") }, { name: "id", label: t("Action"), @@ -176,7 +176,7 @@ const SearchPage: React.FC = ({ dataList }) => { { name: "itemDescription", label: t("Item") }, { name: "lotNo", label: t("Lot No.") }, { name: "storeLocation", label: t("Location") }, - { name: "badItemQty", label: t("Defective Qty") }, + { name: "issueQty", label: t("Defective Qty") }, { name: "id", label: t("Action"), diff --git a/src/components/StockRecord/SearchPage.tsx b/src/components/StockRecord/SearchPage.tsx index 8d1c02a..025dd84 100644 --- a/src/components/StockRecord/SearchPage.tsx +++ b/src/components/StockRecord/SearchPage.tsx @@ -77,16 +77,10 @@ const SearchPage: React.FC = ({ dataList: initialDataList }) => { sorted.forEach((item) => { const currentBalance = balanceMap.get(item.itemId) || 0; - let newBalance = currentBalance; + - // 根据类型计算余额 - if (item.transactionType === "IN") { - newBalance = currentBalance + item.qty; - } else if (item.transactionType === "OUT") { - newBalance = currentBalance - item.qty; - } - - balanceMap.set(item.itemId, newBalance); + + // 格式化日期 - 优先使用 date 字段 let formattedDate = ""; @@ -128,7 +122,7 @@ const SearchPage: React.FC = ({ dataList: initialDataList }) => { formattedDate, inQty: item.transactionType === "IN" ? item.qty : 0, outQty: item.transactionType === "OUT" ? item.qty : 0, - balanceQty: item.balanceQty ? item.balanceQty : newBalance, + balanceQty: item.balanceQty ?? 0, }); });