diff --git a/src/app/(main)/ps/page.tsx b/src/app/(main)/ps/page.tsx
index 19e66b6..6f1d87b 100644
--- a/src/app/(main)/ps/page.tsx
+++ b/src/app/(main)/ps/page.tsx
@@ -110,15 +110,15 @@ export default function ProductionSchedulePage() {
if (response.ok) {
await handleSearch(); // refresh list
- alert("Forecast generated successfully!");
+ alert("成功計算排期!");
} else {
const errorText = await response.text();
console.error("Forecast failed:", errorText);
- alert(`Forecast failed: ${response.status} - ${errorText.substring(0, 120)}`);
+ alert(`計算錯誤: ${response.status} - ${errorText.substring(0, 120)}`);
}
} catch (e) {
console.error("Forecast Error:", e);
- alert("Error occurred while generating forecast.");
+ alert("發生不明狀況.");
} finally {
setLoading(false);
}
@@ -233,7 +233,11 @@ export default function ProductionSchedulePage() {
});
if (response.ok) {
- alert("Job Orders generated successfully!");
+ const data = await response.json();
+ const displayMessage = data.message || "Operation completed.";
+
+ alert(displayMessage);
+ //alert("Job Orders generated successfully!");
setIsDetailOpen(false);
} else {
alert("Failed to generate jobs.");
@@ -252,7 +256,7 @@ export default function ProductionSchedulePage() {
- 排期
+ 排程
@@ -263,7 +267,7 @@ export default function ProductionSchedulePage() {
onClick={() => setIsExportDialogOpen(true)}
sx={{ fontWeight: 'bold' }}
>
- Export Excel
+ 匯出計劃/物料需求Excel
@@ -281,7 +285,7 @@ export default function ProductionSchedulePage() {
{/* Query Bar – unchanged */}
setSearchDate(e.target.value)}
/>
} onClick={handleSearch}>
- Query
+ 搜尋
@@ -298,11 +302,10 @@ export default function ProductionSchedulePage() {
- Action
- ID
- Production Date
- Est. Prod Count
- Total FG Types
+ 詳細
+ 生產日期
+ 預計生產數
+ 成品款數
@@ -313,7 +316,6 @@ export default function ProductionSchedulePage() {
- #{ps.id}
{formatBackendDate(ps.produceAt)}
{formatNum(ps.totalEstProdCount)}
{formatNum(ps.totalFGType)}
@@ -328,7 +330,7 @@ export default function ProductionSchedulePage() {
- Schedule Details: {selectedPs?.id} ({formatBackendDate(selectedPs?.produceAt)})
+ 排期詳細: {selectedPs?.id} ({formatBackendDate(selectedPs?.produceAt)})
@@ -336,15 +338,16 @@ export default function ProductionSchedulePage() {
- Job Order
- Item Code
- Item Name
- Avg Last Month
- Stock
- Days Left
- Batch Need
- Prod Qty
- Priority
+ 工單號
+ 物料編號
+ 物料名稱
+ 每日平均出貨量
+ 出貨前預計存貨量
+ 單位
+ 可用日
+ 生產量(批)
+ 預計生產包數
+ 優先度
@@ -355,6 +358,7 @@ export default function ProductionSchedulePage() {
{line.itemName}
{formatNum(line.avgQtyLastMonth)}
{formatNum(line.stockQty)}
+ {line.stockUnit}
{line.daysLeft}
@@ -378,9 +382,10 @@ export default function ProductionSchedulePage() {
color="primary"
startIcon={isGenerating ? : }
onClick={handleAutoGenJob}
- disabled={isGenerating || !isDateToday}
+ disabled={isGenerating}
+ //disabled={isGenerating || !isDateToday}
>
- Auto Gen Job
+ 自動生成工單
@@ -390,7 +395,7 @@ export default function ProductionSchedulePage() {
color="inherit"
disabled={isGenerating}
>
- Close
+ 關閉
@@ -403,15 +408,15 @@ export default function ProductionSchedulePage() {
maxWidth="sm"
fullWidth
>
- Generate Production Forecast
+ 準備生成預計排期
- Select the starting date and number of days to forecast.
+
: }
>
- Generate Forecast
+ 計算預測排期
@@ -464,14 +468,14 @@ export default function ProductionSchedulePage() {
maxWidth="xs"
fullWidth
>
- Export Production Schedule
+ 匯出排期/物料用量預計
- Select the starting date for the export.
+ 選擇要匯出的起始日期
: }
>
- Export
+ 匯出
diff --git a/src/i18n/zh/common.json b/src/i18n/zh/common.json
index 38dbda7..b4b4a22 100644
--- a/src/i18n/zh/common.json
+++ b/src/i18n/zh/common.json
@@ -425,6 +425,7 @@
"Add Shop to Truck Lane": "新增店鋪至卡車路線",
"Truck lane code already exists. Please use a different code.": "卡車路線編號已存在,請使用其他編號。",
"MaintenanceEdit": "編輯維護和保養",
+ "ps": "排程",
"Printer": "列印機",
"Delete": "刪除",
"Delete Success": "刪除成功",