From f62a3175f76d10bdbfb8775ab5356f2b30cc29bb Mon Sep 17 00:00:00 2001 From: ouyangxq <775153912@qq.com> Date: Wed, 9 Sep 2026 13:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../container-loading/api/terminalDrayages.ts | 32 ++++++++++++++++++- .../pages/ContainersView.vue | 6 ++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/modules/container-loading/api/terminalDrayages.ts b/src/modules/container-loading/api/terminalDrayages.ts index 82b200f8..bf176078 100644 --- a/src/modules/container-loading/api/terminalDrayages.ts +++ b/src/modules/container-loading/api/terminalDrayages.ts @@ -1,7 +1,37 @@ import { http, unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http' export type TerminalDrayageStatus = 'WAITING_FOR_ARRIVAL' | 'ARRIVED' | 'PICKUP_SCHEDULED' | 'PICKED_UP' | 'UNLOADED' | 'EMPTY_RETURNED' -export type TerminalDrayageAction = 'SELECT_FLEET' | 'SCHEDULE_PICKUP' | 'RECORD_PICKUP' | 'RECORD_EMPTY_RETURN' +export type TerminalDrayageAction = 'SELECT_FLEET' | 'SCHEDULE_PICKUP' | 'RECORD_PICKUP' | 'RECORD_EMPTY_RETURN' | 'SEND_PICKUP_EMAIL' + +export interface TerminalDrayageEmail { + id: string + fleetName: string + recipient: string + kind: 'REQUEST_PICKUP' | 'CANCEL_PICKUP' + subject: string + body: string + status: 'PENDING' | 'SENDING' | 'SENT' | 'FAILED' + attempts: number + failureReason: string | null + createdAt: string + sentAt: string | null +} + +export async function getTerminalDrayageEmails(containerId: string) { + type Mailbox = { deliveryEnabled: boolean; records: TerminalDrayageEmail[] } + const response = await http.get, ApiEnvelope>(`${path}/${encodeURIComponent(containerId)}/emails`) + const result = unwrapApiResponse(response) + return { ...result, records: result.records.map((mail) => ({ ...mail, id: String(mail.id) })) } +} + +export function sendTerminalDrayageEmail(containerId: string, expectedVersion: number) { + return command(containerId, 'pickup-email', { expectedVersion }) +} + +export async function retryTerminalDrayageEmail(containerId: string, mailId: string) { + const response = await http.post, ApiEnvelope>(`${path}/${encodeURIComponent(containerId)}/emails/${encodeURIComponent(mailId)}/retry`) + unwrapApiResponse(response) +} export type EmptyReturnWarningStatus = 'NOT_APPLICABLE' | 'PENDING' | 'OVERDUE' | 'RESOLVED' export interface EmptyReturnWarning { diff --git a/src/modules/container-loading/pages/ContainersView.vue b/src/modules/container-loading/pages/ContainersView.vue index 853b3e89..aabe3fa5 100644 --- a/src/modules/container-loading/pages/ContainersView.vue +++ b/src/modules/container-loading/pages/ContainersView.vue @@ -179,7 +179,7 @@ const queryFields = computed(() => [ { key: 'sailingRange', type: 'daterange', label: '预计开船', width: 260, props: { 'aria-label': '预计开船日期范围' } }, ]) const allColumns: DataTableColumn[] = [ - { key: 'actions', label: '操作', width: 310, fixed: 'left', slotName: 'actions' }, + { key: 'actions', label: '操作', width: 140, fixed: 'left', slotName: 'actions' }, { key: 'emptyReturnWarning', label: '报空预警', width: 120, slotName: 'emptyReturnWarning' }, { key: 'containerNo', label: '集装箱号', minWidth: 150, slotName: 'containerNo' }, { key: 'planNo', prop: 'planNo', label: '装柜清单号', minWidth: 165, formatter: (row: ContainerBookingResource) => row.planNo || '—' }, @@ -213,7 +213,7 @@ const overseasColumnKeys = new Set(['actions', 'emptyReturnWarning', 'containerN const columns = computed(() => allColumns .filter((column) => (isDomestic.value ? domesticColumnKeys : overseasColumnKeys).has(String(column.key))) // 国内同时展示查看、运输信息、装柜流程和更多菜单,须为四个入口预留空间。 - .map((column) => isDomestic.value && column.key === 'actions' ? { ...column, width: 380, minWidth: 380 } : column)) + .map((column) => isDomestic.value && column.key === 'actions' ? { ...column, width: 290 } : column)) const drayageHistoryColumns: DataTableColumn[] = [ { key: 'action', label: '动作', width: 130, formatter: (row: TerminalDrayageHistory) => drayageActionText(row.action) }, { key: 'status', label: '状态变化', minWidth: 180, formatter: (row: TerminalDrayageHistory) => `${drayageStatusText(row.fromStatus)} → ${drayageStatusText(row.toStatus)}` }, @@ -727,7 +727,7 @@ onMounted(async () => {
- +