From dff50001250ef74e2fc734afcf1ccf34ee72cb18 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Sat, 7 Mar 2026 18:57:37 +0800 Subject: [PATCH] update --- src/app/api/bom/index.ts | 21 +++++++++++++ src/components/Qc/QcStockInModal.tsx | 47 ++++++++++++++++++---------- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/src/app/api/bom/index.ts b/src/app/api/bom/index.ts index c96c52b..f64361f 100644 --- a/src/app/api/bom/index.ts +++ b/src/app/api/bom/index.ts @@ -11,6 +11,27 @@ export interface BomCombo { description: string; } +export interface BomFormatFileGroup { + fileName: string; + problems: string[]; +} + +/** Format-check 回傳:正確檔名列表 + 失敗列表 */ +export interface BomFormatCheckResponse { + correctFileNames: string[]; + failList: BomFormatFileGroup[]; +} + +export interface BomUploadResponse { + batchId: string; + fileNames: string[]; +} + +export interface ImportBomItemPayload { + fileName: string; + isAlsoWip: boolean; +} + export const preloadBomCombo = (() => { fetchBomCombo() }) diff --git a/src/components/Qc/QcStockInModal.tsx b/src/components/Qc/QcStockInModal.tsx index ef3bb46..dc6d4d3 100644 --- a/src/components/Qc/QcStockInModal.tsx +++ b/src/components/Qc/QcStockInModal.tsx @@ -48,15 +48,13 @@ const style = { left: "50%", transform: "translate(-50%, -50%)", bgcolor: "background.paper", - // pt: 5, - // px: 5, - // pb: 10, display: "block", - width: { xs: "90%", sm: "90%", md: "90%" }, - height: { xs: "90%", sm: "90%", md: "90%" }, + width: "min(1280px, calc(100vw - 48px))", + maxWidth: "1280px", + height: "min(900px, calc(100vh - 48px))", + maxHeight: "calc(100vh - 48px)", }; interface CommonProps extends Omit { - // itemDetail: StockInLine & { qcResult?: PurchaseQcResult[] } & { escResult?: EscalationResult[] } | undefined; inputDetail: StockInLineInput | undefined; session: SessionWithTokens | null; warehouse?: any[]; @@ -64,6 +62,7 @@ interface CommonProps extends Omit { onClose: () => void; skipQc?: Boolean; printSource?: "stockIn" | "productionProcess"; + uiMode?: "default" | "dashboard" | "productionProcess"; } interface Props extends CommonProps { // itemDetail: StockInLine & { qcResult?: PurchaseQcResult[] } & { escResult?: EscalationResult[] }; @@ -79,12 +78,19 @@ const QcStockInModal: React.FC = ({ printerCombo, skipQc = false, printSource = "stockIn", + uiMode = "default", }) => { const { t, i18n: { language }, } = useTranslation("purchaseOrder"); - + const useCompactFields = useMemo(() => { + return uiMode === "dashboard" || uiMode === "productionProcess"; + }, [uiMode]); + + const useDenseQcLayout = useMemo(() => { + return uiMode === "productionProcess"; + }, [uiMode]); const [stockInLineInfo, setStockInLineInfo] = useState(); const [isLoading, setIsLoading] = useState(false); const [isSubmitting, setIsSubmitting] = useState(false); @@ -710,18 +716,25 @@ const printQrcode = useCallback( {stockInLineInfo.jobOrderId ? ( - - ) : ( - - ) - } - {skipQc === false && ( - ) + compactFields={useCompactFields} + /> + ) : ( + + )} + {skipQc === false && ( + ) } {(!viewOnly && !showPutaway) && (