From 6d2f39a4c96aa495bb10abce3388fb00a7c0f676 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Thu, 21 May 2026 03:42:13 +0800 Subject: [PATCH] 521 --- src/api/index/index.ts | 15 + src/api/order.print/orderprint.ts | 6 +- .../storeWarehouse.store/storeWarehouse.ts | 25 +- .../WavePlatformPrintPreviewDialog.vue | 94 +++- .../order/waveOrder/config/wave-config.ts | 12 + src/views/store/component/detail.vue | 12 +- src/views/store/index.vue | 513 +++++++++++++++++- src/views/store/store-config.ts | 7 +- 8 files changed, 627 insertions(+), 57 deletions(-) diff --git a/src/api/index/index.ts b/src/api/index/index.ts index a5930453..190e9665 100644 --- a/src/api/index/index.ts +++ b/src/api/index/index.ts @@ -210,6 +210,21 @@ export function listInterfaceTypes() { } as any) } +/** 获取奇门 ERP 应用列表(用于选择 ERP / AppKey) */ +export function getQimenAppList(data?: Record) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'index.getQimenAppList', + v: '1.0', + timestamp: new Date().getTime() + }, + data: data ?? {}, + isSystemApi: true + } as any) +} + export function searchSpace(data:any){ return request({ url: '/system', diff --git a/src/api/order.print/orderprint.ts b/src/api/order.print/orderprint.ts index f171d365..ee0febed 100644 --- a/src/api/order.print/orderprint.ts +++ b/src/api/order.print/orderprint.ts @@ -19,12 +19,16 @@ export type GetWavePlatformPrintDataParams = { wave_ids: Array } -/** 接口文档:summary / wave_ids / waveGroups(主)/ platform_groups、order_list(兼容)/ ext */ +/** 接口文档:summary / wave_ids / waveGroups(主)/ locked_wave_groups(锁定)/ platform_groups、order_list(兼容)/ ext */ export type WavePlatformPrintDataPayload = { summary?: Record wave_ids?: Array /** 主返回:波次 → 平台 → 订单 */ waveGroups?: unknown[] + /** 锁定波次:结构与 waveGroups 一致 */ + locked_wave_groups?: unknown[] + locked_orders?: Record[] + locked_count?: number platform_groups?: unknown[] order_list?: Record[] ext?: Record diff --git a/src/api/storeWarehouse.store/storeWarehouse.ts b/src/api/storeWarehouse.store/storeWarehouse.ts index c4b1c64a..d99600e2 100644 --- a/src/api/storeWarehouse.store/storeWarehouse.ts +++ b/src/api/storeWarehouse.store/storeWarehouse.ts @@ -156,6 +156,27 @@ export function storeWarehouseAdjustPrintQuantity(data: { } as any) } +/** 按 store_id 分页查询面单余额变更日志 */ +export function storeWarehouseQueryPrintQuantityLogs(data: { + store_id: number | string + pagination?: { + page?: number + page_size?: number + } +}) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storeWarehouse.store.queryPrintQuantityLogs', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + /** 查询签约关系下的奇门接口配置列表 */ export function listApiConfig(data: { @@ -177,7 +198,7 @@ export function listApiConfig(data: { /** 保存接口配置(新增或更新) * - app_name:必传,不再自动生成 - * - QM_WMS 类型:须填写 qimen_app_key / qimen_customer_id / qimen_warehouse_code + * - QM_WMS 类型:须填写 qimen_app_key(ERP)/ qimen_warehouse_code * - OPEN_API 类型:系统自动生成 self_app_key(WMS+32位HEX)和 self_app_secret(64位HEX),无需传入奇门字段 */ export function saveApiConfig(data: { @@ -185,8 +206,8 @@ export function saveApiConfig(data: { interface_type_id: number /** 应用名称(必传,不再自动生成) */ app_name: string + /** ERP AppKey(来自 index.getQimenAppList 下拉选择) */ qimen_app_key?: string - qimen_customer_id?: string qimen_warehouse_code?: string api_version?: string contact_person?: string diff --git a/src/views/order/waveOrder/component/WavePlatformPrintPreviewDialog.vue b/src/views/order/waveOrder/component/WavePlatformPrintPreviewDialog.vue index 7c76cc77..eb83959c 100644 --- a/src/views/order/waveOrder/component/WavePlatformPrintPreviewDialog.vue +++ b/src/views/order/waveOrder/component/WavePlatformPrintPreviewDialog.vue @@ -32,11 +32,12 @@
仓库:{{ requestMeta?.warehouse_id ?? '—' }} 请求波次:{{ requestMeta?.wave_ids?.length ?? 0 }} - 返回波次:{{ waveGroupList.length }} + 返回普通波次:{{ waveGroupList.length }} + 返回锁定波次:{{ lockedWaveGroupList.length }}
-

波次 / 平台列表

+

普通波次 / 平台列表

@@ -73,6 +74,45 @@

(无 waveGroups)

+ +
+

锁定波次 / 平台列表

+
+
+
+
+ 波次: + {{ wave.wave_no }} + | + ID: + {{ wave.wave_id }} +
+
+ 平台 {{ wave.platforms.length }} + 锁定订单 {{ wave.order_count }} +
+
+ +
+
+
+
+ {{ + platform.sys_logistics_name + }} + | + {{ platform.platform_name }} + {{ platform.platform }} +
+ 锁定订单 {{ platform.order_count }} +
+
+
+

(该锁定波次无平台数据)

+
+
+

(无 locked_wave_groups)

+
(无数据)
@@ -149,17 +189,7 @@ const visibleProxy = computed({ set: (v: boolean) => emit('update:modelValue', v) }) -watch( - () => props.modelValue, - (visible) => { - if (visible) { - void loadStationOptions() - } - } -) - -const waveGroupList = computed(() => { - const groups = props.payload?.waveGroups +function buildWaveGroupList(groups: unknown[] | null | undefined, groupKeyPrefix = 'normal'): WaveGroupView[] { if (!Array.isArray(groups)) return [] return groups .filter((x) => x && typeof x === 'object') @@ -179,7 +209,7 @@ const waveGroupList = computed(() => { const sys_logistics_name = logisticsRaw != null && String(logisticsRaw).trim() !== '' ? String(logisticsRaw).trim() : '' return { - platformKey: `${wave_id}-${platformCode}-${platformIndex}`, + platformKey: `${groupKeyPrefix}-${wave_id}-${platformCode}-${platformIndex}`, platform: platformCode, platform_name: platformName, sys_logistics_name, @@ -187,19 +217,40 @@ const waveGroupList = computed(() => { } }) return { - waveKey: `${wave_id}-${wave_no}-${waveIndex}`, + waveKey: `${groupKeyPrefix}-${wave_id}-${wave_no}-${waveIndex}`, wave_id, wave_no, order_count: toNum(wave.order_count, platforms.reduce((sum, p) => sum + p.order_count, 0)), platforms } }) +} + +watch( + () => props.modelValue, + (visible) => { + if (visible) { + void loadStationOptions() + } + } +) + +const waveGroupList = computed(() => { + return buildWaveGroupList(props.payload?.waveGroups, 'normal') +}) + +const lockedWaveGroupList = computed(() => { + return buildWaveGroupList(props.payload?.locked_wave_groups, 'locked') }) const hasWaveGroups = computed(() => { return waveGroupList.value.length > 0 }) +const hasLockedWaveGroups = computed(() => { + return lockedWaveGroupList.value.length > 0 +}) + function toText(v: unknown, fallback = '—'): string { if (v === null || v === undefined) return fallback const s = String(v).trim() @@ -358,6 +409,9 @@ async function printToStation() { requestCode: buildExpressRequestCode(), data: { waveGroups: props.payload.waveGroups || [], + locked_wave_groups: props.payload.locked_wave_groups || [], + locked_orders: props.payload.locked_orders || [], + locked_count: props.payload.locked_count ?? 0, wave_ids: props.payload.wave_ids || [], summary: props.payload.summary || {}, request_meta: props.requestMeta || {} @@ -502,6 +556,11 @@ function escapeHtml(s: string) { background: #fff; overflow: hidden; + &--locked { + border-color: #f3d19e; + background: #fffcf5; + } + &__header { display: flex; justify-content: space-between; @@ -550,6 +609,11 @@ function escapeHtml(s: string) { border-radius: 4px; padding: 6px 8px; + &--locked { + border-color: #f8d2d2; + background: #fff7f7; + } + &__header { display: flex; justify-content: space-between; diff --git a/src/views/order/waveOrder/config/wave-config.ts b/src/views/order/waveOrder/config/wave-config.ts index 317a095c..3073c8e5 100644 --- a/src/views/order/waveOrder/config/wave-config.ts +++ b/src/views/order/waveOrder/config/wave-config.ts @@ -491,6 +491,15 @@ export function unwrapWavePlatformPrintPayload(res: unknown): WavePlatformPrintD const waveGroups = Array.isArray(inner?.waveGroups) ? inner.waveGroups : normalizeWaveGroups((inner as Record).wave_list) + const locked_wave_groups = Array.isArray(inner?.locked_wave_groups) + ? normalizeWaveGroups(inner.locked_wave_groups) + : undefined + const locked_orders = toOrderList(inner?.locked_orders) + const locked_count_raw = (inner as Record)?.locked_count + const locked_count = + locked_count_raw !== undefined && locked_count_raw !== null && Number.isFinite(Number(locked_count_raw)) + ? Number(locked_count_raw) + : undefined const platform_groups = Array.isArray(inner?.platform_groups) ? inner.platform_groups : undefined const order_list = toOrderList(inner?.order_list) const extRaw = inner?.ext @@ -499,6 +508,9 @@ export function unwrapWavePlatformPrintPayload(res: unknown): WavePlatformPrintD summary, wave_ids, waveGroups, + locked_wave_groups, + locked_orders: locked_orders.length ? locked_orders : undefined, + locked_count, platform_groups, order_list: order_list.length ? order_list : undefined, ext diff --git a/src/views/store/component/detail.vue b/src/views/store/component/detail.vue index 2c34086b..eac62b0c 100644 --- a/src/views/store/component/detail.vue +++ b/src/views/store/component/detail.vue @@ -28,13 +28,13 @@ 未配置 @@ -58,13 +58,13 @@ 未配置 @@ -104,6 +104,10 @@ const props = defineProps({ const emit = defineEmits(['view-detail']) +function getQimenErpDisplay(config: any): string { + return String(config?.erp_name || config?.erpName || config?.qimen_app_key || '').trim() || '—' +} + // 将字段平分为左右两列 const leftFields = computed(() => { const mid = Math.ceil(detailPanel.length / 2) diff --git a/src/views/store/index.vue b/src/views/store/index.vue index 3aa3c9e1..dcec3652 100644 --- a/src/views/store/index.vue +++ b/src/views/store/index.vue @@ -148,14 +148,91 @@ +
- - +
+ 刷新 +
+ 变动记录:{{ balanceLogPagination.total }} +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + {{ cfg.interface_name || cfg.interface_category || cfg.interface_code }}
- AppKey:{{ cfg.qimen_app_key }} - 客户ID:{{ cfg.qimen_customer_id }} + ERP:{{ getQimenErpDisplay(cfg) }} 仓库编码:{{ cfg.qimen_warehouse_code }}
@@ -324,8 +400,7 @@
- AppKey:{{ detailDialog.row.qimen_config.qimen_app_key }} - 客户ID:{{ detailDialog.row.qimen_config.qimen_customer_id }} + ERP:{{ getQimenErpDisplay(detailDialog.row.qimen_config) }} 仓库编码:{{ detailDialog.row.qimen_config.qimen_warehouse_code }}
@@ -609,18 +684,43 @@