feat(procurement): 修正採購單與進貨單日期標籤、狀態與操作紀錄本地化
This commit is contained in:
@@ -187,13 +187,13 @@ class RoleController extends Controller
|
|||||||
'vendors' => '廠商資料管理',
|
'vendors' => '廠商資料管理',
|
||||||
'purchase_orders' => '採購單管理',
|
'purchase_orders' => '採購單管理',
|
||||||
'goods_receipts' => '進貨單管理',
|
'goods_receipts' => '進貨單管理',
|
||||||
'production_orders' => '生產工單管理',
|
|
||||||
'recipes' => '配方管理',
|
'recipes' => '配方管理',
|
||||||
|
'production_orders' => '生產工單管理',
|
||||||
|
'utility_fees' => '公共事業費管理',
|
||||||
|
'accounting' => '會計報表',
|
||||||
'users' => '使用者管理',
|
'users' => '使用者管理',
|
||||||
'roles' => '角色與權限',
|
'roles' => '角色與權限',
|
||||||
'system' => '系統管理',
|
'system' => '系統管理',
|
||||||
'utility_fees' => '公共事業費管理',
|
|
||||||
'accounting' => '會計報表',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ const fieldLabels: Record<string, string> = {
|
|||||||
source_purchase_order_id: '來源採購單',
|
source_purchase_order_id: '來源採購單',
|
||||||
quality_status: '品質狀態',
|
quality_status: '品質狀態',
|
||||||
quality_remark: '品質備註',
|
quality_remark: '品質備註',
|
||||||
|
purchase_order_id: '來源採購單',
|
||||||
// 採購單欄位
|
// 採購單欄位
|
||||||
po_number: '採購單號',
|
po_number: '採購單號',
|
||||||
vendor_id: '廠商',
|
vendor_id: '廠商',
|
||||||
@@ -105,6 +106,7 @@ const fieldLabels: Record<string, string> = {
|
|||||||
user_id: '建單人員',
|
user_id: '建單人員',
|
||||||
total_amount: '小計',
|
total_amount: '小計',
|
||||||
expected_delivery_date: '預計到貨日',
|
expected_delivery_date: '預計到貨日',
|
||||||
|
order_date: '下單日期',
|
||||||
status: '狀態',
|
status: '狀態',
|
||||||
tax_amount: '稅額',
|
tax_amount: '稅額',
|
||||||
grand_total: '總計',
|
grand_total: '總計',
|
||||||
@@ -141,6 +143,8 @@ const statusMap: Record<string, string> = {
|
|||||||
received: '已收貨',
|
received: '已收貨',
|
||||||
cancelled: '已取消',
|
cancelled: '已取消',
|
||||||
completed: '已完成',
|
completed: '已完成',
|
||||||
|
closed: '已結案',
|
||||||
|
partial: '部分收貨',
|
||||||
// 生產工單狀態
|
// 生產工單狀態
|
||||||
planned: '已計畫',
|
planned: '已計畫',
|
||||||
in_progress: '生產中',
|
in_progress: '生產中',
|
||||||
@@ -154,6 +158,13 @@ const qualityStatusMap: Record<string, string> = {
|
|||||||
rejected: '瑕疵/拒收',
|
rejected: '瑕疵/拒收',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 入庫類型翻譯對照表
|
||||||
|
const typeMap: Record<string, string> = {
|
||||||
|
standard: '採購進貨',
|
||||||
|
miscellaneous: '雜項入庫',
|
||||||
|
other: '其他入庫',
|
||||||
|
};
|
||||||
|
|
||||||
export default function ActivityDetailDialog({ open, onOpenChange, activity }: Props) {
|
export default function ActivityDetailDialog({ open, onOpenChange, activity }: Props) {
|
||||||
if (!activity) return null;
|
if (!activity) return null;
|
||||||
|
|
||||||
@@ -166,7 +177,7 @@ export default function ActivityDetailDialog({ open, onOpenChange, activity }: P
|
|||||||
|
|
||||||
// 自訂欄位排序順序
|
// 自訂欄位排序順序
|
||||||
const sortOrder = [
|
const sortOrder = [
|
||||||
'po_number', 'vendor_name', 'warehouse_name', 'expected_delivery_date', 'status', 'remark',
|
'po_number', 'vendor_name', 'warehouse_name', 'order_date', 'expected_delivery_date', 'status', 'remark',
|
||||||
'invoice_number', 'invoice_date', 'invoice_amount',
|
'invoice_number', 'invoice_date', 'invoice_amount',
|
||||||
'total_amount', 'tax_amount', 'grand_total' // 確保金額的特定順序
|
'total_amount', 'tax_amount', 'grand_total' // 確保金額的特定順序
|
||||||
];
|
];
|
||||||
@@ -234,8 +245,13 @@ export default function ActivityDetailDialog({ open, onOpenChange, activity }: P
|
|||||||
return qualityStatusMap[value];
|
return qualityStatusMap[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 處理入庫類型
|
||||||
|
if (key === 'type' && typeof value === 'string' && typeMap[value]) {
|
||||||
|
return typeMap[value];
|
||||||
|
}
|
||||||
|
|
||||||
// 處理日期欄位 (YYYY-MM-DD)
|
// 處理日期欄位 (YYYY-MM-DD)
|
||||||
if ((key === 'expected_delivery_date' || key === 'invoice_date' || key === 'arrival_date' || key === 'expiry_date') && typeof value === 'string') {
|
if ((key === 'order_date' || key === 'expected_delivery_date' || key === 'invoice_date' || key === 'arrival_date' || key === 'expiry_date') && typeof value === 'string') {
|
||||||
// 僅取日期部分 (YYYY-MM-DD)
|
// 僅取日期部分 (YYYY-MM-DD)
|
||||||
return value.split('T')[0].split(' ')[0];
|
return value.split('T')[0].split(' ')[0];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default function CreatePurchaseOrder({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!orderDate) {
|
if (!orderDate) {
|
||||||
toast.error("請選擇採購日期");
|
toast.error("請選擇下單日期");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ export default function CreatePurchaseOrder({
|
|||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-8">
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<label className="text-sm font-bold text-gray-700">
|
<label className="text-sm font-bold text-gray-700">
|
||||||
採購日期 <span className="text-red-500">*</span>
|
下單日期 <span className="text-red-500">*</span>
|
||||||
</label>
|
</label>
|
||||||
<Input
|
<Input
|
||||||
type="date"
|
type="date"
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default function ViewPurchaseOrderPage({ order }: Props) {
|
|||||||
<span className="font-medium text-gray-900">{formatDateTime(order.createdAt)}</span>
|
<span className="font-medium text-gray-900">{formatDateTime(order.createdAt)}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span className="text-sm text-gray-500 block mb-1">採購日期</span>
|
<span className="text-sm text-gray-500 block mb-1">下單日期</span>
|
||||||
<span className="font-medium text-gray-900">{order.orderDate || "-"}</span>
|
<span className="font-medium text-gray-900">{order.orderDate || "-"}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user