1
This commit is contained in:
parent
c69d332b1b
commit
78f638a3e8
@ -192,6 +192,7 @@ export interface InboxGroupUpdateParams {
|
||||
storeId?: number // 关联货主ID
|
||||
expressInterfaces?: number[] // 快递接口ID数组,仅groupType=express时生效
|
||||
systemExpressCode?: string // 系统快递编码,groupType=express时必填
|
||||
aiEnabled?: number // 是否启用AI自动回复: 0=关闭 1=开启,默认1
|
||||
}
|
||||
|
||||
/** 修改群信息(inbox.group.update) */
|
||||
|
||||
@ -434,6 +434,7 @@
|
||||
<div v-if="field.type === 'select'" class="compact-field-item">
|
||||
<el-select
|
||||
v-model="customConditions[field.value].value"
|
||||
:multiple="!!field.multiple"
|
||||
:placeholder="field.label"
|
||||
size="small"
|
||||
clearable
|
||||
@ -533,11 +534,36 @@
|
||||
</div>
|
||||
<!-- 文本类型(默认) -->
|
||||
<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
|
||||
v-else
|
||||
v-model="customConditions[field.value].value"
|
||||
:placeholder="field.label"
|
||||
size="small"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleCompactChange"
|
||||
/>
|
||||
</div>
|
||||
@ -716,9 +742,6 @@ function handleCompactChange() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasValue) {
|
||||
condition.operator = ''
|
||||
}
|
||||
})
|
||||
scheduleSaveSnapshot()
|
||||
if (props.autoSubmit) {
|
||||
@ -1895,7 +1918,7 @@ defineExpose({ getConditions, reset, clear, getFieldDraft, setFieldCondition, su
|
||||
.compact-fields {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 8px 10px;
|
||||
padding: 8px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
@ -1914,4 +1937,31 @@ defineExpose({ getConditions, reset, clear, getFieldDraft, setFieldCondition, su
|
||||
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>
|
||||
|
||||
@ -74,6 +74,8 @@ export default {
|
||||
'PackingFlow':'Packing Flow',
|
||||
'printcomputer':'Print Computer',
|
||||
'waybill':'waybill',
|
||||
'inbox_messages':'messages',
|
||||
'inbox_groups':'groups',
|
||||
'':'',
|
||||
'':'',
|
||||
'':'',
|
||||
|
||||
@ -77,8 +77,8 @@ export default {
|
||||
'PackingFlow':'打包流水',
|
||||
'printcomputer':'打印电脑',
|
||||
'waybill':'运单',
|
||||
'':'',
|
||||
'':'',
|
||||
'inbox_messages':'消息',
|
||||
'inbox_groups':'群组',
|
||||
'':'',
|
||||
'':'',
|
||||
'':'',
|
||||
|
||||
@ -41,6 +41,7 @@ export const groupColumns = [
|
||||
{ prop: 'system_express_code', label: '系统快递编码', minWidth: '140', showOverflowTooltip: true },
|
||||
{ prop: 'is_blocked', label: '状态', width: '80' },
|
||||
{ prop: 'created_at', label: '创建时间', width: '170' },
|
||||
{ prop: 'actions', label: '操作', width: '220', fixed: 'right' },
|
||||
]
|
||||
|
||||
// ============================================================
|
||||
@ -50,8 +51,7 @@ export const groupToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'refresh',
|
||||
label: '刷新',
|
||||
type: 'primary',
|
||||
icon: 'Refresh',
|
||||
plain: false,
|
||||
category: 'refresh',
|
||||
action: 'loadData',
|
||||
},
|
||||
]
|
||||
|
||||
@ -10,21 +10,14 @@
|
||||
@condition-change="handleConditionChange"
|
||||
@reset="handleConditionReset"
|
||||
@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="toolbar">
|
||||
<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-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
|
||||
<!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -71,6 +64,14 @@
|
||||
</el-tag>
|
||||
</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>
|
||||
<div class="empty-tip">暂无群组数据</div>
|
||||
</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-item label="选择货主" prop="storeId">
|
||||
<el-select v-model="bindForm.storeId" placeholder="请选择货主" filterable style="width: 100%" :loading="storeLoading">
|
||||
@ -118,7 +119,7 @@
|
||||
</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-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>
|
||||
@ -142,10 +143,17 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<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 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>
|
||||
<template #footer>
|
||||
@ -155,7 +163,7 @@
|
||||
</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">
|
||||
<el-select v-model="msgFilter.direction" placeholder="消息方向" clearable size="small" style="width: 120px" @change="fetchGroupMessages">
|
||||
<el-option label="入站" value="inbound" />
|
||||
@ -204,7 +212,9 @@ import {
|
||||
inboxGroupMessages,
|
||||
inboxBindCode,
|
||||
} 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 ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
@ -334,8 +344,12 @@ const editDialogVisible = ref(false)
|
||||
const editLoading = ref(false)
|
||||
const editFormRef = ref<FormInstance>()
|
||||
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 editRules: FormRules = { systemExpressCode: [{ validator: (_r, _v, cb) => { if (editForm.groupType === 'express' && !editForm.systemExpressCode) cb(new Error('快递类型时系统快递编码不能为空')); else cb() }, trigger: 'blur' }] }
|
||||
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: '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) {
|
||||
editingRow.value = row
|
||||
@ -344,12 +358,40 @@ function handleEdit(row: any) {
|
||||
editForm.storeId = row.store_id ?? null
|
||||
editForm.expressInterfaces = Array.isArray(row.express_interfaces) ? [...row.express_interfaces] : []
|
||||
editForm.systemExpressCode = row.system_express_code ?? ''
|
||||
editForm.aiEnabled = row.ai_enabled ?? 1
|
||||
editDialogVisible.value = true; loadStoreList()
|
||||
}
|
||||
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() {
|
||||
if (editForm.groupType !== 'express') { editForm.expressInterfaces = []; editForm.systemExpressCode = '' }
|
||||
if (editForm.groupType !== 'store') editForm.storeId = null
|
||||
if (editForm.groupType === 'express') loadExpressOptions()
|
||||
}
|
||||
|
||||
async function handleSubmitEdit() {
|
||||
@ -362,6 +404,7 @@ async function handleSubmitEdit() {
|
||||
if (editForm.groupType !== 'express' && 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
|
||||
const res: any = await inboxGroupUpdate(params)
|
||||
if (res && (res.code === 1 || res.code === 200 || res.code === 20000)) {
|
||||
ElMessage.success(res.data?.message || res.message || '群信息修改成功')
|
||||
|
||||
@ -16,8 +16,13 @@
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
@ -48,7 +53,7 @@
|
||||
|
||||
<template #column-source_type="{ row }">
|
||||
<el-tag size="small" :type="row.source_type === 'api' ? '' : 'info'">
|
||||
{{ row.source_type === 'api' ? 'API' : row.source_type ?? '-' }}
|
||||
{{ sourceTypeLabel(row.source_type) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
@ -74,6 +79,17 @@
|
||||
<span v-else>-</span>
|
||||
</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>
|
||||
<div class="empty-tip">暂无站内信消息数据</div>
|
||||
</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">
|
||||
<el-descriptions :column="2" border size="small">
|
||||
<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="工单ID">{{ detailData.work_order_id ?? '-' }}</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="更新时间">{{ detailData.updated_at ?? '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="创建时间">{{ formatTime(detailData.created_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">
|
||||
<div class="content-text">{{ detailData.content }}</div>
|
||||
</el-descriptions-item>
|
||||
@ -139,7 +155,7 @@
|
||||
</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-item label="原消息ID">
|
||||
<el-input :model-value="replyForm.parentId" disabled />
|
||||
@ -174,13 +190,13 @@
|
||||
</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">
|
||||
<el-timeline>
|
||||
<el-timeline-item
|
||||
v-for="item in threadData"
|
||||
:key="item.id"
|
||||
:timestamp="item.created_at"
|
||||
:timestamp="formatTime(item.created_at)"
|
||||
placement="top"
|
||||
:type="item.direction === 'inbound' ? 'primary' : 'success'"
|
||||
>
|
||||
@ -211,7 +227,7 @@
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
inboxList,
|
||||
@ -237,11 +253,20 @@ const channelTagTypeMap: Record<string, string> = {
|
||||
}
|
||||
const pushStatusLabelMap: Record<number, string> = { 0: '待推送', 1: '推送中', 2: '已送达', 3: '失败' }
|
||||
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 channelTagType(c: string) { return channelTagTypeMap[c] ?? 'info' }
|
||||
function pushStatusLabel(s: number) { return pushStatusLabelMap[s] ?? '未知' }
|
||||
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() {
|
||||
// stats in background - not blocking
|
||||
try {
|
||||
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 */ }
|
||||
}
|
||||
|
||||
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() {
|
||||
fetchData()
|
||||
fetchStats()
|
||||
|
||||
@ -84,6 +84,7 @@ export const messageColumns = [
|
||||
{ prop: 'retry_count', label: '重试', width: '60' },
|
||||
{ prop: 'parent_id', label: '父消息ID', width: '90' },
|
||||
{ prop: 'created_at', label: '创建时间', width: '170' },
|
||||
{ prop: 'actions', label: '操作', width: '240', fixed: 'right' },
|
||||
]
|
||||
|
||||
// ============================================================
|
||||
@ -93,9 +94,8 @@ export const messageToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'refresh',
|
||||
label: '刷新',
|
||||
type: 'primary',
|
||||
icon: 'Refresh',
|
||||
plain: false,
|
||||
category: 'refresh',
|
||||
action: 'loadData',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
trigger="click"
|
||||
split-button
|
||||
:size="button.size || 'small'"
|
||||
:type="button.type"
|
||||
:plain="button.plain"
|
||||
:type="resolveButtonStyle(button).type"
|
||||
:plain="resolveButtonStyle(button).plain"
|
||||
:disabled="resolveDisabled(button.disabledKey) || resolveLoading(button.loadingKey)"
|
||||
@click="emitAction(button.action)"
|
||||
@command="emitAction"
|
||||
@ -31,8 +31,8 @@
|
||||
<el-button
|
||||
v-else
|
||||
:size="button.size || 'small'"
|
||||
:type="button.type"
|
||||
:plain="button.plain"
|
||||
:type="resolveButtonStyle(button).type"
|
||||
:plain="resolveButtonStyle(button).plain"
|
||||
:disabled="resolveDisabled(button.disabledKey)"
|
||||
:loading="resolveLoading(button.loadingKey)"
|
||||
@click="emitAction(button.action)"
|
||||
@ -61,8 +61,8 @@
|
||||
v-for="option in button.dropdownOptions"
|
||||
:key="`overflow-${button.key}-${option.action}`"
|
||||
:size="button.size || 'small'"
|
||||
:type="button.type"
|
||||
:plain="button.plain"
|
||||
:type="resolveButtonStyle(button).type"
|
||||
:plain="resolveButtonStyle(button).plain"
|
||||
:disabled="resolveDisabled(button.disabledKey)"
|
||||
:loading="resolveLoading(button.loadingKey)"
|
||||
class="order-toolbar-button-group__overflow-item"
|
||||
@ -74,8 +74,8 @@
|
||||
<el-button
|
||||
v-else
|
||||
:size="button.size || 'small'"
|
||||
:type="button.type"
|
||||
:plain="button.plain"
|
||||
:type="resolveButtonStyle(button).type"
|
||||
:plain="resolveButtonStyle(button).plain"
|
||||
:disabled="resolveDisabled(button.disabledKey)"
|
||||
:loading="resolveLoading(button.loadingKey)"
|
||||
class="order-toolbar-button-group__overflow-item"
|
||||
@ -138,6 +138,17 @@ function emitAction(action: ToolbarButtonConfig['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']) {
|
||||
expandVisible.value = false
|
||||
emitAction(action)
|
||||
@ -246,7 +257,7 @@ watch(isTileMode, () => {
|
||||
max-width: 100%;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
gap: 4px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.order-toolbar-button-group--tile {
|
||||
@ -267,12 +278,31 @@ watch(isTileMode, () => {
|
||||
.order-toolbar-button-group--tile .order-toolbar-button-group__main {
|
||||
overflow: visible;
|
||||
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) {
|
||||
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 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -305,6 +335,65 @@ watch(isTileMode, () => {
|
||||
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 lang="scss">
|
||||
|
||||
@ -275,6 +275,13 @@ export interface ToolbarButtonConfig {
|
||||
loadingKey?: string
|
||||
disabledKey?: string
|
||||
action: string
|
||||
/** 按钮样式分类(优先级高于 type/plain):
|
||||
* 'refresh' - 蓝底白字(primary)
|
||||
* 'setting' - 白底黑字(default)
|
||||
* 'action' - 白底蓝边框蓝字(primary + plain)
|
||||
* 'cancel' - 红底白字(danger)
|
||||
* 不设置则沿用 type/plain */
|
||||
category?: 'refresh' | 'setting' | 'action' | 'cancel'
|
||||
/** 下拉按钮:主按钮点击 action,菜单项使用 dropdownOptions[].action */
|
||||
buttonType?: 'default' | 'dropdown'
|
||||
dropdownOptions?: Array<{ label: string; action: string; divided?: boolean }>
|
||||
@ -308,10 +315,11 @@ export interface PendingBatchAsyncTaskConfig {
|
||||
}
|
||||
|
||||
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: {
|
||||
key: 'export',
|
||||
label: '导出',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
loadingKey: 'exportLoading',
|
||||
action: 'handleExportWaybill',
|
||||
@ -324,6 +332,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
exportSelection: {
|
||||
key: 'exportSelection',
|
||||
label: '导出选中',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
loadingKey: 'exportSelectionLoading',
|
||||
disabledKey: 'hasNoSelection',
|
||||
@ -332,6 +341,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
deliveryExport: {
|
||||
key: 'deliveryExport',
|
||||
label: '导出',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
loadingKey: 'exportLoading',
|
||||
action: 'handleExportWaybill',
|
||||
@ -341,52 +351,63 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
{ label: '导出全部', action: 'handleExportWaybill' }
|
||||
]
|
||||
},
|
||||
columnConfig: { key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
toggleDetail: { key: 'toggleDetail', label: '显示详情', dynamicLabelKey: 'detailToggleLabel', size: 'small', action: 'toggleDetailVisible' },
|
||||
reverseReview: { key: 'reverseReview', label: '反审回待审核', size: 'small', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleReverseReview' },
|
||||
createOrder: { key: 'createOrder', label: '建单', size: 'small', type: 'primary', plain: true, action: 'openCreateOrderDialog' },
|
||||
columnConfig: { key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
toggleDetail: { key: 'toggleDetail', label: '显示详情', dynamicLabelKey: 'detailToggleLabel', category: 'setting', size: 'small', action: 'toggleDetailVisible' },
|
||||
exceptionExcel: {
|
||||
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' },
|
||||
allocateStorage: { key: 'allocateStorage', label: '分配储位', size: 'small', type: 'primary', plain: true, loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageAllocateDialog' },
|
||||
cancelAllocateStorage: { key: 'cancelAllocateStorage', label: '取消分配储位', size: 'small', type: 'danger', plain: true, loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageCancelDialog' },
|
||||
allocateStorage: { key: 'allocateStorage', label: '分配储位', size: 'small', category: 'action', loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageAllocateDialog' },
|
||||
cancelAllocateStorage: { key: 'cancelAllocateStorage', label: '取消分配储位', size: 'small', category: 'cancel', loadingKey: 'storageAllocateLoading', disabledKey: 'hasNoSelection', action: 'openStorageCancelDialog' },
|
||||
waveSingleFetchByIds: {
|
||||
key: 'waveSingleFetchByIds',
|
||||
label: '抓取散单',
|
||||
size: 'small',
|
||||
type: 'primary',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
loadingKey: 'waveSingleFetchLoading',
|
||||
disabledKey: 'hasNoSelection',
|
||||
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: {
|
||||
key: 'batchQuickRecheck',
|
||||
label: '批量发货',
|
||||
size: 'small',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'openBatchQuickRecheckDialog'
|
||||
},
|
||||
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' },
|
||||
updateRemark: { key: 'updateRemark', label: '修改留言', size: 'small', type: 'warning', plain: true, loadingKey: 'updateRemarkLoading', disabledKey: 'hasNoSelection', action: 'openUpdateRemarkDialog' },
|
||||
cloneOrder: { key: 'cloneOrder', label: '克隆订单', size: 'small', type: 'warning', plain: true, loadingKey: 'cloneOrderLoading', disabledKey: 'notSingleSelection', action: 'openCloneOrderDialog' },
|
||||
syncOrderIds: { key: 'syncOrderIds', label: '同步订单', size: 'small', type: 'primary', plain: true, loadingKey: 'syncOrderIdsLoading', disabledKey: 'hasNoSelection', action: 'openSyncOrderIdsDialog' },
|
||||
cancelOrder: { key: 'cancelOrder', label: '取消订单', size: 'small', type: 'danger', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleCancelOrder' },
|
||||
batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', type: 'danger', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' },
|
||||
batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', type: 'warning', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' },
|
||||
batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', type: 'warning', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' },
|
||||
batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', type: 'primary', plain: true, loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' },
|
||||
batchPrint: { key: 'batchPrint', label: '批量打印', size: 'small', type: 'primary', loadingKey: 'batchPrintLoading', disabledKey: 'hasNoSelection', action: 'handleBatchPrint' },
|
||||
batchReview: { key: 'batchReview', label: '批量审核通过', size: 'small', type: 'success', loadingKey: 'reviewSubmitting', disabledKey: 'hasNoSelection', action: 'handleBatchReview' },
|
||||
manualWaybill: { key: 'manualWaybill', label: '录入运单号', size: 'small', category: 'action', loadingKey: 'manualWaybillLoading', disabledKey: 'notSingleSelection', action: 'openManualWaybillDialog' },
|
||||
updateExpress: { key: 'updateExpress', label: '修改快递', size: 'small', category: 'action', loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderExpressDialog' },
|
||||
updatePlatform: { key: 'updatePlatform', label: '修改平台', size: 'small', category: 'action', loadingKey: 'updateOrderMetaLoading', disabledKey: 'hasNoSelection', action: 'openUpdateOrderPlatformDialog' },
|
||||
updateAddress: { key: 'updateAddress', label: '修改地址', size: 'small', category: 'action', loadingKey: 'updateAddressLoading', disabledKey: 'hasNoSelection', action: 'openUpdateAddressDialog' },
|
||||
updateRemark: { key: 'updateRemark', label: '修改留言', size: 'small', category: 'action', loadingKey: 'updateRemarkLoading', disabledKey: 'hasNoSelection', action: 'openUpdateRemarkDialog' },
|
||||
cloneOrder: { key: 'cloneOrder', label: '克隆订单', size: 'small', category: 'action', loadingKey: 'cloneOrderLoading', disabledKey: 'notSingleSelection', action: 'openCloneOrderDialog' },
|
||||
syncOrderIds: { key: 'syncOrderIds', label: '同步订单', size: 'small', category: 'action', loadingKey: 'syncOrderIdsLoading', disabledKey: 'hasNoSelection', action: 'openSyncOrderIdsDialog' },
|
||||
cancelOrder: { key: 'cancelOrder', label: '取消订单', size: 'small', category: 'cancel', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleCancelOrder' },
|
||||
batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', category: 'cancel', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' },
|
||||
batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', category: 'action', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' },
|
||||
batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', category: 'action', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' },
|
||||
batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', category: 'action', loadingKey: 'batchAsyncTaskLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' },
|
||||
batchPrint: { key: 'batchPrint', label: '批量打印', size: 'small', category: 'action', loadingKey: 'batchPrintLoading', disabledKey: 'hasNoSelection', action: 'handleBatchPrint' },
|
||||
batchReview: { key: 'batchReview', label: '批量审核通过', size: 'small', category: 'action', loadingKey: 'reviewSubmitting', disabledKey: 'hasNoSelection', action: 'handleBatchReview' },
|
||||
manualOutboundMigrate: {
|
||||
key: 'manualOutboundMigrate',
|
||||
label: '手动出库迁移',
|
||||
size: 'small',
|
||||
type: 'warning',
|
||||
category: 'action',
|
||||
loadingKey: 'manualLoading',
|
||||
disabledKey: 'hasNoOutboundTarget',
|
||||
action: 'handleToolbarManualOutbound'
|
||||
@ -395,7 +416,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
key: 'resolveException',
|
||||
label: '处理异常订单',
|
||||
size: 'small',
|
||||
type: 'warning',
|
||||
category: 'action',
|
||||
loadingKey: 'resolveExceptionLoading',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'openResolveExceptionDialog'
|
||||
@ -404,8 +425,7 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
key: 'allocateSubOrderNumber',
|
||||
label: '分配子单号',
|
||||
size: 'small',
|
||||
type: 'primary',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
loadingKey: 'allocateSubOrderNumberLoading',
|
||||
disabledKey: 'notSingleSelection',
|
||||
action: 'openAllocateSubOrderNumberDialog'
|
||||
@ -414,12 +434,12 @@ export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
key: 'subWaybillPrint',
|
||||
label: '子单号打印',
|
||||
size: 'small',
|
||||
type: 'success',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
loadingKey: 'subWaybillPrintLoading',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'handleSubWaybillPrint'
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export function pickToolbarButtons(keys: string[]) {
|
||||
@ -1894,12 +1914,11 @@ export const pendingOrderbuttonList: any[] = [
|
||||
|
||||
export const pendingToolbarButtonKeys = [
|
||||
...simpleListToolbarButtonKeys,
|
||||
'reverseReview',
|
||||
'createOrder',
|
||||
'reverseReview',
|
||||
'markPendingOutbound',
|
||||
'waveSingleFetchByIds',
|
||||
'allocateStorage',
|
||||
'cancelAllocateStorage',
|
||||
'allocateExpress',
|
||||
'manualWaybill',
|
||||
'updateExpress',
|
||||
@ -1909,15 +1928,16 @@ export const pendingToolbarButtonKeys = [
|
||||
'batchQuickRecheck',
|
||||
'cloneOrder',
|
||||
'syncOrderIds',
|
||||
'cancelOrder',
|
||||
'batchIntercept',
|
||||
'batchUnintercept',
|
||||
'batchLock',
|
||||
'batchUnlock',
|
||||
'batchPrint',
|
||||
'resolveException',
|
||||
'allocateSubOrderNumber',
|
||||
'subWaybillPrint'
|
||||
'subWaybillPrint',
|
||||
'cancelAllocateStorage',
|
||||
'cancelOrder',
|
||||
'batchIntercept',
|
||||
]
|
||||
|
||||
/** 页面级按钮列表:pendingOrder 直接消费,避免页面内重复拼装 */
|
||||
@ -1928,7 +1948,34 @@ export const pendingToolbarButtons = pickToolbarButtons(pendingToolbarButtonKeys
|
||||
/**
|
||||
* 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)
|
||||
|
||||
|
||||
|
||||
@ -24,40 +24,6 @@
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@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>
|
||||
|
||||
<!-- 已迁移至 ScanBox:搜索订单号 -->
|
||||
@ -407,7 +373,6 @@ import {
|
||||
buildPendingStyleColumns,
|
||||
expectionColumns,
|
||||
expectionOrderAvailableFields,
|
||||
expectionOrderbuttonList,
|
||||
exceptionToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
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) {
|
||||
const label = commandLabels[command] || '操作'
|
||||
const labelMap: Record<string, string> = {
|
||||
'import-exception-tracking': '异常跟踪单导入',
|
||||
'export-exception-tracking': '导出异常跟踪单'
|
||||
}
|
||||
const label = labelMap[command] || '操作'
|
||||
exportLoading.value = true
|
||||
setTimeout(() => {
|
||||
exportLoading.value = false
|
||||
@ -995,7 +949,9 @@ const {
|
||||
const toolbarActionMap: Record<string, () => void | Promise<void>> = {
|
||||
...pendingToolbarActionMap,
|
||||
openResolveExceptionDialog,
|
||||
handleBatchPrint
|
||||
handleBatchPrint,
|
||||
'import-exception-tracking': () => handleExpectionOperation('import-exception-tracking'),
|
||||
'export-exception-tracking': () => handleExpectionOperation('export-exception-tracking')
|
||||
}
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
|
||||
@ -2,38 +2,45 @@
|
||||
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
||||
<!-- 多标签模式 -->
|
||||
<template v-if="!singlePage">
|
||||
<div class="tabs-header-action">
|
||||
<!-- <el-button size="small" @click="workbenchDialogVisible = true">统一查询</el-button> -->
|
||||
<!-- <el-button size="small" @click="bindByWaybillDialogVisible = true">按运单绑定包材</el-button> -->
|
||||
<el-button size="small" :loading="badgeLoading" @click="refreshBadgeCounts">刷新角标</el-button>
|
||||
</div>
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
@tab-change="handleTabChange"
|
||||
tab-position="top"
|
||||
type="border-card"
|
||||
class="tab-container"
|
||||
>
|
||||
<el-tab-pane
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
:name="tab.name"
|
||||
:lazy="false"
|
||||
<!-- 顶部多标签页区域(对齐 stock/stockManagement 的 tab-section) -->
|
||||
<div class="tab-section">
|
||||
<div class="tabs-header-action">
|
||||
<!-- <el-button size="small" @click="workbenchDialogVisible = true">统一查询</el-button> -->
|
||||
<!-- <el-button size="small" @click="bindByWaybillDialogVisible = true">按运单绑定包材</el-button> -->
|
||||
<el-button size="small" :loading="badgeLoading" @click="refreshBadgeCounts">刷新角标</el-button>
|
||||
</div>
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
@tab-change="handleTabChange"
|
||||
tab-position="top"
|
||||
type="border-card"
|
||||
class="tab-container"
|
||||
>
|
||||
<template #label>
|
||||
<span class="custom-tab-label">
|
||||
{{ tab.label }}
|
||||
<el-badge
|
||||
:value="tab.count"
|
||||
:max="99"
|
||||
:hidden="tab.count === 0"
|
||||
class="tab-badge"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
<component :is="tab.component" v-if="activeTab === tab.name" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-tab-pane
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
:name="tab.name"
|
||||
:lazy="false"
|
||||
>
|
||||
<template #label>
|
||||
<span class="custom-tab-label">
|
||||
{{ tab.label }}
|
||||
<el-badge
|
||||
:value="tab.count"
|
||||
:max="99"
|
||||
:hidden="tab.count === 0"
|
||||
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>
|
||||
|
||||
<!-- 单页模式:直接渲染默认页签组件 -->
|
||||
@ -86,6 +93,12 @@ type OrderTabItem = {
|
||||
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[]>([
|
||||
{
|
||||
name: 'reviewOrder',
|
||||
@ -227,14 +240,28 @@ const handleTabChange = (tabName: string | number) => {
|
||||
.order-management-wrapper {
|
||||
position: relative;
|
||||
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;
|
||||
}
|
||||
|
||||
.tabs-header-action {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: 4px;
|
||||
right: 16px;
|
||||
height: 42px;
|
||||
height: 38px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
z-index: 2;
|
||||
@ -243,7 +270,6 @@ const handleTabChange = (tabName: string | number) => {
|
||||
.tab-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
:deep(.el-tabs__header) {
|
||||
margin-bottom: 0;
|
||||
@ -298,14 +324,9 @@ const handleTabChange = (tabName: string | number) => {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/* 隐藏内容区,仅展示标签头(对齐 stock/stockManagement) */
|
||||
:deep(.el-tabs__content) {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
|
||||
.el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
background: #fff;
|
||||
border: 1px solid #e8eef7;
|
||||
border-radius: 6px;
|
||||
|
||||
@ -64,18 +64,16 @@
|
||||
border: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
background-color: #fff;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.toolbar-left {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
|
||||
@ -24,8 +24,6 @@
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<span class="toolbar-switch-label">仅待复核波次</span>
|
||||
<el-switch
|
||||
v-model="onlyTodoWaves"
|
||||
@ -39,6 +37,7 @@
|
||||
@change="handleSourceFilterChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar-right" />
|
||||
</div>
|
||||
|
||||
<div class="split-stack" ref="splitStackRef">
|
||||
|
||||
@ -24,8 +24,6 @@
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<span class="toolbar-switch-label">仅待复核波次</span>
|
||||
<el-switch
|
||||
v-model="onlyTodoWaves"
|
||||
@ -39,6 +37,7 @@
|
||||
@change="handleSourceFilterChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar-right" />
|
||||
</div>
|
||||
|
||||
<div class="split-stack" ref="splitStackRef">
|
||||
|
||||
@ -475,12 +475,13 @@ export function getWaveAssignmentAggregateTagType(value: string | number | null
|
||||
* 主工具栏按钮(action 与波次列表页内 toolbarActionMap 键一致)
|
||||
*/
|
||||
export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{
|
||||
key: 'toggleDetail',
|
||||
label: '显示详情',
|
||||
dynamicLabelKey: 'detailToggleLabel',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
},
|
||||
@ -488,7 +489,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
key: 'batchPrint',
|
||||
label: '批量打印(0)',
|
||||
dynamicLabelKey: 'batchPrintTotal',
|
||||
type: 'info',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'batchPrintDisabled',
|
||||
loadingKey: 'batchPrintLoading',
|
||||
@ -499,7 +500,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
key: 'batchOutboundPrint',
|
||||
label: '打印货单(0)',
|
||||
dynamicLabelKey: 'batchOutboundPrintTotal',
|
||||
type: 'info',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'batchOutboundPrintDisabled',
|
||||
loadingKey: 'batchOutboundPrintLoading',
|
||||
@ -510,8 +511,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
key: 'batchPlatformPrint',
|
||||
label: '批量打印(平台)(0)',
|
||||
dynamicLabelKey: 'batchPlatformPrintTotal',
|
||||
type: 'info',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'batchPlatformPrintDisabled',
|
||||
loadingKey: 'batchPlatformPrintLoading',
|
||||
@ -520,8 +520,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'printerComponentConnection',
|
||||
label: '打印组件连接',
|
||||
type: 'primary',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openPrinterComponentConnectionDialog',
|
||||
onlyForWaveType: 2
|
||||
@ -529,8 +528,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'printerListTest',
|
||||
label: '打印机列表',
|
||||
type: 'primary',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openPrinterListTestDialog',
|
||||
onlyForWaveType: 2
|
||||
@ -539,8 +537,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
key: 'batchPrintPickingList',
|
||||
label: '批量打印拣货单(0)',
|
||||
dynamicLabelKey: 'batchPickingPrintTotal',
|
||||
type: 'info',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchPrintLoading',
|
||||
@ -550,7 +547,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'batchAutoGrouping',
|
||||
label: '批量改为自动加团',
|
||||
type: 'warning',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchAutoGroupingLoading',
|
||||
@ -559,26 +556,17 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'batchFinishAutoGrouping',
|
||||
label: '批量结束自动加团',
|
||||
type: 'success',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchFinishAutoGroupingLoading',
|
||||
action: 'handleBatchFinishAutoGrouping'
|
||||
},
|
||||
{
|
||||
key: 'batchCancel',
|
||||
label: '批量取消波次',
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchCancelLoading',
|
||||
action: 'handleBatchCancel'
|
||||
},
|
||||
{
|
||||
key: 'batchQuickRecheckByWave',
|
||||
label: '批量发货(0)',
|
||||
dynamicLabelKey: 'batchQuickRecheckByWaveTotal',
|
||||
type: 'success',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchQuickRecheckByWaveLoading',
|
||||
@ -587,7 +575,7 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'batchAllocateExpress',
|
||||
label: '快速分配快递号',
|
||||
type: 'success',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchAllocateExpressLoading',
|
||||
@ -596,31 +584,38 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'batchAllocateStorage',
|
||||
label: '批量分配储位',
|
||||
type: 'primary',
|
||||
plain: true,
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchAllocateStorageLoading',
|
||||
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',
|
||||
label: '批量移除异常订单',
|
||||
type: 'danger',
|
||||
plain: true,
|
||||
category: 'cancel',
|
||||
size: 'small',
|
||||
disabledKey: 'noSelection',
|
||||
loadingKey: 'batchRemoveExceptionOrdersLoading',
|
||||
action: 'handleBatchRemoveExceptionOrders'
|
||||
},
|
||||
{
|
||||
key: 'fetchGroupOrder',
|
||||
label: '抓取团购单',
|
||||
type: 'warning',
|
||||
size: 'small',
|
||||
action: 'openGroupOrderDialog',
|
||||
onlyForWaveType: 1
|
||||
},
|
||||
// {
|
||||
// key: 'fetchSingleOrder',
|
||||
// label: '抓取散单候选',
|
||||
@ -955,14 +950,13 @@ export const pickTaskWaveDetailDialogDefaults = {
|
||||
|
||||
/** 拣货任务页工具栏按钮(action 与 WavePickTaskListPanel 内 toolbarActionMap 键一致) */
|
||||
export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'refresh', label: '刷新', size: 'small', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{ key: 'search', label: '查询', type: 'primary', size: 'small', action: 'handleSearch' },
|
||||
{ key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{
|
||||
key: 'batchCancel',
|
||||
label: '批量取消任务',
|
||||
dynamicLabelKey: 'batchCancelTotal',
|
||||
type: 'danger',
|
||||
category: 'cancel',
|
||||
size: 'small',
|
||||
loadingKey: 'batchCancelLoading',
|
||||
disabledKey: 'batchCancelDisabled',
|
||||
@ -972,13 +966,12 @@ export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
|
||||
|
||||
/** 不符合波次策略订单页工具栏按钮 */
|
||||
export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'search', label: '查询', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
// { key: 'reset', label: '重置', size: 'small', action: 'resetFallbackOrderCondition' },
|
||||
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{ key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{
|
||||
key: 'quickScan',
|
||||
label: '快速扫描',
|
||||
type: 'warning',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
loadingKey: 'waveStrategyQuickScanSubmitting',
|
||||
action: 'submitWaveStrategyQuickScan'
|
||||
@ -986,7 +979,7 @@ export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'fetchByIds',
|
||||
label: '按订单IDs抓取散单',
|
||||
type: 'warning',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
loadingKey: 'singleOrderSubmitting',
|
||||
disabledKey: 'noSelection',
|
||||
@ -996,9 +989,9 @@ export const fallbackOrderToolbarButtons: ToolbarButtonConfig[] = [
|
||||
|
||||
/** 波次策略页工具栏按钮 */
|
||||
export const waveStrategyToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{ key: 'create', label: '新建策略', type: 'success', size: 'small', action: 'openCreateWaveStrategyDialog' }
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{ key: 'create', label: '新建策略', category: 'action', size: 'small', action: 'openCreateWaveStrategyDialog' }
|
||||
]
|
||||
|
||||
/** 拣货任务 status 枚举(与 wavePickTaskList / wavePickTaskCancel 文档一致) */
|
||||
|
||||
@ -18,9 +18,8 @@
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<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 size="small" type="primary" plain @click="searchDialogVisible = true">快速搜索</el-button>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
|
||||
|
||||
@ -543,6 +543,14 @@ export type StockToolbarButtonConfig = ToolbarButtonConfig & {
|
||||
|
||||
export const stockToolbarButtons: StockToolbarButtonConfig[] = [
|
||||
{ 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',
|
||||
label: '添加',
|
||||
@ -551,16 +559,7 @@ export const stockToolbarButtons: StockToolbarButtonConfig[] = [
|
||||
permissionKey: 'stock.warehouse.saveWarehouseStock',
|
||||
action: 'handleAdd'
|
||||
},
|
||||
{
|
||||
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: 'import', label: '导入', type: 'primary', plain: true, size: 'small', action: 'openImportDialog' },
|
||||
{
|
||||
key: 'export',
|
||||
label: '导出',
|
||||
@ -574,13 +573,13 @@ export const stockToolbarButtons: StockToolbarButtonConfig[] = [
|
||||
{ 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',
|
||||
label: '显示详情',
|
||||
dynamicLabelKey: 'detailToggleLabel',
|
||||
key: 'batchDelete',
|
||||
label: '批量删除',
|
||||
type: 'danger',
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
permissionKey: 'stock.warehouse.saveWarehouseStock',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'confirmBatchDelete'
|
||||
}
|
||||
]
|
||||
|
||||
@ -568,11 +568,12 @@ export const addReceivingFields = [
|
||||
|
||||
/** 收货单列表主工具栏按钮(action 与 receiving/index.vue 内 toolbarActionMap 键一致) */
|
||||
export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'create', label: '添加收货单', type: 'primary', size: 'small', action: 'handleCreateReceiving' },
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'create', label: '添加收货单', category: 'action', size: 'small', action: 'handleCreateReceiving' },
|
||||
{
|
||||
key: 'export',
|
||||
label: '导出',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
loadingKey: 'exportLoading',
|
||||
action: 'handleExportSelected',
|
||||
@ -582,18 +583,19 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ label: '导出全部', action: 'handleExportAll', divided: true },
|
||||
]
|
||||
},
|
||||
{ key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{
|
||||
key: 'toggleDetail',
|
||||
label: '显示详情',
|
||||
dynamicLabelKey: 'detailToggleLabel',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
},
|
||||
{
|
||||
key: 'complete',
|
||||
label: '完成收货',
|
||||
type: 'primary',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'confirmcomplete'
|
||||
|
||||
@ -2418,7 +2418,7 @@ async function handleGenerateBindCode(row: any) {
|
||||
bindCodeDialog.loading = true
|
||||
try {
|
||||
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) {
|
||||
bindCodeDialog.code = res.data.code
|
||||
ElMessage.success('授权码生成成功')
|
||||
|
||||
@ -212,12 +212,13 @@ export const presetTree: any[] = []
|
||||
// 详情面板字段配置
|
||||
/** 货主列表主工具栏按钮(action 与 stores/index.vue 内 toolbarActionMap 键一致) */
|
||||
export const storeToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'refresh', label: '刷新', type: 'primary', size: 'small', loadingKey: 'loading', action: 'loadList' },
|
||||
{ key: 'openAccount', label: '代开户', type: 'success', size: 'small', action: 'openOpenAccountDialog' },
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
|
||||
{ key: 'openAccount', label: '代开户', category: 'action', size: 'small', action: 'openOpenAccountDialog' },
|
||||
{
|
||||
key: 'toggleBalance',
|
||||
label: '显示余额',
|
||||
dynamicLabelKey: 'balanceToggleLabel',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
action: 'toggleBalance'
|
||||
},
|
||||
@ -225,6 +226,7 @@ export const storeToolbarButtons: ToolbarButtonConfig[] = [
|
||||
key: 'toggleDetail',
|
||||
label: '显示详情',
|
||||
dynamicLabelKey: 'detailToggleLabel',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</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>
|
||||
<el-button-group>
|
||||
<el-button type="success" size="small" @click="openCreate">新增拣货车</el-button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user