Ver código fonte

add escalation combo

master
cyril.tsui 5 dias atrás
pai
commit
3746c7cd40
4 arquivos alterados com 33 adições e 1 exclusões
  1. +4
    -0
      src/app/(main)/po/edit/page.tsx
  2. +6
    -0
      src/app/api/po/index.ts
  3. +15
    -0
      src/app/api/user/index.ts
  4. +8
    -1
      src/components/PoDetail/PoDetailWrapper.tsx

+ 4
- 0
src/app/(main)/po/edit/page.tsx Ver arquivo

@@ -1,3 +1,4 @@
import { fetchEscalationCombo } from "@/app/api/user";
import { SearchParams } from "@/app/utils/fetchUtil";
import { TypeEnum } from "@/app/utils/typeEnum";
import CreateProductMaterial from "@/components/CreateItem";
@@ -22,6 +23,9 @@ const PoEdit: React.FC<Props> = async ({ searchParams }) => {
if (!id) {
notFound();
}

fetchEscalationCombo()

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


+ 6
- 0
src/app/api/po/index.ts Ver arquivo

@@ -15,6 +15,11 @@ export interface PoResult {
estimatedArrivalDate: string;
completedDate: string;
itemDetail?: string;
itemCode?: string;
itemName?: string;
itemQty?: string;
itemSumAcceptedQty?: string;
itemUom?: string;
escalated: boolean;
status: string;
pol?: PurchaseOrderLine[];
@@ -74,6 +79,7 @@ export interface StockInLine {
defaultWarehouseId: number; // id for now
dnNo: string;
dnDate: number[];
stockQty: number;
}

export const fetchPoList = cache(async (queryParams?: Record<string, any>) => {


+ 15
- 0
src/app/api/user/index.ts Ver arquivo

@@ -31,6 +31,15 @@ export type passwordRule = {
specialChar: boolean;
};

export interface EscalationCombo {
id: number;
value: number;
label: string;
name: string;
title: string;
department: string;
}

export const preloadUser = () => {
fetchUser();
};
@@ -56,3 +65,9 @@ export const fetchPwRules = cache(async () => {
next: { tags: ["pwRule"] },
});
});

export const fetchEscalationCombo = cache(async () => {
return serverFetchJson<EscalationCombo>(`${BASE_API_URL}/user/escalation-combo`, {
next: { tags: ["escalationCombo"]}
})
})

+ 8
- 1
src/components/PoDetail/PoDetailWrapper.tsx Ver arquivo

@@ -10,6 +10,7 @@ import PoDetail from "./PoDetail";
import { QcItemWithChecks } from "@/app/api/qc";
import { fetchWarehouseList } from "@/app/api/warehouse";
import { fetchQcItemCheck } from "@/app/api/qc/actions";
import { fetchEscalationCombo } from "@/app/api/user";

interface SubComponents {
Loading: typeof PoDetailLoading;
@@ -20,10 +21,16 @@ type Props = {
};

const PoDetailWrapper: React.FC<Props> & SubComponents = async ({ id }) => {
const [poWithStockInLine, warehouse, qc] = await Promise.all([
const [
poWithStockInLine,
warehouse,
qc,
escalationCombo
] = await Promise.all([
fetchPoWithStockInLines(id),
fetchWarehouseList(),
fetchQcItemCheck(),
fetchEscalationCombo(),
]);
// const poWithStockInLine = await fetchPoWithStockInLines(id)



Carregando…
Cancelar
Salvar