From aef02273ad9bbdfaf6711915608b12ee2a4e0e93 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Tue, 11 Aug 2026 21:37:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BE=A4=E4=BF=A1=E6=81=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=AD=90=E7=B1=BB=E5=9E=8B=E6=8C=89=E7=BE=A4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=8A=A8=E6=80=81=E7=BA=A6=E6=9D=9F=EF=BC=8C=E8=A1=A5?= =?UTF-8?q?=E5=85=A8warehouse/express=E5=AD=90=E7=B1=BB=E5=9E=8B=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inbox/inbox.ts | 2 +- src/views/inbox/group/index.vue | 46 ++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/api/inbox/inbox.ts b/src/api/inbox/inbox.ts index f32b5de1..bd5b9904 100644 --- a/src/api/inbox/inbox.ts +++ b/src/api/inbox/inbox.ts @@ -193,7 +193,7 @@ export function inboxGroupDisable(data: InboxGroupDisableParams) { export interface InboxGroupUpdateParams { id: number // 群记录主键ID groupType?: string // 群类型:store(货主) / warehouse(仓库) / express(快递) - subType?: string // 群子类型:after_sales(售后) / finance(财务) / receiving(收货) + subType?: string // 群子类型,值取决于groupType。store→after_sales/finance/receiving。warehouse→receiving/production/stockout/finance/all/customer_service/exception。express→pickup/after_sales storeId?: number // 关联货主ID expressInterfaces?: number[] // 快递接口ID数组,仅groupType=express时生效 systemExpressCode?: string // 系统快递编码,groupType=express时必填 diff --git a/src/views/inbox/group/index.vue b/src/views/inbox/group/index.vue index ed892fba..9d137d08 100644 --- a/src/views/inbox/group/index.vue +++ b/src/views/inbox/group/index.vue @@ -148,11 +148,14 @@ - + - - - + @@ -244,12 +247,42 @@ import { safeInvoke } from '@/utils/safe-invoke' const groupTypeLabelMap: Record = { store: '货主群', warehouse: '仓库群', express: '快递群' } const groupTypeTagTypeMap: Record = { store: 'primary', warehouse: 'warning', express: 'success' } -const subTypeLabelMap: Record = { after_sales: '售后', finance: '财务', receiving: '收货' } +const subTypeLabelMap: Record = { + after_sales: '售后', finance: '财务', receiving: '收货', + production: '生产', stockout: '出库', all: '全体', customer_service: '客服', exception: '异常', + pickup: '揽收', +} function groupTypeLabel(t: string) { return groupTypeLabelMap[t] ?? t ?? '-' } function groupTypeTagType(t: string) { return groupTypeTagTypeMap[t] ?? 'info' } function subTypeLabel(s: string) { return subTypeLabelMap[s] ?? s ?? '-' } +/** 子类型选项,受群类型约束 */ +const subTypeConfigMap: Record> = { + store: [ + { label: '售后', value: 'after_sales' }, + { label: '财务', value: 'finance' }, + { label: '收货', value: 'receiving' }, + ], + warehouse: [ + { label: '收货', value: 'receiving' }, + { label: '生产', value: 'production' }, + { label: '出库', value: 'stockout' }, + { label: '财务', value: 'finance' }, + { label: '全体', value: 'all' }, + { label: '客服', value: 'customer_service' }, + { label: '异常', value: 'exception' }, + ], + express: [ + { label: '揽收', value: 'pickup' }, + { label: '售后', value: 'after_sales' }, + ], +} + +function getSubTypeOptions(groupType: string) { + return subTypeConfigMap[groupType] ?? [] +} + // ==================== 配置 ==================== const availableFields = groupAvailableFields @@ -484,6 +517,7 @@ function onSystemExpressCodeChange() { } function onEditGroupTypeChange() { + editForm.subType = '' if (editForm.groupType !== 'express') { editForm.expressInterfaces = []; editForm.systemExpressCode = '' } if (editForm.groupType !== 'store') editForm.storeId = null if (editForm.groupType === 'express') { loadExpressCodes(); loadExpressInterfacesByCode() } @@ -496,7 +530,7 @@ async function handleSubmitEdit() { try { const params: any = { id: editingRow.value.id } if (editForm.groupType) params.groupType = editForm.groupType - if (editForm.groupType !== 'express' && editForm.subType) params.subType = editForm.subType + if (editForm.subType) params.subType = editForm.subType if (editForm.groupType === 'store' && editForm.storeId) params.storeId = editForm.storeId if (editForm.groupType === 'express') { params.expressInterfaces = editForm.expressInterfaces; params.systemExpressCode = editForm.systemExpressCode } params.aiEnabled = editForm.aiEnabled