Browse Source

update po

master
cyril.tsui 1 week ago
parent
commit
6693e82352
5 changed files with 65 additions and 17 deletions
  1. +5
    -5
      src/components/PoDetail/PoDetail.tsx
  2. +1
    -1
      src/components/PoDetail/PoInfoCard.tsx
  3. +51
    -8
      src/components/PoSearch/PoSearch.tsx
  4. +1
    -1
      src/i18n/zh/inventory.json
  5. +7
    -2
      src/i18n/zh/purchaseOrder.json

+ 5
- 5
src/components/PoDetail/PoDetail.tsx View File

@@ -113,7 +113,7 @@ const PoSearchList: React.FC<{
}, [poList, searchTerm, t]);

return (
<Paper sx={{ p: 2, maxHeight: "400px", overflow: "auto", minWidth: "300px" }}>
<Paper sx={{ p: 2, maxHeight: "480px", overflow: "auto", minWidth: "300px", height: "480px" }}>
<Typography variant="h6" gutterBottom>
{t("Purchase Orders")}
</Typography>
@@ -486,7 +486,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
{/* <TableCell align="right">{decimalFormatter.format(row.price)}</TableCell> */}
{/* <TableCell align="left">{row.expiryDate}</TableCell> */}
<TableCell align="left">{t(`${currStatus.toLowerCase()}`)}</TableCell>
<TableCell align="right">{integerFormatter.format(row.receivedQty)}</TableCell>
{/* <TableCell align="right">{integerFormatter.format(row.receivedQty)}</TableCell> */}
<TableCell align="center">
<TextField
id="lotNo"
@@ -700,7 +700,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
{true ? (
<FormProvider {...dnFormProps}>
<Stack component={"form"} spacing={2}>
<Card sx={{ display: "block" }}>
<Card sx={{ display: "block", height: "230px" }}>
<CardContent component={Stack} spacing={2}>
<Grid container spacing={2} sx={{ maxWidth: 'fit-content' }}>
<Grid item xs={12}>
@@ -784,9 +784,9 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
{/* <TableCell align="right">{t("total weight")}</TableCell> */}
{/* <TableCell align="right">{`${t("price")} (HKD)`}</TableCell> */}
<TableCell align="left" sx={{ width: '75px' }}>{t("status")}</TableCell>
{renderFieldCondition(FIRST_IN_FIELD) ? <TableCell align="right">{t("receivedQty")}</TableCell> : undefined}
{/* {renderFieldCondition(FIRST_IN_FIELD) ? <TableCell align="right">{t("receivedQty")}</TableCell> : undefined} */}
<TableCell align="center" sx={{ width: '150px' }}>{t("productLotNo")}</TableCell>
{renderFieldCondition(SECOND_IN_FIELD) ? <TableCell align="center" sx={{ width: '150px' }}>{t("dnQty")}(以訂單單位計算)</TableCell> : undefined}
{renderFieldCondition(SECOND_IN_FIELD) ? <TableCell align="center" sx={{ width: '150px' }}>{t("dnQty")}<br/>(以訂單單位計算)</TableCell> : undefined}
<TableCell align="center" sx={{ width: '100px' }}></TableCell>
</TableRow>
</TableHead>


+ 1
- 1
src/components/PoDetail/PoInfoCard.tsx View File

@@ -29,7 +29,7 @@ const PoInfoCard: React.FC<Props> = async (
const { t } = useTranslation("purchaseOrder")
return (
<>
<Card sx={{ display: "block" }}>
<Card sx={{ display: "block", height: "230px" }}>
<CardContent component={Stack} spacing={4}>
<Box>
<Stack spacing={2}>


+ 51
- 8
src/components/PoSearch/PoSearch.tsx View File

@@ -1,7 +1,7 @@
"use client";

import { PoResult } from "@/app/api/po";
import { useCallback, useEffect, useMemo, useState } from "react";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { useRouter, useSearchParams } from "next/navigation";
import SearchBox, { Criterion } from "../SearchBox";
@@ -111,6 +111,14 @@ const PoSearch: React.FC<Props> = ({
}
}, [selectedPoIds, router]);

const itemColumn = useCallback((value: string | undefined) => {
if (!value) {
return <Grid>"N/A"</Grid>
}
const items = value.split(",")
return items.map((item) => <Grid key={item}>{item}</Grid>)
}, [])

const columns = useMemo<Column<PoResult>[]>(
() => [
{
@@ -150,15 +158,50 @@ const PoSearch: React.FC<Props> = ({
return <>{arrayToDateString(params.orderDate)}<br/>{arrayToDateString(params.estimatedArrivalDate)}</>
},
},
// {
// name: "itemDetail",
// label: t("Item Detail"),
// renderCell: (params) => {
// if (!params.itemDetail) {
// return "N/A"
// }
// const items = params.itemDetail.split(",")
// return items.map((item) => <Grid key={item}>{item}</Grid>)
// },
// },
{
name: "itemCode",
label: t("Item Code"),
renderCell: (params) => {
return itemColumn(params.itemCode);
},
},
{
name: "itemName",
label: t("Item Name"),
renderCell: (params) => {
return itemColumn(params.itemName);
},
},
{
name: "itemQty",
label: t("Item Qty"),
renderCell: (params) => {
return itemColumn(params.itemQty);
},
},
{
name: "itemSumAcceptedQty",
label: t("Item Accepted Qty"),
renderCell: (params) => {
return itemColumn(params.itemSumAcceptedQty);
},
},
{
name: "itemDetail",
label: t("Item Detail"),
name: "itemUom",
label: t("Item Purchase UoM"),
renderCell: (params) => {
if (!params.itemDetail) {
return "N/A"
}
const items = params.itemDetail.split(",")
return items.map((item) => <Grid key={item}>{item}</Grid>)
return itemColumn(params.itemUom);
},
},
{


+ 1
- 1
src/i18n/zh/inventory.json View File

@@ -8,7 +8,7 @@
"UoM": "單位",
"mat": "物料",
"fg": "成品",
"Available Qty": "可用數量 (倉存單位)",
"Available Qty": "可用數量",
"Sales UoM": "銷售單位",
"Stock UoM": "庫存單位",
"Available Qty Per Smallest Unit": "可用數量 (基本單位)",


+ 7
- 2
src/i18n/zh/purchaseOrder.json View File

@@ -31,14 +31,19 @@
"itemNo": "貨品編號",
"itemName": "貨品名稱",
"Item Detail": "貨品詳情",
"Item Code": "貨品編號",
"Item Name": "貨品名稱",
"Item Qty": "貨品數量",
"Item Accepted Qty": "貨品已收貨數量",
"Item Purchase UoM": "貨品計量單位",
"qty": "訂單數量",
"uom": "計量單位",
"Stock UoM": "庫存單位",
"Stock In Qty": "入庫數量",
"Stock In Qty": "收貨數量",
"total weight": "總重量",
"weight unit": "重量單位",
"price": "訂單貨值",
"processed": "已處理數量",
"processed": "已上架數量",
"expiryDate": "到期日",
"acceptedQty": "是次來貨數量",
"putawayQty": "上架數量",


Loading…
Cancel
Save