diff --git a/src/modules/overseas-warehouse/api/inboundOrders.ts b/src/modules/overseas-warehouse/api/inboundOrders.ts index 409b7a48..725a39ee 100644 --- a/src/modules/overseas-warehouse/api/inboundOrders.ts +++ b/src/modules/overseas-warehouse/api/inboundOrders.ts @@ -96,3 +96,10 @@ export async function updateFbaAppointment(appointmentNo: string, payload: Updat ) return unwrapApiResponse(response) } + +export async function updateInboundPlan(planNo: string, payload: { customerId: string; overseasWarehouseId: string; warehouseCode?: string; warehouseName?: string; version: number }) { + const response = await overseasHttp.put, ApiEnvelope>( + `/platform/v1/last-leg/inbound-plans/${encodeURIComponent(planNo)}`, payload, + ) + return unwrapApiResponse(response) +} diff --git a/src/modules/overseas-warehouse/api/inventory.ts b/src/modules/overseas-warehouse/api/inventory.ts index 1889c422..279fd444 100644 --- a/src/modules/overseas-warehouse/api/inventory.ts +++ b/src/modules/overseas-warehouse/api/inventory.ts @@ -116,6 +116,10 @@ export async function listInventoryBalances(query: InventoryBalanceQuery) { return normalizeOverseasPage(unwrapApiResponse(response)) } +export async function downloadInventoryBalances(query: Partial) { + return overseasHttp.get('/platform/v1/last-leg/inventory/balances/export', { params: query, responseType: 'blob' }) +} + export async function getInventorySummary(query: InventoryBalanceQuery) { const response = await overseasHttp.get, ApiEnvelope>( '/platform/v1/last-leg/inventory/summary', { params: params({ ...query, page: 1, size: 200 }) }, @@ -159,3 +163,7 @@ export async function listInventoryLedger(query: InventoryLedgerQuery) { ) return normalizeOverseasPage(unwrapApiResponse(response)) } + +export async function downloadInventoryLedger(query: Partial) { + return overseasHttp.get('/platform/v1/last-leg/inventory/ledger/export', { params: query, responseType: 'blob' }) +} diff --git a/src/modules/overseas-warehouse/api/lastMileOrders.ts b/src/modules/overseas-warehouse/api/lastMileOrders.ts index 859aaab3..44fbff2b 100644 --- a/src/modules/overseas-warehouse/api/lastMileOrders.ts +++ b/src/modules/overseas-warehouse/api/lastMileOrders.ts @@ -187,6 +187,10 @@ export async function getLastMileOrder(orderId: string) { return unwrapApiResponse(response) } +export async function downloadLastMileOrders(query: Partial) { + return overseasHttp.get('/platform/v1/last-leg/orders/export', { params: query, responseType: 'blob' }) +} + export async function createLastMileOrderFee(orderId: string, payload: CreateLastMileFeePayload) { const response = await overseasHttp.post, ApiEnvelope>( `/platform/v1/last-leg/orders/${encodeURIComponent(orderId)}/fees`, payload, diff --git a/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue b/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue index 618d6e0d..1d5f906e 100644 --- a/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue +++ b/src/modules/overseas-warehouse/pages/LastMileOrdersView.vue @@ -12,7 +12,7 @@ import ListPageLayout from '@/shared/components/ListPageLayout.vue' import LoadErrorState from '@/shared/components/LoadErrorState.vue' import OperationErrorToast from '@/shared/components/OperationErrorToast.vue' import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue' -import { convertLastMileOrderToInboundPlan, listLastMileOrders, setLastMileOrderDetained, transferLastMileOrders } from '../api/lastMileOrders' +import { convertLastMileOrderToInboundPlan, listLastMileOrders, setLastMileOrderDetained, transferLastMileOrders, downloadLastMileOrders } from '../api/lastMileOrders' import { useAccessPreviewStore } from '@/core/access/accessPreview' import { overseasWarehousePermissions as permission } from '../permissions' import { toLastMileOrderListItem } from '../lastMilePresentation' @@ -28,6 +28,8 @@ const pageSize = ref(10) const total = ref(0) const selectedRows = ref([]) const actionLoading = ref(false) +const exportLoading = ref(false) +async function exportOrders() { exportLoading.value = true; try { const blob = await downloadLastMileOrders(filters.value); const url = URL.createObjectURL(blob as Blob); const a = document.createElement('a'); a.href = url; a.download = '尾程订单.csv'; a.click(); URL.revokeObjectURL(url) } finally { exportLoading.value = false } } const actionError = ref(null) const transferOpen = ref(false) const detainedOpen = ref(false)