This commit is contained in:
yin 2026-08-06 18:16:33 +08:00
parent c69d332b1b
commit 78f638a3e8
22 changed files with 529 additions and 265 deletions

View File

@ -192,6 +192,7 @@ export interface InboxGroupUpdateParams {
storeId?: number // 关联货主ID storeId?: number // 关联货主ID
expressInterfaces?: number[] // 快递接口ID数组,仅groupType=express时生效 expressInterfaces?: number[] // 快递接口ID数组,仅groupType=express时生效
systemExpressCode?: string // 系统快递编码,groupType=express时必填 systemExpressCode?: string // 系统快递编码,groupType=express时必填
aiEnabled?: number // 是否启用AI自动回复: 0=关闭 1=开启,默认1
} }
/** 修改群信息(inbox.group.update) */ /** 修改群信息(inbox.group.update) */

View File

@ -434,6 +434,7 @@
<div v-if="field.type === 'select'" class="compact-field-item"> <div v-if="field.type === 'select'" class="compact-field-item">
<el-select <el-select
v-model="customConditions[field.value].value" v-model="customConditions[field.value].value"
:multiple="!!field.multiple"
:placeholder="field.label" :placeholder="field.label"
size="small" size="small"
clearable clearable
@ -533,11 +534,36 @@
</div> </div>
<!-- 文本类型(默认) --> <!-- 文本类型(默认) -->
<div v-else class="compact-field-item"> <div v-else class="compact-field-item">
<div v-if="getOperators(field).length > 1" class="compact-field-control">
<el-select
v-model="customConditions[field.value].operator"
size="small"
class="compact-operator-select"
@change="handleCompactChange"
>
<el-option
v-for="op in getOperators(field)"
:key="op.value"
:label="op.label"
:value="op.value"
/>
</el-select>
<el-input
v-model="customConditions[field.value].value"
:placeholder="field.label"
size="small"
clearable
class="compact-value-input"
@change="handleCompactChange"
/>
</div>
<el-input <el-input
v-else
v-model="customConditions[field.value].value" v-model="customConditions[field.value].value"
:placeholder="field.label" :placeholder="field.label"
size="small" size="small"
clearable clearable
style="width: 100%"
@change="handleCompactChange" @change="handleCompactChange"
/> />
</div> </div>
@ -716,9 +742,6 @@ function handleCompactChange() {
} }
} }
} }
if (!hasValue) {
condition.operator = ''
}
}) })
scheduleSaveSnapshot() scheduleSaveSnapshot()
if (props.autoSubmit) { if (props.autoSubmit) {
@ -1895,7 +1918,7 @@ defineExpose({ getConditions, reset, clear, getFieldDraft, setFieldCondition, su
.compact-fields { .compact-fields {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding: 8px 10px; padding: 8px 12px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 6px; gap: 6px;
@ -1914,4 +1937,31 @@ defineExpose({ getConditions, reset, clear, getFieldDraft, setFieldCondition, su
width: 100%; width: 100%;
} }
/* 紧凑模式输入框高度微调 */
.compact-field-item :deep(.el-input__wrapper) {
min-height: 28px;
}
/* 紧凑模式文本字段:操作符选择 + 输入框并排 */
.compact-field-control {
display: flex;
gap: 4px;
width: 100%;
}
.compact-operator-select {
width: 70px;
flex-shrink: 0;
}
.compact-value-input {
flex: 1;
min-width: 0;
}
/* 紧凑模式下底部操作栏与字段区域保持一致的左右间距 */
.scan-box--compact .fixed-bottom-actions {
padding: 10px 12px;
}
</style> </style>

View File

@ -74,6 +74,8 @@ export default {
'PackingFlow':'Packing Flow', 'PackingFlow':'Packing Flow',
'printcomputer':'Print Computer', 'printcomputer':'Print Computer',
'waybill':'waybill', 'waybill':'waybill',
'inbox_messages':'messages',
'inbox_groups':'groups',
'':'', '':'',
'':'', '':'',
'':'', '':'',

View File

@ -77,8 +77,8 @@ export default {
'PackingFlow':'打包流水', 'PackingFlow':'打包流水',
'printcomputer':'打印电脑', 'printcomputer':'打印电脑',
'waybill':'运单', 'waybill':'运单',
'':'', 'inbox_messages':'消息',
'':'', 'inbox_groups':'群组',
'':'', '':'',
'':'', '':'',
'':'', '':'',

View File

@ -41,6 +41,7 @@ export const groupColumns = [
{ prop: 'system_express_code', label: '系统快递编码', minWidth: '140', showOverflowTooltip: true }, { prop: 'system_express_code', label: '系统快递编码', minWidth: '140', showOverflowTooltip: true },
{ prop: 'is_blocked', label: '状态', width: '80' }, { prop: 'is_blocked', label: '状态', width: '80' },
{ prop: 'created_at', label: '创建时间', width: '170' }, { prop: 'created_at', label: '创建时间', width: '170' },
{ prop: 'actions', label: '操作', width: '220', fixed: 'right' },
] ]
// ============================================================ // ============================================================
@ -50,8 +51,7 @@ export const groupToolbarButtons: ToolbarButtonConfig[] = [
{ {
key: 'refresh', key: 'refresh',
label: '刷新', label: '刷新',
type: 'primary', category: 'refresh',
icon: 'Refresh', action: 'loadData',
plain: false,
}, },
] ]

View File

@ -10,21 +10,14 @@
@condition-change="handleConditionChange" @condition-change="handleConditionChange"
@reset="handleConditionReset" @reset="handleConditionReset"
@condition-clear="handleConditionClear" @condition-clear="handleConditionClear"
> />
<template #filter-header>
<div style="padding: 8px 0">
<el-button type="primary" size="small" style="width: 100%" @click="showBindDialog">
生成绑群码
</el-button>
</div>
</template>
</scan-box>
<div class="main-content"> <div class="main-content">
<div class="toolbar"> <div class="toolbar">
<div class="toolbar-left"> <div class="toolbar-left">
<el-button type="primary" size="small" @click="showBindDialog">生成绑群码</el-button>
<el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button> <el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button>
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> <!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
</div> </div>
</div> </div>
@ -71,6 +64,14 @@
</el-tag> </el-tag>
</template> </template>
<template #column-actions="{ row }">
<el-button size="small" type="primary" link @click.stop="handleEdit(row)">编辑</el-button>
<el-button size="small" :type="row.is_blocked ? 'success' : 'danger'" link @click.stop="handleToggleDisable(row)">
{{ row.is_blocked ? '启用' : '禁用' }}
</el-button>
<el-button size="small" type="primary" link @click.stop="handleViewMessages(row)">消息</el-button>
</template>
<template #empty> <template #empty>
<div class="empty-tip">暂无群组数据</div> <div class="empty-tip">暂无群组数据</div>
</template> </template>
@ -82,7 +83,7 @@
<!-- ========== 弹窗 ========== --> <!-- ========== 弹窗 ========== -->
<!-- 生成绑群码弹窗 --> <!-- 生成绑群码弹窗 -->
<el-dialog v-model="bindDialogVisible" title="生成绑群码" width="550px" destroy-on-close @closed="resetBindForm"> <el-dialog v-model="bindDialogVisible" title="生成绑群码" width="550px" align-center destroy-on-close @closed="resetBindForm">
<el-form ref="bindFormRef" :model="bindForm" :rules="bindRules" label-width="100px" size="small"> <el-form ref="bindFormRef" :model="bindForm" :rules="bindRules" label-width="100px" size="small">
<el-form-item label="选择货主" prop="storeId"> <el-form-item label="选择货主" prop="storeId">
<el-select v-model="bindForm.storeId" placeholder="请选择货主" filterable style="width: 100%" :loading="storeLoading"> <el-select v-model="bindForm.storeId" placeholder="请选择货主" filterable style="width: 100%" :loading="storeLoading">
@ -118,7 +119,7 @@
</el-dialog> </el-dialog>
<!-- 编辑群信息弹窗 --> <!-- 编辑群信息弹窗 -->
<el-dialog v-model="editDialogVisible" title="编辑群信息" width="600px" destroy-on-close @closed="resetEditForm"> <el-dialog v-model="editDialogVisible" align-center title="编辑群信息" width="600px" destroy-on-close @closed="resetEditForm">
<el-form ref="editFormRef" :model="editForm" :rules="editRules" label-width="110px" size="small"> <el-form ref="editFormRef" :model="editForm" :rules="editRules" label-width="110px" size="small">
<el-form-item label="群ID"><el-input :model-value="editForm.groupId" disabled /></el-form-item> <el-form-item label="群ID"><el-input :model-value="editForm.groupId" disabled /></el-form-item>
<el-form-item label="群名称"><el-input :model-value="editForm.groupName" disabled /></el-form-item> <el-form-item label="群名称"><el-input :model-value="editForm.groupName" disabled /></el-form-item>
@ -142,10 +143,17 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="editForm.groupType === 'express'" label="快递接口" prop="expressInterfaces"> <el-form-item v-if="editForm.groupType === 'express'" label="快递接口" prop="expressInterfaces">
<el-select v-model="editForm.expressInterfaces" placeholder="请选择快递接口(空=全部)" multiple filterable style="width: 100%" /> <el-select v-model="editForm.expressInterfaces" placeholder="请选择快递接口(空=全部)" multiple filterable style="width: 100%" :loading="expressLoading">
<el-option v-for="item in expressInterfaceOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item> </el-form-item>
<el-form-item v-if="editForm.groupType === 'express'" label="系统快递编码" prop="systemExpressCode"> <el-form-item v-if="editForm.groupType === 'express'" label="系统快递编码" prop="systemExpressCode">
<el-input v-model="editForm.systemExpressCode" placeholder="请输入系统快递编码" /> <el-select v-model="editForm.systemExpressCode" placeholder="请选择系统快递编码" filterable clearable style="width: 100%" :loading="expressLoading">
<el-option v-for="item in expressCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="AI 自动回复">
<el-switch v-model="editForm.aiEnabled" :active-value="1" :inactive-value="0" active-text="开" inactive-text="关" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -155,7 +163,7 @@
</el-dialog> </el-dialog>
<!-- 群消息弹窗 --> <!-- 群消息弹窗 -->
<el-dialog v-model="messagesDialogVisible" :title="`群消息 - ${currentGroupName}`" width="900px" destroy-on-close> <el-dialog v-model="messagesDialogVisible" align-center :title="`群消息 - ${currentGroupName}`" width="900px" destroy-on-close>
<div class="msg-filter-bar"> <div class="msg-filter-bar">
<el-select v-model="msgFilter.direction" placeholder="消息方向" clearable size="small" style="width: 120px" @change="fetchGroupMessages"> <el-select v-model="msgFilter.direction" placeholder="消息方向" clearable size="small" style="width: 120px" @change="fetchGroupMessages">
<el-option label="入站" value="inbound" /> <el-option label="入站" value="inbound" />
@ -204,7 +212,9 @@ import {
inboxGroupMessages, inboxGroupMessages,
inboxBindCode, inboxBindCode,
} from '@/api/inbox/inbox' } from '@/api/inbox/inbox'
import { storeList as fetchStoreList } from '@/api/storeWarehouse.store/storeWarehouse' import { storeList as fetchStoreList } from '@/api/storewarehouse.store/storeWarehouse'
import { expressInterfaceList } from '@/api/setting.expressinterface/expressInterface'
import { expressIndexGetExpressList } from '@/api/setting.express/express'
import { groupAvailableFields, groupColumns } from './group-config' import { groupAvailableFields, groupColumns } from './group-config'
import ScanBox from '@/components/ScanBox/index.vue' import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue' import UpperTable from '@/components/UpperTable/index.vue'
@ -334,8 +344,12 @@ const editDialogVisible = ref(false)
const editLoading = ref(false) const editLoading = ref(false)
const editFormRef = ref<FormInstance>() const editFormRef = ref<FormInstance>()
const editingRow = ref<any>(null) const editingRow = ref<any>(null)
const editForm = reactive({ groupId: '', groupName: '', groupType: '' as string, subType: '' as string, storeId: null as number | null, expressInterfaces: [] as number[], systemExpressCode: '' as string }) const editForm = reactive({ groupId: '', groupName: '', groupType: '' as string, subType: '' as string, storeId: null as number | null, expressInterfaces: [] as number[], systemExpressCode: '' as string, aiEnabled: 1 as number })
const editRules: FormRules = { systemExpressCode: [{ validator: (_r, _v, cb) => { if (editForm.groupType === 'express' && !editForm.systemExpressCode) cb(new Error('快递类型时系统快递编码不能为空')); else cb() }, trigger: 'blur' }] } const editRules: FormRules = { systemExpressCode: [{ validator: (_r, _v, cb) => { if (editForm.groupType === 'express' && !editForm.systemExpressCode) cb(new Error('快递类型时系统快递编码不能为空')); else cb() }, trigger: 'change' }] }
const expressInterfaceOptions = ref<Array<{ label: string; value: number }>>([])
const expressCodeOptions = ref<Array<{ label: string; value: string }>>([])
const expressLoading = ref(false)
function handleEdit(row: any) { function handleEdit(row: any) {
editingRow.value = row editingRow.value = row
@ -344,12 +358,40 @@ function handleEdit(row: any) {
editForm.storeId = row.store_id ?? null editForm.storeId = row.store_id ?? null
editForm.expressInterfaces = Array.isArray(row.express_interfaces) ? [...row.express_interfaces] : [] editForm.expressInterfaces = Array.isArray(row.express_interfaces) ? [...row.express_interfaces] : []
editForm.systemExpressCode = row.system_express_code ?? '' editForm.systemExpressCode = row.system_express_code ?? ''
editForm.aiEnabled = row.ai_enabled ?? 1
editDialogVisible.value = true; loadStoreList() editDialogVisible.value = true; loadStoreList()
} }
function resetEditForm() { editFormRef.value?.resetFields(); editingRow.value = null } function resetEditForm() { editFormRef.value?.resetFields(); editingRow.value = null }
async function loadExpressOptions() {
expressLoading.value = true
try {
const [ifaceRes, expressRes]: any[] = await Promise.all([
expressInterfaceList({ pagination: { page: 1, pageSize: 200 } }),
expressIndexGetExpressList({ systemOnly: true }),
])
const ifaceList = ifaceRes?.data?.list || ifaceRes?.data || []
expressInterfaceOptions.value = ifaceList.map((item: any) => ({
label: `${item.name || item.express_code || ''}(${item.id})`,
value: item.id,
}))
const expressList = expressRes?.data?.list || expressRes?.data || []
expressCodeOptions.value = expressList.map((item: any) => ({
label: `${item.code || ''} - ${item.name || ''}`,
value: item.code || '',
}))
} catch {
expressInterfaceOptions.value = []
expressCodeOptions.value = []
} finally {
expressLoading.value = false
}
}
function onEditGroupTypeChange() { function onEditGroupTypeChange() {
if (editForm.groupType !== 'express') { editForm.expressInterfaces = []; editForm.systemExpressCode = '' } if (editForm.groupType !== 'express') { editForm.expressInterfaces = []; editForm.systemExpressCode = '' }
if (editForm.groupType !== 'store') editForm.storeId = null if (editForm.groupType !== 'store') editForm.storeId = null
if (editForm.groupType === 'express') loadExpressOptions()
} }
async function handleSubmitEdit() { async function handleSubmitEdit() {
@ -362,6 +404,7 @@ async function handleSubmitEdit() {
if (editForm.groupType !== 'express' && editForm.subType) params.subType = editForm.subType if (editForm.groupType !== 'express' && editForm.subType) params.subType = editForm.subType
if (editForm.groupType === 'store' && editForm.storeId) params.storeId = editForm.storeId if (editForm.groupType === 'store' && editForm.storeId) params.storeId = editForm.storeId
if (editForm.groupType === 'express') { params.expressInterfaces = editForm.expressInterfaces; params.systemExpressCode = editForm.systemExpressCode } if (editForm.groupType === 'express') { params.expressInterfaces = editForm.expressInterfaces; params.systemExpressCode = editForm.systemExpressCode }
params.aiEnabled = editForm.aiEnabled
const res: any = await inboxGroupUpdate(params) const res: any = await inboxGroupUpdate(params)
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) { if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
ElMessage.success(res.data?.message || res.message || '群信息修改成功') ElMessage.success(res.data?.message || res.message || '群信息修改成功')

View File

@ -16,8 +16,13 @@
<div class="toolbar"> <div class="toolbar">
<div class="toolbar-left"> <div class="toolbar-left">
<el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button> <el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button>
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
<el-tag v-if="queryTime > 0" size="small" effect="plain">{{ queryTime }}ms</el-tag> <el-tag v-if="queryTime > 0" size="small" effect="plain">{{ queryTime }}ms</el-tag>
<template v-if="statsData">
<el-divider direction="vertical" />
<el-tag size="small" type="primary">收件 {{ statsInbound }} | 回信 {{ statsOutbound }}</el-tag>
<el-tag size="small" type="success">24h 新增 {{ statsData.recent_24h_count ?? 0 }}</el-tag>
<el-tag v-for="s in statsStatusTags" :key="s.status" size="small" :type="s.type">{{ s.label }} {{ s.count }}</el-tag>
</template>
</div> </div>
</div> </div>
@ -48,7 +53,7 @@
<template #column-source_type="{ row }"> <template #column-source_type="{ row }">
<el-tag size="small" :type="row.source_type === 'api' ? '' : 'info'"> <el-tag size="small" :type="row.source_type === 'api' ? '' : 'info'">
{{ row.source_type === 'api' ? 'API' : row.source_type ?? '-' }} {{ sourceTypeLabel(row.source_type) }}
</el-tag> </el-tag>
</template> </template>
@ -74,6 +79,17 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
<template #column-actions="{ row }">
<!-- <el-button size="small" type="primary" link @click.stop="handleViewDetail(row)">详情</el-button> -->
<el-button size="small" type="success" link @click.stop="handleOpenReply(row)">回信</el-button>
<el-button
v-if="row.direction === 'outbound' && row.push_status === 3"
size="small" type="warning" link
@click.stop="handleRetry(row)"
>重推</el-button>
<el-button size="small" type="info" link @click.stop="handleViewThread(row)">对话链</el-button>
</template>
<template #empty> <template #empty>
<div class="empty-tip">暂无站内信消息数据</div> <div class="empty-tip">暂无站内信消息数据</div>
</template> </template>
@ -85,7 +101,7 @@
<!-- ========== 弹窗 ========== --> <!-- ========== 弹窗 ========== -->
<!-- 消息详情弹窗 --> <!-- 消息详情弹窗 -->
<el-dialog v-model="detailVisible" title="消息详情" width="750px" destroy-on-close> <el-dialog v-model="detailVisible" title="消息详情" width="750px" destroy-on-close align-center>
<div v-if="detailData" class="detail-content"> <div v-if="detailData" class="detail-content">
<el-descriptions :column="2" border size="small"> <el-descriptions :column="2" border size="small">
<el-descriptions-item label="消息ID">{{ detailData.id }}</el-descriptions-item> <el-descriptions-item label="消息ID">{{ detailData.id }}</el-descriptions-item>
@ -123,8 +139,8 @@
<el-descriptions-item label="已重试次数">{{ detailData.direction === 'outbound' ? (detailData.retry_count ?? 0) : '-' }}</el-descriptions-item> <el-descriptions-item label="已重试次数">{{ detailData.direction === 'outbound' ? (detailData.retry_count ?? 0) : '-' }}</el-descriptions-item>
<el-descriptions-item label="工单ID">{{ detailData.work_order_id ?? '-' }}</el-descriptions-item> <el-descriptions-item label="工单ID">{{ detailData.work_order_id ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="工单号">{{ detailData.work_order_no ?? '-' }}</el-descriptions-item> <el-descriptions-item label="工单号">{{ detailData.work_order_no ?? '-' }}</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ detailData.created_at ?? '-' }}</el-descriptions-item> <el-descriptions-item label="创建时间">{{ formatTime(detailData.created_at) }}</el-descriptions-item>
<el-descriptions-item label="更新时间">{{ detailData.updated_at ?? '-' }}</el-descriptions-item> <el-descriptions-item label="更新时间">{{ formatTime(detailData.updated_at) }}</el-descriptions-item>
<el-descriptions-item v-if="detailData.content" label="正文" :span="2"> <el-descriptions-item v-if="detailData.content" label="正文" :span="2">
<div class="content-text">{{ detailData.content }}</div> <div class="content-text">{{ detailData.content }}</div>
</el-descriptions-item> </el-descriptions-item>
@ -139,7 +155,7 @@
</el-dialog> </el-dialog>
<!-- 回信弹窗 --> <!-- 回信弹窗 -->
<el-dialog v-model="replyVisible" title="系统回信" width="550px" destroy-on-close @closed="resetReplyForm"> <el-dialog v-model="replyVisible" title="系统回信" width="550px" destroy-on-close @closed="resetReplyForm" align-center>
<el-form ref="replyFormRef" :model="replyForm" :rules="replyRules" label-width="100px" size="small"> <el-form ref="replyFormRef" :model="replyForm" :rules="replyRules" label-width="100px" size="small">
<el-form-item label="原消息ID"> <el-form-item label="原消息ID">
<el-input :model-value="replyForm.parentId" disabled /> <el-input :model-value="replyForm.parentId" disabled />
@ -174,13 +190,13 @@
</el-dialog> </el-dialog>
<!-- 对话链弹窗 --> <!-- 对话链弹窗 -->
<el-dialog v-model="threadVisible" title="对话链" width="800px" destroy-on-close> <el-dialog v-model="threadVisible" title="对话链" width="800px" destroy-on-close align-center>
<div v-if="threadData.length" class="thread-content"> <div v-if="threadData.length" class="thread-content">
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
v-for="item in threadData" v-for="item in threadData"
:key="item.id" :key="item.id"
:timestamp="item.created_at" :timestamp="formatTime(item.created_at)"
placement="top" placement="top"
:type="item.direction === 'inbound' ? 'primary' : 'success'" :type="item.direction === 'inbound' ? 'primary' : 'success'"
> >
@ -211,7 +227,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, reactive, ref } from 'vue' import { computed, onMounted, reactive, ref } from 'vue'
import { ElMessage, type FormInstance, type FormRules } from 'element-plus' import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import { import {
inboxList, inboxList,
@ -237,11 +253,20 @@ const channelTagTypeMap: Record<string, string> = {
} }
const pushStatusLabelMap: Record<number, string> = { 0: '待推送', 1: '推送中', 2: '已送达', 3: '失败' } const pushStatusLabelMap: Record<number, string> = { 0: '待推送', 1: '推送中', 2: '已送达', 3: '失败' }
const pushStatusTagTypeMap: Record<number, string> = { 0: 'info', 1: 'warning', 2: 'success', 3: 'danger' } const pushStatusTagTypeMap: Record<number, string> = { 0: 'info', 1: 'warning', 2: 'success', 3: 'danger' }
const sourceTypeLabelMap: Record<string, string> = { api: 'API', system: '系统' }
function channelLabel(c: string) { return channelLabelMap[c] ?? c ?? '-' } function channelLabel(c: string) { return channelLabelMap[c] ?? c ?? '-' }
function channelTagType(c: string) { return channelTagTypeMap[c] ?? 'info' } function channelTagType(c: string) { return channelTagTypeMap[c] ?? 'info' }
function pushStatusLabel(s: number) { return pushStatusLabelMap[s] ?? '未知' } function pushStatusLabel(s: number) { return pushStatusLabelMap[s] ?? '未知' }
function pushStatusTagType(s: number) { return pushStatusTagTypeMap[s] ?? 'info' } function pushStatusTagType(s: number) { return pushStatusTagTypeMap[s] ?? 'info' }
function sourceTypeLabel(s: string) { return sourceTypeLabelMap[s] ?? s ?? '-' }
function formatTime(val: any): string {
if (val === null || val === undefined || val === '') return '-'
const d = new Date(val)
if (isNaN(d.getTime())) return String(val)
return d.toLocaleString('zh-CN', { hour12: false })
}
// ==================== 配置 ==================== // ==================== 配置 ====================
@ -339,13 +364,36 @@ async function fetchData() {
} }
async function fetchStats() { async function fetchStats() {
// stats in background - not blocking
try { try {
const res: any = await inboxStats() const res: any = await inboxStats()
// parse stats if needed if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
statsData.value = res.data ?? null
}
} catch { /* ignore */ } } catch { /* ignore */ }
} }
const statsData = ref<any>(null)
const statsInbound = computed(() => {
const item = statsData.value?.total_by_direction?.find((d: any) => d.direction === 'inbound')
return item?.count ?? 0
})
const statsOutbound = computed(() => {
const item = statsData.value?.total_by_direction?.find((d: any) => d.direction === 'outbound')
return item?.count ?? 0
})
const statsStatusTags = computed(() => {
const list = statsData.value?.total_by_status as any[] | undefined
if (!list) return []
const typeMap: Record<number, string> = { 0: 'info', 1: 'warning', 2: 'success', 3: 'danger' }
const labelMap: Record<number, string> = { 0: '待推送', 1: '推送中', 2: '已送达', 3: '失败' }
return list.map((s: any) => ({
status: s.push_status,
count: s.count,
type: typeMap[s.push_status] ?? 'info',
label: labelMap[s.push_status] ?? `状态${s.push_status}`,
}))
})
function handleRefresh() { function handleRefresh() {
fetchData() fetchData()
fetchStats() fetchStats()

View File

@ -84,6 +84,7 @@ export const messageColumns = [
{ prop: 'retry_count', label: '重试', width: '60' }, { prop: 'retry_count', label: '重试', width: '60' },
{ prop: 'parent_id', label: '父消息ID', width: '90' }, { prop: 'parent_id', label: '父消息ID', width: '90' },
{ prop: 'created_at', label: '创建时间', width: '170' }, { prop: 'created_at', label: '创建时间', width: '170' },
{ prop: 'actions', label: '操作', width: '240', fixed: 'right' },
] ]
// ============================================================ // ============================================================
@ -93,9 +94,8 @@ export const messageToolbarButtons: ToolbarButtonConfig[] = [
{ {
key: 'refresh', key: 'refresh',
label: '刷新', label: '刷新',
type: 'primary', category: 'refresh',
icon: 'Refresh', action: 'loadData',
plain: false,
}, },
] ]

View File

@ -7,8 +7,8 @@
trigger="click" trigger="click"
split-button split-button
:size="button.size || 'small'" :size="button.size || 'small'"
:type="button.type" :type="resolveButtonStyle(button).type"
:plain="button.plain" :plain="resolveButtonStyle(button).plain"
:disabled="resolveDisabled(button.disabledKey) || resolveLoading(button.loadingKey)" :disabled="resolveDisabled(button.disabledKey) || resolveLoading(button.loadingKey)"
@click="emitAction(button.action)" @click="emitAction(button.action)"
@command="emitAction" @command="emitAction"
@ -31,8 +31,8 @@
<el-button <el-button
v-else v-else
:size="button.size || 'small'" :size="button.size || 'small'"
:type="button.type" :type="resolveButtonStyle(button).type"
:plain="button.plain" :plain="resolveButtonStyle(button).plain"
:disabled="resolveDisabled(button.disabledKey)" :disabled="resolveDisabled(button.disabledKey)"
:loading="resolveLoading(button.loadingKey)" :loading="resolveLoading(button.loadingKey)"
@click="emitAction(button.action)" @click="emitAction(button.action)"
@ -61,8 +61,8 @@
v-for="option in button.dropdownOptions" v-for="option in button.dropdownOptions"
:key="`overflow-${button.key}-${option.action}`" :key="`overflow-${button.key}-${option.action}`"
:size="button.size || 'small'" :size="button.size || 'small'"
:type="button.type" :type="resolveButtonStyle(button).type"
:plain="button.plain" :plain="resolveButtonStyle(button).plain"
:disabled="resolveDisabled(button.disabledKey)" :disabled="resolveDisabled(button.disabledKey)"
:loading="resolveLoading(button.loadingKey)" :loading="resolveLoading(button.loadingKey)"
class="order-toolbar-button-group__overflow-item" class="order-toolbar-button-group__overflow-item"
@ -74,8 +74,8 @@
<el-button <el-button
v-else v-else
:size="button.size || 'small'" :size="button.size || 'small'"
:type="button.type" :type="resolveButtonStyle(button).type"
:plain="button.plain" :plain="resolveButtonStyle(button).plain"
:disabled="resolveDisabled(button.disabledKey)" :disabled="resolveDisabled(button.disabledKey)"
:loading="resolveLoading(button.loadingKey)" :loading="resolveLoading(button.loadingKey)"
class="order-toolbar-button-group__overflow-item" class="order-toolbar-button-group__overflow-item"
@ -138,6 +138,17 @@ function emitAction(action: ToolbarButtonConfig['action']) {
emit('action', action) emit('action', action)
} }
/** 根据 category 或 type/plain 解析按钮样式 */
function resolveButtonStyle(button: ToolbarButtonConfig): { type: string; plain: boolean } {
switch (button.category) {
case 'refresh': return { type: 'primary', plain: false } // 蓝底白字
case 'setting': return { type: 'default', plain: false } // 白底黑字
case 'action': return { type: 'primary', plain: true } // 白底蓝边框蓝字
case 'cancel': return { type: 'danger', plain: false } // 红底白字
default: return { type: button.type || 'default', plain: !!button.plain }
}
}
function handleOverflowClick(action: ToolbarButtonConfig['action']) { function handleOverflowClick(action: ToolbarButtonConfig['action']) {
expandVisible.value = false expandVisible.value = false
emitAction(action) emitAction(action)
@ -246,7 +257,7 @@ watch(isTileMode, () => {
max-width: 100%; max-width: 100%;
min-width: 0; min-width: 0;
overflow: hidden; overflow: hidden;
gap: 4px; gap: 6px;
} }
.order-toolbar-button-group--tile { .order-toolbar-button-group--tile {
@ -267,12 +278,31 @@ watch(isTileMode, () => {
.order-toolbar-button-group--tile .order-toolbar-button-group__main { .order-toolbar-button-group--tile .order-toolbar-button-group__main {
overflow: visible; overflow: visible;
flex-wrap: wrap; flex-wrap: wrap;
align-items: flex-start;
align-content: flex-start;
padding-right: 30px;
}
/* 平铺模式下切换按钮绝对定位到右上角,不参与按钮流 */
.order-toolbar-button-group--tile .order-toolbar-button-group__mode-toggle {
position: absolute;
top: 0;
right: 0;
margin-left: 0;
} }
.order-toolbar-button-group__main :deep(.el-dropdown) { .order-toolbar-button-group__main :deep(.el-dropdown) {
flex-shrink: 0; flex-shrink: 0;
} }
/* 清除 Element Plus 默认 .el-button + .el-button 左边距,
换行时每行首个按钮不会多出间隙,统一由 gap 控制等间距 */
.order-toolbar-button-group__main :deep(.el-button),
.order-toolbar-button-group__main :deep(.el-dropdown) {
margin-left: 0;
margin-right: 0;
}
.order-toolbar-button-group__overflow-list { .order-toolbar-button-group__overflow-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -305,6 +335,65 @@ watch(isTileMode, () => {
color: #409EFF; color: #409EFF;
} }
} }
/* 禁用按钮样式优化:保持字体颜色可读,背景极浅区分状态 */
.order-toolbar-button-group__main :deep(.el-button.is-disabled),
.order-toolbar-button-group__main :deep(.el-button.is-disabled:hover),
.order-toolbar-button-group__main :deep(.el-button.is-disabled:focus),
.order-toolbar-button-group__main :deep(.el-button.is-disabled:active) {
color: #606266;
background-color: #fafbfc;
border-color: #ebeef5;
}
/* primary 禁用:保持蓝字可见,极浅蓝背景 */
.order-toolbar-button-group__main :deep(.el-button--primary.is-disabled),
.order-toolbar-button-group__main :deep(.el-button--primary.is-disabled:hover),
.order-toolbar-button-group__main :deep(.el-button--primary.is-disabled:focus),
.order-toolbar-button-group__main :deep(.el-button--primary.is-disabled:active) {
color: #409eff;
background-color: #f5faff;
border-color: #e4efff;
}
/* primary + plain 禁用:白底蓝字 */
.order-toolbar-button-group__main :deep(.el-button--primary.is-plain.is-disabled),
.order-toolbar-button-group__main :deep(.el-button--primary.is-plain.is-disabled:hover),
.order-toolbar-button-group__main :deep(.el-button--primary.is-plain.is-disabled:focus),
.order-toolbar-button-group__main :deep(.el-button--primary.is-plain.is-disabled:active) {
color: #409eff;
background-color: #fff;
border-color: #409eff;
}
/* danger 禁用:白底红字 */
.order-toolbar-button-group__main :deep(.el-button--danger.is-disabled),
.order-toolbar-button-group__main :deep(.el-button--danger.is-disabled:hover),
.order-toolbar-button-group__main :deep(.el-button--danger.is-disabled:focus),
.order-toolbar-button-group__main :deep(.el-button--danger.is-disabled:active) {
color: #f56c6c;
background-color: #fff;
border-color: #f56c6c;
}
/* 溢出列表中的 disabled 按钮同样适用 */
.order-toolbar-button-group__overflow-list :deep(.el-button--primary.is-plain.is-disabled),
.order-toolbar-button-group__overflow-list :deep(.el-button--primary.is-plain.is-disabled:hover),
.order-toolbar-button-group__overflow-list :deep(.el-button--primary.is-plain.is-disabled:focus),
.order-toolbar-button-group__overflow-list :deep(.el-button--primary.is-plain.is-disabled:active) {
color: #409eff;
background-color: #fff;
border-color: #409eff;
}
.order-toolbar-button-group__overflow-list :deep(.el-button--danger.is-disabled),
.order-toolbar-button-group__overflow-list :deep(.el-button--danger.is-disabled:hover),
.order-toolbar-button-group__overflow-list :deep(.el-button--danger.is-disabled:focus),
.order-toolbar-button-group__overflow-list :deep(.el-button--danger.is-disabled:active) {
color: #f56c6c;
background-color: #fff;
border-color: #f56c6c;
}
</style> </style>
<style lang="scss"> <style lang="scss">

View File

@ -275,6 +275,13 @@ export interface ToolbarButtonConfig {
loadingKey?: string loadingKey?: string
disabledKey?: string disabledKey?: string
action: string action: string
/** 按钮样式分类(优先级高于 type/plain):
* 'refresh' - 蓝底白字(primary)
* 'setting' - 白底黑字(default)
* 'action' - 白底蓝边框蓝字(primary + plain)
* 'cancel' - 红底白字(danger)
* 不设置则沿用 type/plain */
category?: 'refresh' | 'setting' | 'action' | 'cancel'
/** 下拉按钮:主按钮点击 action,菜单项使用 dropdownOptions[].action */ /** 下拉按钮:主按钮点击 action,菜单项使用 dropdownOptions[].action */
buttonType?: 'default' | 'dropdown' buttonType?: 'default' | 'dropdown'
dropdownOptions?: Array<{ label: string; action: string; divided?: boolean }> dropdownOptions?: Array<{ label: string; action: string; divided?: boolean }>
@ -308,10 +315,11 @@ export interface PendingBatchAsyncTaskConfig {
} }
export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = { export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
refresh: { key: 'refresh', label: '刷新', type: 'primary', size: 'small', action: 'loadData' }, refresh: { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', action: 'loadData' },
export: { export: {
key: 'export', key: 'export',
label: '导出', label: '导出',
category: 'setting',
size: 'small', size: 'small',
loadingKey: 'exportLoading', loadingKey: 'exportLoading',
action: 'handleExportWaybill', action: 'handleExportWaybill',
@ -324,6 +332,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
exportSelection: { exportSelection: {
key: 'exportSelection', key: 'exportSelection',
label: '导出选中', label: '导出选中',
category: 'setting',
size: 'small', size: 'small',
loadingKey: 'exportSelectionLoading', loadingKey: 'exportSelectionLoading',
disabledKey: 'hasNoSelection', disabledKey: 'hasNoSelection',
@ -332,6 +341,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
deliveryExport: { deliveryExport: {
key: 'deliveryExport', key: 'deliveryExport',
label: '导出', label: '导出',
category: 'setting',
size: 'small', size: 'small',
loadingKey: 'exportLoading', loadingKey: 'exportLoading',
action: 'handleExportWaybill', action: 'handleExportWaybill',
@ -341,52 +351,63 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
{ label: '导出全部', action: 'handleExportWaybill' } { label: '导出全部', action: 'handleExportWaybill' }
] ]
}, },
columnConfig: { key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' }, columnConfig: { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
toggleDetail: { key: 'toggleDetail', label: '显示详情', dynamicLabelKey: 'detailToggleLabel', size: 'small', action: 'toggleDetailVisible' }, toggleDetail: { key: 'toggleDetail', label: '显示详情', dynamicLabelKey: 'detailToggleLabel', category: 'setting', size: 'small', action: 'toggleDetailVisible' },
reverseReview: { key: 'reverseReview', label: '反审回待审核', size: 'small', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleReverseReview' }, exceptionExcel: {
createOrder: { key: 'createOrder', label: '建单', size: 'small', type: 'primary', plain: true, action: 'openCreateOrderDialog' }, key: 'exceptionExcel',
label: 'EXCEL操作',
category: 'setting',
size: 'small',
action: 'handleExpectionExcel',
buttonType: 'dropdown',
dropdownOptions: [
{ label: '异常跟踪单导入', action: 'import-exception-tracking' },
{ label: '导出异常跟踪单', action: 'export-exception-tracking' }
]
},
createOrder: { key: 'createOrder', label: '建单', size: 'small', category: 'action', action: 'openCreateOrderDialog' },
reverseReview: { key: 'reverseReview', label: '反审回待审核', category: 'action', size: 'small', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleReverseReview' },
// markPendingOutbound: { key: 'markPendingOutbound', label: '标记待出库', size: 'small', type: 'warning', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleMarkPendingOutbound' }, // markPendingOutbound: { key: 'markPendingOutbound', label: '标记待出库', size: 'small', type: 'warning', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleMarkPendingOutbound' },
allocateStorage: { key: 'allocateStorage', label: '分配储位', size: 'small', type: 'primary', plain: true, loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageAllocateDialog' }, allocateStorage: { key: 'allocateStorage', label: '分配储位', size: 'small', category: 'action', loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageAllocateDialog' },
cancelAllocateStorage: { key: 'cancelAllocateStorage', label: '取消分配储位', size: 'small', type: 'danger', plain: true, loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageCancelDialog' }, cancelAllocateStorage: { key: 'cancelAllocateStorage', label: '取消分配储位', size: 'small', category: 'cancel', loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageCancelDialog' },
waveSingleFetchByIds: { waveSingleFetchByIds: {
key: 'waveSingleFetchByIds', key: 'waveSingleFetchByIds',
label: '抓取散单', label: '抓取散单',
size: 'small', size: 'small',
type: 'primary', category: 'action',
plain: true,
loadingKey: 'waveSingleFetchLoading', loadingKey: 'waveSingleFetchLoading',
disabledKey: 'hasNoSelection', disabledKey: 'hasNoSelection',
action: 'handleWaveSingleFetchByIds' action: 'handleWaveSingleFetchByIds'
}, },
allocateExpress: { key: 'allocateExpress', label: '分配快递号', size: 'small', type: 'success', loadingKey: 'allocateLoading', disabledKey: 'hasNoSelection', action: 'openAllocateExpressDialog' }, allocateExpress: { key: 'allocateExpress', label: '分配快递号', size: 'small', category: 'action', loadingKey: 'allocateLoading', disabledKey: 'hasNoSelection', action: 'openAllocateExpressDialog' },
batchQuickRecheck: { batchQuickRecheck: {
key: 'batchQuickRecheck', key: 'batchQuickRecheck',
label: '批量发货', label: '批量发货',
size: 'small', size: 'small',
type: 'success', category: 'action',
plain: true,
disabledKey: 'hasNoSelection', disabledKey: 'hasNoSelection',
action: 'openBatchQuickRecheckDialog' action: 'openBatchQuickRecheckDialog'
}, },
manualWaybill: { key: 'manualWaybill', label: '录入运单号', size: 'small', type: 'primary', plain: true, loadingKey: 'manualWaybillLoading', disabledKey: 'notSingleSelection', action: 'openManualWaybillDialog' }, manualWaybill: { key: 'manualWaybill', label: '录入运单号', size: 'small', category: 'action', loadingKey: 'manualWaybillLoading', disabledKey: 'notSingleSelection', action: 'openManualWaybillDialog' },
updateExpress: { key: 'updateExpress', label: '修改快递', size: 'small', type: 'warning', plain: true, loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderExpressDialog' }, updateExpress: { key: 'updateExpress', label: '修改快递', size: 'small', category: 'action', loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderExpressDialog' },
updatePlatform: { key: 'updatePlatform', label: '修改平台', size: 'small', type: 'info', plain: true, loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderPlatformDialog' }, updatePlatform: { key: 'updatePlatform', label: '修改平台', size: 'small', category: 'action', loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderPlatformDialog' },
updateAddress: { key: 'updateAddress', label: '修改地址', size: 'small', type: 'warning', plain: true, loadingKey: 'updateAddressLoading', disabledKey: 'hasNoSelection', action: 'openUpdateAddressDialog' }, updateAddress: { key: 'updateAddress', label: '修改地址', size: 'small', category: 'action', loadingKey: 'updateAddressLoading', disabledKey: 'hasNoSelection', action: 'openUpdateAddressDialog' },
updateRemark: { key: 'updateRemark', label: '修改留言', size: 'small', type: 'warning', plain: true, loadingKey: 'updateRemarkLoading', disabledKey: 'hasNoSelection', action: 'openUpdateRemarkDialog' }, updateRemark: { key: 'updateRemark', label: '修改留言', size: 'small', category: 'action', loadingKey: 'updateRemarkLoading', disabledKey: 'hasNoSelection', action: 'openUpdateRemarkDialog' },
cloneOrder: { key: 'cloneOrder', label: '克隆订单', size: 'small', type: 'warning', plain: true, loadingKey: 'cloneOrderLoading', disabledKey: 'notSingleSelection', action: 'openCloneOrderDialog' }, cloneOrder: { key: 'cloneOrder', label: '克隆订单', size: 'small', category: 'action', loadingKey: 'cloneOrderLoading', disabledKey: 'notSingleSelection', action: 'openCloneOrderDialog' },
syncOrderIds: { key: 'syncOrderIds', label: '同步订单', size: 'small', type: 'primary', plain: true, loadingKey: 'syncOrderIdsLoading', disabledKey: 'hasNoSelection', action: 'openSyncOrderIdsDialog' }, syncOrderIds: { key: 'syncOrderIds', label: '同步订单', size: 'small', category: 'action', loadingKey: 'syncOrderIdsLoading', disabledKey: 'hasNoSelection', action: 'openSyncOrderIdsDialog' },
cancelOrder: { key: 'cancelOrder', label: '取消订单', size: 'small', type: 'danger', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleCancelOrder' }, cancelOrder: { key: 'cancelOrder', label: '取消订单', size: 'small', category: 'cancel', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleCancelOrder' },
batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', type: 'danger', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' }, batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', category: 'cancel', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' },
batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', type: 'warning', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' }, batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', category: 'action', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' },
batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', type: 'warning', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' }, batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', category: 'action', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' },
batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', type: 'primary', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' }, batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', category: 'action', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' },
batchPrint: { key: 'batchPrint', label: '批量打印', size: 'small', type: 'primary', loadingKey: 'batchPrintLoading', disabledKey: 'hasNoSelection', action: 'handleBatchPrint' }, batchPrint: { key: 'batchPrint', label: '批量打印', size: 'small', category: 'action', loadingKey: 'batchPrintLoading', disabledKey: 'hasNoSelection', action: 'handleBatchPrint' },
batchReview: { key: 'batchReview', label: '批量审核通过', size: 'small', type: 'success', loadingKey: 'reviewSubmitting', disabledKey: 'hasNoSelection', action: 'handleBatchReview' }, batchReview: { key: 'batchReview', label: '批量审核通过', size: 'small', category: 'action', loadingKey: 'reviewSubmitting', disabledKey: 'hasNoSelection', action: 'handleBatchReview' },
manualOutboundMigrate: { manualOutboundMigrate: {
key: 'manualOutboundMigrate', key: 'manualOutboundMigrate',
label: '手动出库迁移', label: '手动出库迁移',
size: 'small', size: 'small',
type: 'warning', category: 'action',
loadingKey: 'manualLoading', loadingKey: 'manualLoading',
disabledKey: 'hasNoOutboundTarget', disabledKey: 'hasNoOutboundTarget',
action: 'handleToolbarManualOutbound' action: 'handleToolbarManualOutbound'
@ -395,7 +416,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
key: 'resolveException', key: 'resolveException',
label: '处理异常订单', label: '处理异常订单',
size: 'small', size: 'small',
type: 'warning', category: 'action',
loadingKey: 'resolveExceptionLoading', loadingKey: 'resolveExceptionLoading',
disabledKey: 'hasNoSelection', disabledKey: 'hasNoSelection',
action: 'openResolveExceptionDialog' action: 'openResolveExceptionDialog'
@ -404,8 +425,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
key: 'allocateSubOrderNumber', key: 'allocateSubOrderNumber',
label: '分配子单号', label: '分配子单号',
size: 'small', size: 'small',
type: 'primary', category: 'action',
plain: true,
loadingKey: 'allocateSubOrderNumberLoading', loadingKey: 'allocateSubOrderNumberLoading',
disabledKey: 'notSingleSelection', disabledKey: 'notSingleSelection',
action: 'openAllocateSubOrderNumberDialog' action: 'openAllocateSubOrderNumberDialog'
@ -414,12 +434,12 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
key: 'subWaybillPrint', key: 'subWaybillPrint',
label: '子单号打印', label: '子单号打印',
size: 'small', size: 'small',
type: 'success', category: 'action',
plain: true,
loadingKey: 'subWaybillPrintLoading', loadingKey: 'subWaybillPrintLoading',
disabledKey: 'hasNoSelection', disabledKey: 'hasNoSelection',
action: 'handleSubWaybillPrint' action: 'handleSubWaybillPrint'
} },
} }
export function pickToolbarButtons(keys: string[]) { export function pickToolbarButtons(keys: string[]) {
@ -1894,12 +1914,11 @@ export const pendingOrderbuttonList: any[] = [
export const pendingToolbarButtonKeys = [ export const pendingToolbarButtonKeys = [
...simpleListToolbarButtonKeys, ...simpleListToolbarButtonKeys,
'reverseReview',
'createOrder', 'createOrder',
'reverseReview',
'markPendingOutbound', 'markPendingOutbound',
'waveSingleFetchByIds', 'waveSingleFetchByIds',
'allocateStorage', 'allocateStorage',
'cancelAllocateStorage',
'allocateExpress', 'allocateExpress',
'manualWaybill', 'manualWaybill',
'updateExpress', 'updateExpress',
@ -1909,15 +1928,16 @@ export const pendingToolbarButtonKeys = [
'batchQuickRecheck', 'batchQuickRecheck',
'cloneOrder', 'cloneOrder',
'syncOrderIds', 'syncOrderIds',
'cancelOrder',
'batchIntercept',
'batchUnintercept', 'batchUnintercept',
'batchLock', 'batchLock',
'batchUnlock', 'batchUnlock',
'batchPrint', 'batchPrint',
'resolveException', 'resolveException',
'allocateSubOrderNumber', 'allocateSubOrderNumber',
'subWaybillPrint' 'subWaybillPrint',
'cancelAllocateStorage',
'cancelOrder',
'batchIntercept',
] ]
/** 页面级按钮列表:pendingOrder 直接消费,避免页面内重复拼装 */ /** 页面级按钮列表:pendingOrder 直接消费,避免页面内重复拼装 */
@ -1928,7 +1948,34 @@ export const pendingToolbarButtons = pickToolbarButtons(pendingToolbarButtonKeys
/** /**
* deliveryException * deliveryException
*/ */
export const exceptionToolbarButtonKeys = [...pendingToolbarButtonKeys] export const exceptionToolbarButtonKeys = [
...simpleListToolbarButtonKeys,
'exceptionExcel',
'createOrder',
'reverseReview',
'markPendingOutbound',
'waveSingleFetchByIds',
'allocateStorage',
'allocateExpress',
'manualWaybill',
'updateExpress',
'updatePlatform',
'updateAddress',
'updateRemark',
'batchQuickRecheck',
'cloneOrder',
'syncOrderIds',
'batchUnintercept',
'batchLock',
'batchUnlock',
'batchPrint',
'resolveException',
'allocateSubOrderNumber',
'subWaybillPrint',
'cancelAllocateStorage',
'cancelOrder',
'batchIntercept',
]
export const exceptionToolbarButtons = pickToolbarButtons(exceptionToolbarButtonKeys) export const exceptionToolbarButtons = pickToolbarButtons(exceptionToolbarButtonKeys)

View File

@ -24,40 +24,6 @@
:layout-key="toolbarLayoutKey" :layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick" @action="handleToolbarButtonClick"
/> />
<template v-for="(btn, index) in expectionOrderbuttonList" :key="index">
<el-dropdown
v-if="btn.type === 'dropdown'"
trigger="hover"
@command="(cmd:any) => handleCommand(btn.command, cmd)"
>
<el-button size="small" :loading="btn.loading">
{{ btn.label }}<el-icon class="el-icon--right"><arrow-down /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
v-for="opt in btn.options"
:key="opt.value"
:command="opt.value"
:divided="opt.divided"
>
{{ opt.label }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-button
v-else
size="small"
:type="btn.btnType || 'primary'"
:disabled="btn.needSelection && !hasSelection"
@click="handleCommand(btn.command)"
>
{{ btn.label }}
</el-button>
</template>
</div> </div>
<!-- 已迁移至 ScanBox:搜索订单号 --> <!-- 已迁移至 ScanBox:搜索订单号 -->
@ -407,7 +373,6 @@ import {
buildPendingStyleColumns, buildPendingStyleColumns,
expectionColumns, expectionColumns,
expectionOrderAvailableFields, expectionOrderAvailableFields,
expectionOrderbuttonList,
exceptionToolbarButtons, exceptionToolbarButtons,
type ToolbarButtonConfig, type ToolbarButtonConfig,
translateOrderField, translateOrderField,
@ -829,23 +794,12 @@ async function submitResolveException() {
} }
// 统一执行命令 // 统一执行命令
function handleCommand(commandName: string, subCommand?: string) {
const handlers: Record<string, Function> = {
handleExpectionOperation
}
const handler = handlers[commandName]
if (handler) {
handler(subCommand)
}
}
const commandLabels: Record<string, string> = {
'import-exception-tracking': '异常跟踪单导入',
'export-exception-tracking': '导出异常跟踪单'
}
async function handleExpectionOperation(command: string) { async function handleExpectionOperation(command: string) {
const label = commandLabels[command] || '操作' const labelMap: Record<string, string> = {
'import-exception-tracking': '异常跟踪单导入',
'export-exception-tracking': '导出异常跟踪单'
}
const label = labelMap[command] || '操作'
exportLoading.value = true exportLoading.value = true
setTimeout(() => { setTimeout(() => {
exportLoading.value = false exportLoading.value = false
@ -995,7 +949,9 @@ const {
const toolbarActionMap: Record<string, () => void | Promise<void>> = { const toolbarActionMap: Record<string, () => void | Promise<void>> = {
...pendingToolbarActionMap, ...pendingToolbarActionMap,
openResolveExceptionDialog, openResolveExceptionDialog,
handleBatchPrint handleBatchPrint,
'import-exception-tracking': () => handleExpectionOperation('import-exception-tracking'),
'export-exception-tracking': () => handleExpectionOperation('export-exception-tracking')
} }
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({ const buttonLoadingMap = computed<Record<string, boolean>>(() => ({

View File

@ -2,38 +2,45 @@
<div class="order-management-wrapper" :style="{ height: containerHeight }"> <div class="order-management-wrapper" :style="{ height: containerHeight }">
<!-- 多标签模式 --> <!-- 多标签模式 -->
<template v-if="!singlePage"> <template v-if="!singlePage">
<div class="tabs-header-action"> <!-- 顶部多标签页区域(对齐 stock/stockManagement 的 tab-section) -->
<!-- <el-button size="small" @click="workbenchDialogVisible = true">统一查询</el-button> --> <div class="tab-section">
<!-- <el-button size="small" @click="bindByWaybillDialogVisible = true">按运单绑定包材</el-button> --> <div class="tabs-header-action">
<el-button size="small" :loading="badgeLoading" @click="refreshBadgeCounts">刷新角标</el-button> <!-- <el-button size="small" @click="workbenchDialogVisible = true">统一查询</el-button> -->
</div> <!-- <el-button size="small" @click="bindByWaybillDialogVisible = true">按运单绑定包材</el-button> -->
<el-tabs <el-button size="small" :loading="badgeLoading" @click="refreshBadgeCounts">刷新角标</el-button>
v-model="activeTab" </div>
@tab-change="handleTabChange" <el-tabs
tab-position="top" v-model="activeTab"
type="border-card" @tab-change="handleTabChange"
class="tab-container" tab-position="top"
> type="border-card"
<el-tab-pane class="tab-container"
v-for="tab in tabs"
:key="tab.name"
:name="tab.name"
:lazy="false"
> >
<template #label> <el-tab-pane
<span class="custom-tab-label"> v-for="tab in tabs"
{{ tab.label }} :key="tab.name"
<el-badge :name="tab.name"
:value="tab.count" :lazy="false"
:max="99" >
:hidden="tab.count === 0" <template #label>
class="tab-badge" <span class="custom-tab-label">
/> {{ tab.label }}
</span> <el-badge
</template> :value="tab.count"
<component :is="tab.component" v-if="activeTab === tab.name" /> :max="99"
</el-tab-pane> :hidden="tab.count === 0"
</el-tabs> class="tab-badge"
/>
</span>
</template>
</el-tab-pane>
</el-tabs>
</div>
<!-- 主内容区容器(对齐 stock/stockManagement 的 main-container) -->
<div class="main-container">
<component :is="activeComponent" :key="activeTab" />
</div>
</template> </template>
<!-- 单页模式:直接渲染默认页签组件 --> <!-- 单页模式:直接渲染默认页签组件 -->
@ -86,6 +93,12 @@ type OrderTabItem = {
component: any component: any
} }
/** 当前激活页签对应的组件(渲染在主内容区 main-container 中,对齐 stock/stockManagement) */
const activeComponent = computed(() => {
const tab = tabs.value.find((t) => t.name === activeTab.value)
return tab?.component
})
const tabs = ref<OrderTabItem[]>([ const tabs = ref<OrderTabItem[]>([
{ {
name: 'reviewOrder', name: 'reviewOrder',
@ -227,14 +240,28 @@ const handleTabChange = (tabName: string | number) => {
.order-management-wrapper { .order-management-wrapper {
position: relative; position: relative;
width: 100%; width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ===== 顶部多标签页区域(对齐 stock/stockManagement 的 tab-section) ===== */
.tab-section {
flex-shrink: 0;
position: relative;
background: #fff;
border: 1px solid #e8eef7;
border-bottom: none;
border-radius: 6px 6px 0 0;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
overflow: hidden; overflow: hidden;
} }
.tabs-header-action { .tabs-header-action {
position: absolute; position: absolute;
top: 0; top: 4px;
right: 16px; right: 16px;
height: 42px; height: 38px;
display: flex; display: flex;
align-items: center; align-items: center;
z-index: 2; z-index: 2;
@ -243,7 +270,6 @@ const handleTabChange = (tabName: string | number) => {
.tab-container { .tab-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%;
:deep(.el-tabs__header) { :deep(.el-tabs__header) {
margin-bottom: 0; margin-bottom: 0;
@ -298,14 +324,9 @@ const handleTabChange = (tabName: string | number) => {
bottom: 0; bottom: 0;
} }
/* 隐藏内容区,仅展示标签头(对齐 stock/stockManagement) */
:deep(.el-tabs__content) { :deep(.el-tabs__content) {
flex: 1; display: none;
overflow: auto;
position: relative;
.el-tab-pane {
height: 100%;
}
} }
} }
@ -336,9 +357,25 @@ const handleTabChange = (tabName: string | number) => {
} }
} }
/* ===== 主内容区容器(对齐 stock/stockManagement 的 main-container) ===== */
.main-container {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
background: #fff;
border: 1px solid #e8eef7;
border-top: none;
border-radius: 0 0 6px 6px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
overflow: hidden;
}
/* ========== 单页模式 ========== */ /* ========== 单页模式 ========== */
.single-page-container { .single-page-container {
flex: 1;
min-height: 0;
background: #fff; background: #fff;
border: 1px solid #e8eef7; border: 1px solid #e8eef7;
border-radius: 6px; border-radius: 6px;

View File

@ -64,18 +64,16 @@
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: flex-start;
background-color: #fff; background-color: #fff;
min-width: 0; min-width: 0;
overflow: hidden;
.toolbar-left { .toolbar-left {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
display: flex; display: flex;
align-items: center; align-items: flex-start;
gap: 10px; gap: 10px;
overflow: hidden;
} }
.toolbar-right { .toolbar-right {

View File

@ -24,8 +24,6 @@
:layout-key="toolbarLayoutKey" :layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick" @action="handleToolbarButtonClick"
/> />
</div>
<div class="toolbar-right">
<span class="toolbar-switch-label">仅待复核波次</span> <span class="toolbar-switch-label">仅待复核波次</span>
<el-switch <el-switch
v-model="onlyTodoWaves" v-model="onlyTodoWaves"
@ -39,6 +37,7 @@
@change="handleSourceFilterChange" @change="handleSourceFilterChange"
/> />
</div> </div>
<div class="toolbar-right" />
</div> </div>
<div class="split-stack" ref="splitStackRef"> <div class="split-stack" ref="splitStackRef">

View File

@ -24,8 +24,6 @@
:layout-key="toolbarLayoutKey" :layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick" @action="handleToolbarButtonClick"
/> />
</div>
<div class="toolbar-right">
<span class="toolbar-switch-label">仅待复核波次</span> <span class="toolbar-switch-label">仅待复核波次</span>
<el-switch <el-switch
v-model="onlyTodoWaves" v-model="onlyTodoWaves"
@ -39,6 +37,7 @@
@change="handleSourceFilterChange" @change="handleSourceFilterChange"
/> />
</div> </div>
<div class="toolbar-right" />
</div> </div>
<div class="split-stack" ref="splitStackRef"> <div class="split-stack" ref="splitStackRef">

View File

@ -475,12 +475,13 @@ export function getWaveAssignmentAggregateTagType(value: string | number | null
* 主工具栏按钮(action 与波次列表页内 toolbarActionMap 键一致) * 主工具栏按钮(action 与波次列表页内 toolbarActionMap 键一致)
*/ */
export const waveToolbarButtons: WaveToolbarButtonConfig[] = [ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' }, { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' }, { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
{ {
key: 'toggleDetail', key: 'toggleDetail',
label: '显示详情', label: '显示详情',
dynamicLabelKey: 'detailToggleLabel', dynamicLabelKey: 'detailToggleLabel',
category: 'setting',
size: 'small', size: 'small',
action: 'toggleDetailVisible' action: 'toggleDetailVisible'
}, },
@ -488,7 +489,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
key: 'batchPrint', key: 'batchPrint',
label: '批量打印(0)', label: '批量打印(0)',
dynamicLabelKey: 'batchPrintTotal', dynamicLabelKey: 'batchPrintTotal',
type: 'info', category: 'action',
size: 'small', size: 'small',
disabledKey: 'batchPrintDisabled', disabledKey: 'batchPrintDisabled',
loadingKey: 'batchPrintLoading', loadingKey: 'batchPrintLoading',
@ -499,7 +500,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
key: 'batchOutboundPrint', key: 'batchOutboundPrint',
label: '打印货单(0)', label: '打印货单(0)',
dynamicLabelKey: 'batchOutboundPrintTotal', dynamicLabelKey: 'batchOutboundPrintTotal',
type: 'info', category: 'action',
size: 'small', size: 'small',
disabledKey: 'batchOutboundPrintDisabled', disabledKey: 'batchOutboundPrintDisabled',
loadingKey: 'batchOutboundPrintLoading', loadingKey: 'batchOutboundPrintLoading',
@ -510,8 +511,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
key: 'batchPlatformPrint', key: 'batchPlatformPrint',
label: '批量打印(平台)(0)', label: '批量打印(平台)(0)',
dynamicLabelKey: 'batchPlatformPrintTotal', dynamicLabelKey: 'batchPlatformPrintTotal',
type: 'info', category: 'action',
plain: true,
size: 'small', size: 'small',
disabledKey: 'batchPlatformPrintDisabled', disabledKey: 'batchPlatformPrintDisabled',
loadingKey: 'batchPlatformPrintLoading', loadingKey: 'batchPlatformPrintLoading',
@ -520,8 +520,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ {
key: 'printerComponentConnection', key: 'printerComponentConnection',
label: '打印组件连接', label: '打印组件连接',
type: 'primary', category: 'action',
plain: true,
size: 'small', size: 'small',
action: 'openPrinterComponentConnectionDialog', action: 'openPrinterComponentConnectionDialog',
onlyForWaveType: 2 onlyForWaveType: 2
@ -529,8 +528,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ {
key: 'printerListTest', key: 'printerListTest',
label: '打印机列表', label: '打印机列表',
type: 'primary', category: 'action',
plain: true,
size: 'small', size: 'small',
action: 'openPrinterListTestDialog', action: 'openPrinterListTestDialog',
onlyForWaveType: 2 onlyForWaveType: 2
@ -539,8 +537,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
key: 'batchPrintPickingList', key: 'batchPrintPickingList',
label: '批量打印拣货单(0)', label: '批量打印拣货单(0)',
dynamicLabelKey: 'batchPickingPrintTotal', dynamicLabelKey: 'batchPickingPrintTotal',
type: 'info', category: 'action',
plain: true,
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchPrintLoading', loadingKey: 'batchPrintLoading',
@ -550,7 +547,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ {
key: 'batchAutoGrouping', key: 'batchAutoGrouping',
label: '批量改为自动加团', label: '批量改为自动加团',
type: 'warning', category: 'action',
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchAutoGroupingLoading', loadingKey: 'batchAutoGroupingLoading',
@ -559,26 +556,17 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ {
key: 'batchFinishAutoGrouping', key: 'batchFinishAutoGrouping',
label: '批量结束自动加团', label: '批量结束自动加团',
type: 'success', category: 'action',
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchFinishAutoGroupingLoading', loadingKey: 'batchFinishAutoGroupingLoading',
action: 'handleBatchFinishAutoGrouping' action: 'handleBatchFinishAutoGrouping'
}, },
{
key: 'batchCancel',
label: '批量取消波次',
type: 'danger',
size: 'small',
disabledKey: 'noSelection',
loadingKey: 'batchCancelLoading',
action: 'handleBatchCancel'
},
{ {
key: 'batchQuickRecheckByWave', key: 'batchQuickRecheckByWave',
label: '批量发货(0)', label: '批量发货(0)',
dynamicLabelKey: 'batchQuickRecheckByWaveTotal', dynamicLabelKey: 'batchQuickRecheckByWaveTotal',
type: 'success', category: 'action',
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchQuickRecheckByWaveLoading', loadingKey: 'batchQuickRecheckByWaveLoading',
@ -587,7 +575,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ {
key: 'batchAllocateExpress', key: 'batchAllocateExpress',
label: '快速分配快递号', label: '快速分配快递号',
type: 'success', category: 'action',
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchAllocateExpressLoading', loadingKey: 'batchAllocateExpressLoading',
@ -596,31 +584,38 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
{ {
key: 'batchAllocateStorage', key: 'batchAllocateStorage',
label: '批量分配储位', label: '批量分配储位',
type: 'primary', category: 'action',
plain: true,
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchAllocateStorageLoading', loadingKey: 'batchAllocateStorageLoading',
action: 'handleBatchAllocateStorage' action: 'handleBatchAllocateStorage'
}, },
{
key: 'fetchGroupOrder',
label: '抓取团购单',
category: 'action',
size: 'small',
action: 'openGroupOrderDialog',
onlyForWaveType: 1
},
{
key: 'batchCancel',
label: '批量取消波次',
category: 'cancel',
size: 'small',
disabledKey: 'noSelection',
loadingKey: 'batchCancelLoading',
action: 'handleBatchCancel'
},
{ {
key: 'batchRemoveExceptionOrders', key: 'batchRemoveExceptionOrders',
label: '批量移除异常订单', label: '批量移除异常订单',
type: 'danger', category: 'cancel',
plain: true,
size: 'small', size: 'small',
disabledKey: 'noSelection', disabledKey: 'noSelection',
loadingKey: 'batchRemoveExceptionOrdersLoading', loadingKey: 'batchRemoveExceptionOrdersLoading',
action: 'handleBatchRemoveExceptionOrders' action: 'handleBatchRemoveExceptionOrders'
}, },
{
key: 'fetchGroupOrder',
label: '抓取团购单',
type: 'warning',
size: 'small',
action: 'openGroupOrderDialog',
onlyForWaveType: 1
},
// { // {
// key: 'fetchSingleOrder', // key: 'fetchSingleOrder',
// label: '抓取散单候选', // label: '抓取散单候选',
@ -955,14 +950,13 @@ export const pickTaskWaveDetailDialogDefaults = {
/** 拣货任务页工具栏按钮(action 与 WavePickTaskListPanel 内 toolbarActionMap 键一致) */ /** 拣货任务页工具栏按钮(action 与 WavePickTaskListPanel 内 toolbarActionMap 键一致) */
export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [ export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', size: 'small', action: 'loadData' }, { key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' }, { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
{ key: 'search', label: '查询', type: 'primary', size: 'small', action: 'handleSearch' },
{ {
key: 'batchCancel', key: 'batchCancel',
label: '批量取消任务', label: '批量取消任务',
dynamicLabelKey: 'batchCancelTotal', dynamicLabelKey: 'batchCancelTotal',
type: 'danger', category: 'cancel',
size: 'small', size: 'small',
loadingKey: 'batchCancelLoading', loadingKey: 'batchCancelLoading',
disabledKey: 'batchCancelDisabled', disabledKey: 'batchCancelDisabled',
@ -972,13 +966,12 @@ export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
/** 不符合波次策略订单页工具栏按钮 */ /** 不符合波次策略订单页工具栏按钮 */
export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [ export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [
{ key: 'search', label: '查询', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' }, { key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
// { key: 'reset', label: '重置', size: 'small', action: 'resetFallbackOrderCondition' }, { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
{ {
key: 'quickScan', key: 'quickScan',
label: '快速扫描', label: '快速扫描',
type: 'warning', category: 'action',
size: 'small', size: 'small',
loadingKey: 'waveStrategyQuickScanSubmitting', loadingKey: 'waveStrategyQuickScanSubmitting',
action: 'submitWaveStrategyQuickScan' action: 'submitWaveStrategyQuickScan'
@ -986,7 +979,7 @@ export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [
{ {
key: 'fetchByIds', key: 'fetchByIds',
label: '按订单IDs抓取散单', label: '按订单IDs抓取散单',
type: 'warning', category: 'action',
size: 'small', size: 'small',
loadingKey: 'singleOrderSubmitting', loadingKey: 'singleOrderSubmitting',
disabledKey: 'noSelection', disabledKey: 'noSelection',
@ -996,9 +989,9 @@ export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [
/** 波次策略页工具栏按钮 */ /** 波次策略页工具栏按钮 */
export const waveStrategyToolbarButtons: ToolbarButtonConfig[] = [ export const waveStrategyToolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' }, { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' }, { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
{ key: 'create', label: '新建策略', type: 'success', size: 'small', action: 'openCreateWaveStrategyDialog' } { key: 'create', label: '新建策略', category: 'action', size: 'small', action: 'openCreateWaveStrategyDialog' }
] ]
/** 拣货任务 status 枚举(与 wavePickTaskList / wavePickTaskCancel 文档一致) */ /** 拣货任务 status 枚举(与 wavePickTaskList / wavePickTaskCancel 文档一致) */

View File

@ -18,9 +18,8 @@
<div class="toolbar"> <div class="toolbar">
<div class="toolbar-left"> <div class="toolbar-left">
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button> <el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
<!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
<el-button size="small" type="primary" plain @click="searchDialogVisible = true">快速搜索</el-button>
<el-button type="success" size="small" @click="openCreate">新增组合商品</el-button> <el-button type="success" size="small" @click="openCreate">新增组合商品</el-button>
<el-button size="small" type="primary" plain @click="searchDialogVisible = true">快速搜索</el-button>
</div> </div>
<div class="toolbar-right"> <div class="toolbar-right">

View File

@ -543,6 +543,14 @@ export type StockToolbarButtonConfig = ToolbarButtonConfig & {
export const stockToolbarButtons: StockToolbarButtonConfig[] = [ export const stockToolbarButtons: StockToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' }, { key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
{
key: 'toggleDetail',
label: '显示详情',
dynamicLabelKey: 'detailToggleLabel',
size: 'small',
action: 'toggleDetailVisible'
},
{ {
key: 'add', key: 'add',
label: '添加', label: '添加',
@ -551,16 +559,7 @@ export const stockToolbarButtons: StockToolbarButtonConfig[] = [
permissionKey: 'stock.warehouse.saveWarehouseStock', permissionKey: 'stock.warehouse.saveWarehouseStock',
action: 'handleAdd' action: 'handleAdd'
}, },
{ { key: 'import', label: '导入', type: 'primary', plain: true, size: 'small', action: 'openImportDialog' },
key: 'batchDelete',
label: '批量删除',
type: 'danger',
size: 'small',
permissionKey: 'stock.warehouse.saveWarehouseStock',
disabledKey: 'hasNoSelection',
action: 'confirmBatchDelete'
},
// { key: 'clearData', label: '清空数据', type: 'warning', size: 'small', action: 'handleClearData' },
{ {
key: 'export', key: 'export',
label: '导出', label: '导出',
@ -574,13 +573,13 @@ export const stockToolbarButtons: StockToolbarButtonConfig[] = [
{ label: '导出全部', action: 'handleExportAll', divided: true } { label: '导出全部', action: 'handleExportAll', divided: true }
] ]
}, },
{ key: 'import', label: '导入', type: 'primary', plain: true, size: 'small', action: 'openImportDialog' },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
{ {
key: 'toggleDetail', key: 'batchDelete',
label: '显示详情', label: '批量删除',
dynamicLabelKey: 'detailToggleLabel', type: 'danger',
size: 'small', size: 'small',
action: 'toggleDetailVisible' permissionKey: 'stock.warehouse.saveWarehouseStock',
disabledKey: 'hasNoSelection',
action: 'confirmBatchDelete'
} }
] ]

View File

@ -568,11 +568,12 @@ export const addReceivingFields = [
/** 收货单列表主工具栏按钮(action 与 receiving/index.vue 内 toolbarActionMap 键一致) */ /** 收货单列表主工具栏按钮(action 与 receiving/index.vue 内 toolbarActionMap 键一致) */
export const receivingToolbarButtons: ToolbarButtonConfig[] = [ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' }, { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
{ key: 'create', label: '添加收货单', type: 'primary', size: 'small', action: 'handleCreateReceiving' }, { key: 'create', label: '添加收货单', category: 'action', size: 'small', action: 'handleCreateReceiving' },
{ {
key: 'export', key: 'export',
label: '导出', label: '导出',
category: 'setting',
size: 'small', size: 'small',
loadingKey: 'exportLoading', loadingKey: 'exportLoading',
action: 'handleExportSelected', action: 'handleExportSelected',
@ -582,18 +583,19 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
{ label: '导出全部', action: 'handleExportAll', divided: true }, { label: '导出全部', action: 'handleExportAll', divided: true },
] ]
}, },
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' }, { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
{ {
key: 'toggleDetail', key: 'toggleDetail',
label: '显示详情', label: '显示详情',
dynamicLabelKey: 'detailToggleLabel', dynamicLabelKey: 'detailToggleLabel',
category: 'setting',
size: 'small', size: 'small',
action: 'toggleDetailVisible' action: 'toggleDetailVisible'
}, },
{ {
key: 'complete', key: 'complete',
label: '完成收货', label: '完成收货',
type: 'primary', category: 'action',
size: 'small', size: 'small',
disabledKey: 'hasNoSelection', disabledKey: 'hasNoSelection',
action: 'confirmcomplete' action: 'confirmcomplete'

View File

@ -2418,7 +2418,7 @@ async function handleGenerateBindCode(row: any) {
bindCodeDialog.loading = true bindCodeDialog.loading = true
try { try {
const storeId = row.store_id || row.id const storeId = row.store_id || row.id
const res = await inboxBindCode(storeId) as any const res = await inboxBindCode({ storeId }) as any
if (res?.data?.code) { if (res?.data?.code) {
bindCodeDialog.code = res.data.code bindCodeDialog.code = res.data.code
ElMessage.success('授权码生成成功') ElMessage.success('授权码生成成功')

View File

@ -212,12 +212,13 @@ export const presetTree: any[] = []
// 详情面板字段配置 // 详情面板字段配置
/** 货主列表主工具栏按钮(action 与 stores/index.vue 内 toolbarActionMap 键一致) */ /** 货主列表主工具栏按钮(action 与 stores/index.vue 内 toolbarActionMap 键一致) */
export const storeToolbarButtons: ToolbarButtonConfig[] = [ export const storeToolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadList' }, { key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
{ key: 'openAccount', label: '代开户', type: 'success', size: 'small', action: 'openOpenAccountDialog' }, { key: 'openAccount', label: '代开户', category: 'action', size: 'small', action: 'openOpenAccountDialog' },
{ {
key: 'toggleBalance', key: 'toggleBalance',
label: '显示余额', label: '显示余额',
dynamicLabelKey: 'balanceToggleLabel', dynamicLabelKey: 'balanceToggleLabel',
category: 'setting',
size: 'small', size: 'small',
action: 'toggleBalance' action: 'toggleBalance'
}, },
@ -225,6 +226,7 @@ export const storeToolbarButtons: ToolbarButtonConfig[] = [
key: 'toggleDetail', key: 'toggleDetail',
label: '显示详情', label: '显示详情',
dynamicLabelKey: 'detailToggleLabel', dynamicLabelKey: 'detailToggleLabel',
category: 'setting',
size: 'small', size: 'small',
action: 'toggleDetailVisible' action: 'toggleDetailVisible'
} }

View File

@ -18,7 +18,7 @@
<div class="toolbar-left"> <div class="toolbar-left">
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button> <el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
<el-button size="small" @click="openScanDialog">扫码查询</el-button> <el-button size="small" @click="openScanDialog">扫码查询</el-button>
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> <!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
</div> </div>
<el-button-group> <el-button-group>
<el-button type="success" size="small" @click="openCreate">新增拣货车</el-button> <el-button type="success" size="small" @click="openCreate">新增拣货车</el-button>