1
This commit is contained in:
parent
e1a967b765
commit
2d955cf961
BIN
dist.tar.gz
BIN
dist.tar.gz
Binary file not shown.
@ -1,7 +1,33 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
const v = "1.0"
|
const v = "1.0"
|
||||||
|
|
||||||
export const stockoutList = (data: any) => {
|
// ── storage.stockout.list ──
|
||||||
|
|
||||||
|
export type StockoutListParams = {
|
||||||
|
pagination?: {
|
||||||
|
page?: number
|
||||||
|
pageSize?: number
|
||||||
|
}
|
||||||
|
where?: Record<string, unknown>
|
||||||
|
sort?: {
|
||||||
|
sortField?: string
|
||||||
|
sortOrder?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockoutListResponse = {
|
||||||
|
list: Record<string, unknown>[]
|
||||||
|
pagination: {
|
||||||
|
page?: number
|
||||||
|
pageSize?: number
|
||||||
|
total?: number
|
||||||
|
totalPages?: number
|
||||||
|
hasPrevious?: boolean
|
||||||
|
hasNext?: boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const stockoutList = (data: StockoutListParams) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/system`,
|
url: `/system`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -14,11 +40,23 @@ export const stockoutList = (data: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const stockoutListItems = (data: {
|
// ── storage.stockout.listItems ──
|
||||||
delivery_order_code?: string
|
|
||||||
order_id?: number
|
export type StockoutListItemsParams = {
|
||||||
|
/** 出库单号(推荐) */
|
||||||
|
stockout_order_code?: string
|
||||||
|
/** 出库单ID,与 stockout_order_code 至少传一个 */
|
||||||
id?: number
|
id?: number
|
||||||
}) => {
|
/** @deprecated 旧参数名,兼容 delivery_order_code */
|
||||||
|
delivery_order_code?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockoutListItemsResponse = {
|
||||||
|
order: Record<string, unknown>
|
||||||
|
list: Record<string, unknown>[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const stockoutListItems = (data: StockoutListItemsParams) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/system`,
|
url: `/system`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
@ -44,3 +82,67 @@ export const stockoutToOrder = (data?: { id?: number; delivery_order_code?: stri
|
|||||||
data: data || {}
|
data: data || {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── storage.stockout.confirm ──
|
||||||
|
|
||||||
|
export type StockoutConfirmParams = {
|
||||||
|
/** 出库单ID(必填) */
|
||||||
|
id: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockoutConfirmResponse = {
|
||||||
|
id: number
|
||||||
|
stockout_order_code: string
|
||||||
|
order_status: string
|
||||||
|
logisticsName: string
|
||||||
|
/** 运单号(取自表中 express_code 字段) */
|
||||||
|
expressCode: string
|
||||||
|
/** 运单号列表(取自表中 express_codes 字段) */
|
||||||
|
expressCodes?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 直出确认出库单:不改变内部库存,按出库单明细计划数量(plan_qty)直接确认,状态推进到 COMPLETED。要求 express_code 已填写 */
|
||||||
|
export const stockoutConfirm = (data: StockoutConfirmParams) => {
|
||||||
|
return request({
|
||||||
|
url: `/system`,
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
method: 'storage.stockout.confirm',
|
||||||
|
v,
|
||||||
|
timestamp: new Date().getTime()
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── storage.stockout.updateExpress ──
|
||||||
|
|
||||||
|
export type StockoutUpdateExpressParams = {
|
||||||
|
/** 出库单ID(必填) */
|
||||||
|
id: number
|
||||||
|
/** 运单号 */
|
||||||
|
express_code?: string
|
||||||
|
/** 运单号列表(JSON 数组) */
|
||||||
|
express_codes?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockoutUpdateExpressResponse = {
|
||||||
|
id: number
|
||||||
|
stockout_order_code: string
|
||||||
|
express_code?: string
|
||||||
|
express_codes?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新出库单的运单号字段(express_code / express_codes),用于在确认前填写运单信息 */
|
||||||
|
export const stockoutUpdateExpress = (data: StockoutUpdateExpressParams) => {
|
||||||
|
return request({
|
||||||
|
url: `/system`,
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
method: 'storage.stockout.updateExpress',
|
||||||
|
v,
|
||||||
|
timestamp: new Date().getTime()
|
||||||
|
},
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="scan-box-container" :style="{ width }" :class="{ 'scan-box--compact': isCompact }">
|
<div class="scan-box-container" :style="{ width }" :class="{ 'scan-box--compact': isCompact }">
|
||||||
<!-- Tab 切换 -->
|
<!-- Tab 切换(标准/紧凑模式均显示) -->
|
||||||
<div class="scan-tabs" v-if="!isCompact">
|
<div class="scan-tabs">
|
||||||
<div class="scan-tabs__inner">
|
<div class="scan-tabs__inner">
|
||||||
<el-tabs v-model="activeTab" stretch @tab-click="handleTabChange">
|
<el-tabs v-model="activeTab" stretch @tab-click="handleTabChange">
|
||||||
<el-tab-pane label="筛选" name="custom">
|
<el-tab-pane label="筛选" name="custom">
|
||||||
@ -21,24 +21,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<el-tooltip content="切换紧凑模式" placement="bottom">
|
<el-tooltip :content="isCompact ? '切换标准模式' : '切换紧凑模式'" placement="bottom">
|
||||||
<el-button class="mode-toggle-btn" size="small" link @click="toggleMode">
|
<el-button class="mode-toggle-btn" size="small" link @click="toggleMode">
|
||||||
<el-icon><Fold /></el-icon>
|
<el-icon><Expand v-if="isCompact" /><Fold v-else /></el-icon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 紧凑模式头部 -->
|
|
||||||
<div v-else class="compact-header">
|
|
||||||
<span class="compact-title">{{ title }}</span>
|
|
||||||
<el-tooltip content="切换标准模式" placement="bottom">
|
|
||||||
<el-button class="mode-toggle-btn" size="small" link @click="toggleMode">
|
|
||||||
<el-icon><Expand /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
</el-tooltip>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<div class="scan-content" v-if="!isCompact">
|
<div class="scan-content" v-if="!isCompact">
|
||||||
<!-- 自定义筛选 -->
|
<!-- 自定义筛选 -->
|
||||||
@ -485,7 +475,33 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 数字类型 -->
|
<!-- 数字类型 -->
|
||||||
<div v-else-if="field.type === 'number'" class="compact-field-item">
|
<div v-else-if="field.type === 'number'" class="compact-field-item">
|
||||||
|
<div v-if="getOperators(field).length > 1" class="compact-field-control">
|
||||||
|
<el-select
|
||||||
|
v-model="customConditions[field.value].operator"
|
||||||
|
size="small"
|
||||||
|
class="compact-operator-select"
|
||||||
|
@change="handleCompactChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="op in getOperators(field)"
|
||||||
|
:key="op.value"
|
||||||
|
:label="op.label"
|
||||||
|
:value="op.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
<el-input-number
|
||||||
|
v-if="!isNullishOperator(customConditions[field.value].operator)"
|
||||||
|
v-model="customConditions[field.value].value"
|
||||||
|
:placeholder="field.label"
|
||||||
|
:controls="false"
|
||||||
|
size="small"
|
||||||
|
class="compact-value-input"
|
||||||
|
@change="handleCompactChange"
|
||||||
|
/>
|
||||||
|
<span v-else class="no-value-tip">无需填值</span>
|
||||||
|
</div>
|
||||||
<el-input-number
|
<el-input-number
|
||||||
|
v-else
|
||||||
v-model="customConditions[field.value].value"
|
v-model="customConditions[field.value].value"
|
||||||
:placeholder="field.label"
|
:placeholder="field.label"
|
||||||
:controls="false"
|
:controls="false"
|
||||||
|
|||||||
@ -587,15 +587,16 @@ export function buildWhereConditions(rawConditions: Record<string, any>): Record
|
|||||||
// ============================================================
|
// ============================================================
|
||||||
// 十、工具栏按钮系统
|
// 十、工具栏按钮系统
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// 按钮分为三类:
|
// 按钮分类对齐 storage/receiving 模式:
|
||||||
// common — 公共按钮(刷新、导出)
|
// refresh — 蓝底白字(刷新)
|
||||||
// function — 功能按钮(打开表单/确认窗口)
|
// setting — 白底黑字(导出、字段设置、显示详情)
|
||||||
// basic — 基础操作(字段设置、隐藏详情)
|
// action — 白底蓝边框(功能操作)
|
||||||
|
// cancel — 红底白字(作废/删除)
|
||||||
|
|
||||||
export interface ToolbarButtonConfig {
|
export interface ToolbarButtonConfig {
|
||||||
key: string
|
key: string
|
||||||
label: string
|
label: string
|
||||||
category: 'common' | 'function' | 'basic'
|
category: 'refresh' | 'setting' | 'action' | 'cancel'
|
||||||
size?: '' | 'default' | 'small' | 'large'
|
size?: '' | 'default' | 'small' | 'large'
|
||||||
type?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
|
type?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
|
||||||
plain?: boolean
|
plain?: boolean
|
||||||
@ -610,28 +611,25 @@ export interface ToolbarButtonConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
export const TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||||
// ===== 公共按钮 =====
|
|
||||||
refresh: {
|
refresh: {
|
||||||
key: 'refresh',
|
key: 'refresh',
|
||||||
label: '刷新',
|
label: '刷新',
|
||||||
category: 'common',
|
category: 'refresh',
|
||||||
type: 'primary',
|
|
||||||
size: 'small',
|
size: 'small',
|
||||||
loadingKey: 'loading',
|
loadingKey: 'loading',
|
||||||
action: 'loadData'
|
action: 'loadData'
|
||||||
},
|
},
|
||||||
// ===== 基础操作 =====
|
|
||||||
columnConfig: {
|
columnConfig: {
|
||||||
key: 'columnConfig',
|
key: 'columnConfig',
|
||||||
label: '字段设置',
|
label: '字段设置',
|
||||||
category: 'basic',
|
category: 'setting',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
action: 'openColumnConfigPanel'
|
action: 'openColumnConfigPanel'
|
||||||
},
|
},
|
||||||
toggleDetail: {
|
toggleDetail: {
|
||||||
key: 'toggleDetail',
|
key: 'toggleDetail',
|
||||||
label: '显示详情',
|
label: '显示详情',
|
||||||
category: 'basic',
|
category: 'setting',
|
||||||
dynamicLabelKey: 'detailToggleLabel',
|
dynamicLabelKey: 'detailToggleLabel',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
action: 'toggleDetailVisible'
|
action: 'toggleDetailVisible'
|
||||||
|
|||||||
@ -139,7 +139,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="editForm.groupType === 'store'" label="关联货主" prop="storeId">
|
<el-form-item v-if="editForm.groupType === 'store'" label="关联货主" prop="storeId">
|
||||||
<el-select v-model="editForm.storeId" placeholder="请选择货主" filterable clearable style="width: 100%" :loading="storeLoading">
|
<el-select v-model="editForm.storeId" placeholder="请选择货主" filterable clearable style="width: 100%" :loading="storeLoading">
|
||||||
<el-option v-for="store in storeList" :key="store.id" :label="store.name" :value="store.id" />
|
<el-option v-for="store in storeList" :key="store.id" :label="store.counterparty_name" :value="store.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="editForm.groupType === 'express'" label="快递接口" prop="expressInterfaces">
|
<el-form-item v-if="editForm.groupType === 'express'" label="快递接口" prop="expressInterfaces">
|
||||||
|
|||||||
@ -16,20 +16,14 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
|
<order-toolbar-button-group
|
||||||
<el-button
|
:buttons="packageMaterialToolbarButtons"
|
||||||
type="danger"
|
:resolve-disabled="resolveButtonDisabled"
|
||||||
size="small"
|
:resolve-loading="resolveButtonLoading"
|
||||||
plain
|
:resolve-label="resolveButtonLabel"
|
||||||
:disabled="!selectedIds.length"
|
:layout-key="toolbarLayoutKey"
|
||||||
:loading="batchDeleting"
|
@action="handleToolbarButtonClick"
|
||||||
@click="handleBatchDelete"
|
/>
|
||||||
>
|
|
||||||
批量删除
|
|
||||||
</el-button>
|
|
||||||
<!-- <el-button size="small" type="primary" plain @click="searchFormVisible = true">快速搜索</el-button> -->
|
|
||||||
<el-button type="success" size="small" @click="openCreate">新增包材</el-button>
|
|
||||||
<el-button type="warning" size="small" plain @click="openBatchImport">批量导入</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -200,6 +194,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
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 BatchImportDialog from './component/BatchImportDialog.vue'
|
import BatchImportDialog from './component/BatchImportDialog.vue'
|
||||||
import PackageMaterialSearchForm from './form/PackageMaterialSearchForm.vue'
|
import PackageMaterialSearchForm from './form/PackageMaterialSearchForm.vue'
|
||||||
import {
|
import {
|
||||||
@ -212,6 +209,7 @@ import { useSettingsStore } from '@/stores/modules/settings'
|
|||||||
import {
|
import {
|
||||||
buildPackageMaterialListPayload,
|
buildPackageMaterialListPayload,
|
||||||
parsePackageMaterialListResponse,
|
parsePackageMaterialListResponse,
|
||||||
|
packageMaterialToolbarButtons,
|
||||||
formatDimensions,
|
formatDimensions,
|
||||||
formatNumber,
|
formatNumber,
|
||||||
formatPackageMaterialStatus,
|
formatPackageMaterialStatus,
|
||||||
@ -239,6 +237,54 @@ const saving = ref(false)
|
|||||||
const batchDeleting = ref(false)
|
const batchDeleting = ref(false)
|
||||||
const selectedIds = ref<number[]>([])
|
const selectedIds = ref<number[]>([])
|
||||||
const tableData = ref<PackageMaterialRecord[]>([])
|
const tableData = ref<PackageMaterialRecord[]>([])
|
||||||
|
|
||||||
|
// ── 工具栏状态 ──
|
||||||
|
const buttonLoadingMap = computed(() => ({
|
||||||
|
loading: loading.value,
|
||||||
|
batchDeleting: batchDeleting.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
const buttonDisabledMap = computed(() => ({
|
||||||
|
hasNoSelection: !selectedIds.value.length
|
||||||
|
}))
|
||||||
|
|
||||||
|
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(),
|
||||||
|
openBatchImport: () => openBatchImport(),
|
||||||
|
handleBatchDelete: () => { void handleBatchDelete() }
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||||
|
const handler = toolbarActionMap[action]
|
||||||
|
if (!handler) return
|
||||||
|
safeInvoke(() => handler())
|
||||||
|
}
|
||||||
const queryTime = ref(0)
|
const queryTime = ref(0)
|
||||||
const tableSize = ref<'small' | 'default' | 'large'>('small')
|
const tableSize = ref<'small' | 'default' | 'large'>('small')
|
||||||
const currentConditionRaw = ref<any>(null)
|
const currentConditionRaw = ref<any>(null)
|
||||||
@ -556,23 +602,23 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
padding: 5px 8px;
|
margin-bottom: 3px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
padding: 6px 10px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
gap: 12px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
min-width: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-left {
|
.toolbar-left {
|
||||||
display: flex;
|
flex: 1;
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
|
|||||||
@ -1,3 +1,36 @@
|
|||||||
|
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
/** 包材列表主工具栏按钮(action 与 packageMaterial/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 storage/receiving:
|
||||||
|
* refresh → action 组(新增/导入)→ cancel 组
|
||||||
|
*/
|
||||||
|
export const packageMaterialToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
|
||||||
|
{
|
||||||
|
key: 'create',
|
||||||
|
label: '新增包材',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'openCreate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchImport',
|
||||||
|
label: '批量导入',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'openBatchImport'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchDelete',
|
||||||
|
label: '批量删除',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
loadingKey: 'batchDeleting',
|
||||||
|
action: 'handleBatchDelete'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
export type PackageMaterialRecord = {
|
export type PackageMaterialRecord = {
|
||||||
id?: number
|
id?: number
|
||||||
material_code?: string
|
material_code?: string
|
||||||
|
|||||||
@ -16,18 +16,14 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
|
<order-toolbar-button-group
|
||||||
<el-button
|
:buttons="packageSupplierToolbarButtons"
|
||||||
type="danger"
|
:resolve-disabled="resolveButtonDisabled"
|
||||||
size="small"
|
:resolve-loading="resolveButtonLoading"
|
||||||
plain
|
:resolve-label="resolveButtonLabel"
|
||||||
:disabled="!selectedIds.length"
|
:layout-key="toolbarLayoutKey"
|
||||||
:loading="batchDeleting"
|
@action="handleToolbarButtonClick"
|
||||||
@click="handleBatchDelete"
|
/>
|
||||||
>
|
|
||||||
批量删除
|
|
||||||
</el-button>
|
|
||||||
<el-button type="success" size="small" @click="openCreate">新增供应商</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -116,6 +112,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
|||||||
import type { FormInstance, FormRules } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
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 {
|
import {
|
||||||
packageSupplierCreate,
|
packageSupplierCreate,
|
||||||
packageSupplierDelete,
|
packageSupplierDelete,
|
||||||
@ -126,6 +125,7 @@ import { useSettingsStore } from '@/stores/modules/settings'
|
|||||||
import {
|
import {
|
||||||
buildPackageSupplierListPayload,
|
buildPackageSupplierListPayload,
|
||||||
parsePackageSupplierListResponse,
|
parsePackageSupplierListResponse,
|
||||||
|
packageSupplierToolbarButtons,
|
||||||
formatPackageSupplierStatus,
|
formatPackageSupplierStatus,
|
||||||
normalizePackageSupplierScanConditionToWhere,
|
normalizePackageSupplierScanConditionToWhere,
|
||||||
packageSupplierColumns,
|
packageSupplierColumns,
|
||||||
@ -151,6 +151,53 @@ const saving = ref(false)
|
|||||||
const batchDeleting = ref(false)
|
const batchDeleting = ref(false)
|
||||||
const selectedIds = ref<number[]>([])
|
const selectedIds = ref<number[]>([])
|
||||||
const tableData = ref<PackageSupplierRecord[]>([])
|
const tableData = ref<PackageSupplierRecord[]>([])
|
||||||
|
|
||||||
|
// ── 工具栏状态 ──
|
||||||
|
const buttonLoadingMap = computed(() => ({
|
||||||
|
loading: loading.value,
|
||||||
|
batchDeleting: batchDeleting.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
const buttonDisabledMap = computed(() => ({
|
||||||
|
hasNoSelection: !selectedIds.value.length
|
||||||
|
}))
|
||||||
|
|
||||||
|
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(),
|
||||||
|
handleBatchDelete: () => { void handleBatchDelete() }
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||||
|
const handler = toolbarActionMap[action]
|
||||||
|
if (!handler) return
|
||||||
|
safeInvoke(() => handler())
|
||||||
|
}
|
||||||
const queryTime = ref(0)
|
const queryTime = ref(0)
|
||||||
const tableSize = ref<'small' | 'default' | 'large'>('small')
|
const tableSize = ref<'small' | 'default' | 'large'>('small')
|
||||||
const currentConditionRaw = ref<any>(null)
|
const currentConditionRaw = ref<any>(null)
|
||||||
@ -417,23 +464,23 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toolbar {
|
.toolbar {
|
||||||
padding: 5px 8px;
|
margin-bottom: 3px;
|
||||||
border-bottom: 1px solid #ebeef5;
|
padding: 6px 10px;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
gap: 12px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
min-width: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-left {
|
.toolbar-left {
|
||||||
display: flex;
|
flex: 1;
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upper-wrapper {
|
.upper-wrapper {
|
||||||
|
|||||||
@ -1,3 +1,29 @@
|
|||||||
|
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
/** 包装供应商列表主工具栏按钮(action 与 packageSupplier/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 storage/receiving:
|
||||||
|
* refresh → action 组 → cancel 组
|
||||||
|
*/
|
||||||
|
export const packageSupplierToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadList' },
|
||||||
|
{
|
||||||
|
key: 'create',
|
||||||
|
label: '新增供应商',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'openCreate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchDelete',
|
||||||
|
label: '批量删除',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
loadingKey: 'batchDeleting',
|
||||||
|
action: 'handleBatchDelete'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
export type PackageSupplierRecord = {
|
export type PackageSupplierRecord = {
|
||||||
id?: number
|
id?: number
|
||||||
supplier_code?: string
|
supplier_code?: string
|
||||||
|
|||||||
@ -1359,7 +1359,7 @@ export const deliveryAvailableFields = [
|
|||||||
{ ...isUrgencyScanField, group: SCAN_QUICK_FILTER_GROUP },
|
{ ...isUrgencyScanField, group: SCAN_QUICK_FILTER_GROUP },
|
||||||
{ ...waveAssignmentScanField, group: SCAN_QUICK_FILTER_GROUP },
|
{ ...waveAssignmentScanField, group: SCAN_QUICK_FILTER_GROUP },
|
||||||
// 订单信息
|
// 订单信息
|
||||||
{ ...orderQuickSearchScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...pendingOrderQuickSearchScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
{ ...orderIdScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...orderIdScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
{ ...waveNoScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...waveNoScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
{ ...waybillCodesScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...waybillCodesScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
@ -2064,7 +2064,7 @@ export const expectionOrderAvailableFields = [
|
|||||||
{ ...isUrgencyScanField, group: SCAN_QUICK_FILTER_GROUP },
|
{ ...isUrgencyScanField, group: SCAN_QUICK_FILTER_GROUP },
|
||||||
{ ...waveAssignmentScanField, group: SCAN_QUICK_FILTER_GROUP },
|
{ ...waveAssignmentScanField, group: SCAN_QUICK_FILTER_GROUP },
|
||||||
// 订单信息
|
// 订单信息
|
||||||
{ ...orderQuickSearchScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...pendingOrderQuickSearchScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
{ ...orderIdScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...orderIdScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
{ ...waveNoScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...waveNoScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
{ ...expressCodeScanField, group: SCAN_ORDER_INFO_GROUP },
|
{ ...expressCodeScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||||
|
|||||||
@ -707,6 +707,10 @@ onBeforeUnmount(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.toolbar-left {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -158,25 +158,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-operation="{ row }">
|
<template #column-operation="{ row }">
|
||||||
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
<div class="wave-operation-actions">
|
||||||
<el-button
|
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
||||||
link
|
<el-button
|
||||||
type="success"
|
link
|
||||||
size="small"
|
type="success"
|
||||||
:loading="isWavePickCompleteLoading(row)"
|
size="small"
|
||||||
@click.stop="handleWavePickComplete(row)"
|
:loading="isWavePickCompleteLoading(row)"
|
||||||
>
|
@click.stop="handleWavePickComplete(row)"
|
||||||
批量拣货
|
>
|
||||||
</el-button>
|
批量拣货
|
||||||
<el-button
|
</el-button>
|
||||||
link
|
<el-button
|
||||||
type="warning"
|
link
|
||||||
size="small"
|
type="warning"
|
||||||
:loading="isTogglePrintStatusLoading(row)"
|
size="small"
|
||||||
@click.stop="handleToggleWavePrintStatus(row)"
|
:loading="isTogglePrintStatusLoading(row)"
|
||||||
>
|
@click.stop="handleToggleWavePrintStatus(row)"
|
||||||
{{ getPrintStatusButtonText(row) }}
|
>
|
||||||
</el-button>
|
{{ getPrintStatusButtonText(row) }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -4092,6 +4094,10 @@ async function submitFallbackOrderFetchByIds() {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.toolbar-left {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -4101,10 +4107,34 @@ async function submitFallbackOrderFetchByIds() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-switch-label {
|
.toolbar-switch-label {
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wave-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>
|
</style>
|
||||||
@ -158,25 +158,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-operation="{ row }">
|
<template #column-operation="{ row }">
|
||||||
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
<div class="wave-operation-actions">
|
||||||
<el-button
|
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
||||||
link
|
<el-button
|
||||||
type="success"
|
link
|
||||||
size="small"
|
type="success"
|
||||||
:loading="isWavePickCompleteLoading(row)"
|
size="small"
|
||||||
@click.stop="handleWavePickComplete(row)"
|
:loading="isWavePickCompleteLoading(row)"
|
||||||
>
|
@click.stop="handleWavePickComplete(row)"
|
||||||
批量拣货
|
>
|
||||||
</el-button>
|
批量拣货
|
||||||
<el-button
|
</el-button>
|
||||||
link
|
<el-button
|
||||||
type="warning"
|
link
|
||||||
size="small"
|
type="warning"
|
||||||
:loading="isTogglePrintStatusLoading(row)"
|
size="small"
|
||||||
@click.stop="handleToggleWavePrintStatus(row)"
|
:loading="isTogglePrintStatusLoading(row)"
|
||||||
>
|
@click.stop="handleToggleWavePrintStatus(row)"
|
||||||
{{ getPrintStatusButtonText(row) }}
|
>
|
||||||
</el-button>
|
{{ getPrintStatusButtonText(row) }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -2880,6 +2882,10 @@ async function submitGroupOrderDialog() {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.toolbar-left {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -2895,4 +2901,28 @@ async function submitGroupOrderDialog() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wave-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>
|
</style>
|
||||||
@ -25,9 +25,10 @@
|
|||||||
@action="handleToolbarButtonClick"
|
@action="handleToolbarButtonClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="toolbar-right">
|
<!-- 无需 toolbar-right,保持与 orderManagement 一致 -->
|
||||||
<!-- <span class="toolbar-switch-label">{{ pickTaskWaveListDefaults.toolbarHint }}</span> -->
|
<!-- <div class="toolbar-right">
|
||||||
</div>
|
<span class="toolbar-switch-label">{{ pickTaskWaveListDefaults.toolbarHint }}</span>
|
||||||
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="split-stack" ref="splitStackRef">
|
<div class="split-stack" ref="splitStackRef">
|
||||||
@ -270,6 +271,10 @@ const upperPaneFullStyle = computed(() => ({
|
|||||||
overflow: 'hidden' as const
|
overflow: 'hidden' as const
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
function toggleDetailVisible() {
|
||||||
|
detailVisible.value = !detailVisible.value
|
||||||
|
}
|
||||||
|
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: pickTaskWavePaginationDefaults.initialPageSize,
|
pageSize: pickTaskWavePaginationDefaults.initialPageSize,
|
||||||
@ -297,7 +302,8 @@ const buttonDisabledMap = computed(() => ({
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
const buttonLabelMap = computed(() => ({
|
const buttonLabelMap = computed(() => ({
|
||||||
batchCancelTotal: `批量取消任务(${selectedTaskRows.value.length})`
|
batchCancelTotal: `批量取消任务(${selectedTaskRows.value.length})`,
|
||||||
|
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const toolbarLayoutKey = computed(() =>
|
const toolbarLayoutKey = computed(() =>
|
||||||
@ -328,6 +334,7 @@ const toolbarActionMap: Record<string, () => void> = {
|
|||||||
void loadData()
|
void loadData()
|
||||||
},
|
},
|
||||||
openColumnConfigPanel: () => openColumnConfigPanel(),
|
openColumnConfigPanel: () => openColumnConfigPanel(),
|
||||||
|
toggleDetailVisible: () => toggleDetailVisible(),
|
||||||
handleSearch: () => handleSearch(),
|
handleSearch: () => handleSearch(),
|
||||||
handleBatchCancelTasks: () => {
|
handleBatchCancelTasks: () => {
|
||||||
void handleBatchCancelTasks()
|
void handleBatchCancelTasks()
|
||||||
@ -857,6 +864,10 @@ onMounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.toolbar-left {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
inactive-text="隐藏下一波抓取数量"
|
inactive-text="隐藏下一波抓取数量"
|
||||||
@change="handleWaveStrategyNextFetchOrderCountChange"
|
@change="handleWaveStrategyNextFetchOrderCountChange"
|
||||||
/>
|
/>
|
||||||
<span class="toolbar-switch-label">当前仓库波次策略(wms_wave_strategy)</span>
|
<!-- <span class="toolbar-switch-label">当前仓库波次策略(wms_wave_strategy)</span> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -44,7 +44,7 @@
|
|||||||
title="波次策略列表"
|
title="波次策略列表"
|
||||||
default-align="center"
|
default-align="center"
|
||||||
:enable-column-config="true"
|
:enable-column-config="true"
|
||||||
:column-config-schema-version="1"
|
:column-config-schema-version="2"
|
||||||
:table-id="tableListId"
|
:table-id="tableListId"
|
||||||
:data="filteredColumns"
|
:data="filteredColumns"
|
||||||
:row-key="getRowIdentity"
|
:row-key="getRowIdentity"
|
||||||
@ -135,19 +135,21 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-operation="{ row }">
|
<template #column-operation="{ row }">
|
||||||
<el-button
|
<div class="wave-operation-actions">
|
||||||
type="warning"
|
<el-button
|
||||||
link
|
type="warning"
|
||||||
size="small"
|
link
|
||||||
:loading="waveStrategyFetchSubmittingId === Number(row?.id || 0)"
|
size="small"
|
||||||
:disabled="!Number(row?.id || 0)"
|
:loading="waveStrategyFetchSubmittingId === Number(row?.id || 0)"
|
||||||
@click="submitWaveStrategyFetchAdmin(row)"
|
:disabled="!Number(row?.id || 0)"
|
||||||
>
|
@click="submitWaveStrategyFetchAdmin(row)"
|
||||||
后台抓取
|
>
|
||||||
</el-button>
|
后台抓取
|
||||||
<el-button type="primary" link size="small" @click="openEditWaveStrategyDialog(row)">
|
</el-button>
|
||||||
编辑
|
<el-button type="primary" link size="small" @click="openEditWaveStrategyDialog(row)">
|
||||||
</el-button>
|
编辑
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -1030,6 +1032,30 @@ onMounted(() => {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "../orderManagement/styles/order-sub.scss";
|
@use "../orderManagement/styles/order-sub.scss";
|
||||||
|
|
||||||
|
.wave-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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.empty-tip {
|
.empty-tip {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@ -1052,6 +1078,10 @@ onMounted(() => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.toolbar-left {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -331,7 +331,7 @@ export const waveStrategyColumns = [
|
|||||||
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
|
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
|
||||||
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
||||||
{ prop: 'description', label: '说明', minWidth: 160 },
|
{ prop: 'description', label: '说明', minWidth: 160 },
|
||||||
{ prop: 'operation', label: '操作', width: 170, fixed: 'right', align: 'center' }
|
{ prop: 'operation', label: '操作', width: 140, fixed: 'right', align: 'center' }
|
||||||
]
|
]
|
||||||
|
|
||||||
/** 主表列配置 */
|
/** 主表列配置 */
|
||||||
@ -358,7 +358,7 @@ export const waveBatchColumns = applyWaveListCopyActions([
|
|||||||
{ prop: 'warehouse_id', label: '仓库ID', minWidth: 110 },
|
{ prop: 'warehouse_id', label: '仓库ID', minWidth: 110 },
|
||||||
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
|
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
|
||||||
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
||||||
{ prop: 'operation', label: '操作', minWidth: 280, fixed: 'right' }
|
{ prop: 'operation', label: '操作', minWidth: 140, fixed: 'right' }
|
||||||
])
|
])
|
||||||
|
|
||||||
/** 列表查询 where 白名单(与 sanitizeWaveWhere 一致) */
|
/** 列表查询 where 白名单(与 sanitizeWaveWhere 一致) */
|
||||||
@ -485,6 +485,14 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
action: 'toggleDetailVisible'
|
action: 'toggleDetailVisible'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'fetchGroupOrder',
|
||||||
|
label: '抓取团购单',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'openGroupOrderDialog',
|
||||||
|
onlyForWaveType: 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'batchPrint',
|
key: 'batchPrint',
|
||||||
label: '批量打印(0)',
|
label: '批量打印(0)',
|
||||||
@ -517,22 +525,22 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
|||||||
loadingKey: 'batchPlatformPrintLoading',
|
loadingKey: 'batchPlatformPrintLoading',
|
||||||
action: 'handleBatchPlatformPrint'
|
action: 'handleBatchPlatformPrint'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
key: 'printerComponentConnection',
|
// key: 'printerComponentConnection',
|
||||||
label: '打印组件连接',
|
// label: '打印组件连接',
|
||||||
category: 'action',
|
// category: 'action',
|
||||||
size: 'small',
|
// size: 'small',
|
||||||
action: 'openPrinterComponentConnectionDialog',
|
// action: 'openPrinterComponentConnectionDialog',
|
||||||
onlyForWaveType: 2
|
// onlyForWaveType: 2
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
key: 'printerListTest',
|
// key: 'printerListTest',
|
||||||
label: '打印机列表',
|
// label: '打印机列表',
|
||||||
category: 'action',
|
// category: 'action',
|
||||||
size: 'small',
|
// size: 'small',
|
||||||
action: 'openPrinterListTestDialog',
|
// action: 'openPrinterListTestDialog',
|
||||||
onlyForWaveType: 2
|
// onlyForWaveType: 2
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
key: 'batchPrintPickingList',
|
key: 'batchPrintPickingList',
|
||||||
label: '批量打印拣货单(0)',
|
label: '批量打印拣货单(0)',
|
||||||
@ -590,14 +598,6 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
|||||||
loadingKey: 'batchAllocateStorageLoading',
|
loadingKey: 'batchAllocateStorageLoading',
|
||||||
action: 'handleBatchAllocateStorage'
|
action: 'handleBatchAllocateStorage'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: 'fetchGroupOrder',
|
|
||||||
label: '抓取团购单',
|
|
||||||
category: 'action',
|
|
||||||
size: 'small',
|
|
||||||
action: 'openGroupOrderDialog',
|
|
||||||
onlyForWaveType: 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: 'batchCancel',
|
key: 'batchCancel',
|
||||||
label: '批量取消波次',
|
label: '批量取消波次',
|
||||||
@ -952,6 +952,14 @@ export const pickTaskWaveDetailDialogDefaults = {
|
|||||||
export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
|
export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
{ key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
{ key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||||
|
{
|
||||||
|
key: 'toggleDetail',
|
||||||
|
label: '显示详情',
|
||||||
|
dynamicLabelKey: 'detailToggleLabel',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
action: 'toggleDetailVisible'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'batchCancel',
|
key: 'batchCancel',
|
||||||
label: '批量取消任务',
|
label: '批量取消任务',
|
||||||
@ -1082,7 +1090,7 @@ export const pickTaskWaveColumns = applyWaveListCopyActions([
|
|||||||
{ prop: 'review_finish_time', label: '复核完成', minWidth: 168 },
|
{ prop: 'review_finish_time', label: '复核完成', minWidth: 168 },
|
||||||
{ prop: 'created_at', label: '创建时间', minWidth: 168 },
|
{ prop: 'created_at', label: '创建时间', minWidth: 168 },
|
||||||
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
||||||
{ prop: 'operation', label: '操作', width: 220, fixed: 'right' }
|
{ prop: 'operation', label: '操作', width: 200, fixed: 'right' }
|
||||||
])
|
])
|
||||||
|
|
||||||
export function formatPickTaskStatus(value: unknown): string {
|
export function formatPickTaskStatus(value: unknown): string {
|
||||||
|
|||||||
@ -1,33 +1,43 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
||||||
<!-- 多标签模式 -->
|
<!-- 多标签模式 -->
|
||||||
<el-tabs
|
<template v-if="!singlePage">
|
||||||
v-if="!singlePage"
|
<!-- 顶部多标签页区域(对齐 order/orderManagement 的 tab-section) -->
|
||||||
v-model="activeTab"
|
<div class="tab-section">
|
||||||
@tab-change="handleTabChange"
|
<div class="tabs-header-action">
|
||||||
tab-position="top"
|
<!-- <el-button size="small">操作按钮</el-button> -->
|
||||||
type="border-card"
|
</div>
|
||||||
class="tab-container"
|
<el-tabs
|
||||||
>
|
v-model="activeTab"
|
||||||
<el-tab-pane
|
@tab-change="handleTabChange"
|
||||||
v-for="tab in tabs"
|
tab-position="top"
|
||||||
:key="tab.name"
|
type="border-card"
|
||||||
:name="tab.name"
|
class="tab-container"
|
||||||
:lazy="false"
|
>
|
||||||
>
|
<el-tab-pane
|
||||||
<template #label>
|
v-for="tab in tabs"
|
||||||
<span class="custom-tab-label">{{ tab.label }}</span>
|
:key="tab.name"
|
||||||
</template>
|
:name="tab.name"
|
||||||
|
:lazy="false"
|
||||||
|
>
|
||||||
|
<template #label>
|
||||||
|
<span class="custom-tab-label">{{ tab.label }}</span>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 主内容区容器(对齐 order/orderManagement 的 main-container) -->
|
||||||
|
<div class="main-container">
|
||||||
<keep-alive>
|
<keep-alive>
|
||||||
<component
|
<component
|
||||||
:is="tab.component"
|
:is="activeComponent"
|
||||||
:key="tab.name"
|
:key="activeTab"
|
||||||
v-if="activeTab === tab.name"
|
v-bind="activeTabProps"
|
||||||
v-bind="tab.props || {}"
|
|
||||||
/>
|
/>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</el-tab-pane>
|
</div>
|
||||||
</el-tabs>
|
</template>
|
||||||
|
|
||||||
<!-- 单页模式:直接渲染默认页签组件,复用 .tab-container 样式结构 -->
|
<!-- 单页模式:直接渲染默认页签组件,复用 .tab-container 样式结构 -->
|
||||||
<div v-else class="tab-container single-page-container">
|
<div v-else class="tab-container single-page-container">
|
||||||
@ -70,6 +80,18 @@ const defaultTab = computed(() => tabs.value[0]!)
|
|||||||
|
|
||||||
const activeTab = ref('groupWave')
|
const activeTab = ref('groupWave')
|
||||||
|
|
||||||
|
/** 当前激活页签对应的组件(渲染在主内容区 main-container 中,对齐 order/orderManagement) */
|
||||||
|
const activeComponent = computed(() => {
|
||||||
|
const tab = tabs.value.find((t) => t.name === activeTab.value)
|
||||||
|
return tab?.component
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 当前激活页签对应的 props(对齐 order/orderManagement) */
|
||||||
|
const activeTabProps = computed(() => {
|
||||||
|
const tab = tabs.value.find((t) => t.name === activeTab.value)
|
||||||
|
return tab?.props || {}
|
||||||
|
})
|
||||||
|
|
||||||
type WaveTabItem = {
|
type WaveTabItem = {
|
||||||
name: string
|
name: string
|
||||||
label: string
|
label: string
|
||||||
@ -160,13 +182,36 @@ const handleTabChange = (tabName: string | number) => {
|
|||||||
.order-management-wrapper {
|
.order-management-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===== 顶部多标签页区域(对齐 order/orderManagement 的 tab-section) ===== */
|
||||||
|
.tab-section {
|
||||||
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e8eef7;
|
||||||
|
border-bottom: none;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs-header-action {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 16px;
|
||||||
|
height: 38px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-container {
|
.tab-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
:deep(.el-tabs__header) {
|
:deep(.el-tabs__header) {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
@ -221,14 +266,9 @@ const handleTabChange = (tabName: string | number) => {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 隐藏内容区,仅展示标签头(对齐 order/orderManagement) */
|
||||||
:deep(.el-tabs__content) {
|
:deep(.el-tabs__content) {
|
||||||
flex: 1;
|
display: none;
|
||||||
overflow: auto;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.el-tab-pane {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,14 +278,25 @@ const handleTabChange = (tabName: string | number) => {
|
|||||||
gap: 6px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ===== 主内容区容器(对齐 order/orderManagement 的 main-container) ===== */
|
||||||
|
.main-container {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 0;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #e8eef7;
|
||||||
|
border-top: none;
|
||||||
|
border-radius: 0 0 6px 6px;
|
||||||
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
/* ========== 单页模式 ========== */
|
/* ========== 单页模式 ========== */
|
||||||
|
|
||||||
/*
|
|
||||||
* 单页模式:复用 .tab-container 的 flex 布局,但不渲染 el-tabs,
|
|
||||||
* 直接嵌入子组件。该容器模拟 el-tabs--border-card 的卡片外观,
|
|
||||||
* 保留上下白色分隔线,仅隐藏标签头和灰色标签区域。
|
|
||||||
*/
|
|
||||||
.single-page-container {
|
.single-page-container {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border: 1px solid #e8eef7;
|
border: 1px solid #e8eef7;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|||||||
@ -676,6 +676,61 @@ export function formatEntryBindingStatus(status: unknown): string {
|
|||||||
return map[key] || String(status)
|
return map[key] || String(status)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
/** 入库单列表主工具栏按钮(action 与 entry/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 storage/receiving:
|
||||||
|
* refresh → setting 组(导出/字段设置/详情)→ action 组 → cancel 组
|
||||||
|
*/
|
||||||
|
export const entryToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||||
|
{
|
||||||
|
key: 'export',
|
||||||
|
label: '导出',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
loadingKey: 'exportLoading',
|
||||||
|
action: 'handleExportAll',
|
||||||
|
buttonType: 'dropdown',
|
||||||
|
dropdownOptions: [
|
||||||
|
{ label: '导出选中', action: 'handleExportSelected' },
|
||||||
|
{ label: '导出全部', action: 'handleExportAll', divided: true },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||||
|
{
|
||||||
|
key: 'toggleDetail',
|
||||||
|
label: '显示详情',
|
||||||
|
dynamicLabelKey: 'detailToggleLabel',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
action: 'toggleDetailVisible'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'import',
|
||||||
|
label: '导入',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'handleImport'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'print',
|
||||||
|
label: '打印入库单',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'handleOpenPrintDialog'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchCancel',
|
||||||
|
label: '批量作废',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'confirmBatchCancel'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
export function formatDirectInboundDateTime(
|
export function formatDirectInboundDateTime(
|
||||||
row: unknown,
|
row: unknown,
|
||||||
_col?: unknown,
|
_col?: unknown,
|
||||||
|
|||||||
@ -17,34 +17,15 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
<order-toolbar-button-group
|
||||||
<!-- <el-button size="small" @click="handleCreateEntry">新建入库单</el-button> -->
|
:buttons="entryToolbarButtons"
|
||||||
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
|
:resolve-disabled="resolveButtonDisabled"
|
||||||
<el-dropdown trigger="click" split-button size="small" :loading="exportLoading" @click="handleExportAll" @command="handleExportCommand">
|
:resolve-loading="resolveButtonLoading"
|
||||||
导出
|
:resolve-label="resolveButtonLabel"
|
||||||
<template #dropdown>
|
:layout-key="toolbarLayoutKey"
|
||||||
<el-dropdown-menu>
|
@action="handleToolbarButtonClick"
|
||||||
<el-dropdown-item command="handleExportSelected">导出选中</el-dropdown-item>
|
/>
|
||||||
<el-dropdown-item command="handleExportAll" divided>导出全部</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</template>
|
|
||||||
</el-dropdown>
|
|
||||||
<el-button size="small" @click="handleImport">导入</el-button>
|
|
||||||
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
|
|
||||||
<el-button size="small" @click="toggleDetailVisible">{{ detailVisible ? '隐藏详情' : '显示详情' }}</el-button>
|
|
||||||
<el-button size="small" type="warning" :disabled="!hasSelection" @click="handleOpenPrintDialog">打印入库单</el-button>
|
|
||||||
<!-- <el-button
|
|
||||||
size="small"
|
|
||||||
:disabled="!selectedEntryId"
|
|
||||||
@click="openReceivingCompareTab"
|
|
||||||
>
|
|
||||||
收货对照
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="toolbar-right">
|
|
||||||
<el-input size="small" placeholder="搜索入库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="split-stack" ref="splitStackRef">
|
<div class="split-stack" ref="splitStackRef">
|
||||||
@ -363,6 +344,9 @@ import { useRoute } from 'vue-router'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
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 * as indexApi from '@/api/index/index'
|
||||||
import * as entryApi from '@/api/storage.entry/entry'
|
import * as entryApi from '@/api/storage.entry/entry'
|
||||||
import type { StorageEntryListParams } from '@/api/storage.entry/entry'
|
import type { StorageEntryListParams } from '@/api/storage.entry/entry'
|
||||||
@ -371,6 +355,7 @@ import {
|
|||||||
availableFields,
|
availableFields,
|
||||||
entryColums,
|
entryColums,
|
||||||
addEntryFields,
|
addEntryFields,
|
||||||
|
entryToolbarButtons,
|
||||||
formatEntryOrderStatus,
|
formatEntryOrderStatus,
|
||||||
getEntryOrderStatusTagType,
|
getEntryOrderStatusTagType,
|
||||||
isPendingEntryOrderStatus,
|
isPendingEntryOrderStatus,
|
||||||
@ -484,6 +469,60 @@ const selectionRows = ref<any[]>([])
|
|||||||
const hasSelection = ref(false)
|
const hasSelection = ref(false)
|
||||||
const selectedEntryId = ref<number | string | null>(null)
|
const selectedEntryId = ref<number | string | null>(null)
|
||||||
|
|
||||||
|
// ── 工具栏状态 ──
|
||||||
|
const buttonLoadingMap = computed(() => ({
|
||||||
|
loading: loading.value,
|
||||||
|
exportLoading: exportLoading.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
const buttonDisabledMap = computed(() => ({
|
||||||
|
hasNoSelection: !hasSelection.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
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() },
|
||||||
|
handleExportAll: () => { void handleExportAll() },
|
||||||
|
handleExportSelected: () => { void handleExportSelected() },
|
||||||
|
openColumnConfigPanel: () => openColumnConfigPanel(),
|
||||||
|
toggleDetailVisible: () => toggleDetailVisible(),
|
||||||
|
handleImport: () => handleImport(),
|
||||||
|
handleOpenPrintDialog: () => { void handleOpenPrintDialog() },
|
||||||
|
confirmBatchCancel: () => { void confirmBatchCancel() }
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||||
|
const handler = toolbarActionMap[action]
|
||||||
|
if (!handler) return
|
||||||
|
safeInvoke(() => handler())
|
||||||
|
}
|
||||||
|
|
||||||
const quickSearch = ref('')
|
const quickSearch = ref('')
|
||||||
const currentSort = reactive({ prop: '', order: '' })
|
const currentSort = reactive({ prop: '', order: '' })
|
||||||
|
|
||||||
|
|||||||
@ -17,19 +17,14 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
<order-toolbar-button-group
|
||||||
<!-- <el-button size="small" @click="handleCreateEntry">新建入库单</el-button> -->
|
:buttons="inventoryToolbarButtons"
|
||||||
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
|
:resolve-disabled="resolveButtonDisabled"
|
||||||
<ExportModeDropdown
|
:resolve-loading="resolveButtonLoading"
|
||||||
:loading="exportLoading"
|
:resolve-label="resolveButtonLabel"
|
||||||
:items="exportDropdownItems"
|
:layout-key="toolbarLayoutKey"
|
||||||
:default-action="'handleExportSelected'"
|
@action="handleToolbarButtonClick"
|
||||||
@action="handleExportAction"
|
|
||||||
/>
|
/>
|
||||||
<el-button size="small" @click="handleImport">导入</el-button>
|
|
||||||
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
|
|
||||||
<el-button size="small" @click="toggleDetailVisible">{{ detailVisible ? '隐藏详情' : '显示详情' }}</el-button>
|
|
||||||
<!-- <el-button>是否按批次显示</el-button> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="toolbar-right">
|
<div class="toolbar-right">
|
||||||
@ -167,14 +162,19 @@ import { ref, reactive, onMounted, computed, nextTick } from 'vue'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
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 AsyncExportProgressDialog from '@/components/AsyncExportProgressDialog.vue'
|
import AsyncExportProgressDialog from '@/components/AsyncExportProgressDialog.vue'
|
||||||
import { useAsyncExportTask, type AsyncExportPayload } from '@/composables/useAsyncExportTask'
|
import { useAsyncExportTask, type AsyncExportPayload } from '@/composables/useAsyncExportTask'
|
||||||
|
import type { ExportDropdownItem } from '@/components/ExportModeDropdown.vue'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
// import * as entryApi from '@/api/storage.entry/entry'
|
// import * as entryApi from '@/api/storage.entry/entry'
|
||||||
import * as inventoryApi from '@/api/storage.inventory/inventory'
|
import * as inventoryApi from '@/api/storage.inventory/inventory'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
availableFields,
|
availableFields,
|
||||||
|
inventoryToolbarButtons,
|
||||||
formatInventoryBarcodes,
|
formatInventoryBarcodes,
|
||||||
formatInventoryFlagLabel,
|
formatInventoryFlagLabel,
|
||||||
formatInventoryOptionalText,
|
formatInventoryOptionalText,
|
||||||
@ -186,7 +186,6 @@ import entrydetail from './component/panelstockdetail.vue'
|
|||||||
import log from './component/log.vue'
|
import log from './component/log.vue'
|
||||||
import InventoryStockPickerDialog from './component/InventoryStockPickerDialog.vue'
|
import InventoryStockPickerDialog from './component/InventoryStockPickerDialog.vue'
|
||||||
import type { InventoryStockPickerItem } from './component/InventoryStockPickerDialog.vue'
|
import type { InventoryStockPickerItem } from './component/InventoryStockPickerDialog.vue'
|
||||||
import ExportModeDropdown, { type ExportDropdownItem } from '@/components/ExportModeDropdown.vue'
|
|
||||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||||
import { useSettingsStore } from '@/stores/modules/settings'
|
import { useSettingsStore } from '@/stores/modules/settings'
|
||||||
|
|
||||||
@ -303,7 +302,58 @@ const columns = computed(() => {
|
|||||||
const selectionRows = ref<any[]>([])
|
const selectionRows = ref<any[]>([])
|
||||||
const hasSelection = ref(false)
|
const hasSelection = ref(false)
|
||||||
const selectedEntryId = ref<number | string | null>(null)
|
const selectedEntryId = ref<number | string | null>(null)
|
||||||
|
// ── 工具栏状态 ──
|
||||||
|
const buttonLoadingMap = computed(() => ({
|
||||||
|
loading: loading.value,
|
||||||
|
exportLoading: exportLoading.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
const buttonDisabledMap = computed(() => ({
|
||||||
|
hasNoSelection: !hasSelection.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
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() },
|
||||||
|
handleExportSelected: () => { void handleExportSelected() },
|
||||||
|
handleExportAll: () => { void handleExportAll() },
|
||||||
|
openColumnConfigPanel: () => openColumnConfigPanel(),
|
||||||
|
toggleDetailVisible: () => toggleDetailVisible(),
|
||||||
|
handleImport: () => handleImport(),
|
||||||
|
confirmBatchCancel: () => { void confirmBatchCancel() }
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||||
|
const handler = toolbarActionMap[action]
|
||||||
|
if (!handler) return
|
||||||
|
safeInvoke(() => handler())
|
||||||
|
}
|
||||||
const componentMap: Record<string, any> = {
|
const componentMap: Record<string, any> = {
|
||||||
details: entrydetail,
|
details: entrydetail,
|
||||||
logs: log
|
logs: log
|
||||||
|
|||||||
@ -1,5 +1,52 @@
|
|||||||
import { scanWorkflowField } from '@/views/order/orderManagement/config/order-common-config'
|
import { scanWorkflowField } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
/** 库存列表主工具栏按钮(action 与 inventory/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 storage/receiving:
|
||||||
|
* refresh → setting 组(导出/字段设置/详情)→ action 组 → cancel 组
|
||||||
|
*/
|
||||||
|
export const inventoryToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||||
|
{
|
||||||
|
key: 'export',
|
||||||
|
label: '导出',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
loadingKey: 'exportLoading',
|
||||||
|
action: 'handleExportSelected',
|
||||||
|
buttonType: 'dropdown',
|
||||||
|
dropdownOptions: [
|
||||||
|
{ label: '导出选中', action: 'handleExportSelected' },
|
||||||
|
{ label: '导出全部', action: 'handleExportAll', divided: true },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||||
|
{
|
||||||
|
key: 'toggleDetail',
|
||||||
|
label: '显示详情',
|
||||||
|
dynamicLabelKey: 'detailToggleLabel',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
action: 'toggleDetailVisible'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'import',
|
||||||
|
label: '导入',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'handleImport'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchCancel',
|
||||||
|
label: '批量作废',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'confirmBatchCancel'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
/** ScanBox 基础信息分组(对齐收货单排版) */
|
/** ScanBox 基础信息分组(对齐收货单排版) */
|
||||||
export const INVENTORY_SCAN_BASIC_INFO_GROUP = '基础信息'
|
export const INVENTORY_SCAN_BASIC_INFO_GROUP = '基础信息'
|
||||||
|
|
||||||
|
|||||||
@ -16,10 +16,14 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
<order-toolbar-button-group
|
||||||
<ExportModeDropdown :loading="exportLoading" @action="handleExportAction" />
|
:buttons="logToolbarButtons"
|
||||||
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
|
:resolve-disabled="resolveButtonDisabled"
|
||||||
<el-button size="small" @click="toggleDetailVisible">{{ detailVisible ? '隐藏详情' : '显示详情' }}</el-button>
|
:resolve-loading="resolveButtonLoading"
|
||||||
|
:resolve-label="resolveButtonLabel"
|
||||||
|
:layout-key="toolbarLayoutKey"
|
||||||
|
@action="handleToolbarButtonClick"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -111,17 +115,20 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
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 { getTransactionList } from '@/api/storage.inventory/inventory'
|
import { getTransactionList } from '@/api/storage.inventory/inventory'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import {
|
import {
|
||||||
transactionColumns,
|
transactionColumns,
|
||||||
availableFields,
|
availableFields,
|
||||||
|
logToolbarButtons,
|
||||||
formatDateTime,
|
formatDateTime,
|
||||||
formatTransactionData,
|
formatTransactionData,
|
||||||
inventoryTypeConfig,
|
inventoryTypeConfig,
|
||||||
transactionTypeConfig
|
transactionTypeConfig
|
||||||
} from './log-config'
|
} from './log-config'
|
||||||
import ExportModeDropdown from '@/components/ExportModeDropdown.vue'
|
|
||||||
import { useSettingsStore } from '@/stores/modules/settings'
|
import { useSettingsStore } from '@/stores/modules/settings'
|
||||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
@ -173,6 +180,55 @@ const selectedLogId = ref<string | null>(null)
|
|||||||
const currentCondition = ref<any>(null)
|
const currentCondition = ref<any>(null)
|
||||||
const currentConditionRaw = ref<any>(null)
|
const currentConditionRaw = ref<any>(null)
|
||||||
|
|
||||||
|
// ── 工具栏状态 ──
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
const toolbarActionMap: Record<string, () => void> = {
|
||||||
|
loadData: () => { void loadData() },
|
||||||
|
handleExportWaybill: () => { void handleExport('waybill') },
|
||||||
|
handleExportItem: () => { void handleExport('item') },
|
||||||
|
openColumnConfigPanel: () => openColumnConfigPanel(),
|
||||||
|
toggleDetailVisible: () => toggleDetailVisible()
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||||
|
const handler = toolbarActionMap[action]
|
||||||
|
if (!handler) return
|
||||||
|
safeInvoke(() => handler())
|
||||||
|
}
|
||||||
|
|
||||||
const selectedRowData = computed(() => {
|
const selectedRowData = computed(() => {
|
||||||
return list.value.find(item => item.id === selectedLogId.value) || {}
|
return list.value.find(item => item.id === selectedLogId.value) || {}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,3 +1,35 @@
|
|||||||
|
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
/** 出入库记录列表主工具栏按钮(action 与 log/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 storage/receiving:
|
||||||
|
* refresh → setting 组(导出/字段设置/详情)
|
||||||
|
*/
|
||||||
|
export const logToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||||
|
{
|
||||||
|
key: 'export',
|
||||||
|
label: '导出',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
loadingKey: 'exportLoading',
|
||||||
|
action: 'handleExportWaybill',
|
||||||
|
buttonType: 'dropdown',
|
||||||
|
dropdownOptions: [
|
||||||
|
{ label: '不含明细', action: 'handleExportWaybill' },
|
||||||
|
{ label: '含明细', action: 'handleExportItem', divided: true },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||||
|
{
|
||||||
|
key: 'toggleDetail',
|
||||||
|
label: '显示详情',
|
||||||
|
dynamicLabelKey: 'detailToggleLabel',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
action: 'toggleDetailVisible'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
/** ScanBox 基础信息分组(对齐收货单排版) */
|
/** ScanBox 基础信息分组(对齐收货单排版) */
|
||||||
export const LOG_SCAN_BASIC_INFO_GROUP = '基础信息'
|
export const LOG_SCAN_BASIC_INFO_GROUP = '基础信息'
|
||||||
|
|
||||||
|
|||||||
@ -566,10 +566,12 @@ export const addReceivingFields = [
|
|||||||
{ prop: 'remark', label: '备注', type: 'textarea' }
|
{ prop: 'remark', label: '备注', type: 'textarea' }
|
||||||
]
|
]
|
||||||
|
|
||||||
/** 收货单列表主工具栏按钮(action 与 receiving/index.vue 内 toolbarActionMap 键一致) */
|
/** 收货单列表主工具栏按钮(action 与 receiving/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 order/orderManagement:
|
||||||
|
* refresh → setting 组(导出/字段设置/详情)→ action 组 → cancel 组
|
||||||
|
*/
|
||||||
export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||||
{ key: 'create', label: '添加收货单', category: 'action', size: 'small', action: 'handleCreateReceiving' },
|
|
||||||
{
|
{
|
||||||
key: 'export',
|
key: 'export',
|
||||||
label: '导出',
|
label: '导出',
|
||||||
@ -583,7 +585,7 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
|||||||
{ label: '导出全部', action: 'handleExportAll', divided: true },
|
{ label: '导出全部', action: 'handleExportAll', divided: true },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||||
{
|
{
|
||||||
key: 'toggleDetail',
|
key: 'toggleDetail',
|
||||||
label: '显示详情',
|
label: '显示详情',
|
||||||
@ -592,6 +594,16 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
action: 'toggleDetailVisible'
|
action: 'toggleDetailVisible'
|
||||||
},
|
},
|
||||||
|
{ key: 'create', label: '添加收货单', category: 'action', size: 'small', action: 'handleCreateReceiving' },
|
||||||
|
{
|
||||||
|
key: 'review',
|
||||||
|
label: '批量审核',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
loadingKey: 'reviewLoading',
|
||||||
|
action: 'handleReviewReceiving'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'complete',
|
key: 'complete',
|
||||||
label: '完成收货',
|
label: '完成收货',
|
||||||
@ -600,34 +612,10 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
|||||||
disabledKey: 'hasNoSelection',
|
disabledKey: 'hasNoSelection',
|
||||||
action: 'confirmcomplete'
|
action: 'confirmcomplete'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: 'batchCancel',
|
|
||||||
label: '批量作废',
|
|
||||||
size: 'small',
|
|
||||||
disabledKey: 'hasNoSelection',
|
|
||||||
action: 'confirmBatchCancel'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'reject',
|
|
||||||
label: '批量驳回',
|
|
||||||
type: 'warning',
|
|
||||||
size: 'small',
|
|
||||||
disabledKey: 'hasNoSelection',
|
|
||||||
action: 'handleRejectReceiving'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'review',
|
|
||||||
label: '批量审核',
|
|
||||||
type: 'primary',
|
|
||||||
size: 'small',
|
|
||||||
disabledKey: 'hasNoSelection',
|
|
||||||
loadingKey: 'reviewLoading',
|
|
||||||
action: 'handleReviewReceiving'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: 'quickPutaway',
|
key: 'quickPutaway',
|
||||||
label: '快捷入库',
|
label: '快捷入库',
|
||||||
type: 'success',
|
category: 'action',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
disabledKey: 'singleSelectionOnly',
|
disabledKey: 'singleSelectionOnly',
|
||||||
loadingKey: 'quickPutawayLoading',
|
loadingKey: 'quickPutawayLoading',
|
||||||
@ -636,9 +624,25 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
|||||||
{
|
{
|
||||||
key: 'print',
|
key: 'print',
|
||||||
label: '打印收货单',
|
label: '打印收货单',
|
||||||
type: 'info',
|
category: 'action',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
disabledKey: 'hasNoSelection',
|
disabledKey: 'hasNoSelection',
|
||||||
action: 'handleOpenPrintDialog'
|
action: 'handleOpenPrintDialog'
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
key: 'reject',
|
||||||
|
label: '批量驳回',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'handleRejectReceiving'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchCancel',
|
||||||
|
label: '批量作废',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'confirmBatchCancel'
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="stockout-product-container">
|
<div class="stockout-product-container">
|
||||||
<div v-if="orderInfo" class="order-info">
|
<div v-if="orderInfo" class="order-info">
|
||||||
<span class="order-code">出库单号:{{ orderInfo.delivery_order_code }}</span>
|
<span class="order-code">出库单号:{{ orderInfo.stockout_order_code }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
|
|||||||
@ -72,12 +72,17 @@ import { ref, watch, onMounted } from 'vue'
|
|||||||
import { availableFields, detailpanel } from '../stockout-config'
|
import { availableFields, detailpanel } from '../stockout-config'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { Picture, Check, Refresh } from '@element-plus/icons-vue'
|
import { Picture, Check, Refresh } from '@element-plus/icons-vue'
|
||||||
|
import * as stockoutApi from '@/api/storage.stockout/stockout'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
id: string | number,
|
id: string | number,
|
||||||
row?: any
|
row?: any
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
refresh: []
|
||||||
|
}>()
|
||||||
|
|
||||||
const form = ref<any>({})
|
const form = ref<any>({})
|
||||||
|
|
||||||
const saveLoading = ref(false)
|
const saveLoading = ref(false)
|
||||||
@ -85,8 +90,24 @@ const saveLoading = ref(false)
|
|||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
try {
|
try {
|
||||||
saveLoading.value = true
|
saveLoading.value = true
|
||||||
// 这里调用 API 保存
|
const id = form.value.id || props.id
|
||||||
ElMessage.success('保存成功')
|
if (!id) {
|
||||||
|
ElMessage.warning('缺少出库单ID')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const payload: any = { id: Number(id) }
|
||||||
|
if (form.value.express_code !== undefined) {
|
||||||
|
payload.express_code = form.value.express_code || undefined
|
||||||
|
}
|
||||||
|
if (form.value.express_codes !== undefined) {
|
||||||
|
const codes = typeof form.value.express_codes === 'string'
|
||||||
|
? form.value.express_codes.split(/[,;\n]+/).map((s: string) => s.trim()).filter(Boolean)
|
||||||
|
: form.value.express_codes
|
||||||
|
payload.express_codes = codes?.length ? codes : undefined
|
||||||
|
}
|
||||||
|
await stockoutApi.stockoutUpdateExpress(payload)
|
||||||
|
ElMessage.success('运单信息保存成功')
|
||||||
|
emit('refresh')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
ElMessage.error('保存失败')
|
ElMessage.error('保存失败')
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@ -18,17 +18,14 @@
|
|||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<div class="toolbar-left">
|
<div class="toolbar-left">
|
||||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
<order-toolbar-button-group
|
||||||
<el-button size="small" @click="handleCreateStockout">新建出库单</el-button>
|
:buttons="stockoutToolbarButtons"
|
||||||
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
|
:resolve-disabled="resolveButtonDisabled"
|
||||||
<ExportModeDropdown :loading="exportLoading" @action="handleExportAction" />
|
:resolve-loading="resolveButtonLoading"
|
||||||
<el-button size="small" @click="handleImport">导入</el-button>
|
:resolve-label="resolveButtonLabel"
|
||||||
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
|
:layout-key="toolbarLayoutKey"
|
||||||
<el-button size="small" @click="toggleDetailVisible">{{ detailVisible ? '隐藏详情' : '显示详情' }}</el-button>
|
@action="handleToolbarButtonClick"
|
||||||
</div>
|
/>
|
||||||
|
|
||||||
<div class="toolbar-right">
|
|
||||||
<!-- <el-input size="small" placeholder="搜索出库单号" v-model="quickSearch" style="width:220px" @keyup.enter="onQuickSearch" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -56,9 +53,9 @@
|
|||||||
@refresh="loadData"
|
@refresh="loadData"
|
||||||
@selection-change="onSelectionChange"
|
@selection-change="onSelectionChange"
|
||||||
>
|
>
|
||||||
<template #column-status="{ row }">
|
<template #column-order_status="{ row }">
|
||||||
<el-tag v-if="row.status" :type="statusConfig[row.status as keyof typeof statusConfig]?.tagType || 'info'" size="small">
|
<el-tag v-if="row.order_status" :type="statusConfig[row.order_status as keyof typeof statusConfig]?.tagType || 'info'" size="small">
|
||||||
{{ statusConfig[row.status as keyof typeof statusConfig]?.text || row.status }}
|
{{ statusConfig[row.order_status as keyof typeof statusConfig]?.text || row.order_status }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -118,6 +115,10 @@ import { useRoute } from 'vue-router'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
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 XLSX from 'xlsx'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import * as stockoutApi from '@/api/storage.stockout/stockout' //现有的对应 API
|
import * as stockoutApi from '@/api/storage.stockout/stockout' //现有的对应 API
|
||||||
|
|
||||||
@ -126,14 +127,13 @@ import {
|
|||||||
entryColums,
|
entryColums,
|
||||||
statusConfig,
|
statusConfig,
|
||||||
syncStatusConfig,
|
syncStatusConfig,
|
||||||
|
stockoutToolbarButtons,
|
||||||
formatStockoutData,
|
formatStockoutData,
|
||||||
} from './stockout-config'
|
} from './stockout-config'
|
||||||
|
|
||||||
import stockoutdetail from './component/stockoutdetail.vue'
|
import stockoutdetail from './component/stockoutdetail.vue'
|
||||||
import product from './component/product.vue'
|
import product from './component/product.vue'
|
||||||
import log from './component/log.vue'
|
import log from './component/log.vue'
|
||||||
import ExportModeDropdown from '@/components/ExportModeDropdown.vue'
|
|
||||||
import * as XLSX from 'xlsx'
|
|
||||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||||
import { useSettingsStore } from '@/stores/modules/settings'
|
import { useSettingsStore } from '@/stores/modules/settings'
|
||||||
|
|
||||||
@ -195,6 +195,61 @@ const selectionRows = ref<any[]>([])
|
|||||||
const hasSelection = ref(false)
|
const hasSelection = ref(false)
|
||||||
const selectedStockoutId = ref<number | string | null>(null)
|
const selectedStockoutId = ref<number | string | null>(null)
|
||||||
|
|
||||||
|
// ── 工具栏状态 ──
|
||||||
|
const buttonLoadingMap = computed(() => ({
|
||||||
|
loading: loading.value,
|
||||||
|
exportLoading: exportLoading.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
const buttonDisabledMap = computed(() => ({
|
||||||
|
hasNoSelection: !hasSelection.value
|
||||||
|
}))
|
||||||
|
|
||||||
|
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() },
|
||||||
|
handleExportWaybill: () => { void handleExport('waybill') },
|
||||||
|
handleExportItem: () => { void handleExport('item') },
|
||||||
|
openColumnConfigPanel: () => openColumnConfigPanel(),
|
||||||
|
toggleDetailVisible: () => toggleDetailVisible(),
|
||||||
|
handleCreateStockout: () => handleCreateStockout(),
|
||||||
|
handleImport: () => handleImport(),
|
||||||
|
confirmBatchCancel: () => { void confirmBatchCancel() },
|
||||||
|
confirmStockout: () => { void confirmStockout() }
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||||
|
const handler = toolbarActionMap[action]
|
||||||
|
if (!handler) return
|
||||||
|
safeInvoke(() => handler())
|
||||||
|
}
|
||||||
|
|
||||||
const quickSearch = ref('')
|
const quickSearch = ref('')
|
||||||
const currentSort = reactive({ prop: '', order: '' })
|
const currentSort = reactive({ prop: '', order: '' })
|
||||||
const currentCondition = ref<any>(null)
|
const currentCondition = ref<any>(null)
|
||||||
@ -244,7 +299,7 @@ async function loadData() {
|
|||||||
const params: any = {
|
const params: any = {
|
||||||
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
|
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
|
||||||
where,
|
where,
|
||||||
order: currentSort.prop ? { [currentSort.prop]: currentSort.order === 'ascending' ? 'ASC' : 'DESC' } : undefined
|
sort: currentSort.prop ? { sortField: currentSort.prop, sortOrder: currentSort.order === 'ascending' ? 'ASC' : 'DESC' } : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quickSearch.value) {
|
if (quickSearch.value) {
|
||||||
@ -435,6 +490,60 @@ async function confirmBatchCancel() {
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function confirmStockout() {
|
||||||
|
const rows = selectionRows.value
|
||||||
|
if (!rows.length) {
|
||||||
|
ElMessage.warning('请先选择要确认出库的出库单')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 仅允许 CREATED / PENDING 状态进行确认
|
||||||
|
const confirmable = rows.filter(
|
||||||
|
(r: any) => r.order_status === 'CREATED' || r.order_status === 'PENDING'
|
||||||
|
)
|
||||||
|
if (!confirmable.length) {
|
||||||
|
ElMessage.warning('所选出库单状态不支持确认操作,仅"已创建"或"待出库"状态可确认')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
`确定要直出确认以下 ${confirmable.length} 个出库单吗?确认后状态将变更为"已完成"。请确保已在详情面板填写运单号。`,
|
||||||
|
'确认出库',
|
||||||
|
{ type: 'warning', confirmButtonText: '确认', cancelButtonText: '取消' }
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let successCount = 0
|
||||||
|
let failCount = 0
|
||||||
|
for (const row of confirmable) {
|
||||||
|
try {
|
||||||
|
const res: any = await stockoutApi.stockoutConfirm({ id: row.id })
|
||||||
|
// 更新列表中对应行的运单信息
|
||||||
|
const data = res?.data || res
|
||||||
|
if (data?.expressCode) {
|
||||||
|
row.express_code = data.expressCode
|
||||||
|
}
|
||||||
|
if (data?.expressCodes) {
|
||||||
|
row.express_codes = data.expressCodes
|
||||||
|
}
|
||||||
|
successCount++
|
||||||
|
} catch (e: any) {
|
||||||
|
failCount++
|
||||||
|
console.error(`确认出库单 ${row.stockout_order_code || row.id} 失败`, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (failCount === 0) {
|
||||||
|
ElMessage.success(`成功确认 ${successCount} 个出库单`)
|
||||||
|
} else {
|
||||||
|
ElMessage.warning(`确认完成:成功 ${successCount} 个,失败 ${failCount} 个`)
|
||||||
|
}
|
||||||
|
loadData()
|
||||||
|
}
|
||||||
|
|
||||||
async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
||||||
const sourceRows = selectionRows.value.length ? selectionRows.value : list.value
|
const sourceRows = selectionRows.value.length ? selectionRows.value : list.value
|
||||||
if (!sourceRows.length) {
|
if (!sourceRows.length) {
|
||||||
@ -450,7 +559,7 @@ async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
|||||||
const data = sourceRows.map((row: any) =>
|
const data = sourceRows.map((row: any) =>
|
||||||
exportColumns.map((col: any) => {
|
exportColumns.map((col: any) => {
|
||||||
const val = row[col.prop]
|
const val = row[col.prop]
|
||||||
if (col.prop === 'status') {
|
if (col.prop === 'order_status') {
|
||||||
return statusConfig[val as keyof typeof statusConfig]?.text || val || ''
|
return statusConfig[val as keyof typeof statusConfig]?.text || val || ''
|
||||||
}
|
}
|
||||||
if (col.prop === 'sync_status') {
|
if (col.prop === 'sync_status') {
|
||||||
@ -475,7 +584,7 @@ async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
|||||||
const listData = Array.isArray(items) ? items : []
|
const listData = Array.isArray(items) ? items : []
|
||||||
listData.forEach((item: any) => {
|
listData.forEach((item: any) => {
|
||||||
detailRows.push({
|
detailRows.push({
|
||||||
'出库单号': row.stockout_number || row.order_code || row.id,
|
'出库单号': row.stockout_order_code || row.id,
|
||||||
'商品编码': item.item_code || item.product_code || '',
|
'商品编码': item.item_code || item.product_code || '',
|
||||||
'商品名称': item.item_name || item.product_name || '',
|
'商品名称': item.item_name || item.product_name || '',
|
||||||
'计划数量': item.plan_qty ?? item.quantity ?? '',
|
'计划数量': item.plan_qty ?? item.quantity ?? '',
|
||||||
|
|||||||
@ -1,3 +1,66 @@
|
|||||||
|
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||||
|
|
||||||
|
/** 出库单列表主工具栏按钮(action 与 stockout/index.vue 内 toolbarActionMap 键一致)
|
||||||
|
* 排序与样式分类对齐 storage/receiving:
|
||||||
|
* refresh → setting 组(导出/字段设置/详情)→ action 组 → cancel 组
|
||||||
|
*/
|
||||||
|
export const stockoutToolbarButtons: ToolbarButtonConfig[] = [
|
||||||
|
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||||
|
{
|
||||||
|
key: 'export',
|
||||||
|
label: '导出',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
loadingKey: 'exportLoading',
|
||||||
|
action: 'handleExportWaybill',
|
||||||
|
buttonType: 'dropdown',
|
||||||
|
dropdownOptions: [
|
||||||
|
{ label: '不含明细', action: 'handleExportWaybill' },
|
||||||
|
{ label: '含明细', action: 'handleExportItem', divided: true },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||||
|
{
|
||||||
|
key: 'toggleDetail',
|
||||||
|
label: '显示详情',
|
||||||
|
dynamicLabelKey: 'detailToggleLabel',
|
||||||
|
category: 'setting',
|
||||||
|
size: 'small',
|
||||||
|
action: 'toggleDetailVisible'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// key: 'create',
|
||||||
|
// label: '新建出库单',
|
||||||
|
// category: 'action',
|
||||||
|
// size: 'small',
|
||||||
|
// action: 'handleCreateStockout'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
key: 'import',
|
||||||
|
label: '导入',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
action: 'handleImport'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'confirmStockout',
|
||||||
|
label: '确认出库',
|
||||||
|
category: 'action',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'confirmStockout'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'batchCancel',
|
||||||
|
label: '批量作废',
|
||||||
|
category: 'cancel',
|
||||||
|
size: 'small',
|
||||||
|
disabledKey: 'hasNoSelection',
|
||||||
|
action: 'confirmBatchCancel'
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
/** ScanBox 基础信息分组(对齐收货单排版) */
|
/** ScanBox 基础信息分组(对齐收货单排版) */
|
||||||
export const STOCKOUT_SCAN_BASIC_INFO_GROUP = '基础信息'
|
export const STOCKOUT_SCAN_BASIC_INFO_GROUP = '基础信息'
|
||||||
|
|
||||||
@ -43,18 +106,27 @@ export const stockoutScanBoxConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const statusConfig: Record<string, { text: string; tagType: string }> = {
|
export const statusConfig: Record<string, { text: string; tagType: string }> = {
|
||||||
created: { text: '已创建', tagType: 'success' },
|
CREATED: { text: '已创建', tagType: '' },
|
||||||
pedding: { text: '待出库', tagType: 'warning' },
|
PENDING: { text: '待出库', tagType: 'warning' },
|
||||||
|
PROCESSING: { text: '出库中', tagType: 'primary' },
|
||||||
|
COMPLETED: { text: '已完成', tagType: 'success' },
|
||||||
|
CANCELLED: { text: '已作废', tagType: 'danger' },
|
||||||
|
// 兼容旧小写
|
||||||
|
created: { text: '已创建', tagType: '' },
|
||||||
pending: { text: '待出库', tagType: 'warning' },
|
pending: { text: '待出库', tagType: 'warning' },
|
||||||
processing: { text: '出库中', tagType: 'primary' },
|
processing: { text: '出库中', tagType: 'primary' },
|
||||||
completed: { text: '已完成', tagType: 'success' },
|
completed: { text: '已完成', tagType: 'success' },
|
||||||
cancelled: { text: '已作废', tagType: 'danger' }
|
cancelled: { text: '已作废', tagType: 'danger' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// sync_status 实际值(接口存在拼写:padding)
|
// sync_status 实际值(接口返回大写;兼容旧小写与拼写)
|
||||||
export const syncStatusConfig: Record<string, { text: string; tagType: string }> = {
|
export const syncStatusConfig: Record<string, { text: string; tagType: string }> = {
|
||||||
padding: { text: '待同步', tagType: 'info' },
|
PENDING: { text: '待同步', tagType: 'info' },
|
||||||
|
SUCCESS: { text: '同步成功', tagType: 'success' },
|
||||||
|
FAILED: { text: '同步失败', tagType: 'danger' },
|
||||||
|
// 兼容旧小写与拼写
|
||||||
pending: { text: '待同步', tagType: 'info' },
|
pending: { text: '待同步', tagType: 'info' },
|
||||||
|
padding: { text: '待同步', tagType: 'info' },
|
||||||
success: { text: '同步成功', tagType: 'success' },
|
success: { text: '同步成功', tagType: 'success' },
|
||||||
failed: { text: '同步失败', tagType: 'danger' }
|
failed: { text: '同步失败', tagType: 'danger' }
|
||||||
}
|
}
|
||||||
@ -78,34 +150,30 @@ export function formatDateTime(dateStr: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const entryColums = [
|
export const entryColums = [
|
||||||
{ prop: 'delivery_order_code', label: '出库单号', width: '180', fixed: 'left' },
|
{ prop: 'stockout_order_code', label: '出库单号', width: '220', fixed: 'left' },
|
||||||
{ prop: 'status', label: '出库状态', width: '100' },
|
{ prop: 'order_status', label: '出库状态', width: '100' },
|
||||||
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
||||||
{ prop: 'order_type', label: '单据类型', width: '100' },
|
{ prop: 'order_type', label: '单据类型', width: '100' },
|
||||||
{ prop: 'source_platform_name', label: '来源平台', width: '110' },
|
{ prop: 'source_type', label: '来源类型', width: '100' },
|
||||||
{ prop: 'buyer_nick', label: '买家', width: '130' },
|
{ prop: 'total_order_lines', label: '订单行数', width: '90' },
|
||||||
{ prop: 'name', label: '收货人', width: '100' },
|
{ prop: 'remark', label: '备注', minWidth: '150' },
|
||||||
{ prop: 'mobile', label: '联系电话', width: '130' },
|
{ prop: 'order_create_time', label: '下单时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.order_create_time) },
|
||||||
{ prop: 'logistics_name', label: '物流公司', width: '130' },
|
{ prop: 'created_at', label: '创建时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.created_at) },
|
||||||
{ prop: 'express_code', label: '运单号', width: '150' },
|
|
||||||
{ prop: 'items_count', label: '商品种类', width: '90' },
|
|
||||||
{ prop: 'items_total', label: '商品总数', width: '90' },
|
|
||||||
{ prop: 'place_order_time', label: '下单时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.place_order_time) },
|
|
||||||
{ prop: 'updated_at', label: '更新时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.updated_at) }
|
{ prop: 'updated_at', label: '更新时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.updated_at) }
|
||||||
]
|
]
|
||||||
|
|
||||||
export const availableFields: StockoutScanFieldConfig[] = [
|
export const availableFields: StockoutScanFieldConfig[] = [
|
||||||
// ===== 基础信息 =====
|
// ===== 基础信息 =====
|
||||||
stockoutScanBasicField({ value: 'delivery_order_code', label: '出库单号', type: 'text' }),
|
stockoutScanBasicField({ value: 'stockout_order_code', label: '出库单号', type: 'text' }),
|
||||||
stockoutScanBasicField({
|
stockoutScanBasicField({
|
||||||
value: 'order_type',
|
value: 'order_type',
|
||||||
label: '单据类型',
|
label: '单据类型',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
options: [
|
||||||
|
{ label: '其他出库', value: 'QTCK' },
|
||||||
{ label: '交易出库', value: 'JYCK' },
|
{ label: '交易出库', value: 'JYCK' },
|
||||||
{ label: '调拨出库', value: 'TRANSFER' },
|
{ label: '调拨出库', value: 'TRANSFER' },
|
||||||
{ label: '退货出库', value: 'RETURN' },
|
{ label: '退货出库', value: 'RETURN' }
|
||||||
{ label: '其他出库', value: 'OTHER' }
|
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
stockoutScanBasicField({
|
stockoutScanBasicField({
|
||||||
@ -116,17 +184,26 @@ export const availableFields: StockoutScanFieldConfig[] = [
|
|||||||
filterable: true,
|
filterable: true,
|
||||||
options: []
|
options: []
|
||||||
}),
|
}),
|
||||||
|
stockoutScanBasicField({
|
||||||
|
value: 'source_type',
|
||||||
|
label: '来源类型',
|
||||||
|
type: 'select',
|
||||||
|
options: [
|
||||||
|
{ label: '奇门', value: 'QM' }
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
|
||||||
// ===== 流程状态(合并为一组,对齐波次列表 ScanBox) =====
|
// ===== 流程状态 =====
|
||||||
stockoutScanWorkflowField({
|
stockoutScanWorkflowField({
|
||||||
value: 'status',
|
value: 'order_status',
|
||||||
label: '出库状态',
|
label: '出库状态',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
options: [
|
||||||
{ value: 'pedding', label: '待出库' },
|
{ value: 'CREATED', label: '已创建' },
|
||||||
{ value: 'processing', label: '出库中' },
|
{ value: 'PENDING', label: '待出库' },
|
||||||
{ value: 'completed', label: '已完成' },
|
{ value: 'PROCESSING', label: '出库中' },
|
||||||
{ value: 'cancelled', label: '已作废' }
|
{ value: 'COMPLETED', label: '已完成' },
|
||||||
|
{ value: 'CANCELLED', label: '已作废' }
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
stockoutScanWorkflowField({
|
stockoutScanWorkflowField({
|
||||||
@ -134,21 +211,15 @@ export const availableFields: StockoutScanFieldConfig[] = [
|
|||||||
label: '同步状态',
|
label: '同步状态',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
options: [
|
||||||
{ value: 'padding', label: '待同步' },
|
{ value: 'PENDING', label: '待同步' },
|
||||||
{ value: 'success', label: '同步成功' },
|
{ value: 'SUCCESS', label: '同步成功' },
|
||||||
{ value: 'failed', label: '同步失败' }
|
{ value: 'FAILED', label: '同步失败' }
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// ===== 收货信息 =====
|
|
||||||
stockoutScanReceivingField({ value: 'buyer_nick', label: '买家', type: 'text' }),
|
|
||||||
stockoutScanReceivingField({ value: 'mobile', label: '联系电话', type: 'text' }),
|
|
||||||
stockoutScanReceivingField({ value: 'logistics_code', label: '物流公司', type: 'text' }),
|
|
||||||
stockoutScanReceivingField({ value: 'express_code', label: '运单号', type: 'text' }),
|
|
||||||
|
|
||||||
// ===== 时间 =====
|
// ===== 时间 =====
|
||||||
stockoutScanTimeField({
|
stockoutScanTimeField({
|
||||||
value: 'place_order_time',
|
value: 'order_create_time',
|
||||||
label: '下单时间',
|
label: '下单时间',
|
||||||
type: 'daterange',
|
type: 'daterange',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
@ -158,18 +229,13 @@ export const availableFields: StockoutScanFieldConfig[] = [
|
|||||||
|
|
||||||
// 详情面板表单配置
|
// 详情面板表单配置
|
||||||
export const detailpanel = [
|
export const detailpanel = [
|
||||||
{ prop: 'delivery_order_code', label: '出库单号', type: 'input', disabled: true },
|
{ prop: 'stockout_order_code', label: '出库单号', type: 'input', disabled: true },
|
||||||
{ prop: 'order_type', label: '单据类型', type: 'input', disabled: true },
|
{ prop: 'order_status', label: '出库状态', type: 'select', disabled: true },
|
||||||
{ prop: 'status', label: '出库状态', type: 'select', disabled: true },
|
{ prop: 'express_code', label: '运单号', type: 'input', disabled: false },
|
||||||
{ prop: 'source_platform_name', label: '来源平台', type: 'input', disabled: true },
|
{ prop: 'express_codes', label: '运单号列表', type: 'textarea', disabled: false },
|
||||||
{ prop: 'buyer_nick', label: '买家', type: 'input', disabled: true },
|
{ prop: 'qimen_owner_code', label: '奇门货主编码', type: 'input', disabled: true },
|
||||||
{ prop: 'name', label: '收货人', type: 'input', disabled: true },
|
{ prop: 'qimen_warehouse_code', label: '奇门仓库编码', type: 'input', disabled: true },
|
||||||
{ prop: 'mobile', label: '联系电话', type: 'input', disabled: true },
|
{ prop: 'remark', label: '备注', type: 'textarea' },
|
||||||
{ prop: 'logistics_name', label: '物流公司', type: 'input' },
|
|
||||||
{ prop: 'express_code', label: '运单号', type: 'input' },
|
|
||||||
{ prop: 'province', label: '省', type: 'input', disabled: true },
|
|
||||||
{ prop: 'city', label: '市', type: 'input', disabled: true },
|
|
||||||
{ prop: 'detail_address', label: '详细地址', type: 'input', disabled: true }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
export const productColumns = [
|
export const productColumns = [
|
||||||
@ -204,9 +270,7 @@ export function formatStockoutListItems(list: any[] = []) {
|
|||||||
export function formatStockoutData(list: any[] = []) {
|
export function formatStockoutData(list: any[] = []) {
|
||||||
return (list || []).map(item => ({
|
return (list || []).map(item => ({
|
||||||
...item,
|
...item,
|
||||||
status: item.status || 'pedding',
|
order_status: item.order_status || 'PENDING',
|
||||||
sync_status: item.sync_status || 'padding',
|
sync_status: item.sync_status || 'PENDING',
|
||||||
// 接口返回 create_at,统一为 created_at
|
|
||||||
created_at: item.created_at || item.create_at
|
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -296,7 +296,7 @@ import {
|
|||||||
storeExpressBindingPolicyDel,
|
storeExpressBindingPolicyDel,
|
||||||
storeExpressBindingPolicyEdit,
|
storeExpressBindingPolicyEdit,
|
||||||
storeExpressBindingPolicyList
|
storeExpressBindingPolicyList
|
||||||
} from '@/api/setting.storeExpressBindingPolicy/storeExpressBindingPolicy'
|
} from '@/api/storeexpressbindingpolicy/storeExpressBindingPolicy'
|
||||||
import { expressIndexGetExpressList } from '@/api/setting.express/express'
|
import { expressIndexGetExpressList } from '@/api/setting.express/express'
|
||||||
import { getProhibitedType } from '@/api/stock/stock'
|
import { getProhibitedType } from '@/api/stock/stock'
|
||||||
import { loadStores } from '@/api/index/index'
|
import { loadStores } from '@/api/index/index'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user