ソースを参照

update consumable print label model in put

MergeProblem1
CANCERYS\kw093 1週間前
コミット
758101fb51
6個のファイルの変更38行の追加8行の削除
  1. +1
    -0
      src/app/api/pickOrder/actions.ts
  2. +1
    -1
      src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx
  3. +33
    -6
      src/components/PickOrderSearch/WorkbenchPickExecution.tsx
  4. +1
    -1
      src/i18n/zh/common.json
  5. +1
    -0
      src/i18n/zh/jo.json
  6. +1
    -0
      src/i18n/zh/pickOrder.json

+ 1
- 0
src/app/api/pickOrder/actions.ts ファイルの表示

@@ -1103,6 +1103,7 @@ export const fetchPickOrderDetails = cache(async (ids: string) => {
}); });
export interface PickOrderLotDetailResponse { export interface PickOrderLotDetailResponse {
lotId: number | null; // ✅ 改为可空 lotId: number | null; // ✅ 改为可空
stockInLineId?: number | null;
lotNo: string | null; // ✅ 改为可空 lotNo: string | null; // ✅ 改为可空
expiryDate: string | null; // ✅ 改为可空 expiryDate: string | null; // ✅ 改为可空
location: string | null; // ✅ 改为可空 location: string | null; // ✅ 改为可空


+ 1
- 1
src/components/DoWorkbench/WorkbenchLotLabelPrintModal.tsx ファイルの表示

@@ -694,7 +694,7 @@ const WorkbenchLotLabelPrintModal: React.FC<WorkbenchLotLabelPrintModalProps> =
sx={{ fontWeight: lot._scanned ? 800 : 600 }} sx={{ fontWeight: lot._scanned ? 800 : 600 }}
> >
Lot:{lot.lotNo} Lot:{lot.lotNo}
{lot._scanned ? "(已掃)" : ""}
{lot._scanned ? "(當前批次)" : ""}
</Typography> </Typography>
<Typography variant="body2" color="text.secondary"> <Typography variant="body2" color="text.secondary">
位置:{loc || "—"} 位置:{loc || "—"}


+ 33
- 6
src/components/PickOrderSearch/WorkbenchPickExecution.tsx ファイルの表示

@@ -70,6 +70,7 @@ type LotRow = {
uomDesc: string; uomDesc: string;
requiredQty: number; requiredQty: number;
availableQty: number; availableQty: number;
itemTotalAvailableQty?: number | null;
stockOutLineId: number; stockOutLineId: number;
status: string; status: string;
pickedQty: number; pickedQty: number;
@@ -247,11 +248,19 @@ function lineHasStockOutOrSuggestion(details: PickOrderLotDetailResponse[]): boo


function mapLotDetailsToRows( function mapLotDetailsToRows(
details: PickOrderLotDetailResponse[], details: PickOrderLotDetailResponse[],
ctx: { pickOrderId: number; pickOrderLineId: number; pickOrderCode: string; itemCode: string; itemName: string },
ctx: {
pickOrderId: number;
pickOrderLineId: number;
pickOrderCode: string;
itemCode: string;
itemName: string;
totalAvailableQty?: number | null;
},
): LotRow[] { ): LotRow[] {
return details.map((d, i) => { return details.map((d, i) => {
const solId = toNum(d.stockOutLineId); const solId = toNum(d.stockOutLineId);
const lotId = toNum(d.lotId, i); const lotId = toNum(d.lotId, i);
const stockInLineId = toNum(d.stockInLineId);
return { return {
key: solId > 0 ? `sol:${solId}` : `lot:${lotId}:${i}`, key: solId > 0 ? `sol:${solId}` : `lot:${lotId}:${i}`,
pickOrderId: ctx.pickOrderId, pickOrderId: ctx.pickOrderId,
@@ -262,13 +271,14 @@ function mapLotDetailsToRows(
uomDesc: toStr(d.stockUnit), uomDesc: toStr(d.stockUnit),
requiredQty: toNum(d.requiredQty), requiredQty: toNum(d.requiredQty),
availableQty: toNum(d.remainingAfterAllPickOrders ?? d.availableQty), availableQty: toNum(d.remainingAfterAllPickOrders ?? d.availableQty),
itemTotalAvailableQty: toNum(ctx.totalAvailableQty),
stockOutLineId: solId, stockOutLineId: solId,
status: toStr(d.stockOutLineStatus ?? "pending"), status: toStr(d.stockOutLineStatus ?? "pending"),
pickedQty: toNum(d.actualPickQty ?? d.stockOutLineQty), pickedQty: toNum(d.actualPickQty ?? d.stockOutLineQty),
lotNo: toStr(d.lotNo), lotNo: toStr(d.lotNo),
location: toStr(d.location), location: toStr(d.location),
itemId: toNum(d.itemId) || undefined, itemId: toNum(d.itemId) || undefined,
stockInLineId: lotId > 0 ? lotId : undefined,
stockInLineId: stockInLineId > 0 ? stockInLineId : undefined,
suggestedPickLotId: toNum(d.suggestedPickLotId) || undefined, suggestedPickLotId: toNum(d.suggestedPickLotId) || undefined,
lotAvailability: toStr((d as any).lotAvailability), lotAvailability: toStr((d as any).lotAvailability),
lotStatus: toStr((d as any).lotStatus), lotStatus: toStr((d as any).lotStatus),
@@ -295,6 +305,7 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
pickOrderCode: string; pickOrderCode: string;
itemCode: string; itemCode: string;
itemName: string; itemName: string;
totalAvailableQty?: number;
} | null>(null); } | null>(null);


const [lotRows, setLotRows] = useState<LotRow[]>([]); const [lotRows, setLotRows] = useState<LotRow[]>([]);
@@ -499,7 +510,12 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
async ( async (
pickOrderId: number, pickOrderId: number,
pickOrderLineId: number, pickOrderLineId: number,
meta: { pickOrderCode: string; itemCode: string; itemName: string },
meta: {
pickOrderCode: string;
itemCode: string;
itemName: string;
totalAvailableQty?: number;
},
) => { ) => {
if (!userId || pickOrderLineId <= 0) return; if (!userId || pickOrderLineId <= 0) return;
setLoading(true); setLoading(true);
@@ -526,6 +542,7 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
pickOrderCode: meta.pickOrderCode, pickOrderCode: meta.pickOrderCode,
itemCode: meta.itemCode, itemCode: meta.itemCode,
itemName: meta.itemName, itemName: meta.itemName,
totalAvailableQty: meta.totalAvailableQty,
}), }),
); );
setQtyEditableBySolId({}); setQtyEditableBySolId({});
@@ -704,7 +721,12 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
} }
setSelectedPickOrderLineId(row.pickOrderLineId); setSelectedPickOrderLineId(row.pickOrderLineId);
setSelectedPickOrderId(row.pickOrderId); setSelectedPickOrderId(row.pickOrderId);
setSelectedTopMeta({ pickOrderCode: row.pickOrderCode, itemCode: row.itemCode, itemName: row.itemName });
setSelectedTopMeta({
pickOrderCode: row.pickOrderCode,
itemCode: row.itemCode,
itemName: row.itemName,
totalAvailableQty: row.currentStock,
});
setLotRows([]); setLotRows([]);
setQtyBySolId({}); setQtyBySolId({});
setQtyEditableBySolId({}); setQtyEditableBySolId({});
@@ -714,6 +736,7 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
pickOrderCode: row.pickOrderCode, pickOrderCode: row.pickOrderCode,
itemCode: row.itemCode, itemCode: row.itemCode,
itemName: row.itemName, itemName: row.itemName,
totalAvailableQty: row.currentStock,
}); });
}, },
[loadLineDetailV2, selectedPickOrderLineId], [loadLineDetailV2, selectedPickOrderLineId],
@@ -1383,7 +1406,7 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
<TableCell align="right">{row.pickedQty.toLocaleString()}</TableCell> <TableCell align="right">{row.pickedQty.toLocaleString()}</TableCell>
<TableCell>{row.stockUnit || "-"}</TableCell> <TableCell>{row.stockUnit || "-"}</TableCell>
<TableCell>{safeDisplayTargetDate(row.targetDate)}</TableCell> <TableCell>{safeDisplayTargetDate(row.targetDate)}</TableCell>
<TableCell>{row.status || "-"}</TableCell>
<TableCell>{t(row.status || "-")}</TableCell>
</TableRow> </TableRow>
)) ))
)} )}
@@ -1476,7 +1499,11 @@ const WorkbenchPickExecution: React.FC<Props> = ({ filterArgs }) => {
</Stack> </Stack>
</TableCell> </TableCell>
<TableCell align="right">{`${r.requiredQty.toLocaleString()}(${r.uomDesc || ""})`}</TableCell> <TableCell align="right">{`${r.requiredQty.toLocaleString()}(${r.uomDesc || ""})`}</TableCell>
<TableCell align="right">{`${r.availableQty.toLocaleString()}(${r.uomDesc || ""})`}</TableCell>
<TableCell align="right">
{`${Number(
r.itemTotalAvailableQty ?? r.availableQty ?? 0,
).toLocaleString()}(${r.uomDesc || ""})`}
</TableCell>
<TableCell align="center"> <TableCell align="center">
<Checkbox <Checkbox
checked={isCompletedStatus(r.status) || isCheckedStatus(r.status)} checked={isCompletedStatus(r.status) || isCheckedStatus(r.status)}


+ 1
- 1
src/i18n/zh/common.json ファイルの表示

@@ -14,7 +14,7 @@
"No Lot": "沒有批號", "No Lot": "沒有批號",
"Select All": "全選", "Select All": "全選",
"Do Workbench": "新版成品出倉", "Do Workbench": "新版成品出倉",
"storing": "待品檢入倉",
"Waiting QC Put Away Job Orders": "待QC上架工單", "Waiting QC Put Away Job Orders": "待QC上架工單",
"Put Awayed Job Orders": "已上架工單", "Put Awayed Job Orders": "已上架工單",
"Loading BOM Detail...": "正在載入 BOM 明細…", "Loading BOM Detail...": "正在載入 BOM 明細…",


+ 1
- 0
src/i18n/zh/jo.json ファイルの表示

@@ -8,6 +8,7 @@
"Process": "工序", "Process": "工序",
"Create Job Order": "建立工單", "Create Job Order": "建立工單",
"Code": "工單編號", "Code": "工單編號",
"storing": "待品檢入倉",
"Name": "成品/半成品名稱", "Name": "成品/半成品名稱",
"Picked Qty": "已提料數量", "Picked Qty": "已提料數量",
"Please check around have QR code or not, may be have just now stock in or transfer in or transfer out.": "請檢查周圍是否有QR碼,可能是剛剛入庫或轉移入庫或轉移出庫。", "Please check around have QR code or not, may be have just now stock in or transfer in or transfer out.": "請檢查周圍是否有QR碼,可能是剛剛入庫或轉移入庫或轉移出庫。",


+ 1
- 0
src/i18n/zh/pickOrder.json ファイルの表示

@@ -260,6 +260,7 @@
"The input is not the same as the expected lot number.": "輸入的批次號碼與預期的不符。", "The input is not the same as the expected lot number.": "輸入的批次號碼與預期的不符。",
"Verified successfully!": "驗證成功!", "Verified successfully!": "驗證成功!",
"Cancel": "取消", "Cancel": "取消",
"storing": "待品檢入倉",
"Scan": "掃描", "Scan": "掃描",
"Scanned": "已掃描", "Scanned": "已掃描",
"Loading data...": "正在載入數據...", "Loading data...": "正在載入數據...",


読み込み中…
キャンセル
保存