kelvinsuen преди 2 месеца
родител
ревизия
33e7d5ea0b
променени са 3 файла, в които са добавени 9 реда и са изтрити 10 реда
  1. +6
    -3
      src/components/JoSearch/JoSearch.tsx
  2. +2
    -5
      src/components/PoDetail/PutAwayForm.tsx
  3. +1
    -2
      src/components/PoDetail/QcStockInModal.tsx

+ 6
- 3
src/components/JoSearch/JoSearch.tsx Целия файл

@@ -89,8 +89,10 @@ const JoSearch: React.FC<Props> = ({ defaultInputs, bomCombo }) => {
{
name: "status",
label: t("Status"),
renderCell: (row) => {
return t(upperFirst(row.status))
renderCell: (row) => { // TODO improve
return <span style={{color: row.stockInLineStatus == "escalated" ? "red" : "inherit"}}>
{t(upperFirst(row.status))}
</span>
}
},
{
@@ -195,7 +197,7 @@ const JoSearch: React.FC<Props> = ({ defaultInputs, bomCombo }) => {
// case "storing": btnSx = {label: t("view putaway"), color:"secondary.main"}; break;
case "storing":
switch (silStatus) {
case "pending": btnSx = {label: t("process epqc"), color:"primary.main"}; break;
case "pending": btnSx = {label: t("process epqc"), color:"success.main"}; break;
case "received": btnSx = {label: t("view putaway"), color:"secondary.main"}; break;
case "escalated":
if (sessionToken?.id == jo.silHandlerId) {
@@ -225,6 +227,7 @@ const JoSearch: React.FC<Props> = ({ defaultInputs, bomCombo }) => {
if (record.stockInLineId != null) {
const data = {
id: record.stockInLineId,
expiryDate: arrayToDateString(dayjs().add(1, "month"), "input"),
}
setModalInfo(data);
setOpenModal(true);


+ 2
- 5
src/components/PoDetail/PutAwayForm.tsx Целия файл

@@ -39,6 +39,7 @@ import { GridEditInputCell } from "@mui/x-data-grid";
import { StockInLine } from "@/app/api/stockIn";
import { WarehouseResult } from "@/app/api/warehouse";
import {
arrayToDateString,
arrayToDateTimeString,
OUTPUT_DATE_FORMAT,
stockInLineStatusMap,
@@ -382,11 +383,7 @@ const PutAwayForm: React.FC<Props> = ({ itemDetail, warehouse=[], disabled, setR
<TextField
label={t("expiryDate")}
fullWidth
value={
// dayjs(itemDetail.expiryDate)
dayjs()
.add(20, "day")
.format(OUTPUT_DATE_FORMAT)}
value={arrayToDateString(itemDetail.expiryDate, "output")}
disabled
/>
</Grid>


+ 1
- 2
src/components/PoDetail/QcStockInModal.tsx Целия файл

@@ -21,7 +21,6 @@ import { StockInLineRow } from "./PoInputGrid";
import { useTranslation } from "react-i18next";
import StockInForm from "./StockInForm";
import QcComponent from "./QcComponent";
import { dummyPutAwayLine, dummyQCData } from "./dummyQcTemplate";
import PutAwayForm from "./PutAwayForm";
import { GridRowModes, GridRowSelectionModel, useGridApiRef } from "@mui/x-data-grid";
import {msg, submitDialogWithWarning} from "../Swal/CustomAlerts";
@@ -108,7 +107,7 @@ const PoQcStockInModalVer2: React.FC<Props> = ({
const res = await fetchStockInLineInfo(stockInLineId);
if (res) {
console.log("%c Fetched Stock In Line: ", "color:orange", res);
setStockInLineInfo({...inputDetail, ...res});
setStockInLineInfo({...inputDetail, ...res, expiryDate: inputDetail?.expiryDate}); // TODO review to overwrite res with inputDetail instead (revise PO fetching data)
fetchQcResultData(stockInLineId);
} else throw("Result is undefined");


Зареждане…
Отказ
Запис