diff --git a/src/app/(main)/report/page.tsx b/src/app/(main)/report/page.tsx index 6b1d0ed..1cc9985 100644 --- a/src/app/(main)/report/page.tsx +++ b/src/app/(main)/report/page.tsx @@ -504,7 +504,7 @@ export default function ReportPage() { setLoading={setLoading} reportTitle={currentReport.title} /> - ) : currentReport.id === 'rep-013' || currentReport.id === 'rep-009' || currentReport.id === 'rep-012' ? ( + ) : currentReport.id === 'rep-013' || currentReport.id === 'rep-009' || currentReport.id === 'rep-012' || currentReport.id === 'rep-004' || currentReport.id === 'rep-007' || currentReport.id === 'rep-008' || currentReport.id === 'rep-011' ? ( <> @@ -512,13 +552,13 @@ const LotLabelPrintModal: React.FC = ({ 品號:{analysis.itemCode} {analysis.itemName} - {availableLots.length === 0 ? ( + {filteredLots.length === 0 ? ( - 找不到可用批號(availableQty > 0)。 + 找不到該樓層有可用批號(availableQty > 0)。 ) : ( - {availableLots.map((lot) => { + {filteredLots.map((lot) => { const isPrinting = printingLotLineId === lot.inventoryLotLineId; const loc = String(lot.warehouseCode ?? "").trim(); diff --git a/src/components/ProductionProcess/ProductionProcessList.tsx b/src/components/ProductionProcess/ProductionProcessList.tsx index 8e2b5d9..69e5682 100644 --- a/src/components/ProductionProcess/ProductionProcessList.tsx +++ b/src/components/ProductionProcess/ProductionProcessList.tsx @@ -60,6 +60,9 @@ interface ProductProcessListProps { onSelectMatchingStock: (jobOrderId: number|undefined, productProcessId: number|undefined,pickOrderId: number|undefined) => void; printerCombo: PrinterCombo[]; qcReady: boolean; + includePutaway?: boolean | null; + /** all | completed | notCompleted */ + putawayStatus?: string | null; listPersistedState: ProductionProcessListPersistedState; onListPersistedStateChange: React.Dispatch< React.SetStateAction @@ -93,6 +96,8 @@ const ProductProcessList: React.FC = ({ printerCombo, onSelectMatchingStock, qcReady, + includePutaway, + putawayStatus, listPersistedState, onListPersistedStateChange, }) => { @@ -258,7 +263,8 @@ const ProductProcessList: React.FC = ({ itemCode: appliedSearch.itemCode, jobOrderCode: appliedSearch.jobOrderCode, qcReady, - includePutaway: qcReady ? true : null, + includePutaway: includePutaway ?? (qcReady ? true : null), + putawayStatus, type: typeParam, page, size: PAGE_SIZE, @@ -273,7 +279,7 @@ const ProductProcessList: React.FC = ({ } finally { setLoading(false); } - }, [listPersistedState, qcReady]); + }, [listPersistedState, qcReady, includePutaway, putawayStatus]); useEffect(() => { fetchProcesses(); diff --git a/src/components/ProductionProcess/ProductionProcessPage.tsx b/src/components/ProductionProcess/ProductionProcessPage.tsx index 13501d0..aa48f3e 100644 --- a/src/components/ProductionProcess/ProductionProcessPage.tsx +++ b/src/components/ProductionProcess/ProductionProcessPage.tsx @@ -36,7 +36,10 @@ const ProductionProcessPage: React.FC = ({ printerCo const [productionListState, setProductionListState] = useState( createDefaultProductionProcessListPersistedState, ); - const [finishedQcListState, setFinishedQcListState] = useState( + const [waitingPutawayListState, setWaitingPutawayListState] = useState( + createDefaultProductionProcessListPersistedState, + ); + const [putawayedListState, setPutawayedListState] = useState( createDefaultProductionProcessListPersistedState, ); const { data: session } = useSession() as { data: SessionWithTokens | null }; @@ -199,7 +202,8 @@ const ProductionProcessPage: React.FC = ({ printerCo - + + @@ -231,8 +235,10 @@ const ProductionProcessPage: React.FC = ({ printerCo { const id = jobOrderId ?? null; if (id !== null) { @@ -248,13 +254,36 @@ const ProductionProcessPage: React.FC = ({ printerCo }} /> )} - {tabIndex === 2 && ( - + {tabIndex === 2 && ( + { + const id = jobOrderId ?? null; + if (id !== null) { + setSelectedProcessId(id); + } + }} + onSelectMatchingStock={(jobOrderId, productProcessId, pickOrderId) => { + setSelectedMatchingStock({ + jobOrderId: jobOrderId || 0, + productProcessId: productProcessId || 0, + pickOrderId: pickOrderId || 0, + }); + }} + /> )} {tabIndex === 3 && ( - + )} {tabIndex === 4 && ( + + )} + {tabIndex === 5 && ( )} diff --git a/src/components/PutAwayScan/PutAwayModal.tsx b/src/components/PutAwayScan/PutAwayModal.tsx index 2f8e6f9..f14cb8d 100644 --- a/src/components/PutAwayScan/PutAwayModal.tsx +++ b/src/components/PutAwayScan/PutAwayModal.tsx @@ -128,6 +128,7 @@ const PutAwayModal: React.FC = ({ open, onClose, warehouse, stockInLineId ...defaultNewValue, }, }); + const { isSubmitting } = formProps.formState; const errors = formProps.formState.errors; useEffect(() => { @@ -646,7 +647,7 @@ const PutAwayModal: React.FC = ({ open, onClose, warehouse, stockInLineId }, }} // onClick={formProps.handleSubmit()} - disabled={!verified || qtyError != ""} + disabled={!verified || qtyError != "" || isSubmitting} > {t("confirm putaway")} diff --git a/src/i18n/zh/common.json b/src/i18n/zh/common.json index 01a0c87..7048d7f 100644 --- a/src/i18n/zh/common.json +++ b/src/i18n/zh/common.json @@ -12,6 +12,8 @@ "Please Select BOM": "請選擇 BOM", "No Lot": "沒有批號", "Select All": "全選", + "Waiting QC Put Away Job Orders": "待QC上架工單", + "Put Awayed Job Orders": "已上架工單", "Loading BOM Detail...": "正在載入 BOM 明細…", "Output Quantity": "使用數量", "Process & Equipment": "製程與設備",