cyril.tsui 1 miesiąc temu
rodzic
commit
000ece986d
7 zmienionych plików z 93 dodań i 11 usunięć
  1. +3
    -0
      src/app/api/scheduling/index.ts
  2. +12
    -5
      src/components/DetailedSchedule/DetailedScheduleSearchView.tsx
  3. +11
    -0
      src/components/DetailedScheduleDetail/ViewByFGDetails.tsx
  4. +12
    -4
      src/components/RoughSchedule/RoughSchedileSearchView.tsx
  5. +22
    -0
      src/components/RoughScheduleDetail/ViewByBomDetails.tsx
  6. +23
    -2
      src/components/RoughScheduleDetail/ViewByFGDetails.tsx
  7. +10
    -0
      src/components/ScheduleTable/BomMaterialTable.tsx

+ 3
- 0
src/app/api/scheduling/index.ts Wyświetl plik

@@ -31,6 +31,7 @@ export interface RoughProdScheduleLineResultByFg {
type: string;
availableQty: number;
prodQty: number;
uomName: string;
lastMonthAvgSales: number;
estCloseBal: number;
priority: number;
@@ -94,6 +95,7 @@ export interface DetailedProdScheduleLineResult {
type: string;
demandQty: number;
bomOutputQty: number;
uomName: string;
prodTimeInMinute: DetailedProdScheduleLineProdTimeResult[];
priority: number;
approved: boolean;
@@ -107,6 +109,7 @@ export interface DetailedProdScheduleLineBomMaterialResult {
type: string;
availableQty: number;
demandQty: number;
uomName: string;
}

export interface DetailedProdScheduleLineProdTimeResult {


+ 12
- 5
src/components/DetailedSchedule/DetailedScheduleSearchView.tsx Wyświetl plik

@@ -19,6 +19,7 @@ import dayjs from "dayjs";
import { orderBy, uniqBy } from "lodash";
import { Button, Stack } from "@mui/material";
import isToday from 'dayjs/plugin/isToday';
import useUploadContext from "../UploadProvider/useUploadContext";
dayjs.extend(isToday);

// may need move to "index" or "actions"
@@ -45,6 +46,7 @@ const DSOverview: React.FC<Props> = ({ type, defaultInputs }) => {
ProdScheduleResult[]
>([]);
const { t } = useTranslation("schedule");
const { setIsUploading } = useUploadContext();

const router = useRouter();
// const [filterObj, setFilterObj] = useState({});
@@ -282,11 +284,16 @@ const DSOverview: React.FC<Props> = ({ type, defaultInputs }) => {
}, []);

const testDetailedScheduleClick = useCallback(async () => {
console.log(inputs.scheduleAt)
const response = await testDetailedSchedule(inputs.scheduleAt)

if (response) {
refetchData(inputs, "paging");
try {
setIsUploading(true)
const response = await testDetailedSchedule(inputs.scheduleAt)
if (response) {
refetchData(inputs, "paging");
}
} catch(e) {
console.log(e)
} finally {
setIsUploading(false)
}
}, [inputs])



+ 11
- 0
src/components/DetailedScheduleDetail/ViewByFGDetails.tsx Wyświetl plik

@@ -168,6 +168,17 @@ const ViewByFGDetails: React.FC<Props> = ({ apiRef, isEdit, type, onReleaseClick
return row.demandQty;
},
},
{
field: "uomName",
label: t("UoM Name"),
type: "read-only",
style: {
textAlign: "left",
},
renderCell: (row) => {
return row.uomName;
},
},
{
field: "prodTimeInMinute",
label: t("Estimated Production Time"),


+ 12
- 4
src/components/RoughSchedule/RoughSchedileSearchView.tsx Wyświetl plik

@@ -28,6 +28,7 @@ import dayjs from "dayjs";
import { defaultPagingController } from "../SearchResults/SearchResults";
import { ScheduleType } from "@/app/api/scheduling";
import { Button, Stack } from "@mui/material";
import useUploadContext from "../UploadProvider/useUploadContext";

// type RecordStructure ={
// id: number,
@@ -59,6 +60,7 @@ const RSOverview: React.FC<Props> = ({ type, defaultInputs }) => {
);
const [totalCount, setTotalCount] = useState(0);
const [inputs, setInputs] = useState(defaultInputs);
const { setIsUploading } = useUploadContext();

const searchCriteria: Criterion<SearchParamNames>[] = useMemo(() => {
const searchCriteria: Criterion<SearchParamNames>[] = [
@@ -254,10 +256,16 @@ const RSOverview: React.FC<Props> = ({ type, defaultInputs }) => {
}, []);

const testRoughScheduleClick = useCallback(async () => {
const response = await testRoughSchedule()

if (response) {
refetchData(inputs, "paging");
try {
setIsUploading(true)
const response = await testRoughSchedule()
if (response) {
refetchData(inputs, "paging");
}
} catch(e) {
console.log(e)
} finally {
setIsUploading(false)
}
}, []);



+ 22
- 0
src/components/RoughScheduleDetail/ViewByBomDetails.tsx Wyświetl plik

@@ -302,6 +302,17 @@ const ViewByBomDetails: React.FC<Props> = ({
return row.demandQty7;
},
},
{
field: "uomName",
label: t("UoM Name"),
type: "read-only",
style: {
textAlign: "left",
},
renderCell: (row) => {
return row.uomName;
},
},
],
[t],
);
@@ -356,6 +367,17 @@ const ViewByBomDetails: React.FC<Props> = ({
return row.demandQty;
},
},
{
field: "uomName",
label: t("UoM Name"),
type: "read-only",
style: {
textAlign: "left",
},
renderCell: (row) => {
return row.uomName;
},
},
],
[],
);


+ 23
- 2
src/components/RoughScheduleDetail/ViewByFGDetails.tsx Wyświetl plik

@@ -184,6 +184,18 @@ const ViewByFGDetails: React.FC<Props> = ({
return row.prodQty;
},
},
{
field: "uomName",
label: t("UoM Name"),
type: "read-only",
style: {
textAlign: "left",
},
// editable: true,
renderCell: (row) => {
return row.uomName;
},
},
],
[],
);
@@ -269,12 +281,21 @@ const ViewByFGDetails: React.FC<Props> = ({
return row.prodQty;
},
},
{
field: "uomName",
label: t("UoM Name"),
type: "read-only",
style: {
textAlign: "left",
},
renderCell: (row) => {
return row.uomName;
},
},
],
[],
);

console.log(getValues("prodScheduleLinesByFg"));

return (
<Grid container spacing={2}>
<Grid item xs={12} key={"all"}>


+ 10
- 0
src/components/ScheduleTable/BomMaterialTable.tsx Wyświetl plik

@@ -133,6 +133,16 @@ function BomMaterialTable({ bomMaterial }: Props) {
return decimalFormatter.format(row.value);
},
},
{
field: "uomName",
headerName: t("UoM Name"),
flex: 0.5,
align: "left",
headerAlign: "left",
renderCell: (row) => {
return row.value;
},
},
{
field: "status",
headerName: t("status"),


Ładowanie…
Anuluj
Zapisz