Przeglądaj źródła

update item, po

master
cyril.tsui 1 tydzień temu
rodzic
commit
2b500868fa
5 zmienionych plików z 24 dodań i 17 usunięć
  1. +4
    -0
      src/app/(main)/settings/items/edit/page.tsx
  2. +1
    -0
      src/app/api/settings/item/actions.ts
  3. +2
    -0
      src/app/api/settings/item/index.ts
  4. +3
    -3
      src/components/PoDetail/PoDetail.tsx
  5. +14
    -14
      src/components/PoDetail/PoInputGrid.tsx

+ 4
- 0
src/app/(main)/settings/items/edit/page.tsx Wyświetl plik

@@ -1,3 +1,4 @@
import { fetchQcCategoryCombo } from "@/app/api/settings/qcCategory";
import { SearchParams } from "@/app/utils/fetchUtil";
import { TypeEnum } from "@/app/utils/typeEnum";
import CreateProductMaterial from "@/components/CreateItem";
@@ -17,6 +18,9 @@ const productSetting: React.FC<Props> = async ({ searchParams }) => {
if (!id) {
notFound();
}

fetchQcCategoryCombo()

return (
<>
{/* <Typography variant="h4">{t("Create Material")}</Typography> */}


+ 1
- 0
src/app/api/settings/item/actions.ts Wyświetl plik

@@ -35,6 +35,7 @@ export type CreateItemInputs = {
type: string;
qcChecks: QcChecksInputs[];
qcChecks_active: number[];
qcCategoryId: number | undefined;
};

export const saveItem = async (data: CreateItemInputs) => {


+ 2
- 0
src/app/api/settings/item/index.ts Wyświetl plik

@@ -4,6 +4,7 @@ import "server-only";
// import { BASE_API_URL } from "@/config/api";
import { serverFetchJson } from "../../../utils/fetchUtil";
import { BASE_API_URL } from "../../../../config/api";
import { QcCategoryResult } from "../qcCategory";

// import { TypeInputs, UomInputs, WeightUnitInputs } from "./actions";

@@ -37,6 +38,7 @@ export type ItemsResult = {
action?: any;
fgName?: string;
excludeDate?: string;
qcCategory?: QcCategoryResult;
};

export type Result = {


+ 3
- 3
src/components/PoDetail/PoDetail.tsx Wyświetl plik

@@ -406,9 +406,9 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
<TableCell align="right">{integerFormatter.format(row.qty)}</TableCell>
<TableCell align="right">{integerFormatter.format(processedQty)}</TableCell>
<TableCell align="left">{row.uom?.code}</TableCell>
<TableCell align="right">
{/* <TableCell align="right">
{decimalFormatter.format(totalWeight)} {weightUnit}
</TableCell>
</TableCell> */}
{/* <TableCell align="left">{weightUnit}</TableCell> */}
<TableCell align="right">{decimalFormatter.format(row.price)}</TableCell>
{/* <TableCell align="left">{row.expiryDate}</TableCell> */}
@@ -651,7 +651,7 @@ const PoDetail: React.FC<Props> = ({ po, qc, warehouse }) => {
<TableCell align="right">{t("qty")}</TableCell>
<TableCell align="right">{t("processed")}</TableCell>
<TableCell align="left">{t("uom")}</TableCell>
<TableCell align="right">{t("total weight")}</TableCell>
{/* <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}


+ 14
- 14
src/components/PoDetail/PoInputGrid.tsx Wyświetl plik

@@ -480,20 +480,20 @@ const closeNewModal = useCallback(() => {
return params.row.uom.code;
},
},
{
field: "weight",
headerName: t("weight"),
width: 120,
// flex: 0.5,
renderCell: (params) => {
const weight = calculateWeight(
params.row.acceptedQty,
params.row.uom,
);
const weightUnit = returnWeightUnit(params.row.uom);
return `${decimalFormatter.format(weight)} ${weightUnit}`;
},
},
// {
// field: "weight",
// headerName: t("weight"),
// width: 120,
// // flex: 0.5,
// renderCell: (params) => {
// const weight = calculateWeight(
// params.row.acceptedQty,
// params.row.uom,
// );
// const weightUnit = returnWeightUnit(params.row.uom);
// return `${decimalFormatter.format(weight)} ${weightUnit}`;
// },
// },
{
field: "status",
headerName: t("status"),


Ładowanie…
Anuluj
Zapisz