From 42ee4a6d922816e4781e74dae1ada05236986c9d Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Tue, 24 Feb 2026 10:50:27 +0800 Subject: [PATCH] update --- src/app/api/stockIssue/actions.ts | 3 ++ src/components/General/LoadingComponent.tsx | 2 +- .../InputDataGrid/InputDataGrid.tsx | 2 +- .../Jodetail/FInishedJobOrderRecord.tsx | 2 + .../Jodetail/JobPickExecutionForm.tsx | 7 ++-- .../Jodetail/newJobPickExecution.tsx | 2 +- .../ProductionProcessList.tsx | 2 +- src/components/Qc/QcForm.tsx | 2 +- src/components/StockIssue/SearchPage.tsx | 13 +++++++ src/components/StockIssue/SubmitIssueForm.tsx | 39 +++++++++++++++++-- src/i18n/zh/common.json | 2 +- src/i18n/zh/inventory.json | 7 ++++ src/i18n/zh/jo.json | 2 +- 13 files changed, 70 insertions(+), 15 deletions(-) diff --git a/src/app/api/stockIssue/actions.ts b/src/app/api/stockIssue/actions.ts index 790c4fe..5d52d32 100644 --- a/src/app/api/stockIssue/actions.ts +++ b/src/app/api/stockIssue/actions.ts @@ -25,6 +25,7 @@ export interface StockIssueResult { handleStatus: string; handleDate: string | null; handledBy: number | null; + uomDesc: string | null; } export interface ExpiryItemResult { id: number; @@ -178,6 +179,8 @@ export async function submitMissItem(issueId: number, handler: number) { itemDescription: string | null; storeLocation: string | null; issues: IssueDetailItem[]; + bookQty: number; + uomDesc: string | null; } export interface IssueDetailItem { diff --git a/src/components/General/LoadingComponent.tsx b/src/components/General/LoadingComponent.tsx index fc802b2..868d187 100644 --- a/src/components/General/LoadingComponent.tsx +++ b/src/components/General/LoadingComponent.tsx @@ -8,7 +8,7 @@ export const LoadingComponent: React.FC = () => { display="flex" justifyContent="center" alignItems="center" - // autoheight="true" + > diff --git a/src/components/InputDataGrid/InputDataGrid.tsx b/src/components/InputDataGrid/InputDataGrid.tsx index 51ebecf..bab891d 100644 --- a/src/components/InputDataGrid/InputDataGrid.tsx +++ b/src/components/InputDataGrid/InputDataGrid.tsx @@ -370,7 +370,7 @@ function InputDataGrid({ // columns={!checkboxSelection ? _columns : columns} columns={needActions ? _columns : columns} editMode="row" - // autoHeight + sx={{ height: "30vh", "--DataGrid-overlayHeight": "100px", diff --git a/src/components/Jodetail/FInishedJobOrderRecord.tsx b/src/components/Jodetail/FInishedJobOrderRecord.tsx index e076661..5f5a0a8 100644 --- a/src/components/Jodetail/FInishedJobOrderRecord.tsx +++ b/src/components/Jodetail/FInishedJobOrderRecord.tsx @@ -509,9 +509,11 @@ const FInishedJobOrderRecord: React.FC = ({ filterArgs }) => { size="small" sx={{ mb: 1 }} /> + {/* {jobOrderPickOrder.completedItems}/{jobOrderPickOrder.totalItems} {t("items completed")} + */} { // 增加 badPackageQty 判断,确保有坏包装会走 issue 流程 const badPackageQty = Number((formData as any).badPackageQty) || 0; - const isNormalPick = verifiedQty > 0 - && formData.missQty == 0 - && formData.badItemQty == 0 - && badPackageQty == 0; + const isNormalPick = (formData.missQty == null || formData.missQty === 0) + && (formData.badItemQty == null || formData.badItemQty === 0) + && (badPackageQty === 0); if (isNormalPick) { if (onNormalPickSubmit) { diff --git a/src/components/Jodetail/newJobPickExecution.tsx b/src/components/Jodetail/newJobPickExecution.tsx index 4549061..3b9a9d8 100644 --- a/src/components/Jodetail/newJobPickExecution.tsx +++ b/src/components/Jodetail/newJobPickExecution.tsx @@ -1822,7 +1822,7 @@ const JobPickExecution: React.FC = ({ filterArgs, onBackToList }) => { }, [handleSubmitPickQtyWithQty]); const handleSubmitAllScanned = useCallback(async () => { const scannedLots = combinedLotData.filter(lot => - lot.stockOutLineStatus === 'checked' + lot.stockOutLineStatus === 'checked' || lot.stockOutLineStatus === 'partially_completed' ); if (scannedLots.length === 0) { diff --git a/src/components/ProductionProcess/ProductionProcessList.tsx b/src/components/ProductionProcess/ProductionProcessList.tsx index 2190567..956bdbd 100644 --- a/src/components/ProductionProcess/ProductionProcessList.tsx +++ b/src/components/ProductionProcess/ProductionProcessList.tsx @@ -306,7 +306,7 @@ const ProductProcessList: React.FC = ({ onSelectProcess )} {statusLower === "completed" && ( - )} diff --git a/src/components/Qc/QcForm.tsx b/src/components/Qc/QcForm.tsx index 46a33a4..8fac0e4 100644 --- a/src/components/Qc/QcForm.tsx +++ b/src/components/Qc/QcForm.tsx @@ -232,7 +232,7 @@ const QcForm: React.FC = ({ rows, disabled = false }) => { return ( <> - // autoHeight + = ({ dataList }) => { { name: "itemDescription", label: t("Item") }, { name: "lotNo", label: t("Lot No.") }, { name: "storeLocation", label: t("Location") }, + { + name: "bookQty", + label: t("Book Qty"), + renderCell: (item) => ( + <>{item.bookQty?.toFixed(2) ?? "0"} {item.uomDesc ?? ""} + ), + }, { name: "issueQty", label: t("Miss Qty") }, + { name: "uomDesc", label: t("UoM"), renderCell: (item) => ( + <>{item.uomDesc ?? ""} + ) }, { name: "id", label: t("Action"), @@ -196,6 +206,9 @@ const SearchPage: React.FC = ({ dataList }) => { { name: "lotNo", label: t("Lot No.") }, { name: "storeLocation", label: t("Location") }, { name: "issueQty", label: t("Defective Qty") }, + { name: "uomDesc", label: t("UoM"), renderCell: (item) => ( + <>{item.uomDesc ?? ""} + ) }, { name: "id", label: t("Action"), diff --git a/src/components/StockIssue/SubmitIssueForm.tsx b/src/components/StockIssue/SubmitIssueForm.tsx index 37d6bab..1a891fe 100644 --- a/src/components/StockIssue/SubmitIssueForm.tsx +++ b/src/components/StockIssue/SubmitIssueForm.tsx @@ -49,7 +49,10 @@ const SubmitIssueForm: React.FC = ({ const [submitting, setSubmitting] = useState(false); const [details, setDetails] = useState(null); const [submitQty, setSubmitQty] = useState(""); - + const bookQty = details?.bookQty ?? 0; + const submitQtyNum = parseFloat(submitQty); + const submitQtyValid = !Number.isNaN(submitQtyNum) && submitQtyNum >= 0; + const remainAvailable = submitQtyValid ? Math.max(0, bookQty - submitQtyNum) : bookQty; useEffect(() => { if (open && lotId) { loadDetails(); @@ -121,9 +124,17 @@ const SubmitIssueForm: React.FC = ({ {t("Lot No.")}: {details.lotNo} - + {t("Location")}: {details.storeLocation} + + {t("Book Qty")}:{" "} + {details.bookQty} + + + {t("UoM")}:{" "} + {details.uomDesc ?? ""} + @@ -146,8 +157,8 @@ const SubmitIssueForm: React.FC = ({ {issue.pickerName || "-"} {issueType === "miss" - ? issue.missQty?.toFixed(2) || "0" - : issue.issueQty?.toFixed(2) || "0"} + ? issue.missQty?.toFixed(0) || "0" + : issue.issueQty?.toFixed(0) || "0"} {issue.pickOrderCode} {issue.doOrderCode || "-"} @@ -168,6 +179,26 @@ const SubmitIssueForm: React.FC = ({ inputProps={{ min: 0, step: 0.01 }} sx={{ mt: 2 }} /> + { + const raw = e.target.value; + if (raw === "") { + setSubmitQty(""); + return; + } + const remain = parseFloat(raw); + if (!Number.isNaN(remain) && remain >= 0) { + const newSubmit = Math.max(0, bookQty - remain); + setSubmitQty(newSubmit.toFixed(0)); + } + }} + inputProps={{ min: 0, step: 0.01, readOnly: false }} + sx={{ mt: 2 }} + />