| @@ -965,6 +965,8 @@ export interface TruckLaneRenameLogResponse { | |||||
| oldDepartureTime?: string | null; | oldDepartureTime?: string | null; | ||||
| newDepartureTime?: string | null; | newDepartureTime?: string | null; | ||||
| ticketCount: number; | ticketCount: number; | ||||
| /** `truck.id` of shops in the renamed lane, comma-separated. */ | |||||
| truckIds?: string | null; | |||||
| } | } | ||||
| export const previewTruckLaneRenameAction = async ( | export const previewTruckLaneRenameAction = async ( | ||||
| @@ -203,13 +203,13 @@ const TruckScheduleDashboard: React.FC = () => { | |||||
| return '-'; | return '-'; | ||||
| }; | }; | ||||
| // Compare a timestamp against the selected date (today/tomorrow/...) and return a short label. | |||||
| // Used to avoid confusion when picking crosses midnight. | |||||
| // Compare a timestamp against calendar today. Same-day picks show no chip; | |||||
| // only midnight-crossing (yesterday / tomorrow / N days) gets a label. | |||||
| // Does not filter rows — trucklane tickets for the selected delivery date still show. | |||||
| const relativeDayLabel = useCallback( | const relativeDayLabel = useCallback( | ||||
| (dateTimeData: string | number[] | null, dateOption: string): string | null => { | |||||
| (dateTimeData: string | number[] | null): string | null => { | |||||
| if (!dateTimeData) return null; | if (!dateTimeData) return null; | ||||
| const dateOffset = getDateOffset(dateOption); | |||||
| const baseDate = dayjs().startOf('day').add(dateOffset, 'day'); | |||||
| const baseDate = dayjs().startOf('day'); | |||||
| let dt: dayjs.Dayjs; | let dt: dayjs.Dayjs; | ||||
| if (Array.isArray(dateTimeData)) { | if (Array.isArray(dateTimeData)) { | ||||
| @@ -518,8 +518,8 @@ const TruckScheduleDashboard: React.FC = () => { | |||||
| filteredData.map((row, index) => { | filteredData.map((row, index) => { | ||||
| const timeRemaining = calculateTimeRemaining(row, selectedDate); | const timeRemaining = calculateTimeRemaining(row, selectedDate); | ||||
| const chipColor = getTimeChipColor(row, selectedDate); | const chipColor = getTimeChipColor(row, selectedDate); | ||||
| const startRel = relativeDayLabel(row.firstTicketStartTime, selectedDate); | |||||
| const endRel = relativeDayLabel(row.lastTicketEndTime, selectedDate); | |||||
| const startRel = relativeDayLabel(row.firstTicketStartTime); | |||||
| const endRel = relativeDayLabel(row.lastTicketEndTime); | |||||
| return ( | return ( | ||||
| <TableRow | <TableRow | ||||
| @@ -106,7 +106,7 @@ | |||||
| "lane_noMatchFilter": "No lanes match (clear search or floor filter)", | "lane_noMatchFilter": "No lanes match (clear search or floor filter)", | ||||
| "floor_label": "Floor", | "floor_label": "Floor", | ||||
| "floor_all": "All", | "floor_all": "All", | ||||
| "filter_clear": "Clear", | |||||
| "filter_clear": "Clear all", | |||||
| "filter_apply": "OK", | "filter_apply": "OK", | ||||
| "btn_addLane": "Add lane", | "btn_addLane": "Add lane", | ||||
| "tools_title": "Tools", | "tools_title": "Tools", | ||||
| @@ -135,7 +135,6 @@ | |||||
| "departureDialog_hint": "Name and departure apply to every master row on this lane. Press \"Save changes\" to write them. Existing delivery tickets keep the old name; later releases use the new name.", | "departureDialog_hint": "Name and departure apply to every master row on this lane. Press \"Save changes\" to write them. Existing delivery tickets keep the old name; later releases use the new name.", | ||||
| "departureDialog_title": "Edit lane", | "departureDialog_title": "Edit lane", | ||||
| "departureDialog_nameLabel": "Lane name", | "departureDialog_nameLabel": "Lane name", | ||||
| "departureDialog_remarkReadonly": "Remark (not edited here)", | |||||
| "laneEditTooltip": "Edit lane name and departure time (written when you press Save changes)", | "laneEditTooltip": "Edit lane name and departure time (written when you press Save changes)", | ||||
| "confirm_weekdayToken": "The weekday token in the lane name will change or become unreadable. 4F assignment matches Mon–Sun inside the name. Apply anyway?", | "confirm_weekdayToken": "The weekday token in the lane name will change or become unreadable. 4F assignment matches Mon–Sun inside the name. Apply anyway?", | ||||
| "confirm_renameLane": "Rename \"{{from}}\" to \"{{to}}\".\n{{unfinished}} unfinished delivery ticket(s) stay on the old name (handlers: {{handlers}}).\n{{completed}} completed ticket(s) stay on the old name.\nLater releases use the new name.\n{{schedules}} open schedule line(s) will change from/to.\nNothing is written until you press Save changes.", | "confirm_renameLane": "Rename \"{{from}}\" to \"{{to}}\".\n{{unfinished}} unfinished delivery ticket(s) stay on the old name (handlers: {{handlers}}).\n{{completed}} completed ticket(s) stay on the old name.\nLater releases use the new name.\n{{schedules}} open schedule line(s) will change from/to.\nNothing is written until you press Save changes.", | ||||
| @@ -152,7 +151,7 @@ | |||||
| "renameErr_LANE_NOT_FOUND": "No live lane rows were found, so nothing was written", | "renameErr_LANE_NOT_FOUND": "No live lane rows were found, so nothing was written", | ||||
| "renameErr_LANE_TIME_INVALID": "Departure time is not a valid time", | "renameErr_LANE_TIME_INVALID": "Departure time is not a valid time", | ||||
| "renameLog_title": "Lane renames", | "renameLog_title": "Lane renames", | ||||
| "renameLog_line": "{{when}} {{who}}: {{from}} → {{to}} ({{floor}}, tickets {{tickets}})", | |||||
| "renameLog_line": "{{when}} {{who}}: {{from}} → {{to}} ({{floor}})", | |||||
| "departureEditAria": "Edit departure time", | "departureEditAria": "Edit departure time", | ||||
| "departureTooltipEditSave": "Edit departure time (saved with \"Save changes\")", | "departureTooltipEditSave": "Edit departure time (saved with \"Save changes\")", | ||||
| "departureTooltipNeedShops": "Add shops before setting departure time", | "departureTooltipNeedShops": "Add shops before setting departure time", | ||||
| @@ -231,9 +230,14 @@ | |||||
| "err_save": "Save failed", | "err_save": "Save failed", | ||||
| "exportRoutes": "Export routes", | "exportRoutes": "Export routes", | ||||
| "filter_apply": "OK", | "filter_apply": "OK", | ||||
| "filter_clear": "Clear", | |||||
| "filter_clear": "Clear all", | |||||
| "floor_all": "All", | "floor_all": "All", | ||||
| "floor_label": "Floor", | "floor_label": "Floor", | ||||
| "lane_filter": "Filter", | |||||
| "laneFilter_special": "Lane code", | |||||
| "laneFilter_zone": "Zone", | |||||
| "laneFilter_weekday": "Weekday", | |||||
| "laneFilter_area": "Area", | |||||
| "id": "id", | "id": "id", | ||||
| "importRoutes": "Import routes", | "importRoutes": "Import routes", | ||||
| "import_staged_preview": "Import preview loaded: {{file}} ({{sheets}} sheet(s) / {{rows}} rows). Press \"Save changes\" to persist.", | "import_staged_preview": "Import preview loaded: {{file}} ({{sheets}} sheet(s) / {{rows}} rows). Press \"Save changes\" to persist.", | ||||
| @@ -106,7 +106,7 @@ | |||||
| "lane_noMatchFilter": "無符合條件的車線(清除搜索或樓層篩選)", | "lane_noMatchFilter": "無符合條件的車線(清除搜索或樓層篩選)", | ||||
| "floor_label": "樓層", | "floor_label": "樓層", | ||||
| "floor_all": "全部", | "floor_all": "全部", | ||||
| "filter_clear": "清除", | |||||
| "filter_clear": "清除全部", | |||||
| "filter_apply": "確定", | "filter_apply": "確定", | ||||
| "btn_addLane": "新增車線", | "btn_addLane": "新增車線", | ||||
| "tools_title": "操作工具", | "tools_title": "操作工具", | ||||
| @@ -106,7 +106,12 @@ | |||||
| "lane_selectAll": "全選", | "lane_selectAll": "全選", | ||||
| "floor_label": "樓層", | "floor_label": "樓層", | ||||
| "floor_all": "全部", | "floor_all": "全部", | ||||
| "filter_clear": "清除", | |||||
| "lane_filter": "篩選", | |||||
| "laneFilter_special": "車線", | |||||
| "laneFilter_zone": "區", | |||||
| "laneFilter_weekday": "星期", | |||||
| "laneFilter_area": "地區", | |||||
| "filter_clear": "清除全部", | |||||
| "filter_apply": "確定", | "filter_apply": "確定", | ||||
| "btn_addLane": "新增車線", | "btn_addLane": "新增車線", | ||||
| "tools_title": "操作工具", | "tools_title": "操作工具", | ||||
| @@ -202,8 +207,7 @@ | |||||
| "addShop_confirm": "確認", | "addShop_confirm": "確認", | ||||
| "departureDialog_title": "編輯車線", | "departureDialog_title": "編輯車線", | ||||
| "departureDialog_nameLabel": "車線名稱", | "departureDialog_nameLabel": "車線名稱", | ||||
| "departureDialog_remarkReadonly": "備註(這次不改)", | |||||
| "departureDialog_hint": "名稱與出車時間會套用到此車線全部主檔。按上方「儲存更改」才寫入。既有出倉票維持舊名稱;之後放單才用新名稱。", | |||||
| "departureDialog_hint": "名稱與出車時間會套用到此車線全部店鋪。\n 既有送貨訂單維持舊名稱;之後放單才用新名稱。\n 按上方「儲存更改」才寫入。", | |||||
| "laneEditTooltip": "編輯車線名稱與出車時間(按「儲存更改」才寫入)", | "laneEditTooltip": "編輯車線名稱與出車時間(按「儲存更改」才寫入)", | ||||
| "confirm_weekdayToken": "車線名稱裡的星期代碼會改變,或改完後無法辨認。4F 派車是用名稱裡的 Mon–Sun 對日子。仍要套用?", | "confirm_weekdayToken": "車線名稱裡的星期代碼會改變,或改完後無法辨認。4F 派車是用名稱裡的 Mon–Sun 對日子。仍要套用?", | ||||
| "confirm_renameLane": "把「{{from}}」改成「{{to}}」。\n未完成出倉票 {{unfinished}} 張維持舊名稱(負責人:{{handlers}})。\n已完成 {{completed}} 張維持舊名稱。\n之後放單才用新名稱。\n未完成排程 {{schedules}} 筆的起迄名稱會改。\n按「儲存更改」後才寫入。", | "confirm_renameLane": "把「{{from}}」改成「{{to}}」。\n未完成出倉票 {{unfinished}} 張維持舊名稱(負責人:{{handlers}})。\n已完成 {{completed}} 張維持舊名稱。\n之後放單才用新名稱。\n未完成排程 {{schedules}} 筆的起迄名稱會改。\n按「儲存更改」後才寫入。", | ||||
| @@ -220,7 +224,7 @@ | |||||
| "renameErr_LANE_NOT_FOUND": "找不到這條車線的主檔,沒有寫入", | "renameErr_LANE_NOT_FOUND": "找不到這條車線的主檔,沒有寫入", | ||||
| "renameErr_LANE_TIME_INVALID": "出車時間格式不正確", | "renameErr_LANE_TIME_INVALID": "出車時間格式不正確", | ||||
| "renameLog_title": "車線改名紀錄", | "renameLog_title": "車線改名紀錄", | ||||
| "renameLog_line": "{{when}} {{who}}:{{from}} → {{to}}({{floor}},票 {{tickets}})", | |||||
| "renameLog_line": "{{when}} {{who}}:{{from}} → {{to}}({{floor}})", | |||||
| "seqDialog_title": "編輯裝車順序", | "seqDialog_title": "編輯裝車順序", | ||||
| "logistics_colLaneCount": "{{count}} 條車線", | "logistics_colLaneCount": "{{count}} 條車線", | ||||
| "tooltip_openLaneBoard": "在車線看板開此車線", | "tooltip_openLaneBoard": "在車線看板開此車線", | ||||