浏览代码

update with dashboard

master
MSI\derek 1 个月前
父节点
当前提交
a96f98b3ad
共有 7 个文件被更改,包括 89 次插入8 次删除
  1. +3
    -0
      src/app/api/inventory/actions.ts
  2. +1
    -1
      src/app/api/pickOrder/actions.ts
  3. +14
    -0
      src/app/api/pickOrder/index.ts
  4. +7
    -0
      src/app/utils/formatUtil.ts
  5. +18
    -0
      src/components/DashboardLineChart/DashboardLineChart.tsx
  6. +28
    -7
      src/components/DashboardPage/DashboardPage.tsx
  7. +18
    -0
      src/components/DashboardProgressChart/DashboardProgressChart.tsx

+ 3
- 0
src/app/api/inventory/actions.ts 查看文件

@@ -10,6 +10,9 @@ import { RecordsRes } from "../utils";

export interface LotLineInfo {
inventoryLotLineId: number,
itemId: number,
itemNo: string,
itemName: string,
lotNo: string,
remainingQty: number,
uom: string


+ 1
- 1
src/app/api/pickOrder/actions.ts 查看文件

@@ -91,7 +91,7 @@ export const consolidatePickOrder_revert = async (ids: number[]) => {
export const releasePickOrder = async (data: ReleasePickOrderInputs) => {
console.log(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",
body: JSON.stringify(data),
headers: { "Content-Type": "application/json" },


+ 14
- 0
src/app/api/pickOrder/index.ts 查看文件

@@ -2,6 +2,7 @@ import "server-only";
import { Pageable, serverFetchJson } from "@/app/utils/fetchUtil";
import { BASE_API_URL } from "@/config/api";
import { cache } from "react";
import { String } from "lodash";

interface PickOrderItemInfo {
name: string,
@@ -31,6 +32,19 @@ export interface PickOrderLine {
uomCode: 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{
id: number,
code: string,


+ 7
- 0
src/app/utils/formatUtil.ts 查看文件

@@ -67,6 +67,13 @@ export const stockInLineStatusMap: { [status: string]: number } = {
"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 } = {
"pending": 1,
"consolidated": 2,


+ 18
- 0
src/components/DashboardLineChart/DashboardLineChart.tsx 查看文件

@@ -0,0 +1,18 @@
"use client"
// npm install
interface Props { // params type

}

const DashboardLineChart: React.FC<Props> = ({
// params
}) => {

return (
<>
line chart
</>
)
}
export default DashboardLineChart


+ 28
- 7
src/components/DashboardPage/DashboardPage.tsx 查看文件

@@ -5,20 +5,41 @@ import theme from "../../theme";
import { TabsProps } from "@mui/material/Tabs";
import React, { useCallback, useEffect, useState } from "react";
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 router = useRouter();

return (
<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>
);


+ 18
- 0
src/components/DashboardProgressChart/DashboardProgressChart.tsx 查看文件

@@ -0,0 +1,18 @@
"use client"

interface Props { // params type

}

const DashboardProgressChart: React.FC<Props> = ({
// params
}) => {

return (
<>
progress chart
</>
)
}
export default DashboardProgressChart


正在加载...
取消
保存