|
|
@@ -48,15 +48,13 @@ const style = { |
|
|
left: "50%", |
|
|
left: "50%", |
|
|
transform: "translate(-50%, -50%)", |
|
|
transform: "translate(-50%, -50%)", |
|
|
bgcolor: "background.paper", |
|
|
bgcolor: "background.paper", |
|
|
// pt: 5, |
|
|
|
|
|
// px: 5, |
|
|
|
|
|
// pb: 10, |
|
|
|
|
|
display: "block", |
|
|
display: "block", |
|
|
width: { xs: "90%", sm: "90%", md: "90%" }, |
|
|
|
|
|
height: { xs: "90%", sm: "90%", md: "90%" }, |
|
|
|
|
|
|
|
|
width: "min(1280px, calc(100vw - 48px))", |
|
|
|
|
|
maxWidth: "1280px", |
|
|
|
|
|
height: "min(900px, calc(100vh - 48px))", |
|
|
|
|
|
maxHeight: "calc(100vh - 48px)", |
|
|
}; |
|
|
}; |
|
|
interface CommonProps extends Omit<ModalProps, "children"> { |
|
|
interface CommonProps extends Omit<ModalProps, "children"> { |
|
|
// itemDetail: StockInLine & { qcResult?: PurchaseQcResult[] } & { escResult?: EscalationResult[] } | undefined; |
|
|
|
|
|
inputDetail: StockInLineInput | undefined; |
|
|
inputDetail: StockInLineInput | undefined; |
|
|
session: SessionWithTokens | null; |
|
|
session: SessionWithTokens | null; |
|
|
warehouse?: any[]; |
|
|
warehouse?: any[]; |
|
|
@@ -64,6 +62,7 @@ interface CommonProps extends Omit<ModalProps, "children"> { |
|
|
onClose: () => void; |
|
|
onClose: () => void; |
|
|
skipQc?: Boolean; |
|
|
skipQc?: Boolean; |
|
|
printSource?: "stockIn" | "productionProcess"; |
|
|
printSource?: "stockIn" | "productionProcess"; |
|
|
|
|
|
uiMode?: "default" | "dashboard" | "productionProcess"; |
|
|
} |
|
|
} |
|
|
interface Props extends CommonProps { |
|
|
interface Props extends CommonProps { |
|
|
// itemDetail: StockInLine & { qcResult?: PurchaseQcResult[] } & { escResult?: EscalationResult[] }; |
|
|
// itemDetail: StockInLine & { qcResult?: PurchaseQcResult[] } & { escResult?: EscalationResult[] }; |
|
|
@@ -79,12 +78,19 @@ const QcStockInModal: React.FC<Props> = ({ |
|
|
printerCombo, |
|
|
printerCombo, |
|
|
skipQc = false, |
|
|
skipQc = false, |
|
|
printSource = "stockIn", |
|
|
printSource = "stockIn", |
|
|
|
|
|
uiMode = "default", |
|
|
}) => { |
|
|
}) => { |
|
|
const { |
|
|
const { |
|
|
t, |
|
|
t, |
|
|
i18n: { language }, |
|
|
i18n: { language }, |
|
|
} = useTranslation("purchaseOrder"); |
|
|
} = useTranslation("purchaseOrder"); |
|
|
|
|
|
|
|
|
|
|
|
const useCompactFields = useMemo(() => { |
|
|
|
|
|
return uiMode === "dashboard" || uiMode === "productionProcess"; |
|
|
|
|
|
}, [uiMode]); |
|
|
|
|
|
|
|
|
|
|
|
const useDenseQcLayout = useMemo(() => { |
|
|
|
|
|
return uiMode === "productionProcess"; |
|
|
|
|
|
}, [uiMode]); |
|
|
const [stockInLineInfo, setStockInLineInfo] = useState<StockInLine>(); |
|
|
const [stockInLineInfo, setStockInLineInfo] = useState<StockInLine>(); |
|
|
const [isLoading, setIsLoading] = useState<boolean>(false); |
|
|
const [isLoading, setIsLoading] = useState<boolean>(false); |
|
|
const [isSubmitting, setIsSubmitting] = useState<boolean>(false); |
|
|
const [isSubmitting, setIsSubmitting] = useState<boolean>(false); |
|
|
@@ -710,18 +716,25 @@ const printQrcode = useCallback( |
|
|
</Typography> |
|
|
</Typography> |
|
|
</Grid> |
|
|
</Grid> |
|
|
{stockInLineInfo.jobOrderId ? ( |
|
|
{stockInLineInfo.jobOrderId ? ( |
|
|
<FgStockInForm itemDetail={stockInLineInfo} disabled={viewOnly || showPutaway} compactFields /> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<StockInForm itemDetail={stockInLineInfo} disabled={viewOnly || showPutaway} compactFields /> |
|
|
|
|
|
) |
|
|
|
|
|
} |
|
|
|
|
|
{skipQc === false && ( |
|
|
|
|
|
<QcComponent |
|
|
|
|
|
|
|
|
<FgStockInForm |
|
|
itemDetail={stockInLineInfo} |
|
|
itemDetail={stockInLineInfo} |
|
|
disabled={viewOnly || showPutaway} |
|
|
disabled={viewOnly || showPutaway} |
|
|
compactLayout |
|
|
|
|
|
denseLayout={printSource === "productionProcess"} |
|
|
|
|
|
/>) |
|
|
|
|
|
|
|
|
compactFields={useCompactFields} |
|
|
|
|
|
/> |
|
|
|
|
|
) : ( |
|
|
|
|
|
<StockInForm |
|
|
|
|
|
itemDetail={stockInLineInfo} |
|
|
|
|
|
disabled={viewOnly || showPutaway} |
|
|
|
|
|
compactFields={useCompactFields} |
|
|
|
|
|
/> |
|
|
|
|
|
)} |
|
|
|
|
|
{skipQc === false && ( |
|
|
|
|
|
<QcComponent |
|
|
|
|
|
itemDetail={stockInLineInfo} |
|
|
|
|
|
disabled={viewOnly || showPutaway} |
|
|
|
|
|
compactLayout={uiMode === "dashboard" || uiMode === "productionProcess"} |
|
|
|
|
|
denseLayout={useDenseQcLayout} |
|
|
|
|
|
/>) |
|
|
} |
|
|
} |
|
|
<Stack direction="row" justifyContent="flex-end" gap={1} sx={{pt:2}}> |
|
|
<Stack direction="row" justifyContent="flex-end" gap={1} sx={{pt:2}}> |
|
|
{(!viewOnly && !showPutaway) && (<Button |
|
|
{(!viewOnly && !showPutaway) && (<Button |
|
|
|