| @@ -10,6 +10,9 @@ import { RecordsRes } from "../utils"; | |||||
| export interface LotLineInfo { | export interface LotLineInfo { | ||||
| inventoryLotLineId: number, | inventoryLotLineId: number, | ||||
| itemId: number, | |||||
| itemNo: string, | |||||
| itemName: string, | |||||
| lotNo: string, | lotNo: string, | ||||
| remainingQty: number, | remainingQty: number, | ||||
| uom: string | uom: string | ||||
| @@ -91,7 +91,7 @@ export const consolidatePickOrder_revert = async (ids: number[]) => { | |||||
| export const releasePickOrder = async (data: ReleasePickOrderInputs) => { | export const releasePickOrder = async (data: ReleasePickOrderInputs) => { | ||||
| console.log(data) | console.log(data) | ||||
| console.log(JSON.stringify(data)) | console.log(JSON.stringify(data)) | ||||
| const po = await serverFetchJson<any>(`${BASE_API_URL}/pickOrder/releaseConso`, { | |||||
| const po = await serverFetchJson<{body: any, status: number}>(`${BASE_API_URL}/pickOrder/releaseConso`, { | |||||
| method: "POST", | method: "POST", | ||||
| body: JSON.stringify(data), | body: JSON.stringify(data), | ||||
| headers: { "Content-Type": "application/json" }, | headers: { "Content-Type": "application/json" }, | ||||
| @@ -2,6 +2,7 @@ import "server-only"; | |||||
| import { Pageable, serverFetchJson } from "@/app/utils/fetchUtil"; | import { Pageable, serverFetchJson } from "@/app/utils/fetchUtil"; | ||||
| import { BASE_API_URL } from "@/config/api"; | import { BASE_API_URL } from "@/config/api"; | ||||
| import { cache } from "react"; | import { cache } from "react"; | ||||
| import { String } from "lodash"; | |||||
| interface PickOrderItemInfo { | interface PickOrderItemInfo { | ||||
| name: string, | name: string, | ||||
| @@ -31,6 +32,19 @@ export interface PickOrderLine { | |||||
| uomCode: string, | uomCode: string, | ||||
| uomDesc: string | uomDesc: string | ||||
| } | } | ||||
| export interface StockOutLine { | |||||
| id: number | |||||
| itemId: number | |||||
| itemName: string | |||||
| itemNo: string | |||||
| qty: number | |||||
| stockOutId?: number | |||||
| pickOrderLineId: number | |||||
| lotNo?: string | |||||
| inventoryLotLineId?: number | |||||
| status: string | |||||
| pickTime?: string | |||||
| } | |||||
| export interface ConsoPickOrderResult{ | export interface ConsoPickOrderResult{ | ||||
| id: number, | id: number, | ||||
| code: string, | code: string, | ||||
| @@ -67,6 +67,13 @@ export const stockInLineStatusMap: { [status: string]: number } = { | |||||
| "rejected": 9, | "rejected": 9, | ||||
| }; | }; | ||||
| export const stockOutLineStatusMap: { [status: string]: number } = { | |||||
| "draft": 0, | |||||
| "pending": 1, // waiting for qc | |||||
| // after qc = completed | |||||
| "completed": 2, | |||||
| }; | |||||
| export const pickOrderStatusMap: { [status: string]: number } = { | export const pickOrderStatusMap: { [status: string]: number } = { | ||||
| "pending": 1, | "pending": 1, | ||||
| "consolidated": 2, | "consolidated": 2, | ||||
| @@ -0,0 +1,18 @@ | |||||
| "use client" | |||||
| // npm install | |||||
| interface Props { // params type | |||||
| } | |||||
| const DashboardLineChart: React.FC<Props> = ({ | |||||
| // params | |||||
| }) => { | |||||
| return ( | |||||
| <> | |||||
| line chart | |||||
| </> | |||||
| ) | |||||
| } | |||||
| export default DashboardLineChart | |||||
| @@ -5,20 +5,41 @@ import theme from "../../theme"; | |||||
| import { TabsProps } from "@mui/material/Tabs"; | import { TabsProps } from "@mui/material/Tabs"; | ||||
| import React, { useCallback, useEffect, useState } from "react"; | import React, { useCallback, useEffect, useState } from "react"; | ||||
| import { useRouter } from "next/navigation"; | import { useRouter } from "next/navigation"; | ||||
| import { Card, CardContent, CardHeader, Grid } from "@mui/material"; | |||||
| import DashboardProgressChart from "../DashboardProgressChart/DashboardProgressChart"; | |||||
| import DashboardLineChart from "../DashboardLineChart/DashboardLineChart"; | |||||
| type Props = { | |||||
| } | |||||
| const DashboardPage: React.FC<Props> = ({ | |||||
| }) => { | |||||
| type Props = {}; | |||||
| const DashboardPage: React.FC<Props> = ({}) => { | |||||
| const { t } = useTranslation("dashboard"); | const { t } = useTranslation("dashboard"); | ||||
| const router = useRouter(); | const router = useRouter(); | ||||
| return ( | return ( | ||||
| <ThemeProvider theme={theme}> | <ThemeProvider theme={theme}> | ||||
| <> | <> | ||||
| <Grid container> | |||||
| <Grid item xs={12}> | |||||
| <Card> | |||||
| <CardHeader | |||||
| title={t("Progress chart")} | |||||
| /> | |||||
| <CardContent> | |||||
| <DashboardProgressChart /> | |||||
| </CardContent> | |||||
| </Card> | |||||
| </Grid> | |||||
| <Grid item xs={12}> | |||||
| <Card> | |||||
| <CardHeader | |||||
| title={t("Line chart")} | |||||
| /> | |||||
| <CardContent> | |||||
| <DashboardLineChart /> | |||||
| </CardContent> | |||||
| </Card> | |||||
| </Grid> | |||||
| </Grid> | |||||
| </> | </> | ||||
| </ThemeProvider> | </ThemeProvider> | ||||
| ); | ); | ||||
| @@ -0,0 +1,18 @@ | |||||
| "use client" | |||||
| interface Props { // params type | |||||
| } | |||||
| const DashboardProgressChart: React.FC<Props> = ({ | |||||
| // params | |||||
| }) => { | |||||
| return ( | |||||
| <> | |||||
| progress chart | |||||
| </> | |||||
| ) | |||||
| } | |||||
| export default DashboardProgressChart | |||||
| @@ -30,7 +30,7 @@ | |||||
| "Supplier": "供應商", | "Supplier": "供應商", | ||||
| "Purchase Order":"採購單", | "Purchase Order":"採購單", | ||||
| "Demand Forecast":"需求預測", | "Demand Forecast":"需求預測", | ||||
| "Pick Order":"挑選貨單", | |||||
| "Pick Order": "提料單", | |||||
| "Deliver Order":"交貨單", | "Deliver Order":"交貨單", | ||||
| "Project":"專案", | "Project":"專案", | ||||
| "Product":"產品", | "Product":"產品", | ||||
| @@ -90,16 +90,16 @@ | |||||
| "Pick Order": "挑選貨單", | |||||
| "Pick Order": "提料單", | |||||
| "Type": "類型", | "Type": "類型", | ||||
| "Reset": "重置", | "Reset": "重置", | ||||
| "Search": "搜尋", | "Search": "搜尋", | ||||
| "Pick Orders": "挑選貨單", | |||||
| "Consolidated Pick Orders": "合併挑選貨單", | |||||
| "Pick Order No.": "挑選貨單編號", | |||||
| "Pick Order Date": "挑選貨單日期", | |||||
| "Pick Order Status": "挑選貨單狀態", | |||||
| "Pick Order Type": "挑選貨單類型", | |||||
| "Pick Orders": "提料單", | |||||
| "Consolidated Pick Orders": "合併提料單", | |||||
| "Pick Order No.": "提料單編號", | |||||
| "Pick Order Date": "提料單日期", | |||||
| "Pick Order Status": "提料單狀態", | |||||
| "Pick Order Type": "提料單類型", | |||||
| "Consolidated Code": "合併編號", | "Consolidated Code": "合併編號", | ||||
| "type": "類型", | "type": "類型", | ||||
| "Items": "項目", | "Items": "項目", | ||||