Browse Source

stock issue

master
Anna Ho 1 week ago
parent
commit
e689ad4c0f
5 changed files with 59 additions and 19 deletions
  1. +29
    -0
      src/app/(main)/stockIssue/page.tsx
  2. +1
    -0
      src/components/Breadcrumb/Breadcrumb.tsx
  3. +6
    -0
      src/components/NavigationContent/NavigationContent.tsx
  4. +6
    -6
      src/components/StockIssue/SearchPage.tsx
  5. +17
    -13
      src/components/StockIssue/action.ts

+ 29
- 0
src/app/(main)/stockIssue/page.tsx View File

@@ -0,0 +1,29 @@
import SearchPage from "@/components/StockIssue/index";
import { PreloadList } from "@/components/StockIssue/action";
import { getServerI18n } from "@/i18n";
import { I18nProvider } from "@/i18n";
import { Stack, Typography } from "@mui/material";
import { Metadata } from "next";
import { Suspense } from "react";

export const metadata: Metadata = {
title: "Pick Order",
};

const SearchView: React.FC = async () => {
const { t } = await getServerI18n("pickOrder");

PreloadList();

return (
<>
<I18nProvider namespaces={["pickOrder", "common"]}>
<Suspense fallback={<SearchPage.Loading />}>
<SearchPage />
</Suspense>
</I18nProvider>
</>
);
};

export default SearchView;

+ 1
- 0
src/components/Breadcrumb/Breadcrumb.tsx View File

@@ -28,6 +28,7 @@ const pathToLabelMap: { [path: string]: string } = {
"/jo": "Job Order",
"/jo/edit": "Edit Job Order",
"/putAway": "Put Away",
"/stockIssue": "Stock Issue",
};

const Breadcrumb = () => {


+ 6
- 0
src/components/NavigationContent/NavigationContent.tsx View File

@@ -84,6 +84,12 @@ const NavigationContent: React.FC = () => {
label: "Stock Take Management",
path: "/stocktakemanagement",
},
//TODO: anna
// {
// icon: <RequestQuote />,
// label: "Stock Issue",
// path: "/stockIssue",
// },
{
icon: <RequestQuote />,
label: "Put Away Scan",


+ 6
- 6
src/components/StockIssue/SearchPage.tsx View File

@@ -20,7 +20,7 @@ const SearchPage: React.FC<Props> = ({dataList}) => {
() => [
{
label: t("Lot No."),
paramName: "lot_no",
paramName: "lotNo",
type: "text",
},
],
@@ -29,11 +29,11 @@ const SearchPage: React.FC<Props> = ({dataList}) => {

const columns = useMemo<Column<StockIssueResult>[]>(
() => [
{ name: "item_code", label: t("Item Code") },
{ name: "item_description", label: t("Item") },
{ name: "lot_no", label: t("Lot No.") },
{ name: "store_location", label: t("Location") },
{ name: "bad_item_qty", label: t("Defective Qty") }
{ name: "itemCode", label: t("Item Code") },
{ name: "itemDescription", label: t("Item") },
{ name: "lotNo", label: t("Lot No.") },
{ name: "storeLocation", label: t("Location") },
{ name: "badItemQty", label: t("Defective Qty") }
],
[t],
);


+ 17
- 13
src/components/StockIssue/action.ts View File

@@ -7,21 +7,25 @@ import { cache } from "react";
export interface StockIssueResult {
action: any;
id: number;
item_id: number;
item_code: string;
item_description: string;
lot_id: number;
lot_no: string;
store_location: string;
required_qty: number;
bad_item_qty: number;
issue_remark: string;
picker_name: string;
handle_status: string;
handle_date: string;
handled_by: number;
itemId: number;
itemCode: string;
itemDescription: string;
lotId: number;
lotNo: string;
storeLocation: string;
requiredQty: number;
badItemQty: number;
issueRemark: string;
pickerName: string;
handleStatus: string;
handleDate: string;
handledBy: number;
}

export const PreloadList = () => {
fetchList();
};

export const fetchList = cache(async () => {
return serverFetchJson<StockIssueResult[]>(`${BASE_API_URL}/pickExecution/badItemList`, {
next: { tags: ["Bad Item List"] },


Loading…
Cancel
Save