This commit is contained in:
yin 2026-08-08 18:14:24 +08:00
parent 692e5cd4a4
commit ac42f708fe
37 changed files with 1809 additions and 1045 deletions

View File

@ -462,9 +462,12 @@ export type WaveStrategyFallbackOrderListRow = Record<string, unknown> & {
sys_platform_name?: string
items_count?: number | string
items_total?: number | string
items_weight?: number | string
weight_type?: string
buyer_message?: string
item_snapshot?: string
store_remark?: string
excluded_reason?: string
}
export type WaveStrategyFallbackOrderListPagination = {

View File

@ -1900,6 +1900,7 @@ defineExpose({ getConditions, reset, clear, getFieldDraft, setFieldCondition, su
flex-shrink: 0;
padding: 4px;
margin-left: auto;
margin-right: 16px;
color: #909399;
font-size: 14px;
}

View File

@ -12,13 +12,14 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" @click="loadData">
<el-icon><Refresh /></el-icon> 刷新
</el-button>
<el-button size="small" plain @click="tableRef?.openColumnConfig?.()">字段设置</el-button>
<el-button size="small" plain @click="toggleDetailVisible">
{{ detailVisible ? '隐藏详情' : '显示详情' }}
</el-button>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -32,12 +33,19 @@
table-id="packingflow-list"
:data="list"
:columns="columns"
:table-size="tableSize"
:loading="loading"
:pagination="pagination"
:show-index="true"
:show-selection="true"
:show-actions="true"
:query-time="queryTime"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handleSizeChange"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<template #column-id="{ row }">
<span>{{ row.id ?? '—' }}</span>
@ -74,7 +82,7 @@
<VideoButton :videos="row.videos || []" @click="openVideoList(row)" />
</template>
<template #column-operation="{ row }">
<div class="operation-btns">
<div class="wave-operation-actions">
<el-button
type="warning"
size="small"
@ -254,7 +262,6 @@
<script setup lang="ts">
import { ref, reactive, computed, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Refresh } from '@element-plus/icons-vue'
import dayjs from 'dayjs'
import { packingList, packingGet, packingSetEndTime, packingForceRecord, type PackingTaskItem, type PackingListSort } from '@/api/order/packing/index'
import {
@ -265,15 +272,19 @@ import {
getPackModeLabel,
getPackModeTagType,
hasVideoConfig,
videoEnableConfig
videoEnableConfig,
packingflowToolbarButtons
} from './packingflow-config'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import WarehouseSelect from '@/components/WarehouseSelect.vue'
import VideoButton, { type VideoItem } from './components/VideoButton.vue'
import VideoListDialog from './components/VideoListDialog.vue'
import VideoPlayerDialog from './components/VideoPlayerDialog.vue'
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
import { safeInvoke } from '@/utils/safe-invoke'
// ─── 列配置 ─────────────────────────────────────────────────────────────────
const columns = packingColumns
@ -315,7 +326,11 @@ function resolveVideoEnableVal(row: any): number {
const scanBox = ref()
const tableRef = ref()
const loading = ref(false)
const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const list = ref<PackingTaskItem[]>([])
const selectionRows = ref<PackingTaskItem[]>([])
const toolbarButtons = packingflowToolbarButtons
const pagination = reactive({
currentPage: 1,
pageSize: 20,
@ -328,9 +343,64 @@ const queryForm = reactive({
const whereConditions = ref<Record<string, any>>({})
// ─── 工具栏状态管理 ────────────────────────────────────────────────────────
const buttonLoadingMap = computed(() => ({
loading: loading.value
}))
const buttonDisabledMap = computed(() => ({}))
const buttonLabelMap = computed(() => ({
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({
loading: buttonLoadingMap.value,
disabled: buttonDisabledMap.value,
labels: buttonLabelMap.value
})
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean((buttonLoadingMap.value as Record<string, boolean>)[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean((buttonDisabledMap.value as Record<string, boolean>)[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return (buttonLabelMap.value as Record<string, string>)[dynamicLabelKey] || defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadData: () => { void loadData() },
openColumnConfigPanel: () => openColumnConfigPanel(),
toggleDetailVisible: () => toggleDetailVisible()
}
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
function handleSelectionChange(rows: PackingTaskItem[]) {
selectionRows.value = rows || []
}
function openColumnConfigPanel() {
tableRef.value?.openColumnConfig?.()
}
// ─── 数据加载 ──────────────────────────────────────────────────────────────
async function loadData() {
loading.value = true
const startTime = Date.now()
try {
const where: Record<string, any> = { ...whereConditions.value }
@ -354,6 +424,7 @@ async function loadData() {
} catch (e: any) {
ElMessage.error(e?.message || '查询异常')
} finally {
queryTime.value = Date.now() - startTime
loading.value = false
}
}
@ -625,7 +696,7 @@ onMounted(() => {
padding: 2px 0;
}
.operation-btns {
.wave-operation-actions {
display: flex;
align-items: center;
justify-content: center;

View File

@ -1,4 +1,22 @@
import dayjs from 'dayjs'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
// =============================================================================
// 工具栏按钮配置(对齐 order/waveOrder?tab=sandanWave)
// =============================================================================
export const packingflowToolbarButtons: ToolbarButtonConfig[] = [
{ 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'
},
]
// =============================================================================
// 类型定义
@ -140,7 +158,7 @@ export const packingColumns = [
{ prop: 'has_video', label: '包含录像', width: 90 },
{ prop: 'video_enable', label: '录像可用', width: 90 },
{ prop: 'videos', label: '录像', width: 110 },
{ prop: 'operation', label: '操作', width: 140, fixed: 'right' }
{ prop: 'operation', label: '操作', width: 100, fixed: 'right' }
]
// =============================================================================

View File

@ -68,10 +68,6 @@ export const groupColumns = [
// 工具栏按钮
// ============================================================
export const groupToolbarButtons: ToolbarButtonConfig[] = [
{
key: 'refresh',
label: '刷新',
category: 'refresh',
action: 'loadData',
},
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
{ key: 'showBindDialog', label: '生成绑群码', category: 'action', size: 'small', type: 'primary', action: 'showBindDialog' },
]

View File

@ -16,9 +16,14 @@
<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> -->
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -34,10 +39,14 @@
:table-size="tableSize"
:pagination="upperPagination"
:show-index="true"
:show-actions="true"
:loading="loading"
:query-time="queryTime"
row-key="id"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@sort-change="handleSortChange"
@refresh="handleRefresh"
>
<template #column-group_type="{ row }">
@ -72,11 +81,13 @@
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<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>
</div>
</template>
<template #empty>
@ -222,9 +233,12 @@ import {
import { loadStores, loadExpressInterfaces } from '@/api/index/index'
import { extractStoreListFromResponse, fillStoreScanFieldOptions, mapStoreListToSelectOptions } from '@/views/order/orderManagement/config/order-common-config'
import { expressIndexGetExpressList } from '@/api/setting.express/express'
import { groupAvailableFields, groupColumns } from './group-config'
import { groupAvailableFields, groupColumns, groupToolbarButtons } from './group-config'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
// ==================== 常量 ====================
@ -242,11 +256,43 @@ const availableFields = groupAvailableFields
const columns = groupColumns
const tableSize = 'small'
const toolbarButtons = groupToolbarButtons
const buttonLoadingMap = ref<Record<string, boolean>>({ loading: false })
const buttonDisabledMap = ref<Record<string, boolean>>({})
const buttonLabelMap = ref<Record<string, string>>({})
const toolbarLayoutKey = ref('')
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean(buttonLoadingMap.value[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean(buttonDisabledMap.value[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
return dynamicLabelKey ? (buttonLabelMap.value[dynamicLabelKey] || defaultLabel) : defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadData: () => { handleRefresh() },
showBindDialog: () => { showBindDialog() }
}
function handleToolbarButtonClick(action: string) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
// ==================== 数据状态 ====================
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const loading = ref(false)
const queryTime = ref(0)
const tableData = ref<any[]>([])
const currentConditions = ref<Record<string, any>>({})
const selectedRow = ref<any>(null)
@ -295,6 +341,7 @@ function buildWhereFromConditions(conditions: Record<string, any>) {
async function fetchData() {
loading.value = true
const start = Date.now()
try {
const where = buildWhereFromConditions(currentConditions.value)
const params: any = {
@ -314,10 +361,17 @@ async function fetchData() {
} catch (error) {
console.error('获取群组列表失败:', error)
tableData.value = []; pagination.total = 0; upperPagination.total = 0
} finally { loading.value = false }
} finally { loading.value = false; queryTime.value = Date.now() - start }
}
function handleRefresh() { fetchData() }
function handleRefresh() {
upperPagination.currentPage = 1
fetchData()
}
function handleSortChange(_sort: { prop: string; order: string }) {
// 预留排序事件处理
}
function handlePageChange(page: number) { pagination.currentPage = page; upperPagination.currentPage = page; fetchData() }
function handlePageSizeChange(size: number) { pagination.pageSize = size; upperPagination.pageSize = size; pagination.currentPage = 1; upperPagination.currentPage = 1; fetchData() }
@ -509,74 +563,28 @@ onMounted(() => { loadStoreList(); fetchData() })
</script>
<style scoped lang="scss">
.order-sub-container {
@use "../../order/orderManagement/styles/order-sub.scss";
.wave-operation-actions {
display: flex;
height: 100%;
width: 100%;
background-color: #f0f2f5;
:deep(.scan-box-container) {
flex: 0 0 250px;
flex-shrink: 0;
height: 100%;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
}
}
.split-stack {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
:deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
}
}
}
.result-content {
text-align: center;
.result-tip { font-size: 13px; color: #606266; margin-bottom: 16px; }
.result-code-box {
display: flex; align-items: center; justify-content: center; gap: 12px;
padding: 16px; background: #f5f7fa; border-radius: 6px;
.result-code { font-size: 20px; font-weight: 700; color: #409eff; letter-spacing: 2px; font-family: monospace; }
}
}
.msg-filter-bar { display: flex; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #ebeef5; }
.msg-table-wrapper { margin-bottom: 0; }
.msg-pagination-wrapper { display: flex; justify-content: flex-end; margin-top: 10px; }
.empty-tip { color: #909399; font-size: 13px; padding: 16px; text-align: center; }
align-items: center;
justify-content: center;
gap: 4px;
flex-wrap: wrap;
}
.result-content {
text-align: center;
.result-tip { font-size: 13px; color: #606266; margin-bottom: 16px; }
.result-code-box {
display: flex; align-items: center; justify-content: center; gap: 12px;
padding: 16px; background: #f5f7fa; border-radius: 6px;
.result-code { font-size: 20px; font-weight: 700; color: #409eff; letter-spacing: 2px; font-family: monospace; }
}
}
.msg-filter-bar { display: flex; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #ebeef5; }
.msg-table-wrapper { margin-bottom: 0; }
.msg-pagination-wrapper { display: flex; justify-content: flex-end; margin-top: 10px; }
.empty-tip { color: #909399; font-size: 13px; padding: 16px; text-align: center; }
</style>

View File

@ -15,10 +15,16 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" :loading="loading" @click="handleRefresh">刷新</el-button>
<el-tag v-if="queryTime > 0" size="small" effect="plain">{{ queryTime }}ms</el-tag>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
<template v-if="statsData">
<el-divider direction="vertical" />
<!-- <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>
@ -38,6 +44,7 @@
:table-size="tableSize"
:pagination="upperPagination"
:show-index="true"
:show-actions="true"
:loading="loading"
:query-time="queryTime"
@current-change="handleRowClick"
@ -67,6 +74,7 @@
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<!-- <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
@ -75,6 +83,7 @@
@click.stop="handleRetry(row)"
>重推</el-button>
<el-button size="small" type="info" link @click.stop="handleViewThread(row)">对话链</el-button>
</div>
</template>
<template #empty>
@ -229,6 +238,9 @@ import { extractStoreListFromResponse, fillStoreScanFieldOptions } from '@/views
import { messageAvailableFields, messageColumns } from './message-config'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
// ==================== 常量 ====================
@ -263,6 +275,37 @@ const availableFields = messageAvailableFields
const columns = messageColumns
const tableSize = 'small'
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
]
const buttonLoadingMap = ref<Record<string, boolean>>({ loading: false })
const buttonDisabledMap = ref<Record<string, boolean>>({})
const buttonLabelMap = ref<Record<string, string>>({})
const toolbarLayoutKey = ref('')
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean(buttonLoadingMap.value[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean(buttonDisabledMap.value[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
return dynamicLabelKey ? (buttonLabelMap.value[dynamicLabelKey] || defaultLabel) : defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadData: () => { handleRefresh() },
}
function handleToolbarButtonClick(action: string) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
// ==================== 数据状态 ====================
const scanBox = ref<any>(null)
@ -534,62 +577,17 @@ onMounted(() => {
</script>
<style scoped lang="scss">
.order-sub-container {
@use "../../order/orderManagement/styles/order-sub.scss";
.wave-operation-actions {
display: flex;
height: 100%;
width: 100%;
background-color: #f0f2f5;
align-items: center;
justify-content: center;
gap: 4px;
flex-wrap: wrap;
}
:deep(.scan-box-container) {
flex: 0 0 250px;
flex-shrink: 0;
height: 100%;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
}
}
.split-stack {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
:deep(.upper-table-container) {
height: 100%;
display: flex;
flex-direction: column;
}
}
}
}
.detail-content {
.detail-content {
.content-text {
background: #f5f7fa;
padding: 10px 14px;
@ -621,5 +619,4 @@ onMounted(() => {
}
.thread-empty { text-align: center; padding: 40px; color: #909399; }
.empty-tip { color: #909399; font-size: 13px; padding: 16px; }
}
</style>

View File

@ -1,10 +1,12 @@
<template>
<div class="package-material-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
cache-key="material-package-material"
width="250px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:initial-conditions="initialConditions"
:preset-tree="presetTree"
:available-fields="availableFieldsRef"
@condition-change="handleConditionChange"
@ -27,11 +29,13 @@
</div>
</div>
<div class="upper-wrapper">
<div class="split-stack" ref="splitStackRef">
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="包材列表"
default-align="center"
:enable-column-config="true"
table-id="material-package-material"
:data="tableData"
:columns="columns"
@ -43,8 +47,10 @@
:loading="loading"
:query-time="queryTime"
row-key="id"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@sort-change="handleSortChange"
@refresh="loadList"
@selection-change="onSelectionChange"
>
@ -75,6 +81,7 @@
<div class="empty-tip">暂无包材数据,可调整左侧筛选条件</div>
</template>
</upper-table>
</div>
</div>
</div>
@ -197,6 +204,7 @@ import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
import * as indexApi from '@/api/index/index'
import BatchImportDialog from './component/BatchImportDialog.vue'
import PackageMaterialSearchForm from './form/PackageMaterialSearchForm.vue'
import {
@ -222,7 +230,9 @@ import {
const settingsStore = useSettingsStore()
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const splitStackRef = ref<HTMLElement | null>(null)
const initialConditions = ref<any>(null)
const presetTree = ref<any[]>([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(packageMaterialScanFields)))
@ -288,6 +298,7 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const currentConditionRaw = ref<any>(null)
const currentSort = reactive({ prop: '', order: '' })
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
@ -315,6 +326,17 @@ const rules: FormRules = {
material_name: [{ required: true, message: '请输入包材名称', trigger: 'blur' }]
}
function handleSortChange({ prop, order }: any) {
currentSort.prop = prop
currentSort.order = order
pagination.currentPage = 1
loadList()
}
function handleRowClick(_row: any) {
// 预留行点击事件,用于未来扩展详情面板
}
const isSuccess = (res: any) => res && [0, 1, 200].includes(res.code)
function normalizeMaterialCode() {
@ -384,11 +406,13 @@ async function loadList() {
const start = Date.now()
try {
const where = normalizePackageMaterialScanConditionToWhere(currentConditionRaw.value)
const order = currentSort.prop ? { [currentSort.prop]: currentSort.order === 'ascending' ? 'ASC' : 'DESC' } : undefined
const res: any = await packageMaterialGet(
buildPackageMaterialListPayload({
page: pagination.currentPage,
pageSize: pagination.pageSize,
where
where,
order
})
)
if (!isSuccess(res)) {
@ -581,68 +605,30 @@ function onBatchImportSuccess() {
loadList()
}
async function loadFilterData() {
try {
const presetRes: any = await indexApi.fastWhereTree('package_material')
if (presetRes && presetRes.code === 200) {
presetTree.value = presetRes.presetTree || []
}
} catch (e) {
console.error('加载筛选配置失败', e)
}
}
onMounted(() => {
loadFilterData()
loadList()
})
</script>
<style lang="scss" scoped>
.package-material-container {
display: flex;
width: 100%;
background-color: #f0f2f5;
<style scoped lang="scss">
@use "../../order/orderManagement/styles/order-sub.scss";
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
min-width: 0;
}
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: flex-start;
background-color: #fff;
min-width: 0;
flex-shrink: 0;
}
.toolbar-left {
flex: 1;
min-width: 0;
display: flex;
align-items: flex-start;
gap: 10px;
}
.toolbar-right {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
.upper-wrapper {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
</style>

View File

@ -227,6 +227,7 @@ export function buildPackageMaterialListPayload(options: {
page: number
pageSize: number
where?: Record<string, unknown>
order?: Record<string, string>
}) {
const payload: Record<string, unknown> = {
page: options.page,
@ -239,6 +240,9 @@ export function buildPackageMaterialListPayload(options: {
if (options.where && Object.keys(options.where).length) {
payload.where = options.where
}
if (options.order && Object.keys(options.order).length) {
payload.order = options.order
}
return payload
}

View File

@ -1,10 +1,12 @@
<template>
<div class="package-supplier-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
cache-key="material-package-supplier"
width="250px"
:tree-props="{ children: 'children', label: 'label' }"
:auto-submit="false"
:initial-conditions="initialConditions"
:preset-tree="presetTree"
:available-fields="availableFieldsRef"
@condition-change="handleConditionChange"
@ -27,11 +29,13 @@
</div>
</div>
<div class="upper-wrapper">
<div class="split-stack" ref="splitStackRef">
<div class="upper-wrapper">
<upper-table
ref="upperTable"
title="包装供应商列表"
default-align="center"
:enable-column-config="true"
table-id="material-package-supplier"
:data="tableData"
:columns="columns"
@ -43,8 +47,10 @@
:loading="loading"
:query-time="queryTime"
row-key="id"
@current-change="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@sort-change="handleSortChange"
@refresh="loadList"
@selection-change="onSelectionChange"
>
@ -63,6 +69,7 @@
<div class="empty-tip">暂无供应商数据,可调整左侧筛选条件</div>
</template>
</upper-table>
</div>
</div>
</div>
@ -115,6 +122,7 @@ import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
import * as indexApi from '@/api/index/index'
import {
packageSupplierCreate,
packageSupplierDelete,
@ -136,7 +144,9 @@ import {
const settingsStore = useSettingsStore()
const scanBox = ref<any>(null)
const upperTable = ref<any>(null)
const splitStackRef = ref<HTMLElement | null>(null)
const initialConditions = ref<any>(null)
const presetTree = ref<any[]>([])
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(packageSupplierScanFields)))
@ -201,6 +211,7 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const currentConditionRaw = ref<any>(null)
const currentSort = reactive({ prop: '', order: '' })
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
@ -223,6 +234,17 @@ const rules: FormRules = {
const isSuccess = (res: any) => res && [0, 1, 200].includes(res.code)
function handleSortChange({ prop, order }: any) {
currentSort.prop = prop
currentSort.order = order
pagination.currentPage = 1
loadList()
}
function handleRowClick(_row: any) {
// 预留行点击事件,用于未来扩展详情面板
}
function normalizeSupplierCode() {
formData.supplier_code = String(formData.supplier_code || '').trim().toUpperCase()
}
@ -264,11 +286,13 @@ async function loadList() {
const start = Date.now()
try {
const where = normalizePackageSupplierScanConditionToWhere(currentConditionRaw.value)
const order = currentSort.prop ? { [currentSort.prop]: currentSort.order === 'ascending' ? 'ASC' : 'DESC' } : undefined
const res: any = await packageSupplierGet(
buildPackageSupplierListPayload({
page: pagination.currentPage,
pageSize: pagination.pageSize,
where
where,
order
})
)
if (!isSuccess(res)) {
@ -443,61 +467,30 @@ function handleBatchDelete() {
.catch(() => undefined)
}
async function loadFilterData() {
try {
const presetRes: any = await indexApi.fastWhereTree('package_supplier')
if (presetRes && presetRes.code === 200) {
presetTree.value = presetRes.presetTree || []
}
} catch (e) {
console.error('加载筛选配置失败', e)
}
}
onMounted(() => {
loadFilterData()
loadList()
})
</script>
<style lang="scss" scoped>
.package-supplier-container {
display: flex;
width: 100%;
background-color: #f0f2f5;
<style scoped lang="scss">
@use "../../order/orderManagement/styles/order-sub.scss";
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
min-width: 0;
}
.toolbar {
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: flex-start;
background-color: #fff;
min-width: 0;
flex-shrink: 0;
}
.toolbar-left {
flex: 1;
min-width: 0;
display: flex;
align-items: flex-start;
gap: 10px;
}
.upper-wrapper {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
</style>

View File

@ -205,6 +205,7 @@ export function buildPackageSupplierListPayload(options: {
page: number
pageSize: number
where?: Record<string, unknown>
order?: Record<string, string>
}) {
const payload: Record<string, unknown> = {
page: options.page,
@ -217,6 +218,9 @@ export function buildPackageSupplierListPayload(options: {
if (options.where && Object.keys(options.where).length) {
payload.where = options.where
}
if (options.order && Object.keys(options.order).length) {
payload.order = options.order
}
return payload
}

View File

@ -25,9 +25,6 @@
@action="handleToolbarButtonClick"
/>
</div>
<div class="toolbar-right">
<!-- <span class="toolbar-switch-label">已选 {{ selectionRows.length }} 个订单</span> -->
</div>
</div>
<div class="split-stack">
@ -73,8 +70,12 @@
<span class="order-info-text">{{ getFallbackOrderItemSnapshotText(row) }}</span>
</template>
<template #column-updated_at="{ row }">
{{ formatDateTime(row.updated_at || row.update_time || row.updated_time) }}
<template #column-weight_type="{ row }">
<span>{{ row.weight_type || '—' }}</span>
</template>
<template #column-excluded_reason="{ row }">
<span>{{ row.excluded_reason || '—' }}</span>
</template>
<template #empty>
@ -710,20 +711,6 @@ onBeforeUnmount(() => {
.toolbar-left {
align-items: center;
}
.toolbar-right {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
padding-left: 8px;
}
.toolbar-switch-label {
font-size: 12px;
color: var(--el-text-color-regular);
white-space: nowrap;
}
}
}
</style>

View File

@ -24,6 +24,8 @@
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
<div class="toolbar-right">
<span class="toolbar-switch-label">仅待复核波次</span>
<el-switch
v-model="onlyTodoWaves"
@ -37,7 +39,6 @@
@change="handleSourceFilterChange"
/>
</div>
<div class="toolbar-right" />
</div>
<div class="split-stack" ref="splitStackRef">
@ -3982,6 +3983,13 @@ async function submitFallbackOrderFetchByIds() {
gap: 10px;
}
.toolbar-switch-label {
margin-left: 8px;
font-size: 12px;
color: #606266;
white-space: nowrap;
}
.single-fallback-layout {
display: flex;
gap: 10px;
@ -4091,11 +4099,11 @@ async function submitFallbackOrderFetchByIds() {
.order-sub-container .main-content {
.toolbar {
display: flex;
align-items: center;
align-items: flex-start;
justify-content: space-between;
.toolbar-left {
align-items: center;
align-items: flex-start;
}
.toolbar-right {

View File

@ -24,6 +24,8 @@
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
<div class="toolbar-right">
<span class="toolbar-switch-label">仅待复核波次</span>
<el-switch
v-model="onlyTodoWaves"
@ -37,7 +39,6 @@
@change="handleSourceFilterChange"
/>
</div>
<div class="toolbar-right" />
</div>
<div class="split-stack" ref="splitStackRef">
@ -2777,6 +2778,13 @@ async function submitGroupOrderDialog() {
gap: 10px;
}
.toolbar-switch-label {
margin-left: 8px;
font-size: 12px;
color: #606266;
white-space: nowrap;
}
.single-fallback-layout {
display: flex;
gap: 10px;
@ -2879,11 +2887,11 @@ async function submitGroupOrderDialog() {
.order-sub-container .main-content {
.toolbar {
display: flex;
align-items: center;
align-items: flex-start;
justify-content: space-between;
.toolbar-left {
align-items: center;
align-items: flex-start;
}
.toolbar-right {

View File

@ -81,6 +81,22 @@
</el-tag>
</template>
<template #column-wave_no="{ row }">
<span>{{ getPickTaskWaveNos(row).join(', ') || '—' }}</span>
</template>
<template #column-batch_no="{ row }">
<span>{{ row.batch_no || '—' }}</span>
</template>
<template #column-warehouse_id="{ row }">
<span>{{ row.warehouse_id ?? '—' }}</span>
</template>
<template #column-creator_name="{ row }">
<span>{{ row.creator_name || row.creator_id || '—' }}</span>
</template>
<template #column-box_count="{ row }">
<el-tooltip v-if="row.box_count === 0" content="可能未统计" placement="top">
<span>{{ row.box_count }}</span>
@ -231,7 +247,8 @@ import {
formatPickTaskSource,
getPickTaskStatusTagType,
getPickTaskReviewStatusTagType,
getPickTaskSourceTagType
getPickTaskSourceTagType,
getPickTaskWaveNos
} from './config/wave-config'
const props = withDefaults(

View File

@ -100,6 +100,30 @@
{{ row.min_same_structure ?? '—' }} ~ {{ row.max_same_structure ?? '—' }}
</template>
<template #column-warehouse_id="{ row }">
<span>{{ row.warehouse_id ?? '—' }}</span>
</template>
<template #column-creator_name="{ row }">
<span>{{ row.creator_name || '—' }}</span>
</template>
<template #column-allowed_owners="{ row }">
<span>{{ formatArrayField(row.allowed_owners) }}</span>
</template>
<template #column-allowed_expresses="{ row }">
<span>{{ formatArrayField(row.allowed_expresses) }}</span>
</template>
<template #column-allowed_provinces="{ row }">
<span>{{ formatArrayField(row.allowed_provinces) }}</span>
</template>
<template #column-allowed_platforms="{ row }">
<span>{{ formatArrayField(row.allowed_platforms) }}</span>
</template>
<template #column-require_same_express="{ row }">
<el-tag v-if="row.require_same_express != null" size="small" :type="row.require_same_express ? 'success' : 'info'">
{{ row.require_same_express ? '是' : '否' }}
@ -646,6 +670,13 @@ function formatDateTime(value: string | number | null | undefined) {
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
function formatArrayField(value: unknown) {
if (Array.isArray(value) && value.length > 0) {
return value.join(', ')
}
return '—'
}
function normalizeCode(value: unknown) {
return String(value ?? '').trim()
}

View File

@ -257,19 +257,19 @@ export function getPickTaskWaveNos(row: any): string[] {
/** 不符合波次策略订单列表:UpperTable 列配置 */
export const fallbackOrderColumns = applyWaveListCopyActions([
{ prop: 'id', label: 'ID', width: 80, align: 'center', fixed: 'left' },
{ prop: 'delivery_no', label: '订单号', minWidth: 180, fixed: 'left' },
{ prop: 'tracking_no', label: '物流单号', minWidth: 160 },
{ prop: 'store_name', label: '店铺', minWidth: 140 },
{ prop: 'sys_platform_name', label: '平台', minWidth: 120 },
{ prop: 'sys_logistics_name', label: '物流公司', minWidth: 130 },
{ prop: 'province', label: '省份', minWidth: 100 },
{ prop: 'weight_type', label: '重量类型', minWidth: 100 },
{ prop: 'items_count', label: '商品种数', minWidth: 100 },
{ prop: 'items_total', label: '商品总数', minWidth: 100 },
{ prop: 'items_weight', label: '商品重量(g)', minWidth: 110 },
{ prop: 'item_snapshot', label: '商品快照', minWidth: 260 },
{ prop: 'wave_scan_result', label: '扫描结果', minWidth: 110 },
{ prop: 'buyer_message', label: '买家留言', minWidth: 180 },
{ prop: 'updated_at', label: '更新时间', minWidth: 170 }
{ prop: 'excluded_reason', label: '排除原因', minWidth: 130 }
])
/** 波次策略:左侧筛选可用字段 */
@ -322,12 +322,18 @@ export const waveStrategyColumns = [
{ prop: 'batch_mode', label: '批次模式', width: 110, align: 'center' },
{ prop: 'sku_range', label: 'SKU区间', minWidth: 120, align: 'center' },
{ prop: 'qty_range', label: '件数区间', minWidth: 120, align: 'center' },
{ prop: 'same_structure_range', label: '同结构区间', minWidth: 120, align: 'center' },
{ prop: 'same_structure_range', label: '同结构区间', minWidth: 130, align: 'center' },
{ prop: 'require_same_express', label: '同快递', width: 80, align: 'center' },
{ prop: 'allow_cross_owner', label: '跨货主', width: 80, align: 'center' },
{ prop: 'batch_max_orders', label: '单波最大订单', width: 120, align: 'center' },
{ prop: 'batch_max_skus', label: '单波最大SKU', width: 120, align: 'center' },
{ prop: 'group_batch_max_orders', label: '团购单波最大', width: 120, align: 'center' },
{ prop: 'warehouse_id', label: '仓库ID', width: 90, align: 'center' },
{ prop: 'creator_name', label: '创建人', width: 100, align: 'center' },
{ prop: 'allowed_owners', label: '允许货主', minWidth: 130 },
{ prop: 'allowed_expresses', label: '允许快递', minWidth: 130 },
{ prop: 'allowed_provinces', label: '允许省份', minWidth: 130 },
{ prop: 'allowed_platforms', label: '允许平台', minWidth: 130 },
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
{ prop: 'description', label: '说明', minWidth: 160 },
@ -1064,21 +1070,17 @@ export const pickTaskWaveAvailableFields = [
export const pickTaskWaveColumns = applyWaveListCopyActions([
{ prop: 'task_id', label: '任务ID', width: 90 },
{ prop: 'task_no', label: '任务编号', minWidth: 220 },
{
prop: 'wave_list',
label: '波次号',
minWidth: 180,
copyAction: 'copy',
copyValue: getPickTaskWaveNos
},
{ prop: 'wave_no', label: '波次号', minWidth: 160 },
{ prop: 'status', label: '任务状态', width: 110 },
{ prop: 'review_status', label: '复核状态', width: 100 },
{ prop: 'pick_mode', label: '拣货模式', width: 100 },
{ prop: 'source', label: '来源', width: 90 },
{ prop: 'warehouse_id', label: '仓库ID', width: 90, align: 'center' },
{ prop: 'wave_count', label: '波次数', width: 90 },
{ prop: 'order_count', label: '订单数', width: 90 },
{ prop: 'box_count', label: '箱数', width: 110 },
{ prop: 'operator_name', label: '操作人', minWidth: 120 },
{ prop: 'creator_name', label: '创建人', minWidth: 100 },
{ prop: 'pick_user_name', label: '拣货员', minWidth: 120 },
{ prop: 'review_user_name', label: '复核人', minWidth: 120 },
{ prop: 'current_cart_id', label: '当前车ID', width: 100 },

View File

@ -1,53 +1,61 @@
<template>
<div class="shipper-signing-container">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
cache-key="shipper-signing"
width="250px"
title="货主筛选"
:auto-submit="false"
:preset-tree="presetTree"
:available-fields="availableFields"
:initial-conditions="{ use_status: 1 }"
@condition-change="handleConditionChange"
@reset="handleReset"
@condition-clear="handleConditionClear"
@submit="handleSubmit"
/>
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-tag v-if="currentSubject.company_name" size="small" type="primary" effect="plain">
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
<el-tag v-if="currentSubject.company_name" size="small" type="primary" effect="plain" style="margin-left:8px">
当前仓库:{{ currentSubject.company_name }}
</el-tag>
<el-button size="small" @click="loadList">
<el-icon><Refresh /></el-icon> 刷新
</el-button>
</div>
<div class="toolbar-right">
<el-input
v-model="queryForm.keyword"
placeholder="搜索货主名或备注"
clearable
size="small"
style="width: 200px"
@keyup.enter="handleSearch"
>
<template #prefix>
<el-icon><Search /></el-icon>
</template>
</el-input>
</div>
</div>
<div class="upper-wrapper">
<div class="split-stack" ref="splitStackRef">
<div class="upper-wrapper" :style="detailVisible ? upperPaneStyle : upperPaneFullStyle">
<upper-table
ref="tableRef"
title="货主签约列表"
default-align="center"
:enable-column-config="true"
table-id="shipper-signing-list"
:data="list"
:columns="columns"
:table-size="tableSize"
:loading="loading"
:pagination="pagination"
:show-index="true"
:show-selection="true"
:show-actions="true"
:query-time="queryTime"
row-key="id"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handleSizeChange"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<template #column-counterparty_name="{ row }">
<span>{{ row.remask || row.counterparty_name }}</span>
@ -78,10 +86,50 @@
{{ row.has_qimen_config ? '已配置' : '未配置' }}
</el-tag>
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<el-button
v-if="row.needs_my_confirm"
size="small"
type="warning"
link
@click.stop="handleConfirmSign(row)"
>确认签约</el-button>
<el-button
size="small"
type="primary"
link
@click.stop="handleRename(row)"
>修改备注</el-button>
<el-button
v-if="row.use_status === 1"
size="small"
type="danger"
link
@click.stop="handleUnbind(row, 0)"
>禁用</el-button>
<el-button
v-else
size="small"
type="success"
link
@click.stop="handleUnbind(row, 1)"
>启用</el-button>
</div>
</template>
<template #empty>
<div class="empty-tip">暂无签约货主数据</div>
</template>
</upper-table>
</div>
</div>
<div class="lower-level" v-if="selectedRow">
<template v-if="detailVisible">
<div
class="pane-resizer"
title="拖动调整列表与详情区域高度"
@mousedown="beginSplitDrag"
/>
<div class="lower-level" v-if="selectedRow" :style="lowerPaneStyle">
<div class="detail-header">
<el-tabs v-model="activeTab" class="detail-tab">
<el-tab-pane label="签约详情" name="details" />
@ -128,21 +176,111 @@
</el-descriptions-item>
</el-descriptions>
</div>
</div>
<div class="lower-level empty" v-else>
<el-empty description="请选择数据查看详情" :image-size="60" />
</div>
<div class="no-selection" v-else :style="lowerPaneStyle">
<div class="empty-tip">
<p>请从上方列表中选择一项查看详情</p>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { Search, Refresh } from '@element-plus/icons-vue'
import { ref, reactive, onMounted, computed } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { storeWarehouseWarehouseList } from '@/api/storewarehouse.warehouse/storeWarehouse'
import { storeWarehouseUnbind, storeWarehouseRename, storeWarehouseConfirmSign } from '@/api/storewarehouse.store/storeWarehouse'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { useSettingsStore } from '@/stores/modules/settings'
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
import { safeInvoke } from '@/utils/safe-invoke'
const settingsStore = useSettingsStore()
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
const containerHeight = computed(() => shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)')
const {
splitStackRef,
beginSplitDrag,
lowerPaneStyle,
upperPaneStyle,
} = useVerticalSplitPane({ defaultLowerPercent: 35 })
const upperPaneFullStyle = computed(() => ({
flex: '1 1 auto',
minHeight: '0',
overflow: 'hidden',
}))
const detailVisible = ref(true)
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
{
key: 'toggleDetail',
label: '显示详情',
dynamicLabelKey: 'detailToggleLabel',
category: 'setting',
size: 'small',
action: 'toggleDetailVisible'
},
]
// ─── 工具栏状态管理 ──────────────────────────────────────────────────────────
const buttonLoadingMap = computed(() => ({
loading: loading.value
}))
const buttonDisabledMap = computed(() => ({}))
const buttonLabelMap = computed(() => ({
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({
loading: buttonLoadingMap.value,
disabled: buttonDisabledMap.value,
labels: buttonLabelMap.value
})
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean((buttonLoadingMap.value as Record<string, boolean>)[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean((buttonDisabledMap.value as Record<string, boolean>)[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return (buttonLabelMap.value as Record<string, string>)[dynamicLabelKey] || defaultLabel
}
function toggleDetailVisible() {
detailVisible.value = !detailVisible.value
}
const toolbarActionMap: Record<string, () => void> = {
loadList: () => { void loadList() },
toggleDetailVisible: () => toggleDetailVisible()
}
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
const columns = [
{ prop: 'counterparty_name', label: '签约货主', minWidth: 140 },
@ -151,10 +289,18 @@ const columns = [
{ prop: 'use_status', label: '使用状态', width: 90 },
{ prop: 'print_quantity', label: '面单余额', width: 100 },
{ prop: 'has_qimen_config', label: '奇门配置', width: 100 },
{ prop: 'auth_end', label: '授权截止', width: 120 }
{ prop: 'auth_end', label: '授权截止', width: 120 },
{ prop: 'actions', label: '操作', width: 200, fixed: 'right' }
]
const availableFields = [
{
label: '关键词',
value: 'keyword',
type: 'text',
group: '基础信息',
placeholder: '搜索货主名或备注'
},
{
label: '签约状态',
value: 'auth_status',
@ -183,25 +329,27 @@ const presetTree: any[] = []
const currentSubject = ref<{ store_id?: number; company_name?: string; role?: string }>({})
const loading = ref(false)
const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const list = ref<any[]>([])
const selectionRows = ref<any[]>([])
const selectedRow = ref<any>(null)
const tableRef = ref<any>(null)
const scanBox = ref<any>(null)
const activeTab = ref('details')
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const queryForm = reactive({ keyword: '' })
const currentCondition = ref<any>({ use_status: 1 })
async function loadList() {
loading.value = true
const startTime = Date.now()
try {
const params: any = {
page: pagination.currentPage,
page_size: pagination.pageSize,
...currentCondition.value
}
if (queryForm.keyword) params.keyword = queryForm.keyword
const res = await storeWarehouseWarehouseList(params) as any
if (res?.data) {
@ -217,6 +365,7 @@ async function loadList() {
} catch {
ElMessage.error('获取货主签约列表失败')
} finally {
queryTime.value = Date.now() - startTime
loading.value = false
}
}
@ -233,8 +382,8 @@ function handleConditionChange(condition: any) {
if (condition) {
Object.keys(condition).forEach(k => {
const c = condition[k]
if (c && typeof c === 'object' && c.value !== undefined) {
if (c.value !== '' && c.value !== null) {
if (c && typeof c === 'object' && !Array.isArray(c) && c.value !== undefined) {
if (c.value !== '' && c.value !== null && c.value !== undefined) {
where[k] = c.value
}
} else if (c !== '' && c !== null && c !== undefined) {
@ -247,20 +396,26 @@ function handleConditionChange(condition: any) {
loadList()
}
function handleSearch() {
function handleSubmit() {
pagination.currentPage = 1
loadList()
}
function handleConditionClear() {
currentCondition.value = {}
pagination.currentPage = 1
loadList()
}
function handleReset() {
queryForm.keyword = ''
currentCondition.value = {}
pagination.currentPage = 1
if (scanBox.value?.reset) {
scanBox.value.reset()
} else {
pagination.currentPage = 1
loadList()
} else if (scanBox.value?.clear) {
scanBox.value.clear()
}
loadList()
}
function handlePageChange(page: number) {
@ -278,6 +433,14 @@ function handleRowClick(row: any) {
selectedRow.value = row
}
function handleSortChange(_sort: { prop: string; order: string }) {
// 预留排序事件处理
}
function handleSelectionChange(rows: any[]) {
selectionRows.value = rows || []
}
function getAuthStatusType(status: number): string {
const map: Record<number, string> = { 1: 'warning', 2: 'success', 3: 'danger', 4: 'info' }
return map[status] || 'info'
@ -288,92 +451,106 @@ function getAuthStatusLabel(status: number): string {
return map[status] || '未知'
}
// ─── 操作 ────────────────────────────────────────────────────────────────────
async function handleConfirmSign(row: any) {
try {
await ElMessageBox.confirm(
`确认与「${row.store_name || row.remask || row.counterparty_name}」的签约关系?`,
'确认签约',
{ type: 'warning' }
)
} catch { return }
try {
const res = await storeWarehouseConfirmSign({ id: row.id }) as any
if (res?.flag === 'success' || res?.code === 200) {
ElMessage.success('签约已确认')
loadList()
} else {
ElMessage.error(res?.message || '确认签约失败')
}
} catch { ElMessage.error('确认签约失败') }
}
async function handleRename(row: any) {
try {
const { value } = await ElMessageBox.prompt('请输入新的备注名称', '修改备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputValue: row.remask || row.counterparty_name,
})
const res = await storeWarehouseRename({ id: row.id, remask: value }) as any
if (res?.flag === 'success' || res?.code === 200) {
ElMessage.success('修改备注成功')
loadList()
} else {
ElMessage.error(res?.message || '修改备注失败')
}
} catch { /* cancelled */ }
}
async function handleUnbind(row: any, targetStatus: number) {
const actionLabel = targetStatus === 0 ? '禁用' : '启用'
try {
await ElMessageBox.confirm(
`确认要${actionLabel}与「${row.store_name || row.remask || row.counterparty_name}」的签约关系吗?`,
`${actionLabel}签约`,
{ type: targetStatus === 0 ? 'warning' : 'info', confirmButtonText: actionLabel, cancelButtonText: '取消' }
)
} catch { return }
try {
const res = await storeWarehouseUnbind({ id: row.id, warehouse_use_status: targetStatus }) as any
if (res?.flag === 'success' || res?.code === 200) {
ElMessage.success(`${actionLabel}成功`)
loadList()
} else {
ElMessage.error(res?.message || `${actionLabel}失败`)
}
} catch { ElMessage.error('操作失败') }
}
onMounted(() => {
loadList()
})
</script>
<style scoped lang="scss">
.shipper-signing-container {
@use "../../order/orderManagement/styles/order-sub.scss";
.order-sub-container .main-content .lower-level .detail-container {
padding: 6px 10px;
display: flex;
height: 100%;
flex-direction: column;
box-sizing: border-box;
overflow: auto;
flex: 1;
min-height: 0;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
padding: 12px;
overflow: hidden;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
flex-shrink: 0;
gap: 12px;
.real-name {
color: #999;
font-size: 12px;
}
&-left {
display: flex;
align-items: center;
gap: 6px;
}
.wave-operation-actions {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
flex-wrap: wrap;
}
&-right {
display: flex;
align-items: center;
}
}
.text-muted {
color: #c0c4cc;
}
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
}
.lower-level {
margin-top: 8px;
border: 1px solid #ebeef5;
border-radius: 4px;
flex-shrink: 0;
display: flex;
flex-direction: column;
&.empty {
border: none;
}
.detail-header {
padding: 0 12px;
border-bottom: 1px solid #ebeef5;
flex-shrink: 0;
}
.detail-container {
padding: 12px;
overflow: auto;
max-height: 260px;
}
}
.text-danger {
color: #f56c6c;
font-weight: 500;
}
.text-muted {
color: #c0c4cc;
}
.real-name {
font-size: 12px;
color: #c0c4cc;
}
:deep(.el-descriptions__label) {
width: 110px;
}
.text-danger {
color: #f56c6c;
}
</style>

View File

@ -5,11 +5,14 @@
cache-key="store-stores"
width="250px"
title="货主筛选"
:auto-submit="false"
:preset-tree="presetTree"
:available-fields="availableFields"
:initial-conditions="{ use_status: 1 }"
@condition-change="handleConditionChange"
@reset="handleReset"
@condition-clear="handleConditionClear"
@submit="handleSubmit"
/>
<div class="main-content">
@ -24,20 +27,6 @@
@action="handleToolbarButtonClick"
/>
</div>
<div class="toolbar-right">
<el-input
v-model="queryForm.keyword"
placeholder="搜索主体名或备注"
clearable
size="small"
style="width: 200px"
@keyup.enter="handleSearch"
>
<template #prefix>
<el-icon><Search /></el-icon>
</template>
</el-input>
</div>
</div>
<div class="split-stack" ref="splitStackRef">
@ -50,12 +39,20 @@
table-id="store-stores-list"
:data="list"
:columns="columns"
:table-size="tableSize"
:loading="loading"
:pagination="pagination"
show-selection
:show-index="true"
:show-selection="true"
:show-actions="true"
:query-time="queryTime"
row-key="id"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handleSizeChange"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<template #column-counterparty_name="{ row }">
<span>{{ row.store_name || row.remask || row.counterparty_name }}</span>
@ -109,6 +106,7 @@
</el-tag>
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<el-button
v-if="row.needs_my_confirm"
size="small"
@ -153,7 +151,7 @@
type="success"
link
@click.stop="handleGenerateBindCode(row)"
>生成加群授权码</el-button>
>加群授权</el-button>
<el-button
v-if="row.current_subject_role === 'warehouse'"
size="small"
@ -161,6 +159,7 @@
link
@click.stop="openQimenDialog(row)"
>接口配置</el-button>
</div>
</template>
<template #empty>
<div class="empty-tip">暂无货主数据</div>
@ -980,7 +979,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, computed, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Plus, Refresh, QuestionFilled, Link } from '@element-plus/icons-vue'
import { Plus, Refresh, QuestionFilled, Link } from '@element-plus/icons-vue'
import { storeWarehouseList, storeWarehouseUnbind,
storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields,
storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig,
@ -1028,7 +1027,10 @@ const upperPaneFullStyle = computed(() => ({
const detailVisible = ref(true)
const loading = ref(false)
const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const list = ref<any[]>([])
const selectionRows = ref<any[]>([])
const selectedRow = ref<any>(null)
const tableRef = ref<any>(null)
const scanBox = ref<any>(null)
@ -1189,7 +1191,6 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
}
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const queryForm = reactive({ keyword: '' })
const columns = ref(defaultColumns)
const availableFields = reactive(defaultAvailableFields)
@ -1199,13 +1200,13 @@ const currentCondition = ref<any>({ use_status: 1 })
async function loadList() {
loading.value = true
const startTime = Date.now()
try {
const params: any = {
page: pagination.currentPage,
page_size: pagination.pageSize,
...currentCondition.value
}
if (queryForm.keyword) params.keyword = queryForm.keyword
const res = await storeWarehouseList(params) as any
if (res?.data) {
@ -1218,6 +1219,7 @@ async function loadList() {
} catch (e) {
ElMessage.error('获取列表失败')
} finally {
queryTime.value = Date.now() - startTime
loading.value = false
}
}
@ -1227,8 +1229,9 @@ function handleConditionChange(condition: any) {
if (condition) {
Object.keys(condition).forEach(k => {
const c = condition[k]
if (c && typeof c === 'object' && c.value !== undefined) {
if (c.value !== '' && c.value !== null) {
// 处理 ScanBox 规范格式:{ value, operator, type }
if (c && typeof c === 'object' && !Array.isArray(c) && c.value !== undefined) {
if (c.value !== '' && c.value !== null && c.value !== undefined) {
where[k] = c.value
}
} else if (c !== '' && c !== null && c !== undefined) {
@ -1241,20 +1244,34 @@ function handleConditionChange(condition: any) {
loadList()
}
function handleSearch() {
function handleSubmit() {
pagination.currentPage = 1
loadList()
}
function handleConditionClear() {
currentCondition.value = {}
pagination.currentPage = 1
loadList()
}
function handleReset() {
queryForm.keyword = ''
currentCondition.value = {}
pagination.currentPage = 1
if (scanBox.value?.reset) {
scanBox.value.reset()
} else {
pagination.currentPage = 1
loadList()
} else if (scanBox.value?.clear) {
scanBox.value.clear()
}
loadList()
}
function handleSortChange(_sort: { prop: string; order: string }) {
// 预留排序事件处理
}
function handleSelectionChange(rows: any[]) {
selectionRows.value = rows || []
}
function handlePageChange(page: number) {
@ -1866,7 +1883,7 @@ function parsePrintQuantity(value: unknown): number | undefined {
/** 调用 storeWarehouse.store.list,按签约 id 拉取最新一行(含 print_quantity) */
async function fetchLatestContractRowById(contractId: number): Promise<any | null> {
const filterAttempts: Record<string, unknown>[] = [
queryForm.keyword ? { keyword: queryForm.keyword } : {},
{ keyword: currentCondition.value?.keyword },
{}
]
@ -2479,6 +2496,14 @@ onMounted(loadList)
font-size: 12px;
}
.wave-operation-actions {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
flex-wrap: wrap;
}
// ─── 加群授权码弹窗样式 ────────────────────────────────────────────────────────
.bind-code-display {
text-align: center;

View File

@ -179,10 +179,17 @@ export const columns = [
{ prop: 'use_status', label: '使用状态', width: 90 },
{ prop: 'print_quantity', label: '面单余额', width: 100 },
{ prop: 'has_qimen_config', label: '奇门配置', width: 100 },
{ prop: 'actions', label: '操作', width: 460, fixed: 'right' }
{ prop: 'actions', label: '操作', width: 280, fixed: 'right' }
]
export const availableFields = [
{
label: '关键词',
value: 'keyword',
type: 'text',
group: '基础信息',
placeholder: '搜索主体名或备注'
},
{
label: '签约状态',
value: 'auth_status',
@ -213,7 +220,6 @@ export const presetTree: any[] = []
/** 货主列表主工具栏按钮(action 与 stores/index.vue 内 toolbarActionMap 键一致) */
export const storeToolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
{ key: 'openAccount', label: '代开户', category: 'action', size: 'small', action: 'openOpenAccountDialog' },
{
key: 'toggleBalance',
label: '显示余额',
@ -229,7 +235,8 @@ export const storeToolbarButtons: ToolbarButtonConfig[] = [
category: 'setting',
size: 'small',
action: 'toggleDetailVisible'
}
},
{ key: 'openAccount', label: '代开户', category: 'action', size: 'small', action: 'openOpenAccountDialog' },
]
export const detailPanel = [

View File

@ -16,18 +16,14 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" :loading="loading" @click="loadList">刷新</el-button>
<el-button type="success" size="small" @click="openCreate">新增编码</el-button>
<el-button
type="danger"
size="small"
plain
:disabled="!selectedIds.length"
:loading="batchDeleting"
@click="handleBatchDelete"
>
批量删除
</el-button>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
layout-key="encoding-courier"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -51,16 +47,19 @@
@selection-change="onSelectionChange"
>
<template #column-actions="{ row }">
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
<el-button
link
type="danger"
:loading="deletingId === row.id"
:disabled="row.id == null"
@click="handleDelete(row)"
>
删除
</el-button>
<div class="encoding-operation-actions">
<el-button link type="primary" size="small" @click="openEdit(row)">编辑</el-button>
<el-button
link
type="danger"
size="small"
:loading="deletingId === row.id"
:disabled="row.id == null"
@click="handleDelete(row)"
>
删除
</el-button>
</div>
</template>
<template #empty>
@ -120,6 +119,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { getExpressList } from '@/api/index/index'
import {
expressCheckCodeUnique,
@ -161,6 +162,38 @@ const saving = ref(false)
const deletingId = ref<number | string | null>(null)
const batchDeleting = ref(false)
const selectedIds = ref<number[]>([])
// ---- toolbar 按钮配置(分类排序,对齐 waveOrder) ----
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', action: 'loadData' },
{ key: 'create', label: '新增编码', category: 'action', size: 'small', action: 'openCreate' },
{ key: 'batchDelete', label: '批量删除', category: 'cancel', size: 'small', disabledKey: 'noSelection', loadingKey: 'batchDelete', action: 'handleBatchDelete' }
]
function resolveButtonDisabled(key?: string): boolean {
if (key === 'noSelection') return !selectedIds.value.length
return false
}
function resolveButtonLoading(key?: string): boolean {
if (key === 'loading') return loading.value
if (key === 'batchDelete') return batchDeleting.value
return false
}
function resolveButtonLabel(defaultLabel: string, _dynamicLabelKey?: string): string {
return defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadData: loadList,
openCreate,
handleBatchDelete
}
function handleToolbarButtonClick(action: string) {
toolbarActionMap[action]?.()
}
const tableData = ref<ExpressRecord[]>([])
const expressOptions = ref<ExpressOption[]>([])
const queryTime = ref(0)
@ -492,4 +525,28 @@ onMounted(async () => {
<style lang="scss" scoped>
@use '../styles/encoding-sub.scss';
.encoding-operation-actions {
display: flex;
flex-wrap: wrap;
gap: 0 2px;
justify-content: center;
:deep(.el-button) {
font-size: 11px;
padding: 0 4px;
height: 20px;
margin-left: 0;
margin-right: 0;
}
:deep(.el-button + .el-button) {
margin-left: 0;
}
:deep(.el-button.is-link) {
padding: 0 4px;
height: 20px;
}
}
</style>

View File

@ -16,8 +16,14 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" :loading="loading" @click="loadList">刷新</el-button>
<el-button type="success" size="small" @click="openCreate">新增平台编码</el-button>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
layout-key="encoding-platform"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -40,8 +46,10 @@
@refresh="loadList"
>
<template #column-actions="{ row }">
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
<el-button link type="danger" @click="handleDelete(row)">删除</el-button>
<div class="encoding-operation-actions">
<el-button link type="primary" size="small" @click="openEdit(row)">编辑</el-button>
<el-button link type="danger" size="small" @click="handleDelete(row)">删除</el-button>
</div>
</template>
<template #empty>
@ -96,6 +104,8 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { getPlatformList } from '@/api/index/index'
import {
settingPlatformCreate,
@ -131,6 +141,34 @@ const columns = platformColumns
const loading = ref(false)
const saving = ref(false)
// ---- toolbar 按钮配置(分类排序,对齐 waveOrder) ----
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', action: 'loadData' },
{ key: 'create', label: '新增平台编码', category: 'action', size: 'small', action: 'openCreate' }
]
function resolveButtonDisabled(_key?: string): boolean {
return false
}
function resolveButtonLoading(key?: string): boolean {
if (key === 'loading') return loading.value
return false
}
function resolveButtonLabel(defaultLabel: string, _dynamicLabelKey?: string): string {
return defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadData: loadList,
openCreate
}
function handleToolbarButtonClick(action: string) {
toolbarActionMap[action]?.()
}
const tableData = ref<PlatformRecord[]>([])
const platformOptions = ref<PlatformOption[]>([])
const queryTime = ref(0)
@ -360,4 +398,28 @@ onMounted(async () => {
<style lang="scss" scoped>
@use '../styles/encoding-sub.scss';
.encoding-operation-actions {
display: flex;
flex-wrap: wrap;
gap: 0 2px;
justify-content: center;
:deep(.el-button) {
font-size: 11px;
padding: 0 4px;
height: 20px;
margin-left: 0;
margin-right: 0;
}
:deep(.el-button + .el-button) {
margin-left: 0;
}
:deep(.el-button.is-link) {
padding: 0 4px;
height: 20px;
}
}
</style>

View File

@ -64,7 +64,7 @@
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;
@ -73,7 +73,7 @@
flex: 1;
min-width: 0;
display: flex;
align-items: center;
align-items: flex-start;
gap: 10px;
overflow: hidden;
}

View File

@ -1,5 +1,5 @@
<template>
<div class="express-interface-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
width="250px"
@ -16,6 +16,19 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
<!-- <span v-if="viewMode === 'warehouse' && warehouseContextHint" class="toolbar-hint">
{{ warehouseContextHint }}
</span> -->
</div>
<div class="toolbar-right">
<el-radio-group
v-model="viewMode"
class="view-mode-toggle"
@ -25,16 +38,7 @@
<el-radio-button label="paged">分页列表</el-radio-button>
<el-radio-button label="warehouse">按仓库 + 平台(全量)</el-radio-button>
</el-radio-group>
<el-button size="small" type="primary" :loading="loading" @click="loadData">刷新</el-button>
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
<el-button type="success" size="small" @click="openCreate">新增接口配置</el-button>
<el-button size="small" :disabled="selectedRows.length === 0" @click="handleCopySelected">复制</el-button>
<!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
<span v-if="viewMode === 'warehouse' && warehouseContextHint" class="toolbar-hint">
{{ warehouseContextHint }}
</span>
</div>
</div>
<div class="split-stack" ref="splitStackRef">
@ -62,11 +66,13 @@
@refresh="loadData"
>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<template v-if="!isExternalSharedInterface(row)">
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
</template>
<span v-else class="action-disabled-text">--</span>
</div>
</template>
<template #empty>
<div class="empty-tip">
@ -504,6 +510,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
import {
getPrintPlatformTemplateList,
getPlatformOauthLink,
@ -611,6 +620,60 @@ const upperPaneFullStyle = computed(() => ({
overflow: 'hidden'
}))
// ─── 工具栏按钮配置 ──────────────────────────────────────────────────────────
const toolbarButtons: ToolbarButtonConfig[] = [
{ 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: 'openCreate' },
{ key: 'copy', label: '复制', category: 'action', size: 'small', disabledKey: 'noSelection',action: 'handleCopySelected' },
]
const buttonLoadingMap = computed(() => ({
loading: loading.value
}))
const buttonDisabledMap = computed(() => ({
noSelection: selectedRows.value.length === 0
}))
const buttonLabelMap = computed(() => ({}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({
loading: buttonLoadingMap.value,
disabled: buttonDisabledMap.value,
labels: buttonLabelMap.value
})
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean((buttonLoadingMap.value as Record<string, boolean>)[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean((buttonDisabledMap.value as Record<string, boolean>)[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return (buttonLabelMap.value as Record<string, string>)[dynamicLabelKey] || defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadData: () => { void loadData() },
openColumnConfigPanel: () => openColumnConfigPanel(),
openCreate: () => openCreate(),
handleCopySelected: () => { void handleCopySelected() }
}
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
const viewMode = ref<'paged' | 'warehouse'>('paged')
const loading = ref(false)
const saving = ref(false)
@ -2030,146 +2093,52 @@ onMounted(async () => {
</script>
<style scoped lang="scss">
.express-interface-container {
@use "../../../order/orderManagement/styles/order-sub.scss";
.order-sub-container .main-content .lower-level .detail-container {
padding: 6px 10px;
overflow: auto;
flex: 1;
min-height: 0;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.wave-operation-actions {
display: flex;
width: 100%;
background-color: #f0f2f5;
align-items: center;
justify-content: center;
gap: 4px;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
min-width: 0;
}
.action-disabled-text {
color: #c0c4cc;
}
.toolbar {
padding: 5px 8px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
background-color: #fff;
flex-shrink: 0;
}
.view-mode-toggle {
flex-shrink: 0;
}
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
min-width: 0;
}
.toolbar-hint {
font-size: 12px;
color: var(--el-text-color-secondary, #909399);
line-height: 1.4;
max-width: min(360px, 100%);
}
.view-mode-toggle {
flex-shrink: 0;
}
.express-relation {
margin-top: 12px;
.toolbar-hint {
&__title {
font-size: 12px;
color: var(--el-text-color-secondary, #909399);
line-height: 1.4;
max-width: min(360px, 100%);
}
.split-stack {
flex: 1 1 auto;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.pane-resizer {
flex: 0 0 6px;
min-height: 6px;
background: #e4e7ed;
cursor: row-resize;
flex-shrink: 0;
&:hover {
background: #dcdfe6;
}
}
.upper-wrapper {
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
}
.lower-level {
display: flex;
flex-direction: column;
border-top: 1px solid #ebeef5;
overflow: hidden;
background-color: #fff;
.detail-header {
flex-shrink: 0;
padding: 8px 12px;
border-bottom: 1px solid #ebeef5;
background-color: #fafafa;
display: flex;
align-items: baseline;
gap: 10px;
}
.detail-title {
font-size: 13px;
font-weight: 600;
color: var(--el-text-color-primary);
}
.detail-sub {
font-size: 12px;
color: var(--el-text-color-secondary);
}
.detail-container {
flex: 1;
min-height: 0;
overflow: auto;
padding: 10px 12px;
}
}
.express-relation {
margin-top: 12px;
&__title {
font-size: 12px;
font-weight: 600;
color: var(--el-text-color-regular);
margin-bottom: 8px;
}
}
.no-selection {
display: flex;
align-items: center;
justify-content: center;
color: #909399;
background-color: #fff;
padding: 10px;
.empty-tip {
text-align: center;
font-size: 13px;
line-height: 1.5;
}
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
font-weight: 600;
color: var(--el-text-color-regular);
margin-bottom: 8px;
}
}

View File

@ -0,0 +1,45 @@
<template>
<div class="pickcart-info-panel" v-loading="loading">
<template v-if="data">
<el-descriptions :column="2" border size="small">
<el-descriptions-item label="ID">{{ data.cart_id }}</el-descriptions-item>
<el-descriptions-item label="仓库ID">{{ data.warehouse_id }}</el-descriptions-item>
<el-descriptions-item label="编码">{{ data.cart_code }}</el-descriptions-item>
<el-descriptions-item label="名称">{{ data.cart_name || '--' }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag :type="statusInfo.type" size="small">
{{ statusInfo.text }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="绑定任务ID">
{{ data.current_task_id ?? '未绑定' }}
</el-descriptions-item>
<el-descriptions-item label="绑定任务编号" :span="2">
{{ data.current_task_no || '--' }}
</el-descriptions-item>
</el-descriptions>
</template>
<div v-else class="empty-tip">暂无详情数据</div>
</div>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import type { PickCartDetailResponse } from '@/api/pickcart/pickcart'
import { formatPickCartStatus } from '../pickcart-config'
const props = defineProps<{
data: PickCartDetailResponse | null
loading: boolean
}>()
const statusInfo = computed(() => formatPickCartStatus(props.data?.status))
</script>
<style scoped>
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="pickcart-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
width="250px"
@ -16,18 +16,20 @@
<div class="main-content">
<div class="toolbar">
<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> -->
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
layout-key="pickcart"
@action="handleToolbarButtonClick"
/>
</div>
<el-button-group>
<el-button type="success" size="small" @click="openCreate">新增拣货车</el-button>
<el-button type="success" size="small" plain @click="openBatchCreate">批量新增</el-button>
</el-button-group>
</div>
<div class="upper-wrapper">
<upper-table
<div class="split-stack" ref="splitStackRef">
<div class="upper-wrapper" :style="(detailVisible && detailRow) ? upperPaneStyle : upperPaneFullStyle">
<upper-table
ref="upperTable"
title="拣货车列表"
table-id="setting-pickcart"
@ -40,6 +42,8 @@
:loading="loading"
:query-time="queryTime"
row-key="cart_id"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handlePageSizeChange"
@refresh="loadList"
@ -58,16 +62,45 @@
</template>
<template #column-actions="{ row }">
<el-button link type="primary" size="small" @click.stop="openDetail(row)">详情</el-button>
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="success" size="small" @click.stop="openBind(row)">绑定任务</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
<div class="pickcart-operation-actions">
<el-button link type="primary" size="small" @click.stop="handleRowClick(row)">详情</el-button>
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="success" size="small" @click.stop="openBind(row)">绑定任务</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
</div>
</template>
<template #empty>
<div class="empty-tip">暂无拣货车数据,可调整左侧筛选条件或点击新增</div>
</template>
</upper-table>
</div>
<template v-if="detailVisible">
<div v-if="detailRow" class="pane-resizer" @mousedown="beginSplitDrag" />
<div v-if="detailRow" class="lower-level" :class="tableSize" :style="lowerPaneStyle">
<div class="detail-header">
<el-tabs v-model="activeDetailTab" class="detail-tab">
<el-tab-pane label="属性" name="info" />
</el-tabs>
</div>
<div class="detail-container">
<KeepAlive>
<component
:is="activeComponent"
:key="String(detailRow?.cart_id ?? '')"
:data="detailData"
:loading="detailLoading"
/>
</KeepAlive>
</div>
</div>
<div v-else class="no-selection">
<div class="empty-tip">
<p>点击行查看拣货车详情</p>
</div>
</div>
</template>
</div>
</div>
@ -108,32 +141,6 @@
</template>
</el-dialog>
<!-- 详情 -->
<el-drawer v-model="detailVisible" title="拣货车详情" size="480px" @close="detailData = null">
<div v-loading="detailLoading" class="detail-body">
<template v-if="detailData">
<el-descriptions :column="1" border size="small">
<el-descriptions-item label="ID">{{ detailData.cart_id }}</el-descriptions-item>
<el-descriptions-item label="仓库ID">{{ detailData.warehouse_id }}</el-descriptions-item>
<el-descriptions-item label="编码">{{ detailData.cart_code }}</el-descriptions-item>
<el-descriptions-item label="名称">{{ detailData.cart_name || '--' }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag :type="formatPickCartStatus(detailData.status).type" size="small">
{{ formatPickCartStatus(detailData.status).text }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="绑定任务ID">
{{ detailData.current_task_id ?? '未绑定' }}
</el-descriptions-item>
<el-descriptions-item label="绑定任务编号">
{{ detailData.current_task_no || '--' }}
</el-descriptions-item>
</el-descriptions>
</template>
<el-empty v-else-if="!detailLoading" description="暂无详情" />
</div>
</el-drawer>
<!-- 扫码查询 -->
<el-dialog v-model="scanDialogVisible" title="扫码查询拣货车" width="520px" align-center @close="resetScan">
<el-form label-width="110px" @submit.prevent="submitScan">
@ -307,11 +314,15 @@
</template>
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { computed, onMounted, reactive, ref, watch, markRaw } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
import InfoPanel from './components/InfoPanel.vue'
import {
pickCartBindTaskCart,
pickCartCodeDuplicateCheck,
@ -357,6 +368,53 @@ const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const currentConditionRaw = ref<any>(null)
// ---- split pane ----
const { splitStackRef, beginSplitDrag, lowerPaneStyle, upperPaneStyle } = useVerticalSplitPane({
defaultLowerPercent: 38,
minLowerPercent: 20,
maxLowerPercent: 70
})
const upperPaneFullStyle = computed(() => ({
flex: '1 1 auto',
minHeight: '0',
overflow: 'hidden'
}))
// ---- toolbar 按钮配置(分类排序,对齐 waveOrder) ----
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', action: 'loadList' },
{ key: 'toggleDetail', label: '显示详情', dynamicLabelKey: 'detailToggleLabel', category: 'setting', size: 'small', action: 'toggleDetail' },
{ key: 'scanQuery', label: '扫码查询', category: 'setting', size: 'small', action: 'openScanDialog' },
{ key: 'create', label: '新增拣货车', category: 'action', size: 'small', action: 'openCreate' },
{ key: 'batchCreate', label: '批量新增', category: 'action', size: 'small', action: 'openBatchCreate' }
]
function resolveButtonDisabled(_key?: string): boolean {
return false
}
function resolveButtonLoading(key?: string): boolean {
if (key === 'loading') return loading.value
return false
}
function resolveButtonLabel(defaultLabel: string, _dynamicLabelKey?: string): string {
return defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadList,
toggleDetail,
openScanDialog,
openCreate,
openBatchCreate
}
function handleToolbarButtonClick(action: string) {
toolbarActionMap[action]?.()
}
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const dialogVisible = ref(false)
@ -376,10 +434,19 @@ const rules: FormRules = {
status: [{ required: true, message: '请选择状态', trigger: 'change' }]
}
const detailRow = ref<PickCartRecord | null>(null)
const detailVisible = ref(false)
const activeDetailTab = ref('info')
const activeComponent = computed(() => {
if (activeDetailTab.value === 'info') return markRaw(InfoPanel)
return null
})
const detailLoading = ref(false)
const detailData = ref<PickCartDetailResponse | null>(null)
const detailToggleLabel = computed(() => detailVisible.value ? '隐藏详情' : '显示详情')
const scanDialogVisible = ref(false)
const scanLoading = ref(false)
const scanForm = reactive({ cart_code: '' })
@ -801,8 +868,13 @@ function handleDelete(row: PickCartRecord) {
.catch(() => undefined)
}
async function openDetail(row: PickCartRecord) {
function toggleDetail() {
detailVisible.value = !detailVisible.value
}
async function handleRowClick(row: PickCartRecord) {
if (!row.cart_id) return
detailRow.value = row
detailVisible.value = true
detailLoading.value = true
detailData.value = null
@ -907,60 +979,56 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
.pickcart-container {
display: flex;
width: 100%;
background-color: #f0f2f5;
@use "../../../order/orderManagement/styles/order-sub.scss";
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
min-width: 0;
}
.toolbar {
padding: 5px 8px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
background-color: #fff;
flex-shrink: 0;
}
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
min-width: 0;
}
.upper-wrapper {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.order-sub-container .main-content .lower-level .detail-container {
padding: 12px;
}
.detail-body {
padding: 0 4px;
.order-sub-container .main-content .lower-level .detail-header {
padding: 0 12px;
}
.detail-header__title {
display: flex;
align-items: center;
gap: 10px;
font-size: 14px;
font-weight: 600;
color: #303133;
}
.detail-header__code {
font-size: 12px;
font-weight: 400;
color: #909399;
padding: 0 8px;
background: #f0f2f5;
border-radius: 4px;
}
.pickcart-operation-actions {
display: flex;
flex-wrap: wrap;
gap: 0 2px;
justify-content: center;
:deep(.el-button) {
font-size: 11px;
padding: 0 4px;
height: 20px;
margin-left: 0;
margin-right: 0;
}
:deep(.el-button + .el-button) {
margin-left: 0;
}
:deep(.el-button.is-link) {
padding: 0 4px;
height: 20px;
}
}
.scan-result {

View File

@ -12,22 +12,14 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button type="primary" size="small" :icon="Refresh" title="刷新" :loading="loading" @click="handleRefresh">
刷新
</el-button>
<el-button type="primary" size="small" :icon="Plus" title="添加打印台" @click="handleAdd">
添加
</el-button>
<el-button
type="danger"
size="small"
:icon="Delete"
title="批量删除"
:disabled="!hasSelection"
@click="confirmBatchDelete"
>
批量删除
</el-button>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
layout-key="printStation"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -74,6 +66,13 @@
{{ formatTime(row.update_at) }}
</template>
<template #column-actions="{ row }">
<div class="printstation-operation-actions">
<el-button link type="primary" size="small" @click="handleEdit(row)">编辑</el-button>
<el-button link type="danger" size="small" @click="handleDeleteRow(row)">删除</el-button>
</div>
</template>
<template #empty>
<div class="custom-empty">
<el-icon><Printer /></el-icon>
@ -124,6 +123,8 @@ import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import Info from './components/info.vue'
import Add from './components/add.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import * as printApi from '@/api/print/print'
import { Delete, Plus, Refresh, Printer } from '@element-plus/icons-vue'
@ -193,7 +194,8 @@ const tableColumns = ref([
{ prop: 'components', label: '打印组件', minWidth: '280', showOverflowTooltip: true },
{ prop: 'creator_name', label: '创建人', minWidth: '100', showOverflowTooltip: true },
{ prop: 'create_at', label: '创建时间', minWidth: '168', showOverflowTooltip: true },
{ prop: 'update_at', label: '更新时间', minWidth: '168', showOverflowTooltip: true }
{ prop: 'update_at', label: '更新时间', minWidth: '168', showOverflowTooltip: true },
{ prop: 'actions', label: '操作', width: '140', fixed: 'right' as const }
])
const drawer = ref(false)
@ -228,6 +230,27 @@ const queryTime = ref(0)
const hasSelection = ref(false)
const showSelection = ref(true)
// ---- toolbar 按钮配置(分类排序,对齐 waveOrder) ----
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', action: 'handleRefresh' },
{ key: 'add', label: '添加', category: 'action', size: 'small', action: 'handleAdd' },
{ key: 'batchDelete', label: '批量删除', category: 'cancel', size: 'small', disabledKey: 'noSelection', action: 'confirmBatchDelete' }
]
function resolveButtonDisabled(key?: string): boolean {
if (key === 'noSelection') return !hasSelection.value
return false
}
function resolveButtonLoading(key?: string): boolean {
if (key === 'loading') return loading.value
return false
}
function resolveButtonLabel(defaultLabel: string, _dynamicLabelKey?: string): string {
return defaultLabel
}
const computerMap = ref<Map<string, string>>(new Map())
const PRINT_WHERE_KEYS = ['id', 'name', 'computer_id', 'custom_barcode'] as const
@ -394,6 +417,54 @@ const confirmBatchDelete = async () => {
}
}
function handleEdit(row: any) {
handleTableRowSelect(row)
drawer.value = true
}
async function handleDeleteRow(row: any) {
const id = row?.id
if (id == null || id === '') {
ElMessage.warning('无法删除:缺少有效 ID')
return
}
try {
await ElMessageBox.confirm(
`确定删除打印台「${row.name || id}」吗?`,
'删除确认',
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' }
)
} catch {
return
}
try {
const res: any = await printApi.delItems([id])
if (res && okCode(res.code)) {
ElMessage.success('删除成功')
if (currentStationId.value != null && String(currentStationId.value) === String(id)) {
currentStationId.value = null
currentTableRow.value = undefined
}
await fetchPrintStationList()
} else {
ElMessage.error((res && (res.msg || res.message)) || '删除失败')
}
} catch (e: any) {
console.error(e)
ElMessage.error('删除失败')
}
}
const toolbarActionMap: Record<string, () => void> = {
handleRefresh,
handleAdd,
confirmBatchDelete
}
function handleToolbarButtonClick(action: string) {
toolbarActionMap[action]?.()
}
onMounted(async () => {
await loadComputersForLabels()
await fetchPrintStationList()
@ -415,12 +486,14 @@ onMounted(async () => {
overflow: hidden;
.toolbar {
padding: 10px;
border-bottom: 1px solid #ebeef5;
margin-bottom: 3px;
padding: 6px 10px;
border: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
align-items: flex-start;
background-color: #fff;
min-width: 0;
}
.upper-wrapper {
@ -537,4 +610,28 @@ onMounted(async () => {
}
}
}
.printstation-operation-actions {
display: flex;
flex-wrap: wrap;
gap: 0 2px;
justify-content: center;
:deep(.el-button) {
font-size: 11px;
padding: 0 4px;
height: 20px;
margin-left: 0;
margin-right: 0;
}
:deep(.el-button + .el-button) {
margin-left: 0;
}
:deep(.el-button.is-link) {
padding: 0 4px;
height: 20px;
}
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="shops-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
width="250px"
@ -16,9 +16,14 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
<el-button type="success" size="small" @click="openCreate">新增店铺</el-button>
<!-- <el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag> -->
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -78,9 +83,11 @@
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="success" size="small" @click.stop="openAuthorize(row)">授权</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
</div>
</template>
<template #empty>
@ -183,6 +190,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
import { getPrintPlatformList } from '@/api/setting.expressinterface/expressInterface'
import { getPlatformOauthLink } from '@/api/index/index'
import {
@ -235,6 +245,45 @@ const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const currentConditionRaw = ref<any>(null)
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
{ key: 'create', label: '新增店铺', category: 'action', size: 'small', action: 'openCreate' },
]
const buttonLoadingMap = computed(() => ({
loading: loading.value
}))
const buttonDisabledMap = computed(() => ({}))
const buttonLabelMap = computed(() => ({}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({ loading: buttonLoadingMap.value, disabled: buttonDisabledMap.value, labels: buttonLabelMap.value })
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean((buttonLoadingMap.value as Record<string, boolean>)[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean((buttonDisabledMap.value as Record<string, boolean>)[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return (buttonLabelMap.value as Record<string, string>)[dynamicLabelKey] || defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadList: () => { void loadList() },
openCreate: () => openCreate()
}
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const dialogVisible = ref(false)
@ -668,57 +717,21 @@ onMounted(async () => {
})
</script>
<style lang="scss" scoped>
.shops-container {
<style scoped lang="scss">
@use "../../../order/orderManagement/styles/order-sub.scss";
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.wave-operation-actions {
display: flex;
width: 100%;
background-color: #f0f2f5;
.main-content {
flex: 1;
display: flex;
flex-direction: column;
padding: 10px;
overflow: hidden;
min-width: 0;
}
.toolbar {
padding: 5px 8px;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
flex-wrap: wrap;
background-color: #fff;
flex-shrink: 0;
}
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
min-width: 0;
}
.upper-wrapper {
flex: 1 1 auto;
min-height: 0;
overflow: hidden;
}
.upper-wrapper :deep(.upper-table-container) {
height: 100%;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
align-items: center;
justify-content: center;
gap: 4px;
}
.auth-tip {

View File

@ -1,5 +1,5 @@
<template>
<div class="store-express-binding-policy-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
width="250px"
@ -16,8 +16,14 @@
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
<el-button type="success" size="small" @click="openCreate">新增策略</el-button>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
</div>
@ -79,8 +85,10 @@
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
</div>
</template>
<template #empty>
@ -291,6 +299,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import { safeInvoke } from '@/utils/safe-invoke'
import {
storeExpressBindingPolicyAdd,
storeExpressBindingPolicyDel,
@ -334,6 +345,43 @@ const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const currentConditionRaw = ref<any>(null)
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
{ key: 'create', label: '新增策略', category: 'action', size: 'small', action: 'openCreate' },
]
const buttonLoadingMap = computed(() => ({ loading: loading.value }))
const buttonDisabledMap = computed(() => ({}))
const buttonLabelMap = computed(() => ({}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({ loading: buttonLoadingMap.value, disabled: buttonDisabledMap.value, labels: buttonLabelMap.value })
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean((buttonLoadingMap.value as Record<string, boolean>)[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean((buttonDisabledMap.value as Record<string, boolean>)[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return (buttonLabelMap.value as Record<string, string>)[dynamicLabelKey] || defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadList: () => { void loadList() },
openCreate: () => openCreate()
}
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const dialogVisible = ref(false)
@ -655,36 +703,13 @@ onMounted(() => {
</script>
<style scoped lang="scss">
.store-express-binding-policy-container {
@use "../../../order/orderManagement/styles/order-sub.scss";
.wave-operation-actions {
display: flex;
gap: 12px;
padding: 12px;
box-sizing: border-box;
.main-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 10px;
}
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
&-left {
display: flex;
align-items: center;
gap: 8px;
}
}
.upper-wrapper {
flex: 1;
min-height: 0;
}
align-items: center;
justify-content: center;
gap: 4px;
}
.tag-input-wrapper {

View File

@ -1,5 +1,5 @@
<template>
<div class="workbench-container" :style="{ height: containerHeight }">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
width="250px"
@ -16,10 +16,15 @@
<div class="main-content">
<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>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
layout-key="workbench"
@action="handleToolbarButtonClick"
/>
</div>
<el-button type="success" size="small" @click="openCreate">新增工作台</el-button>
</div>
<div class="upper-wrapper">
@ -62,10 +67,12 @@
</template>
<template #column-actions="{ row }">
<el-button link type="primary" size="small" @click.stop="openDetail(row)">详情</el-button>
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="success" size="small" @click.stop="openBindCamera(row)">摄像头</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
<div class="workbench-operation-actions">
<el-button link type="primary" size="small" @click.stop="openDetail(row)">详情</el-button>
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
<el-button link type="success" size="small" @click.stop="openBindCamera(row)">摄像头</el-button>
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
</div>
</template>
<template #empty>
@ -194,6 +201,8 @@ import { Search } from '@element-plus/icons-vue'
import type { FormInstance, FormRules } from 'element-plus'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import {
list as workbenchList,
detail as workbenchDetail,
@ -236,6 +245,34 @@ const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const currentConditionRaw = ref<any>(null)
// ---- toolbar 按钮配置(分类排序,对齐 waveOrder) ----
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', action: 'loadList' },
{ key: 'create', label: '新增工作台', category: 'action', size: 'small', action: 'openCreate' }
]
function resolveButtonDisabled(_key?: string): boolean {
return false
}
function resolveButtonLoading(key?: string): boolean {
if (key === 'loading') return loading.value
return false
}
function resolveButtonLabel(defaultLabel: string, _dynamicLabelKey?: string): string {
return defaultLabel
}
const toolbarActionMap: Record<string, () => void> = {
loadList,
openCreate
}
function handleToolbarButtonClick(action: string) {
toolbarActionMap[action]?.()
}
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const dialogVisible = ref(false)
@ -566,47 +603,29 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
.workbench-container {
@use "../../../order/orderManagement/styles/order-sub.scss";
.workbench-operation-actions {
display: flex;
gap: 12px;
padding: 12px;
box-sizing: border-box;
flex-wrap: wrap;
gap: 0 2px;
justify-content: center;
.main-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 10px;
min-width: 0;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 8px;
.toolbar-left {
display: flex;
align-items: center;
gap: 8px;
}
}
.upper-wrapper {
flex: 1;
min-height: 0;
}
.detail-body {
:deep(.el-button) {
font-size: 11px;
padding: 0 4px;
height: 20px;
margin-left: 0;
margin-right: 0;
}
.empty-tip {
color: #909399;
font-size: 13px;
padding: 20px 0;
:deep(.el-button + .el-button) {
margin-left: 0;
}
:deep(.el-button.is-link) {
padding: 0 4px;
height: 20px;
}
}

View File

@ -15,7 +15,7 @@
/>
-->
<template>
<div class="operation-cell">
<div class="wave-operation-actions">
<template v-for="btn in buttons" :key="btn.key">
<!-- action 按钮:支持确认弹窗 -->
<el-button

View File

@ -530,7 +530,7 @@ export function buildWhereConditions(rawConditions: Record<string, any>): Record
export interface ToolbarButtonConfig {
key: string
label: string
category: 'common' | 'function' | 'basic'
category: 'refresh' | 'setting' | 'action' | 'cancel'
size?: '' | 'default' | 'small' | 'large'
type?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
plain?: boolean
@ -546,42 +546,42 @@ export interface ToolbarButtonConfig {
/** ★ 摄像头工具栏按钮 */
export const TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
// ===== 公共按钮 =====
// ===== 刷新 =====
refresh: {
key: 'refresh',
label: '刷新',
category: 'common',
category: 'refresh',
type: 'primary',
size: 'small',
loadingKey: 'loading',
action: 'loadData'
},
// ===== 功能按钮 =====
addCamera: {
key: 'addCamera',
label: '新增摄像头',
category: 'function',
type: 'success',
size: 'small',
action: 'openAddCameraDialog',
formKey: 'CameraFormDialog'
},
// ===== 基础操作 =====
// ===== 设置 =====
columnConfig: {
key: 'columnConfig',
label: '字段设置',
category: 'basic',
category: 'setting',
size: 'small',
action: 'openColumnConfigPanel'
},
toggleDetail: {
key: 'toggleDetail',
label: '显示详情',
category: 'basic',
category: 'setting',
dynamicLabelKey: 'detailToggleLabel',
size: 'small',
action: 'toggleDetailVisible'
}
},
// ===== 操作 =====
addCamera: {
key: 'addCamera',
label: '新增摄像头',
category: 'action',
type: 'success',
size: 'small',
action: 'openAddCameraDialog',
formKey: 'CameraFormDialog'
},
}
/** 按标签页名称获取工具栏按钮列表(自动根据 PAGE_CONFIG 过滤) */

View File

@ -205,7 +205,7 @@
#[`column-${colProp}`]="{ row }"
>
<template v-if="colProp === 'operation'">
<div class="operation-cell">
<div class="wave-operation-actions">
<el-button link type="primary" size="small" @click.stop="openCameraForm('edit', getRowById(row['id']))">编辑</el-button>
<el-button link type="danger" size="small" @click.stop="handleDeleteCamera(getRowById(row['id'])!)">删除</el-button>
<el-button link type="warning" size="small" @click.stop="openOsdDialog(getRowById(row['id'])!)">OSD</el-button>
@ -440,7 +440,7 @@ const currentDetailTabApiMethod = computed(() => {
/** 当前标签页的工具栏按钮列表 */
const currentToolbarButtons = computed<OrderToolbarButtonConfig[]>(() => {
const btns = getTabToolbarButtons(activeTabName.value)
return btns.map((btn: ToolbarButtonConfig) => ({
return btns.map((btn: any) => ({
key: btn.key,
label: btn.label,
size: btn.size,
@ -451,7 +451,8 @@ const currentToolbarButtons = computed<OrderToolbarButtonConfig[]>(() => {
action: btn.action,
dynamicLabelKey: btn.dynamicLabelKey,
buttonType: btn.buttonType,
dropdownOptions: btn.dropdownOptions
dropdownOptions: btn.dropdownOptions,
category: btn.category
}))
})
@ -1023,4 +1024,12 @@ onMounted(() => {
color: #909399;
text-align: center;
}
.wave-operation-actions {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
flex-wrap: wrap;
}
</style>

View File

@ -15,7 +15,7 @@
/>
-->
<template>
<div class="operation-cell">
<div class="wave-operation-actions">
<template v-for="btn in buttons" :key="btn.key">
<!-- action 按钮:支持确认弹窗 -->
<el-button

View File

@ -537,7 +537,7 @@ export function buildWhereConditions(rawConditions: Record<string, any>): Record
export interface ToolbarButtonConfig {
key: string
label: string
category: 'common' | 'function' | 'basic'
category: 'refresh' | 'setting' | 'action' | 'cancel'
size?: '' | 'default' | 'small' | 'large'
type?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
plain?: boolean
@ -553,34 +553,34 @@ export interface ToolbarButtonConfig {
/** ★ 录像服务器工具栏按钮 */
export const TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
// ===== 公共按钮 =====
// ===== 刷新 =====
refresh: {
key: 'refresh',
label: '刷新',
category: 'common',
category: 'refresh',
type: 'primary',
size: 'small',
loadingKey: 'loading',
action: 'loadData'
},
// ===== 功能按钮 =====
// ===== 设置 =====
columnConfig: {
key: 'columnConfig',
label: '字段设置',
category: 'setting',
size: 'small',
action: 'openColumnConfigPanel'
},
// ===== 操作 =====
addServer: {
key: 'addServer',
label: '新增录像服务器',
category: 'function',
category: 'action',
type: 'success',
size: 'small',
action: 'openAddServerDialog',
formKey: 'ServerFormDialog'
},
// ===== 基础操作 =====
columnConfig: {
key: 'columnConfig',
label: '字段设置',
category: 'basic',
size: 'small',
action: 'openColumnConfigPanel'
}
}
/** 按标签页名称获取工具栏按钮列表(自动根据 PAGE_CONFIG 过滤) */

View File

@ -225,11 +225,12 @@ const currentDetailTabApiMethod = computed(() => {
// ============================================================
const currentToolbarButtons = computed<OrderToolbarButtonConfig[]>(() => {
const btns = getTabToolbarButtons(activeTabName.value)
return btns.map((btn: ToolbarButtonConfig) => ({
return btns.map((btn: any) => ({
key: btn.key, label: btn.label, size: btn.size, type: btn.type,
plain: btn.plain, loadingKey: btn.loadingKey, disabledKey: btn.disabledKey,
action: btn.action, dynamicLabelKey: btn.dynamicLabelKey,
buttonType: btn.buttonType, dropdownOptions: btn.dropdownOptions
buttonType: btn.buttonType, dropdownOptions: btn.dropdownOptions,
category: btn.category
}))
})
@ -545,7 +546,7 @@ onMounted(() => { loadData() })
color: #909399;
}
.operation-cell {
.wave-operation-actions {
display: flex;
align-items: center;
justify-content: center;

View File

@ -1,56 +1,58 @@
<template>
<div class="warehouses-container">
<div class="order-sub-container" :style="{ height: containerHeight }">
<scan-box
ref="scanBox"
cache-key="warehouses-list"
width="250px"
title="仓库筛选"
:auto-submit="false"
:preset-tree="presetTree"
:available-fields="availableFields"
:initial-conditions="{ store_use_status: 1 }"
@condition-change="handleConditionChange"
@reset="handleReset"
@condition-clear="handleConditionClear"
@submit="handleSubmit"
/>
<div class="main-content">
<div class="toolbar">
<div class="toolbar-left">
<el-button size="small" type="primary" @click="openSignDialog">
<el-icon><Plus /></el-icon> 发起签约
</el-button>
<el-button size="small" :loading="exportLoading" @click="handleExportLogs">
<el-icon><Download /></el-icon> 导出日志
</el-button>
<el-button size="small" @click="loadList">
<el-icon><Refresh /></el-icon> 刷新
</el-button>
</div>
<div class="toolbar-right">
<el-input
v-model="queryForm.keyword"
placeholder="搜索仓库名或备注"
clearable
size="small"
style="width: 200px"
@keyup.enter="handleSearch"
>
<template #prefix>
<el-icon><Search /></el-icon>
</template>
</el-input>
<order-toolbar-button-group
:buttons="toolbarButtons"
:resolve-disabled="resolveButtonDisabled"
:resolve-loading="resolveButtonLoading"
:resolve-label="resolveButtonLabel"
:layout-key="toolbarLayoutKey"
@action="handleToolbarButtonClick"
/>
</div>
</div>
<div class="upper-wrapper">
<div class="split-stack" ref="splitStackRef">
<div class="upper-wrapper" :style="detailVisible ? upperPaneStyle : upperPaneFullStyle">
<upper-table
ref="tableRef"
title="仓库签约列表"
default-align="center"
:enable-column-config="true"
table-id="warehouses-list"
:data="list"
:columns="columns"
:table-size="tableSize"
:loading="loading"
:pagination="pagination"
:show-index="true"
:show-selection="true"
:show-actions="true"
:query-time="queryTime"
row-key="id"
@current-change="handleRowClick"
@row-click="handleRowClick"
@page-change="handlePageChange"
@page-size-change="handleSizeChange"
@sort-change="handleSortChange"
@selection-change="handleSelectionChange"
>
<template #column-counterparty_name="{ row }">
<span>{{ row.warehouse_name || row.remask || row.counterparty_name }}</span>
@ -91,6 +93,7 @@
</el-tag>
</template>
<template #column-actions="{ row }">
<div class="wave-operation-actions">
<el-button
size="small"
type="primary"
@ -119,11 +122,18 @@
@click.stop="handleUnbind(row, 1)"
>启用</el-button>
<span v-else class="text-muted">—</span>
</div>
</template>
</upper-table>
</div>
</div>
<div class="lower-level" v-if="selectedRow">
<template v-if="detailVisible">
<div
class="pane-resizer"
title="拖动调整列表与详情区域高度"
@mousedown="beginSplitDrag"
/>
<div class="lower-level" v-if="selectedRow" :style="lowerPaneStyle">
<div class="detail-header">
<el-tabs v-model="activeTab" class="detail-tab">
<el-tab-pane label="签约详情" name="details" />
@ -209,9 +219,14 @@
/>
</div>
</div>
</div>
<div class="lower-level empty" v-else>
<el-empty description="请选择数据查看详情" :image-size="60" />
</div>
<div class="no-selection" v-else :style="lowerPaneStyle">
<div class="empty-tip">
<p>请从上方列表中选择一项查看详情</p>
</div>
</div>
</template>
</div>
</div>
@ -403,9 +418,8 @@
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, watch } from 'vue'
import { ref, reactive, onMounted, computed, watch } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, Plus, Refresh, Download } from '@element-plus/icons-vue'
import {
warehouseList,
storeWarehouseSign,
@ -420,8 +434,98 @@ import {
import { listInterfaceTypes, getQimenAppList } from '@/api/index/index'
import ScanBox from '@/components/ScanBox/index.vue'
import UpperTable from '@/components/UpperTable/index.vue'
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
import AsyncExportProgressDialog from '@/components/AsyncExportProgressDialog.vue'
import { useAsyncExportTask } from '@/composables/useAsyncExportTask'
import { useSettingsStore } from '@/stores/modules/settings'
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
import { safeInvoke } from '@/utils/safe-invoke'
const settingsStore = useSettingsStore()
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
const containerHeight = computed(() => shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)')
const {
splitStackRef,
beginSplitDrag,
lowerPaneStyle,
upperPaneStyle,
} = useVerticalSplitPane({ defaultLowerPercent: 35 })
const upperPaneFullStyle = computed(() => ({
flex: '1 1 auto',
minHeight: '0',
overflow: 'hidden',
}))
const detailVisible = ref(true)
const toolbarButtons: ToolbarButtonConfig[] = [
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
{
key: 'toggleDetail',
label: '显示详情',
dynamicLabelKey: 'detailToggleLabel',
category: 'setting',
size: 'small',
action: 'toggleDetailVisible'
},
{ key: 'openSign', label: '发起签约', category: 'action', size: 'small', action: 'openSignDialog' },
{ key: 'exportLogs', label: '导出日志', category: 'action', size: 'small', loadingKey: 'exportLoading', action: 'handleExportLogs' },
]
// ─── 工具栏状态管理 ──────────────────────────────────────────────────────────
const buttonLoadingMap = computed(() => ({
loading: loading.value,
exportLoading: exportLoading.value
}))
const buttonDisabledMap = computed(() => ({}))
const buttonLabelMap = computed(() => ({
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
}))
const toolbarLayoutKey = computed(() =>
JSON.stringify({
loading: buttonLoadingMap.value,
disabled: buttonDisabledMap.value,
labels: buttonLabelMap.value
})
)
function resolveButtonLoading(loadingKey?: string) {
if (!loadingKey) return false
return Boolean((buttonLoadingMap.value as Record<string, boolean>)[loadingKey])
}
function resolveButtonDisabled(disabledKey?: string) {
if (!disabledKey) return false
return Boolean((buttonDisabledMap.value as Record<string, boolean>)[disabledKey])
}
function resolveButtonLabel(defaultLabel: string, dynamicLabelKey?: string) {
if (!dynamicLabelKey) return defaultLabel
return (buttonLabelMap.value as Record<string, string>)[dynamicLabelKey] || defaultLabel
}
function toggleDetailVisible() {
detailVisible.value = !detailVisible.value
}
const toolbarActionMap: Record<string, () => void> = {
loadList: () => { void loadList() },
openSignDialog: () => openSignDialog(),
handleExportLogs: () => { void handleExportLogs() },
toggleDetailVisible: () => toggleDetailVisible()
}
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
const handler = toolbarActionMap[action]
if (!handler) return
safeInvoke(() => handler())
}
// ─── 列表列配置 ─────────────────────────────────────────────────────────────
const columns = [
@ -437,6 +541,13 @@ const columns = [
// ─── 筛选字段配置 ─────────────────────────────────────────────────────────
const availableFields = [
{
label: '关键词',
value: 'keyword',
type: 'text',
group: '基础信息',
placeholder: '搜索仓库名或备注'
},
{
label: '签约状态',
value: 'auth_status',
@ -468,19 +579,16 @@ const currentSubject = ref<{ store_id?: number; company_name?: string; role?: st
// ─── 列表状态 ──────────────────────────────────────────────────────────────
const loading = ref(false)
const queryTime = ref(0)
const tableSize = ref<'small' | 'default' | 'large'>('small')
const list = ref<any[]>([])
const selectionRows = ref<any[]>([])
const selectedRow = ref<any>(null)
const tableRef = ref<any>(null)
const scanBox = ref<any>(null)
const activeTab = ref('details')
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
const queryForm = reactive<{
keyword: string
auth_status: number | undefined
store_use_status: number | undefined
}>({ keyword: '', auth_status: undefined, store_use_status: undefined })
const currentCondition = ref<any>({ store_use_status: 1 })
// ─── 操作日志状态 ──────────────────────────────────────────────────────────
@ -506,13 +614,13 @@ const {
// ─── 加载列表 ──────────────────────────────────────────────────────────────
async function loadList() {
loading.value = true
const startTime = Date.now()
try {
const params: any = {
page: pagination.currentPage,
page_size: pagination.pageSize,
...currentCondition.value
}
if (queryForm.keyword) params.keyword = queryForm.keyword
const res = await warehouseList(params) as any
if (res?.data) {
@ -528,6 +636,7 @@ async function loadList() {
} catch (e) {
ElMessage.error('获取列表失败')
} finally {
queryTime.value = Date.now() - startTime
loading.value = false
}
}
@ -544,8 +653,8 @@ function handleConditionChange(condition: any) {
if (condition) {
Object.keys(condition).forEach(k => {
const c = condition[k]
if (c && typeof c === 'object' && c.value !== undefined) {
if (c.value !== '' && c.value !== null) {
if (c && typeof c === 'object' && !Array.isArray(c) && c.value !== undefined) {
if (c.value !== '' && c.value !== null && c.value !== undefined) {
where[k] = c.value
}
} else if (c !== '' && c !== null && c !== undefined) {
@ -558,20 +667,26 @@ function handleConditionChange(condition: any) {
loadList()
}
function handleSearch() {
function handleSubmit() {
pagination.currentPage = 1
loadList()
}
function handleConditionClear() {
currentCondition.value = {}
pagination.currentPage = 1
loadList()
}
function handleReset() {
queryForm.keyword = ''
currentCondition.value = {}
pagination.currentPage = 1
if (scanBox.value?.reset) {
scanBox.value.reset()
} else {
pagination.currentPage = 1
loadList()
} else if (scanBox.value?.clear) {
scanBox.value.clear()
}
loadList()
}
function handlePageChange(page: number) {
@ -589,6 +704,14 @@ function handleRowClick(row: any) {
selectedRow.value = row
}
function handleSortChange(_sort: { prop: string; order: string }) {
// 预留排序事件处理
}
function handleSelectionChange(rows: any[]) {
selectionRows.value = rows || []
}
// ─── 工具函数 ──────────────────────────────────────────────────────────────
function getAuthStatusType(status: number): string {
const map: Record<number, string> = { 1: 'warning', 2: 'success', 3: 'danger', 4: 'info', 5: 'danger' }
@ -930,117 +1053,50 @@ onMounted(() => {
</script>
<style scoped lang="scss">
.warehouses-container {
@use "../order/orderManagement/styles/order-sub.scss";
.order-sub-container .main-content .lower-level .detail-container {
padding: 6px 10px;
display: flex;
height: 100%;
flex-direction: column;
box-sizing: border-box;
overflow: auto;
flex: 1;
min-height: 0;
}
.main-content {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
padding: 12px;
overflow: hidden;
}
.empty-tip {
text-align: center;
font-size: 13px;
color: #909399;
padding: 16px;
}
.toolbar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
flex-shrink: 0;
gap: 12px;
.real-name {
color: #999;
font-size: 12px;
}
&-left {
display: flex;
align-items: center;
gap: 6px;
}
.wave-operation-actions {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
flex-wrap: wrap;
}
&-right {
display: flex;
align-items: center;
}
}
.text-muted {
color: #c0c4cc;
}
.upper-wrapper {
flex: 1;
min-height: 0;
overflow: hidden;
}
.text-danger {
color: #f56c6c;
font-weight: 500;
}
.lower-level {
margin-top: 8px;
border: 1px solid #ebeef5;
border-radius: 4px;
flex-shrink: 0;
display: flex;
flex-direction: column;
&.empty {
border: none;
}
.detail-header {
padding: 0 12px;
border-bottom: 1px solid #ebeef5;
flex-shrink: 0;
}
.detail-container {
padding: 12px;
overflow: auto;
max-height: 260px;
}
.log-placeholder {
padding: 20px 0;
}
}
.text-danger {
color: #f56c6c;
font-weight: 500;
}
.real-name {
font-size: 12px;
color: #c0c4cc;
}
.sign-preview {
.sign-tip {
margin-top: 16px;
}
}
.policy-form-scroll {
max-height: 400px;
overflow-y: auto;
}
.policy-json-editor {
.policy-json-label {
margin-bottom: 6px;
font-size: 13px;
font-weight: 500;
}
.policy-json-error {
color: #f56c6c;
font-size: 12px;
margin-top: 4px;
}
.policy-json-tip {
color: #c0c4cc;
font-size: 12px;
margin-top: 6px;
}
}
:deep(.el-descriptions__label) {
width: 110px;
.sign-preview {
.sign-tip {
margin-top: 16px;
}
}