diff --git a/dist.tar.gz b/dist.tar.gz index 9589bf33..daaa0240 100644 Binary files a/dist.tar.gz and b/dist.tar.gz differ diff --git a/src/api/order.pendingOrder/orderpendingOrder.ts b/src/api/order.pendingOrder/orderpendingOrder.ts index 235b45fa..c7dcc980 100644 --- a/src/api/order.pendingOrder/orderpendingOrder.ts +++ b/src/api/order.pendingOrder/orderpendingOrder.ts @@ -1,8 +1,12 @@ import request from "@/utils/request"; +import { orderModulePendingOrderDownloadCreateTemplate } from "@/api/order/order"; const v = "1.0"; export type { OrderWorkbenchListResponse, OrderListPagination } from '@/api/order.index/orderindex' +export type { PendingOrderDownloadCreateTemplateResponse } from '@/api/order/order' + +export const orderPendingOrderDownloadCreateTemplate = orderModulePendingOrderDownloadCreateTemplate; // 啊大王大大 @@ -69,12 +73,19 @@ export type PendingOrderUpdateAddressParams = { area?: string; town?: string; detail_address?: string; + /** 订单留言/备注,对应列表字段 remark */ + remark?: string; }; export type PendingOrderCloneOrderParams = { order_id: number; }; +export type PendingOrderManualWaybillParams = { + order_id: number; + waybill_code: string; +}; + export type PendingOrderCreateOrderItem = { item_id: number; plan_qty: number; @@ -100,6 +111,7 @@ export type PendingOrderCreateOrderParams = { logistics_name?: string; sys_platform_code?: string; shop_nick?: string; + remark?: string; source_platform_code?: string; source_order_codes?: string; order_type?: string; @@ -449,6 +461,23 @@ export function orderPendingOrderCloneOrder(data: PendingOrderCloneOrderParams): } as any); } +/** order.pendingOrder.manualWaybill:手工录入运单号 */ +export function orderPendingOrderManualWaybill( + data: PendingOrderManualWaybillParams, +): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.manualWaybill", + v, + timestamp: Date.now(), + }, + data, + isSystemApi: true, + } as any); +} + export function orderPendingOrderCreateOrder(data: PendingOrderCreateOrderParams): Promise { return request({ url: "/system", @@ -630,8 +659,10 @@ export type OrderPendingOrderApi = { updateOrderExpress: typeof orderPendingOrderUpdateOrderExpress; updateAddress: typeof orderPendingOrderUpdateAddress; cloneOrder: typeof orderPendingOrderCloneOrder; + manualWaybill: typeof orderPendingOrderManualWaybill; createOrder: typeof orderPendingOrderCreateOrder; importOrdersFromExcel: typeof orderPendingOrderImportOrdersFromExcel; + downloadCreateTemplate: typeof orderPendingOrderDownloadCreateTemplate; parseAddress: typeof orderPendingOrderParseAddress; batchIntercept: typeof orderPendingOrderBatchIntercept; batchInterceptTaskProgress: typeof orderPendingOrderBatchInterceptTaskProgress; @@ -658,8 +689,10 @@ export const orderPendingOrder: OrderPendingOrderApi = { updateOrderExpress: orderPendingOrderUpdateOrderExpress, updateAddress: orderPendingOrderUpdateAddress, cloneOrder: orderPendingOrderCloneOrder, + manualWaybill: orderPendingOrderManualWaybill, createOrder: orderPendingOrderCreateOrder, importOrdersFromExcel: orderPendingOrderImportOrdersFromExcel, + downloadCreateTemplate: orderPendingOrderDownloadCreateTemplate, parseAddress: orderPendingOrderParseAddress, batchIntercept: orderPendingOrderBatchIntercept, batchInterceptTaskProgress: orderPendingOrderBatchInterceptTaskProgress, diff --git a/src/layout/component/CreateOrderSessionHost.vue b/src/layout/component/CreateOrderSessionHost.vue new file mode 100644 index 00000000..25d8e278 --- /dev/null +++ b/src/layout/component/CreateOrderSessionHost.vue @@ -0,0 +1,15 @@ + + + diff --git a/src/layout/index.vue b/src/layout/index.vue index f4dd2846..dc6879a6 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -12,6 +12,7 @@
+
@@ -30,6 +31,7 @@ import { useAiStore } from '@/stores/modules/ai' import Sidebar from './component/Sidebar/index.vue' import TaskView from './component/TaskView/index.vue' import AppMain from './component/AppMain.vue' +import CreateOrderSessionHost from './component/CreateOrderSessionHost.vue' import AiChat from './component/AiChat/index.vue' import { useWindowSize } from '@vueuse/core' diff --git a/src/views/order/orderManagement/archiveOrder.vue b/src/views/order/orderManagement/archiveOrder.vue index 4822aff8..663793d4 100644 --- a/src/views/order/orderManagement/archiveOrder.vue +++ b/src/views/order/orderManagement/archiveOrder.vue @@ -16,18 +16,14 @@
- - {{ resolveButtonLabel(button.label, button.dynamicLabelKey) }} - +
@@ -152,6 +148,7 @@ import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue import { createOrderPageExport } from './utils/order-page-export' import { parseOrderListResponse } from './utils/order-index-helpers' import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane' +import OrderToolbarButtonGroup from './component/OrderToolbarButtonGroup.vue' import { createSimpleListToolbarController } from './utils/toolbar-actions' import { safeInvoke } from '@/utils/safe-invoke' @@ -396,6 +393,14 @@ const buttonLabelMap = computed>(() => ({ detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情' })) +const toolbarLayoutKey = computed(() => + JSON.stringify({ + loading: buttonLoadingMap.value, + disabled: buttonDisabledMap.value, + labels: buttonLabelMap.value + }) +) + const { actionMap: toolbarActionMap } = createSimpleListToolbarController({ loadData, handleExport, diff --git a/src/views/order/orderManagement/component/CreateOrderFloatWidget.vue b/src/views/order/orderManagement/component/CreateOrderFloatWidget.vue new file mode 100644 index 00000000..cc498f84 --- /dev/null +++ b/src/views/order/orderManagement/component/CreateOrderFloatWidget.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/views/order/orderManagement/component/CreatePendingOrderDialog.vue b/src/views/order/orderManagement/component/CreatePendingOrderDialog.vue index 41e66098..5feee557 100644 --- a/src/views/order/orderManagement/component/CreatePendingOrderDialog.vue +++ b/src/views/order/orderManagement/component/CreatePendingOrderDialog.vue @@ -1,13 +1,22 @@ + + diff --git a/src/views/order/orderManagement/composables/useCreateOrderSession.ts b/src/views/order/orderManagement/composables/useCreateOrderSession.ts new file mode 100644 index 00000000..a18be657 --- /dev/null +++ b/src/views/order/orderManagement/composables/useCreateOrderSession.ts @@ -0,0 +1,90 @@ +import { ref, shallowRef } from 'vue' + +export type CreateOrderFloatSummary = { + rowCount: number + orderCount: number + loading: boolean + parsing: boolean +} + +const dialogVisible = ref(false) +const minimized = ref(false) +const sessionActive = ref(false) +const resetToken = ref(0) +const floatSummary = ref({ + rowCount: 0, + orderCount: 0, + loading: false, + parsing: false +}) + +const successCallbacks = shallowRef(new Set<() => void | Promise>()) + +export function useCreateOrderSession() { + function openCreateOrderDialog() { + sessionActive.value = true + dialogVisible.value = true + minimized.value = false + } + + function minimizeCreateOrderDialog() { + dialogVisible.value = false + minimized.value = true + sessionActive.value = true + } + + function restoreCreateOrderDialog() { + if (!sessionActive.value) { + openCreateOrderDialog() + return + } + dialogVisible.value = true + minimized.value = false + } + + function closeCreateOrderSession() { + dialogVisible.value = false + minimized.value = false + sessionActive.value = false + resetToken.value += 1 + floatSummary.value = { + rowCount: 0, + orderCount: 0, + loading: false, + parsing: false + } + } + + function updateFloatSummary(patch: Partial) { + floatSummary.value = { ...floatSummary.value, ...patch } + } + + function registerCreateOrderSuccess(callback: () => void | Promise) { + successCallbacks.value.add(callback) + } + + function unregisterCreateOrderSuccess(callback: () => void | Promise) { + successCallbacks.value.delete(callback) + } + + async function notifyCreateOrderSuccess() { + const tasks = Array.from(successCallbacks.value).map((cb) => cb()) + await Promise.allSettled(tasks) + } + + return { + dialogVisible, + minimized, + sessionActive, + resetToken, + floatSummary, + openCreateOrderDialog, + minimizeCreateOrderDialog, + restoreCreateOrderDialog, + closeCreateOrderSession, + updateFloatSummary, + registerCreateOrderSuccess, + unregisterCreateOrderSuccess, + notifyCreateOrderSuccess + } +} diff --git a/src/views/order/orderManagement/config/order-common-config.ts b/src/views/order/orderManagement/config/order-common-config.ts index 3ec8d734..e2751e6f 100644 --- a/src/views/order/orderManagement/config/order-common-config.ts +++ b/src/views/order/orderManagement/config/order-common-config.ts @@ -259,6 +259,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record = { action: 'handleWaveSingleFetchByIds' }, allocateExpress: { key: 'allocateExpress', label: '分配快递号', size: 'small', type: 'success', loadingKey: 'allocateLoading', disabledKey: 'hasNoSelection', action: 'openAllocateExpressDialog' }, + manualWaybill: { key: 'manualWaybill', label: '录入运单号', size: 'small', type: 'primary', plain: true, loadingKey: 'manualWaybillLoading', disabledKey: 'notSingleSelection', action: 'openManualWaybillDialog' }, updateExpress: { key: 'updateExpress', label: '修改快递', size: 'small', type: 'warning', plain: true, loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderExpressDialog' }, updatePlatform: { key: 'updatePlatform', label: '修改平台', size: 'small', type: 'info', plain: true, loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderPlatformDialog' }, updateAddress: { key: 'updateAddress', label: '修改地址', size: 'small', type: 'warning', plain: true, loadingKey: 'updateAddressLoading', disabledKey: 'hasNoSelection', action: 'openUpdateAddressDialog' }, @@ -1273,6 +1274,7 @@ export const pendingToolbarButtonKeys = [ 'allocateStorage', 'cancelAllocateStorage', 'allocateExpress', + 'manualWaybill', 'updateExpress', 'updatePlatform', 'updateAddress', diff --git a/src/views/order/orderManagement/deliveryException.vue b/src/views/order/orderManagement/deliveryException.vue index b6ad4e09..d8a8d5b7 100644 --- a/src/views/order/orderManagement/deliveryException.vue +++ b/src/views/order/orderManagement/deliveryException.vue @@ -16,18 +16,14 @@
- - {{ resolveButtonLabel(button.label, button.dynamicLabelKey) }} - +
@@ -152,6 +148,7 @@ import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue import { createOrderPageExport } from './utils/order-page-export' import { parseOrderListResponse } from './utils/order-index-helpers' import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane' +import OrderToolbarButtonGroup from './component/OrderToolbarButtonGroup.vue' import { createSimpleListToolbarController } from './utils/toolbar-actions' import { safeInvoke } from '@/utils/safe-invoke' @@ -396,6 +393,14 @@ const buttonLabelMap = computed>(() => ({ detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情' })) +const toolbarLayoutKey = computed(() => + JSON.stringify({ + loading: buttonLoadingMap.value, + disabled: buttonDisabledMap.value, + labels: buttonLabelMap.value + }) +) + const { actionMap: toolbarActionMap } = createSimpleListToolbarController({ loadData, handleExport, diff --git a/src/views/order/orderManagement/deliveryOrder.vue b/src/views/order/orderManagement/deliveryOrder.vue index 7df528f1..9cff591f 100644 --- a/src/views/order/orderManagement/deliveryOrder.vue +++ b/src/views/order/orderManagement/deliveryOrder.vue @@ -15,28 +15,15 @@
-
-
- - {{ resolveButtonLabel(button.label, button.dynamicLabelKey) }} - -
+
+
@@ -227,12 +214,12 @@ import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue import { createOrderPageExport } from './utils/order-page-export' import { parseOrderListResponse, resolveOrderRecheckStatus } from './utils/order-index-helpers' import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane' +import OrderToolbarButtonGroup from './component/OrderToolbarButtonGroup.vue' import { createSimpleListToolbarController } from './utils/toolbar-actions' import { safeInvoke } from '@/utils/safe-invoke' const scanBox = ref(null) const upperTable = ref(null) -const scrollContainerRef = ref(null) const presetTree = ref([]) const availableFieldsRef = reactive(JSON.parse(JSON.stringify(deliveryAvailableFields))) const activeTab = ref('detail') @@ -270,36 +257,6 @@ function fetchDeliveryOrderDetail(data: Record) { }) } -const isDragging = ref(false) -const startX = ref(0) -const scrollLeft = ref(0) - -const handleToolbarWheel = (e: WheelEvent) => { - if (scrollContainerRef.value) { - e.preventDefault() - scrollContainerRef.value.scrollLeft += e.deltaY - } -} - -const handleMouseDown = (e: MouseEvent) => { - if (!scrollContainerRef.value) return - isDragging.value = true - startX.value = e.pageX - scrollContainerRef.value.offsetLeft - scrollLeft.value = scrollContainerRef.value.scrollLeft -} - -const handleMouseMove = (e: MouseEvent) => { - if (!isDragging.value || !scrollContainerRef.value) return - e.preventDefault() - const x = e.pageX - scrollContainerRef.value.offsetLeft - const walk = (x - startX.value) * 1.5 - scrollContainerRef.value.scrollLeft = scrollLeft.value - walk -} - -const handleMouseUp = () => { - isDragging.value = false -} - const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({ defaultLowerPercent: 38 }) @@ -514,6 +471,14 @@ const buttonLabelMap = computed>(() => ({ detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情' })) +const toolbarLayoutKey = computed(() => + JSON.stringify({ + loading: buttonLoadingMap.value, + disabled: buttonDisabledMap.value, + labels: buttonLabelMap.value + }) +) + const { actionMap: toolbarActionMap } = createSimpleListToolbarController({ loadData, handleExport, @@ -547,29 +512,6 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) { diff --git a/src/views/order/orderManagement/form/UpdateAddressForm.vue b/src/views/order/orderManagement/form/UpdateAddressForm.vue index 1bf38724..5e5c847d 100644 --- a/src/views/order/orderManagement/form/UpdateAddressForm.vue +++ b/src/views/order/orderManagement/form/UpdateAddressForm.vue @@ -13,7 +13,7 @@ show-icon class="update-address-alert" title="修改限制" - description="仅允许修改 post_status='none'(未分配快递)的订单。至少填写一项地址字段,空白字段不会更新到订单。" + description="地址字段仅允许修改 post_status='none'(未分配快递)的订单;留言不受此限制。至少填写一项地址字段或留言,空白字段不会更新到订单。" /> @@ -98,6 +98,18 @@ placeholder="留空则不修改" /> + + +