|
|
@@ -34,7 +34,6 @@ import { |
|
|
confirmLotSubstitution, |
|
|
confirmLotSubstitution, |
|
|
suggestPickOrderWorkbenchV2, |
|
|
suggestPickOrderWorkbenchV2, |
|
|
type PickOrderLotDetailResponse, |
|
|
type PickOrderLotDetailResponse, |
|
|
updateStockOutLineStatusByQRCodeAndLotNo, |
|
|
|
|
|
} from "@/app/api/pickOrder/actions"; |
|
|
} from "@/app/api/pickOrder/actions"; |
|
|
import { workbenchScanPick } from "@/app/api/doworkbench/actions"; |
|
|
import { workbenchScanPick } from "@/app/api/doworkbench/actions"; |
|
|
import { workbenchScanPickResponseNeedsFullRefresh } from "@/app/api/doworkbench/workbenchScanPickUtils"; |
|
|
import { workbenchScanPickResponseNeedsFullRefresh } from "@/app/api/doworkbench/workbenchScanPickUtils"; |
|
|
@@ -917,27 +916,6 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => { |
|
|
const warnMsg = (res.message as string) || t("Lot switch rejected. Continue with scan-pick."); |
|
|
const warnMsg = (res.message as string) || t("Lot switch rejected. Continue with scan-pick."); |
|
|
setMessage(warnMsg); |
|
|
setMessage(warnMsg); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
|
|
|
const res = await updateStockOutLineStatusByQRCodeAndLotNo({ |
|
|
|
|
|
pickOrderLineId: expected.row.pickOrderLineId, |
|
|
|
|
|
inventoryLotNo: scanned.lotNo, |
|
|
|
|
|
stockInLineId: scanned.stockInLineId ?? null, |
|
|
|
|
|
stockOutLineId: expected.row.stockOutLineId, |
|
|
|
|
|
itemId: Number(expected.row.itemId ?? 0), |
|
|
|
|
|
status: "checked", |
|
|
|
|
|
}); |
|
|
|
|
|
switchedToUnavailable = res.code === "BOUND_UNAVAILABLE"; |
|
|
|
|
|
if (res.code !== "SUCCESS" && res.code !== "checked" && !switchedToUnavailable) { |
|
|
|
|
|
const msg = (res.message as string) || t("Lot switch failed"); |
|
|
|
|
|
setLotConfirmationError(msg); |
|
|
|
|
|
setError(msg); |
|
|
|
|
|
startTransition(() => { |
|
|
|
|
|
setQrScanError(true); |
|
|
|
|
|
setQrScanSuccess(false); |
|
|
|
|
|
setQrScanErrorMsg(msg); |
|
|
|
|
|
}); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!switchedToUnavailable) { |
|
|
if (!switchedToUnavailable) { |
|
|
@@ -1518,6 +1496,17 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => { |
|
|
size="small" |
|
|
size="small" |
|
|
type="number" |
|
|
type="number" |
|
|
value={qtyBySolId[r.stockOutLineId] ?? Number(r.requiredQty)} |
|
|
value={qtyBySolId[r.stockOutLineId] ?? Number(r.requiredQty)} |
|
|
|
|
|
onKeyDown={(e) => { |
|
|
|
|
|
const editable = qtyEditableBySolId[r.stockOutLineId] === true; |
|
|
|
|
|
if (!editable) return; |
|
|
|
|
|
if (e.key !== "{") return; |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
setQtyEditableBySolId((prev) => ({ |
|
|
|
|
|
...prev, |
|
|
|
|
|
[r.stockOutLineId]: false, |
|
|
|
|
|
})); |
|
|
|
|
|
(e.currentTarget as HTMLInputElement).blur(); |
|
|
|
|
|
}} |
|
|
onChange={(e) => { |
|
|
onChange={(e) => { |
|
|
const v = e.target.value; |
|
|
const v = e.target.value; |
|
|
setQtyBySolId((prev) => { |
|
|
setQtyBySolId((prev) => { |
|
|
|