diff --git a/src/components/InventorySearch/InventorySearch.tsx b/src/components/InventorySearch/InventorySearch.tsx index d3866e6..ad262af 100644 --- a/src/components/InventorySearch/InventorySearch.tsx +++ b/src/components/InventorySearch/InventorySearch.tsx @@ -104,10 +104,10 @@ const InventorySearch: React.FC = ({ inventories }) => { break; case "paging": setFilteredInventories((fi) => - orderBy( - uniqBy([...fi, ...response.records], "id"), - ["id"], ["desc"] - )); + // orderBy( + uniqBy([...fi, ...response.records], "id") + // , ["id"], ["desc"]) + ); } } }, [inventoriesPagingController, setInventoriesPagingController]) diff --git a/src/components/PoDetail/PoDetail.tsx b/src/components/PoDetail/PoDetail.tsx index 48e1280..5ffb3f8 100644 --- a/src/components/PoDetail/PoDetail.tsx +++ b/src/components/PoDetail/PoDetail.tsx @@ -86,7 +86,10 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { const [rows, setRows] = useState( purchaseOrder.pol || [], ); - + const [row, setRow] = useState(rows[0]); + const [stockInLine, setStockInLine] = useState(rows[0].stockInLine); + const [processedQty, setProcessedQty] = useState(rows[0].processed); + const searchParams = useSearchParams(); // const [currPoStatus, setCurrPoStatus] = useState(purchaseOrder.status); @@ -115,7 +118,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { }, [purchaseOrder]); function Row(props: { row: PurchaseOrderLine }) { - const { row } = props; + const { row } = props; const [firstReceiveQty, setFirstReceiveQty] = useState() const [secondReceiveQty, setSecondReceiveQty] = useState() const [open, setOpen] = useState(false); @@ -144,7 +147,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { return ( <> *": { borderBottom: "unset" }, color: "black" }}> - + {/* = ({ po, qc, warehouse }) => { > {open ? : } - + */} {row.itemNo} {row.itemName} - {integerFormatter.format(row.qty)} - {integerFormatter.format(processedQty)} + {integerFormatter.format(row.qty)} + {integerFormatter.format(processedQty)} {row.uom?.code} - + {decimalFormatter.format(totalWeight)} {weightUnit} {/* {weightUnit} */} - {decimalFormatter.format(row.price)} + {decimalFormatter.format(row.price)} {/* {row.expiryDate} */} {t(`${currStatus.toLowerCase()}`)} - {/* + 0 - + = ({ po, qc, warehouse }) => { } }} /> - */} + + + + - + {/* */} {/* */} - - + {/* */} + {/* */} {/* */} - + {/*
@@ -208,10 +216,10 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { -
-
-
-
+ */} + {/* */} + {/* */} + {/*
*/} ); } @@ -321,7 +329,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { - {false ? ( + {true ? ( = ({ po, qc, warehouse }) => { label={t("dnDate")} type="text" // Use type="text" to allow validation in the change handler variant="outlined" - defaultValue={"07/08/2025"} + defaultValue={"11/08/2025"} // value={secondReceiveQty} // onChange={handleChange} InputProps={{ @@ -365,14 +373,14 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { item xs={6} display="flex" - justifyContent="end" - alignItems="end" + // justifyContent="center" + alignItems="center" > - + ) : undefined} - + {/* */} {/* scanner */} {/* */} @@ -403,22 +411,22 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { - {/* for the collapse button */} - {t("itemNo")} - {t("itemName")} - {t("qty")} - {t("processed")} + {/* for the collapse button */} + {t("itemNo")} + {t("itemName")} + {t("qty")} + {t("processed")} {t("uom")} - {t("total weight")} + {t("total weight")} {/* {t("weight unit")} */} - {`${t("price")} (HKD)`} + {`${t("price")} (HKD)`} {/* {t("expiryDate")} */} - {t("status")} + {t("status")} {/* start == true && firstInQty == null ? no hide : hide*/} - {/* {renderFieldCondition(FIRST_IN_FIELD) ? {t("receivedQty")} : undefined} */} + {renderFieldCondition(FIRST_IN_FIELD) ? {t("receivedQty")} : undefined} {/* start == true && firstInQty == null ? hide and disabled : no hide*/} - {/* {renderFieldCondition(SECOND_IN_FIELD) ? {t("dnQty")} : undefined} */} - {/* {"add icon button"} */} + {renderFieldCondition(SECOND_IN_FIELD) ? {t("dnQty")}(以訂單單位計算) : undefined} + @@ -429,6 +437,32 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => {
+ + 已選擇: {row.itemNo}-{row.itemName} + + + + + + + + + + + + + +
+
+
{/* tab 2 */} diff --git a/src/components/PoDetail/PoInputGrid.tsx b/src/components/PoDetail/PoInputGrid.tsx index 64fb98e..eb3392f 100644 --- a/src/components/PoDetail/PoInputGrid.tsx +++ b/src/components/PoDetail/PoInputGrid.tsx @@ -406,16 +406,16 @@ function PoInputGrid({ const columns = useMemo( () => [ - { - field: "itemNo", - headerName: t("itemNo"), - width: 100, - // flex: 0.4, - }, + // { + // field: "itemNo", + // headerName: t("itemNo"), + // width: 100, + // // flex: 0.4, + // }, { field: "dnNo", headerName: t("dnNo"), - width: 100, + width: 125, renderCell: () => { return <>DN0000001 } @@ -424,23 +424,23 @@ function PoInputGrid({ { field: "dnDate", headerName: t("dnDate"), - width: 100, + width: 125, renderCell: () => { return <>07/08/2025 } // flex: 0.4, }, - { - field: "itemName", - headerName: t("itemName"), - width: 100, - // flex: 0.6, - }, + // { + // field: "itemName", + // headerName: t("itemName"), + // width: 100, + // // flex: 0.6, + // }, { field: "acceptedQty", headerName: t("acceptedQty"), // flex: 0.5, - width: 100, + width: 125, type: "number", // editable: true, // replace with tooltip + content diff --git a/src/components/StyledDataGrid/StyledDataGrid.tsx b/src/components/StyledDataGrid/StyledDataGrid.tsx index 163b4f6..295dc3b 100644 --- a/src/components/StyledDataGrid/StyledDataGrid.tsx +++ b/src/components/StyledDataGrid/StyledDataGrid.tsx @@ -7,8 +7,9 @@ const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ backgroundColor: theme.palette.grey[50], }, "& .MuiDataGrid-columnHeaderTitle": { + borderBottom: "none", color: theme.palette.grey[700], - fontSize: 12, + fontSize: 16, fontWeight: 600, lineHeight: 2, letterSpacing: 0.5, @@ -17,8 +18,12 @@ const StyledDataGrid = styled(DataGrid)(({ theme }) => ({ "& .MuiDataGrid-columnSeparator": { color: theme.palette.primary.main, }, - "& .MuiDataGrid-row:nth-of-type(even)": { - backgroundColor: theme.palette.grey[200], // Light grey for even rows + // "& .MuiDataGrid-row:nth-of-type(even)": { + // backgroundColor: theme.palette.grey[200], // Light grey for even rows + // }, + '& .MuiDataGrid-cell': { + borderBottomColor: theme.palette.divider, + padding: '1px 6px', }, })); diff --git a/src/i18n/zh/purchaseOrder.json b/src/i18n/zh/purchaseOrder.json index 6dc93c7..3642893 100644 --- a/src/i18n/zh/purchaseOrder.json +++ b/src/i18n/zh/purchaseOrder.json @@ -37,7 +37,7 @@ "price": "訂單貨值", "processed": "已處理數量", "expiryDate": "到期日", - "acceptedQty": "是次訂單/來貨/巳來貨數量", + "acceptedQty": "是次來貨數量", "weight": "重量", "start": "開始", "qc": "質量控制", @@ -57,6 +57,7 @@ "received": "已收貨", "completed": "已完成", "rejected": "已拒絕", + "status": "狀態", "acceptedQty must not greater than": "接受數量不得大於", "minimal value is 1": "最小值為1", @@ -93,7 +94,7 @@ "receivedQty": "已來貨數量", "dnQty": "送貨單數量", - "Accept submit": "接受來貨", + "Accept submit": "處理來貨", "qc processing": "處理來貨及品檢", "putawayBtn": "上架", "dnNo": "送貨單編號",