@@ -105,7 +105,7 @@ function InputDataGrid<T, V, E>({ | |||||
const { | const { | ||||
t, | t, | ||||
// i18n: { language }, | // i18n: { language }, | ||||
} = useTranslation(); | |||||
} = useTranslation("common"); | |||||
const formKey = _formKey.toString() | const formKey = _formKey.toString() | ||||
const { setValue, getValues } = useFormContext(); | const { setValue, getValues } = useFormContext(); | ||||
const [rowModesModel, setRowModesModel] = | const [rowModesModel, setRowModesModel] = | ||||
@@ -27,7 +27,7 @@ const ItemsSearch: React.FC<Props> = ({ items }) => { | |||||
const [pagingController, setPagingController] = useState({ | const [pagingController, setPagingController] = useState({ | ||||
pageNum: 1, | pageNum: 1, | ||||
pageSize: 10, | pageSize: 10, | ||||
totalCount: 0, | |||||
// totalCount: 0, | |||||
}); | }); | ||||
const [totalCount, setTotalCount] = useState(0) | const [totalCount, setTotalCount] = useState(0) | ||||
const searchCriteria: Criterion<SearchParamNames>[] = useMemo(() => { | const searchCriteria: Criterion<SearchParamNames>[] = useMemo(() => { | ||||
@@ -96,11 +96,11 @@ const EscalationForm: React.FC<Props> = ({ | |||||
{t(`Escalation`)}: {determineCount} | {t(`Escalation`)}: {determineCount} | ||||
</Typography> | </Typography> | ||||
</Grid> | </Grid> | ||||
<Grid item xs={12}> | |||||
{/* <Grid item xs={12}> | |||||
<Typography variant="h6" display="block" marginBlockEnd={1}> | <Typography variant="h6" display="block" marginBlockEnd={1}> | ||||
{t(`to be processed`)}: {itemDetail.acceptedQty - acceptedQty} | {t(`to be processed`)}: {itemDetail.acceptedQty - acceptedQty} | ||||
</Typography> | </Typography> | ||||
</Grid> | |||||
</Grid> */} | |||||
<Grid | <Grid | ||||
container | container | ||||
justifyContent="flex-start" | justifyContent="flex-start" | ||||
@@ -110,7 +110,7 @@ const EscalationForm: React.FC<Props> = ({ | |||||
> | > | ||||
<Grid item xs={6}> | <Grid item xs={6}> | ||||
<TextField | <TextField | ||||
label={t("acceptedQty")} | |||||
label={t("reportQty")} | |||||
fullWidth | fullWidth | ||||
{...register("acceptedQty", { | {...register("acceptedQty", { | ||||
required: "acceptedQty required!", | required: "acceptedQty required!", | ||||
@@ -139,7 +139,7 @@ function PoInputGrid({ | |||||
const { data: session } = useSession(); | const { data: session } = useSession(); | ||||
useEffect(() => { | useEffect(() => { | ||||
const completedList = entries.filter((e) => e.status === "completed"); | |||||
const completedList = entries.filter((e) => stockInLineStatusMap[e.status!!] >= 8); | |||||
const processedQty = completedList.reduce( | const processedQty = completedList.reduce( | ||||
(acc, curr) => acc + (curr.acceptedQty || 0), | (acc, curr) => acc + (curr.acceptedQty || 0), | ||||
0 | 0 | ||||
@@ -37,7 +37,7 @@ import { QcItemWithChecks } from "@/app/api/qc"; | |||||
import { GridEditInputCell } from "@mui/x-data-grid"; | import { GridEditInputCell } from "@mui/x-data-grid"; | ||||
import { StockInLine } from "@/app/api/po"; | import { StockInLine } from "@/app/api/po"; | ||||
import { WarehouseResult } from "@/app/api/warehouse"; | import { WarehouseResult } from "@/app/api/warehouse"; | ||||
import { stockInLineStatusMap } from "@/app/utils/formatUtil"; | |||||
import { OUTPUT_DATE_FORMAT, stockInLineStatusMap } from "@/app/utils/formatUtil"; | |||||
import { QRCodeSVG } from "qrcode.react"; | import { QRCodeSVG } from "qrcode.react"; | ||||
import { QrCode } from "../QrCode"; | import { QrCode } from "../QrCode"; | ||||
import ReactQrCodeScanner, { | import ReactQrCodeScanner, { | ||||
@@ -45,6 +45,9 @@ import ReactQrCodeScanner, { | |||||
} from "../ReactQrCodeScanner/ReactQrCodeScanner"; | } from "../ReactQrCodeScanner/ReactQrCodeScanner"; | ||||
import { QrCodeInfo } from "@/app/api/qrcode"; | import { QrCodeInfo } from "@/app/api/qrcode"; | ||||
import { useQcCodeScanner } from "../QrCodeScannerProvider/QrCodeScannerProvider"; | import { useQcCodeScanner } from "../QrCodeScannerProvider/QrCodeScannerProvider"; | ||||
import dayjs from "dayjs"; | |||||
import arraySupport from "dayjs/plugin/arraySupport"; | |||||
dayjs.extend(arraySupport); | |||||
interface Props { | interface Props { | ||||
itemDetail: StockInLine; | itemDetail: StockInLine; | ||||
@@ -322,7 +325,7 @@ const PutawayForm: React.FC<Props> = ({ itemDetail, warehouse, disabled }) => { | |||||
<TextField | <TextField | ||||
label={t("productionDate")} | label={t("productionDate")} | ||||
fullWidth | fullWidth | ||||
value={itemDetail.productionDate} | |||||
value={dayjs(itemDetail.productionDate).add(-1, "month").format(OUTPUT_DATE_FORMAT)} | |||||
disabled | disabled | ||||
/> | /> | ||||
</Grid> | </Grid> | ||||
@@ -330,7 +333,7 @@ const PutawayForm: React.FC<Props> = ({ itemDetail, warehouse, disabled }) => { | |||||
<TextField | <TextField | ||||
label={t("expiryDate")} | label={t("expiryDate")} | ||||
fullWidth | fullWidth | ||||
value={itemDetail.expiryDate} | |||||
value={dayjs(itemDetail.expiryDate).add(-1, "month").format(OUTPUT_DATE_FORMAT)} | |||||
disabled | disabled | ||||
/> | /> | ||||
</Grid> | </Grid> | ||||
@@ -245,7 +245,7 @@ const QcForm: React.FC<Props> = ({ qc, itemDetail, disabled }) => { | |||||
// helperText={errors.sampleRate?.message} | // helperText={errors.sampleRate?.message} | ||||
/> | /> | ||||
</Grid> */} | </Grid> */} | ||||
<Grid item xs={12} lg={6}> | |||||
{/* <Grid item xs={12} lg={6}> | |||||
<TextField | <TextField | ||||
label={t("sampleRate")} | label={t("sampleRate")} | ||||
fullWidth | fullWidth | ||||
@@ -286,7 +286,7 @@ const QcForm: React.FC<Props> = ({ qc, itemDetail, disabled }) => { | |||||
error={Boolean(errors.totalWeight)} | error={Boolean(errors.totalWeight)} | ||||
helperText={errors.totalWeight?.message} | helperText={errors.totalWeight?.message} | ||||
/> | /> | ||||
</Grid> | |||||
</Grid> */} | |||||
</Grid> | </Grid> | ||||
<Grid | <Grid | ||||
container | container | ||||
@@ -6,5 +6,8 @@ | |||||
"Search": "搜尋", | "Search": "搜尋", | ||||
"Code": "編號", | "Code": "編號", | ||||
"Name": "名稱", | "Name": "名稱", | ||||
"Type": "類型" | |||||
"Type": "類型", | |||||
"Add some entries!": "添加條目", | |||||
"Add Record": "新增", | |||||
"Clean Record": "重置" | |||||
} | } |
@@ -73,6 +73,8 @@ | |||||
"acceptedWeight": "接受重量", | "acceptedWeight": "接受重量", | ||||
"productionDate": "生產日期", | "productionDate": "生產日期", | ||||
"reportQty": "上報數量", | |||||
"Select warehouse": "選擇倉庫", | "Select warehouse": "選擇倉庫", | ||||
"Putaway Detail": "上架詳情", | "Putaway Detail": "上架詳情", | ||||
"LotNo": "批號", | "LotNo": "批號", | ||||