From 656a2229769f917030082f654f2d273467ce4d46 Mon Sep 17 00:00:00 2001 From: "Tommy\\2Fi-Staff" Date: Tue, 3 Mar 2026 19:58:31 +0800 Subject: [PATCH] upDATE --- src/components/Qc/QcComponent.tsx | 21 ++++++++++++++------- src/components/Qc/QcForm.tsx | 4 ++-- src/components/Qc/QcStockInModal.tsx | 3 ++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/Qc/QcComponent.tsx b/src/components/Qc/QcComponent.tsx index ae194a2..4f8f335 100644 --- a/src/components/Qc/QcComponent.tsx +++ b/src/components/Qc/QcComponent.tsx @@ -50,6 +50,8 @@ interface Props { // itemDetail: StockInLine & { qcResult?: PurchaseQcResult[] } & { escResult?: EscalationResult[] }; // qc: QcItemWithChecks[]; disabled: boolean; + /** When true, use smaller typography and input size to match 來貨詳情 section (e.g. in QcStockInModal). */ + compactLayout?: boolean; // qcItems: QcData[] // setQcItems: Dispatch> } @@ -62,7 +64,7 @@ type EntryError = type QcRow = TableRow, EntryError>; // fetchQcItemCheck -const QcComponent: React.FC = ({ itemDetail, disabled = false }) => { +const QcComponent: React.FC = ({ itemDetail, disabled = false, compactLayout = false }) => { const { t } = useTranslation("purchaseOrder"); const apiRef = useGridApiRef(); const { @@ -421,10 +423,13 @@ useEffect(() => { ); } + const headerVariant = compactLayout ? "subtitle1" : "h5"; + const subVariant = compactLayout ? "body2" : "subtitle1"; + const sub2Variant = compactLayout ? "body2" : "subtitle2"; const QcHeader = useMemo(() => () => { if (qcCategory === undefined || qcCategory === null) { return ( - + N/A ); @@ -432,19 +437,19 @@ useEffect(() => { return ( <> - + {qcCategory?.name} ({qcCategory?.code}) - + 品檢類型:{qcType} - + {formattedDesc(qcCategory?.description)} ); - }, [qcType, qcCategory]); + }, [qcType, qcCategory, headerVariant, subVariant, sub2Variant]); return ( <> @@ -513,7 +518,7 @@ useEffect(() => { )} - + {t("Qc Decision")} @@ -566,6 +571,7 @@ useEffect(() => { // type="number" id="accQty" label={t("acceptQty")} + size={compactLayout ? "small" : "medium"} sx={{ width: '150px' }} // value={Number(accQty)} defaultValue={Number(accQty)} @@ -618,6 +624,7 @@ useEffect(() => { = ({ rows, disabled = false }) => { { field: "failQty", headerName: t("failedQty"), - flex: 0.5, + flex: 0.8, // editable: true, renderCell: (params) => { const index = getRowIndex(params);//params.api.getRowIndexRelativeToVisibleRows(params.id); @@ -174,7 +174,7 @@ const QcForm: React.FC = ({ rows, disabled = false }) => { { field: "remarks", headerName: t("remarks"), - flex: 2, + flex: 1.7, renderCell: (params) => { // const index = Number(params.id);//params.api.getRowIndexRelativeToVisibleRows(params.id); const index = getRowIndex(params);//params.api.getRowIndexRelativeToVisibleRows(params.id); diff --git a/src/components/Qc/QcStockInModal.tsx b/src/components/Qc/QcStockInModal.tsx index 653b68d..00c3cba 100644 --- a/src/components/Qc/QcStockInModal.tsx +++ b/src/components/Qc/QcStockInModal.tsx @@ -705,7 +705,7 @@ const printQrcode = useCallback( {tabIndex === 0 && - + {t("Delivery Detail")} @@ -719,6 +719,7 @@ const printQrcode = useCallback( ) }