feat(procurement): 修正採購單與進貨單日期標籤、狀態與操作紀錄本地化
This commit is contained in:
@@ -97,6 +97,7 @@ const fieldLabels: Record<string, string> = {
|
||||
source_purchase_order_id: '來源採購單',
|
||||
quality_status: '品質狀態',
|
||||
quality_remark: '品質備註',
|
||||
purchase_order_id: '來源採購單',
|
||||
// 採購單欄位
|
||||
po_number: '採購單號',
|
||||
vendor_id: '廠商',
|
||||
@@ -105,6 +106,7 @@ const fieldLabels: Record<string, string> = {
|
||||
user_id: '建單人員',
|
||||
total_amount: '小計',
|
||||
expected_delivery_date: '預計到貨日',
|
||||
order_date: '下單日期',
|
||||
status: '狀態',
|
||||
tax_amount: '稅額',
|
||||
grand_total: '總計',
|
||||
@@ -141,6 +143,8 @@ const statusMap: Record<string, string> = {
|
||||
received: '已收貨',
|
||||
cancelled: '已取消',
|
||||
completed: '已完成',
|
||||
closed: '已結案',
|
||||
partial: '部分收貨',
|
||||
// 生產工單狀態
|
||||
planned: '已計畫',
|
||||
in_progress: '生產中',
|
||||
@@ -154,6 +158,13 @@ const qualityStatusMap: Record<string, string> = {
|
||||
rejected: '瑕疵/拒收',
|
||||
};
|
||||
|
||||
// 入庫類型翻譯對照表
|
||||
const typeMap: Record<string, string> = {
|
||||
standard: '採購進貨',
|
||||
miscellaneous: '雜項入庫',
|
||||
other: '其他入庫',
|
||||
};
|
||||
|
||||
export default function ActivityDetailDialog({ open, onOpenChange, activity }: Props) {
|
||||
if (!activity) return null;
|
||||
|
||||
@@ -166,7 +177,7 @@ export default function ActivityDetailDialog({ open, onOpenChange, activity }: P
|
||||
|
||||
// 自訂欄位排序順序
|
||||
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',
|
||||
'total_amount', 'tax_amount', 'grand_total' // 確保金額的特定順序
|
||||
];
|
||||
@@ -234,8 +245,13 @@ export default function ActivityDetailDialog({ open, onOpenChange, activity }: P
|
||||
return qualityStatusMap[value];
|
||||
}
|
||||
|
||||
// 處理入庫類型
|
||||
if (key === 'type' && typeof value === 'string' && typeMap[value]) {
|
||||
return typeMap[value];
|
||||
}
|
||||
|
||||
// 處理日期欄位 (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)
|
||||
return value.split('T')[0].split(' ')[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user