From 5473ff820d8354376db73bb09a79f6afbf5966b5 Mon Sep 17 00:00:00 2001 From: "CANCERYS\\kw093" Date: Mon, 26 Jan 2026 16:15:51 +0800 Subject: [PATCH] update bar --- .../FinishedGoodSearch/FinishedGoodSearch.tsx | 3 +- .../GoodPickExecutionForm.tsx | 2 +- .../GoodPickExecutiondetail.tsx | 74 +++++++++++++++++-- 3 files changed, 72 insertions(+), 7 deletions(-) diff --git a/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx b/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx index 4637e41..ef47f79 100644 --- a/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx +++ b/src/components/FinishedGoodSearch/FinishedGoodSearch.tsx @@ -655,7 +655,7 @@ const handleAssignByLane = useCallback(async ( > {t("Print All Draft")} ({releasedOrderCount}) - +{/* + */} diff --git a/src/components/FinishedGoodSearch/GoodPickExecutionForm.tsx b/src/components/FinishedGoodSearch/GoodPickExecutionForm.tsx index c5441af..5ff744d 100644 --- a/src/components/FinishedGoodSearch/GoodPickExecutionForm.tsx +++ b/src/components/FinishedGoodSearch/GoodPickExecutionForm.tsx @@ -419,7 +419,7 @@ const PickExecutionForm: React.FC = ({ onChange={(e) => handleInputChange("reason", e.target.value)} label={t("Remark")} > - {t("Select Reason")} + {t("Select Remark")} {t("Edit")} {t("Just Complete")} diff --git a/src/components/FinishedGoodSearch/GoodPickExecutiondetail.tsx b/src/components/FinishedGoodSearch/GoodPickExecutiondetail.tsx index 0ffac31..4c64435 100644 --- a/src/components/FinishedGoodSearch/GoodPickExecutiondetail.tsx +++ b/src/components/FinishedGoodSearch/GoodPickExecutiondetail.tsx @@ -19,6 +19,7 @@ import { TablePagination, Modal, Chip, + LinearProgress, } from "@mui/material"; import dayjs from 'dayjs'; import TestQrCodeProvider from '../QrCodeScannerProvider/TestQrCodeProvider'; @@ -78,7 +79,33 @@ interface Props { onSwitchToRecordTab?: () => void; onRefreshReleasedOrderCount?: () => void; } - +const LinearProgressWithLabel: React.FC<{ completed: number; total: number }> = ({ completed, total }) => { + const { t } = useTranslation(["pickOrder", "do"]); + const progress = total > 0 ? (completed / total) * 100 : 0; + + return ( + + + + + + + + {t("Progress")}: {completed}/{total} + + + + + + ); +}; // QR Code Modal Component (from LotTable) const QrCodeModal: React.FC<{ open: boolean; @@ -477,7 +504,7 @@ const [pickOrderSwitching, setPickOrderSwitching] = useState(false); const [paginationController, setPaginationController] = useState({ pageNum: 0, - pageSize: 10, + pageSize: -1, }); const [usernameList, setUsernameList] = useState([]); @@ -515,7 +542,23 @@ const [isConfirmingLot, setIsConfirmingLot] = useState(false); console.log(`QR Code clicked for pick order ID: ${pickOrderId}`); // TODO: Implement QR code functionality }; + const progress = useMemo(() => { + if (combinedLotData.length === 0) { + return { completed: 0, total: 0 }; + } + + const nonPendingCount = combinedLotData.filter(lot => { + const status = lot.stockOutLineStatus?.toLowerCase(); + return status !== 'pending'; + }).length; + + return { + completed: nonPendingCount, + total: combinedLotData.length + }; + }, [combinedLotData]); + const handleLotMismatch = useCallback((expectedLot: any, scannedLot: any) => { console.log("Lot mismatch detected:", { expectedLot, scannedLot }); setExpectedLotData(expectedLot); @@ -1808,13 +1851,16 @@ useEffect(() => { const newPageSize = parseInt(event.target.value, 10); setPaginationController({ pageNum: 0, - pageSize: newPageSize, + pageSize: newPageSize === -1 ? -1 : newPageSize, }); }, []); // Pagination data with sorting by routerIndex // Remove the sorting logic and just do pagination const paginatedData = useMemo(() => { + if (paginationController.pageSize === -1) { + return combinedLotData; // Show all items + } const startIndex = paginationController.pageNum * paginationController.pageSize; const endIndex = startIndex + paginationController.pageSize; return combinedLotData.slice(startIndex, endIndex); // No sorting needed @@ -2337,6 +2383,24 @@ const handleSubmitAllScanned = useCallback(async () => { > + + + {/* DO Header */} @@ -2540,7 +2604,7 @@ paginatedData.map((lot, index) => { }} > {lot.lotNo || - t('⚠️ No Stock Available')} + t('No Stock Available')} @@ -2726,7 +2790,7 @@ paginatedData.map((lot, index) => { rowsPerPage={paginationController.pageSize} onPageChange={handlePageChange} onRowsPerPageChange={handlePageSizeChange} - rowsPerPageOptions={[10, 25, 50]} + rowsPerPageOptions={[10, 25, 50,-1]} labelRowsPerPage={t("Rows per page")} labelDisplayedRows={({ from, to, count }) => `${from}-${to} of ${count !== -1 ? count : `more than ${to}`}`