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'
|
||||
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({
|
||||
url: `/system`,
|
||||
method: 'post',
|
||||
@ -14,11 +40,23 @@ export const stockoutList = (data: any) => {
|
||||
})
|
||||
}
|
||||
|
||||
export const stockoutListItems = (data: {
|
||||
delivery_order_code?: string
|
||||
order_id?: number
|
||||
// ── storage.stockout.listItems ──
|
||||
|
||||
export type StockoutListItemsParams = {
|
||||
/** 出库单号(推荐) */
|
||||
stockout_order_code?: string
|
||||
/** 出库单ID,与 stockout_order_code 至少传一个 */
|
||||
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({
|
||||
url: `/system`,
|
||||
method: 'post',
|
||||
@ -44,3 +82,67 @@ export const stockoutToOrder = (data?: { id?: number; delivery_order_code?: stri
|
||||
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>
|
||||
<div class="scan-box-container" :style="{ width }" :class="{ 'scan-box--compact': isCompact }">
|
||||
<!-- Tab 切换 -->
|
||||
<div class="scan-tabs" v-if="!isCompact">
|
||||
<!-- Tab 切换(标准/紧凑模式均显示) -->
|
||||
<div class="scan-tabs">
|
||||
<div class="scan-tabs__inner">
|
||||
<el-tabs v-model="activeTab" stretch @tab-click="handleTabChange">
|
||||
<el-tab-pane label="筛选" name="custom">
|
||||
@ -21,24 +21,14 @@
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</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-icon><Fold /></el-icon>
|
||||
<el-icon><Expand v-if="isCompact" /><Fold v-else /></el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</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">
|
||||
<!-- 自定义筛选 -->
|
||||
@ -485,7 +475,33 @@
|
||||
</div>
|
||||
<!-- 数字类型 -->
|
||||
<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
|
||||
v-else
|
||||
v-model="customConditions[field.value].value"
|
||||
:placeholder="field.label"
|
||||
:controls="false"
|
||||
|
||||
@ -587,15 +587,16 @@ export function buildWhereConditions(rawConditions: Record<string, any>): Record
|
||||
// ============================================================
|
||||
// 十、工具栏按钮系统
|
||||
// ============================================================
|
||||
// 按钮分为三类:
|
||||
// common — 公共按钮(刷新、导出)
|
||||
// function — 功能按钮(打开表单/确认窗口)
|
||||
// basic — 基础操作(字段设置、隐藏详情)
|
||||
// 按钮分类对齐 storage/receiving 模式:
|
||||
// refresh — 蓝底白字(刷新)
|
||||
// setting — 白底黑字(导出、字段设置、显示详情)
|
||||
// action — 白底蓝边框(功能操作)
|
||||
// cancel — 红底白字(作废/删除)
|
||||
|
||||
export interface ToolbarButtonConfig {
|
||||
key: string
|
||||
label: string
|
||||
category: 'common' | 'function' | 'basic'
|
||||
category: 'refresh' | 'setting' | 'action' | 'cancel'
|
||||
size?: '' | 'default' | 'small' | 'large'
|
||||
type?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
|
||||
plain?: boolean
|
||||
@ -610,28 +611,25 @@ export interface ToolbarButtonConfig {
|
||||
}
|
||||
|
||||
export const TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
// ===== 公共按钮 =====
|
||||
refresh: {
|
||||
key: 'refresh',
|
||||
label: '刷新',
|
||||
category: 'common',
|
||||
type: 'primary',
|
||||
category: 'refresh',
|
||||
size: 'small',
|
||||
loadingKey: 'loading',
|
||||
action: 'loadData'
|
||||
},
|
||||
// ===== 基础操作 =====
|
||||
columnConfig: {
|
||||
key: 'columnConfig',
|
||||
label: '字段设置',
|
||||
category: 'basic',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
action: 'openColumnConfigPanel'
|
||||
},
|
||||
toggleDetail: {
|
||||
key: 'toggleDetail',
|
||||
label: '显示详情',
|
||||
category: 'basic',
|
||||
category: 'setting',
|
||||
dynamicLabelKey: 'detailToggleLabel',
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
</el-form-item>
|
||||
<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-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-form-item>
|
||||
<el-form-item v-if="editForm.groupType === 'express'" label="快递接口" prop="expressInterfaces">
|
||||
|
||||
@ -16,20 +16,14 @@
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
plain
|
||||
:disabled="!selectedIds.length"
|
||||
:loading="batchDeleting"
|
||||
@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>
|
||||
<order-toolbar-button-group
|
||||
:buttons="packageMaterialToolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -200,6 +194,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import BatchImportDialog from './component/BatchImportDialog.vue'
|
||||
import PackageMaterialSearchForm from './form/PackageMaterialSearchForm.vue'
|
||||
import {
|
||||
@ -212,6 +209,7 @@ import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import {
|
||||
buildPackageMaterialListPayload,
|
||||
parsePackageMaterialListResponse,
|
||||
packageMaterialToolbarButtons,
|
||||
formatDimensions,
|
||||
formatNumber,
|
||||
formatPackageMaterialStatus,
|
||||
@ -239,6 +237,54 @@ const saving = ref(false)
|
||||
const batchDeleting = ref(false)
|
||||
const selectedIds = ref<number[]>([])
|
||||
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 tableSize = ref<'small' | 'default' | 'large'>('small')
|
||||
const currentConditionRaw = ref<any>(null)
|
||||
@ -556,23 +602,23 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
padding: 5px 8px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
margin-bottom: 3px;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
background-color: #fff;
|
||||
min-width: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.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 = {
|
||||
id?: number
|
||||
material_code?: string
|
||||
|
||||
@ -16,18 +16,14 @@
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" :loading="loading" @click="loadList">刷新</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
plain
|
||||
:disabled="!selectedIds.length"
|
||||
:loading="batchDeleting"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
<el-button type="success" size="small" @click="openCreate">新增供应商</el-button>
|
||||
<order-toolbar-button-group
|
||||
:buttons="packageSupplierToolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -116,6 +112,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import {
|
||||
packageSupplierCreate,
|
||||
packageSupplierDelete,
|
||||
@ -126,6 +125,7 @@ import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import {
|
||||
buildPackageSupplierListPayload,
|
||||
parsePackageSupplierListResponse,
|
||||
packageSupplierToolbarButtons,
|
||||
formatPackageSupplierStatus,
|
||||
normalizePackageSupplierScanConditionToWhere,
|
||||
packageSupplierColumns,
|
||||
@ -151,6 +151,53 @@ const saving = ref(false)
|
||||
const batchDeleting = ref(false)
|
||||
const selectedIds = ref<number[]>([])
|
||||
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 tableSize = ref<'small' | 'default' | 'large'>('small')
|
||||
const currentConditionRaw = ref<any>(null)
|
||||
@ -417,23 +464,23 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
padding: 5px 8px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
margin-bottom: 3px;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
background-color: #fff;
|
||||
min-width: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.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 = {
|
||||
id?: number
|
||||
supplier_code?: string
|
||||
|
||||
@ -1359,7 +1359,7 @@ export const deliveryAvailableFields = [
|
||||
{ ...isUrgencyScanField, 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 },
|
||||
{ ...waveNoScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||
{ ...waybillCodesScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||
@ -2064,7 +2064,7 @@ export const expectionOrderAvailableFields = [
|
||||
{ ...isUrgencyScanField, 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 },
|
||||
{ ...waveNoScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||
{ ...expressCodeScanField, group: SCAN_ORDER_INFO_GROUP },
|
||||
|
||||
@ -707,6 +707,10 @@ onBeforeUnmount(() => {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.toolbar-left {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -158,25 +158,27 @@
|
||||
</template>
|
||||
|
||||
<template #column-operation="{ row }">
|
||||
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
size="small"
|
||||
:loading="isWavePickCompleteLoading(row)"
|
||||
@click.stop="handleWavePickComplete(row)"
|
||||
>
|
||||
批量拣货
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
:loading="isTogglePrintStatusLoading(row)"
|
||||
@click.stop="handleToggleWavePrintStatus(row)"
|
||||
>
|
||||
{{ getPrintStatusButtonText(row) }}
|
||||
</el-button>
|
||||
<div class="wave-operation-actions">
|
||||
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
size="small"
|
||||
:loading="isWavePickCompleteLoading(row)"
|
||||
@click.stop="handleWavePickComplete(row)"
|
||||
>
|
||||
批量拣货
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
:loading="isTogglePrintStatusLoading(row)"
|
||||
@click.stop="handleToggleWavePrintStatus(row)"
|
||||
>
|
||||
{{ getPrintStatusButtonText(row) }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
@ -4092,6 +4094,10 @@ async function submitFallbackOrderFetchByIds() {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.toolbar-left {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -4101,10 +4107,34 @@ async function submitFallbackOrderFetchByIds() {
|
||||
}
|
||||
|
||||
.toolbar-switch-label {
|
||||
font-size: 12px;
|
||||
font-size: 11px;
|
||||
color: var(--el-text-color-regular);
|
||||
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>
|
||||
@ -158,25 +158,27 @@
|
||||
</template>
|
||||
|
||||
<template #column-operation="{ row }">
|
||||
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
size="small"
|
||||
:loading="isWavePickCompleteLoading(row)"
|
||||
@click.stop="handleWavePickComplete(row)"
|
||||
>
|
||||
批量拣货
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
:loading="isTogglePrintStatusLoading(row)"
|
||||
@click.stop="handleToggleWavePrintStatus(row)"
|
||||
>
|
||||
{{ getPrintStatusButtonText(row) }}
|
||||
</el-button>
|
||||
<div class="wave-operation-actions">
|
||||
<el-button link type="primary" size="small" @click.stop="openPendingOrdersByWave(row)">处理订单</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="success"
|
||||
size="small"
|
||||
:loading="isWavePickCompleteLoading(row)"
|
||||
@click.stop="handleWavePickComplete(row)"
|
||||
>
|
||||
批量拣货
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="warning"
|
||||
size="small"
|
||||
:loading="isTogglePrintStatusLoading(row)"
|
||||
@click.stop="handleToggleWavePrintStatus(row)"
|
||||
>
|
||||
{{ getPrintStatusButtonText(row) }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
@ -2880,6 +2882,10 @@ async function submitGroupOrderDialog() {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.toolbar-left {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
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>
|
||||
@ -25,9 +25,10 @@
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<!-- <span class="toolbar-switch-label">{{ pickTaskWaveListDefaults.toolbarHint }}</span> -->
|
||||
</div>
|
||||
<!-- 无需 toolbar-right,保持与 orderManagement 一致 -->
|
||||
<!-- <div class="toolbar-right">
|
||||
<span class="toolbar-switch-label">{{ pickTaskWaveListDefaults.toolbarHint }}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="split-stack" ref="splitStackRef">
|
||||
@ -270,6 +271,10 @@ const upperPaneFullStyle = computed(() => ({
|
||||
overflow: 'hidden' as const
|
||||
}))
|
||||
|
||||
function toggleDetailVisible() {
|
||||
detailVisible.value = !detailVisible.value
|
||||
}
|
||||
|
||||
const pagination = reactive({
|
||||
currentPage: 1,
|
||||
pageSize: pickTaskWavePaginationDefaults.initialPageSize,
|
||||
@ -297,7 +302,8 @@ const buttonDisabledMap = computed(() => ({
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed(() => ({
|
||||
batchCancelTotal: `批量取消任务(${selectedTaskRows.value.length})`
|
||||
batchCancelTotal: `批量取消任务(${selectedTaskRows.value.length})`,
|
||||
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
|
||||
}))
|
||||
|
||||
const toolbarLayoutKey = computed(() =>
|
||||
@ -328,6 +334,7 @@ const toolbarActionMap: Record<string, () => void> = {
|
||||
void loadData()
|
||||
},
|
||||
openColumnConfigPanel: () => openColumnConfigPanel(),
|
||||
toggleDetailVisible: () => toggleDetailVisible(),
|
||||
handleSearch: () => handleSearch(),
|
||||
handleBatchCancelTasks: () => {
|
||||
void handleBatchCancelTasks()
|
||||
@ -857,6 +864,10 @@ onMounted(() => {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.toolbar-left {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
inactive-text="隐藏下一波抓取数量"
|
||||
@change="handleWaveStrategyNextFetchOrderCountChange"
|
||||
/>
|
||||
<span class="toolbar-switch-label">当前仓库波次策略(wms_wave_strategy)</span>
|
||||
<!-- <span class="toolbar-switch-label">当前仓库波次策略(wms_wave_strategy)</span> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
title="波次策略列表"
|
||||
default-align="center"
|
||||
:enable-column-config="true"
|
||||
:column-config-schema-version="1"
|
||||
:column-config-schema-version="2"
|
||||
:table-id="tableListId"
|
||||
:data="filteredColumns"
|
||||
:row-key="getRowIdentity"
|
||||
@ -135,19 +135,21 @@
|
||||
</template>
|
||||
|
||||
<template #column-operation="{ row }">
|
||||
<el-button
|
||||
type="warning"
|
||||
link
|
||||
size="small"
|
||||
:loading="waveStrategyFetchSubmittingId === Number(row?.id || 0)"
|
||||
:disabled="!Number(row?.id || 0)"
|
||||
@click="submitWaveStrategyFetchAdmin(row)"
|
||||
>
|
||||
后台抓取
|
||||
</el-button>
|
||||
<el-button type="primary" link size="small" @click="openEditWaveStrategyDialog(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<div class="wave-operation-actions">
|
||||
<el-button
|
||||
type="warning"
|
||||
link
|
||||
size="small"
|
||||
:loading="waveStrategyFetchSubmittingId === Number(row?.id || 0)"
|
||||
:disabled="!Number(row?.id || 0)"
|
||||
@click="submitWaveStrategyFetchAdmin(row)"
|
||||
>
|
||||
后台抓取
|
||||
</el-button>
|
||||
<el-button type="primary" link size="small" @click="openEditWaveStrategyDialog(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
@ -1030,6 +1032,30 @@ onMounted(() => {
|
||||
<style scoped lang="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 {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
@ -1052,6 +1078,10 @@ onMounted(() => {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.toolbar-left {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -331,7 +331,7 @@ export const waveStrategyColumns = [
|
||||
{ prop: 'create_time', label: '创建时间', minWidth: 168 },
|
||||
{ prop: 'update_time', label: '更新时间', minWidth: 168 },
|
||||
{ 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: 'create_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 一致) */
|
||||
@ -485,6 +485,14 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
},
|
||||
{
|
||||
key: 'fetchGroupOrder',
|
||||
label: '抓取团购单',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openGroupOrderDialog',
|
||||
onlyForWaveType: 1
|
||||
},
|
||||
{
|
||||
key: 'batchPrint',
|
||||
label: '批量打印(0)',
|
||||
@ -517,22 +525,22 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
loadingKey: 'batchPlatformPrintLoading',
|
||||
action: 'handleBatchPlatformPrint'
|
||||
},
|
||||
{
|
||||
key: 'printerComponentConnection',
|
||||
label: '打印组件连接',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openPrinterComponentConnectionDialog',
|
||||
onlyForWaveType: 2
|
||||
},
|
||||
{
|
||||
key: 'printerListTest',
|
||||
label: '打印机列表',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openPrinterListTestDialog',
|
||||
onlyForWaveType: 2
|
||||
},
|
||||
// {
|
||||
// key: 'printerComponentConnection',
|
||||
// label: '打印组件连接',
|
||||
// category: 'action',
|
||||
// size: 'small',
|
||||
// action: 'openPrinterComponentConnectionDialog',
|
||||
// onlyForWaveType: 2
|
||||
// },
|
||||
// {
|
||||
// key: 'printerListTest',
|
||||
// label: '打印机列表',
|
||||
// category: 'action',
|
||||
// size: 'small',
|
||||
// action: 'openPrinterListTestDialog',
|
||||
// onlyForWaveType: 2
|
||||
// },
|
||||
{
|
||||
key: 'batchPrintPickingList',
|
||||
label: '批量打印拣货单(0)',
|
||||
@ -590,14 +598,6 @@ export const waveToolbarButtons: WaveToolbarButtonConfig[] = [
|
||||
loadingKey: 'batchAllocateStorageLoading',
|
||||
action: 'handleBatchAllocateStorage'
|
||||
},
|
||||
{
|
||||
key: 'fetchGroupOrder',
|
||||
label: '抓取团购单',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
action: 'openGroupOrderDialog',
|
||||
onlyForWaveType: 1
|
||||
},
|
||||
{
|
||||
key: 'batchCancel',
|
||||
label: '批量取消波次',
|
||||
@ -952,6 +952,14 @@ export const pickTaskWaveDetailDialogDefaults = {
|
||||
export const pickTaskWaveToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ key: 'search', label: '查询', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'columnConfig', label: '字段设置', category: 'setting', size: 'small', action: 'openColumnConfigPanel' },
|
||||
{
|
||||
key: 'toggleDetail',
|
||||
label: '显示详情',
|
||||
dynamicLabelKey: 'detailToggleLabel',
|
||||
category: 'setting',
|
||||
size: 'small',
|
||||
action: 'toggleDetailVisible'
|
||||
},
|
||||
{
|
||||
key: 'batchCancel',
|
||||
label: '批量取消任务',
|
||||
@ -1082,7 +1090,7 @@ export const pickTaskWaveColumns = applyWaveListCopyActions([
|
||||
{ prop: 'review_finish_time', label: '复核完成', minWidth: 168 },
|
||||
{ prop: 'created_at', 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 {
|
||||
|
||||
@ -1,33 +1,43 @@
|
||||
<template>
|
||||
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
||||
<!-- 多标签模式 -->
|
||||
<el-tabs
|
||||
v-if="!singlePage"
|
||||
v-model="activeTab"
|
||||
@tab-change="handleTabChange"
|
||||
tab-position="top"
|
||||
type="border-card"
|
||||
class="tab-container"
|
||||
>
|
||||
<el-tab-pane
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
:name="tab.name"
|
||||
:lazy="false"
|
||||
>
|
||||
<template #label>
|
||||
<span class="custom-tab-label">{{ tab.label }}</span>
|
||||
</template>
|
||||
<template v-if="!singlePage">
|
||||
<!-- 顶部多标签页区域(对齐 order/orderManagement 的 tab-section) -->
|
||||
<div class="tab-section">
|
||||
<div class="tabs-header-action">
|
||||
<!-- <el-button size="small">操作按钮</el-button> -->
|
||||
</div>
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
@tab-change="handleTabChange"
|
||||
tab-position="top"
|
||||
type="border-card"
|
||||
class="tab-container"
|
||||
>
|
||||
<el-tab-pane
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
:name="tab.name"
|
||||
:lazy="false"
|
||||
>
|
||||
<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>
|
||||
<component
|
||||
:is="tab.component"
|
||||
:key="tab.name"
|
||||
v-if="activeTab === tab.name"
|
||||
v-bind="tab.props || {}"
|
||||
:is="activeComponent"
|
||||
:key="activeTab"
|
||||
v-bind="activeTabProps"
|
||||
/>
|
||||
</keep-alive>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 单页模式:直接渲染默认页签组件,复用 .tab-container 样式结构 -->
|
||||
<div v-else class="tab-container single-page-container">
|
||||
@ -70,6 +80,18 @@ const defaultTab = computed(() => tabs.value[0]!)
|
||||
|
||||
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 = {
|
||||
name: string
|
||||
label: string
|
||||
@ -160,13 +182,36 @@ const handleTabChange = (tabName: string | number) => {
|
||||
.order-management-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
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 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
:deep(.el-tabs__header) {
|
||||
margin-bottom: 0;
|
||||
@ -221,14 +266,9 @@ const handleTabChange = (tabName: string | number) => {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
/* 隐藏内容区,仅展示标签头(对齐 order/orderManagement) */
|
||||
:deep(.el-tabs__content) {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
|
||||
.el-tab-pane {
|
||||
height: 100%;
|
||||
}
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,14 +278,25 @@ const handleTabChange = (tabName: string | number) => {
|
||||
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 {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
background: #fff;
|
||||
border: 1px solid #e8eef7;
|
||||
border-radius: 6px;
|
||||
|
||||
@ -676,6 +676,61 @@ export function formatEntryBindingStatus(status: unknown): string {
|
||||
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(
|
||||
row: unknown,
|
||||
_col?: unknown,
|
||||
|
||||
@ -17,34 +17,15 @@
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<!-- <el-button size="small" @click="handleCreateEntry">新建入库单</el-button> -->
|
||||
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
|
||||
<el-dropdown trigger="click" split-button size="small" :loading="exportLoading" @click="handleExportAll" @command="handleExportCommand">
|
||||
导出
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<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> -->
|
||||
<order-toolbar-button-group
|
||||
:buttons="entryToolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- <div class="toolbar-right">
|
||||
<el-input size="small" placeholder="搜索入库单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="split-stack" ref="splitStackRef">
|
||||
@ -363,6 +344,9 @@ import { useRoute } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import * as entryApi from '@/api/storage.entry/entry'
|
||||
import type { StorageEntryListParams } from '@/api/storage.entry/entry'
|
||||
@ -371,6 +355,7 @@ import {
|
||||
availableFields,
|
||||
entryColums,
|
||||
addEntryFields,
|
||||
entryToolbarButtons,
|
||||
formatEntryOrderStatus,
|
||||
getEntryOrderStatusTagType,
|
||||
isPendingEntryOrderStatus,
|
||||
@ -484,6 +469,60 @@ const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
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 currentSort = reactive({ prop: '', order: '' })
|
||||
|
||||
|
||||
@ -17,19 +17,14 @@
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<!-- <el-button size="small" @click="handleCreateEntry">新建入库单</el-button> -->
|
||||
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
|
||||
<ExportModeDropdown
|
||||
:loading="exportLoading"
|
||||
:items="exportDropdownItems"
|
||||
:default-action="'handleExportSelected'"
|
||||
@action="handleExportAction"
|
||||
<order-toolbar-button-group
|
||||
:buttons="inventoryToolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
<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 class="toolbar-right">
|
||||
@ -167,14 +162,19 @@ import { ref, reactive, onMounted, computed, nextTick } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import AsyncExportProgressDialog from '@/components/AsyncExportProgressDialog.vue'
|
||||
import { useAsyncExportTask, type AsyncExportPayload } from '@/composables/useAsyncExportTask'
|
||||
import type { ExportDropdownItem } from '@/components/ExportModeDropdown.vue'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
// import * as entryApi from '@/api/storage.entry/entry'
|
||||
import * as inventoryApi from '@/api/storage.inventory/inventory'
|
||||
|
||||
import {
|
||||
availableFields,
|
||||
inventoryToolbarButtons,
|
||||
formatInventoryBarcodes,
|
||||
formatInventoryFlagLabel,
|
||||
formatInventoryOptionalText,
|
||||
@ -186,7 +186,6 @@ import entrydetail from './component/panelstockdetail.vue'
|
||||
import log from './component/log.vue'
|
||||
import InventoryStockPickerDialog 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 { useSettingsStore } from '@/stores/modules/settings'
|
||||
|
||||
@ -303,7 +302,58 @@ const columns = computed(() => {
|
||||
const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
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> = {
|
||||
details: entrydetail,
|
||||
logs: log
|
||||
|
||||
@ -1,5 +1,52 @@
|
||||
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 基础信息分组(对齐收货单排版) */
|
||||
export const INVENTORY_SCAN_BASIC_INFO_GROUP = '基础信息'
|
||||
|
||||
|
||||
@ -16,10 +16,14 @@
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<ExportModeDropdown :loading="exportLoading" @action="handleExportAction" />
|
||||
<el-button size="small" @click="openColumnConfigPanel">字段设置</el-button>
|
||||
<el-button size="small" @click="toggleDetailVisible">{{ detailVisible ? '隐藏详情' : '显示详情' }}</el-button>
|
||||
<order-toolbar-button-group
|
||||
:buttons="logToolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -111,17 +115,20 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import { getTransactionList } from '@/api/storage.inventory/inventory'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import {
|
||||
transactionColumns,
|
||||
availableFields,
|
||||
logToolbarButtons,
|
||||
formatDateTime,
|
||||
formatTransactionData,
|
||||
inventoryTypeConfig,
|
||||
transactionTypeConfig
|
||||
} from './log-config'
|
||||
import ExportModeDropdown from '@/components/ExportModeDropdown.vue'
|
||||
import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import dayjs from 'dayjs'
|
||||
@ -173,6 +180,55 @@ const selectedLogId = ref<string | null>(null)
|
||||
const currentCondition = 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(() => {
|
||||
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 基础信息分组(对齐收货单排版) */
|
||||
export const LOG_SCAN_BASIC_INFO_GROUP = '基础信息'
|
||||
|
||||
|
||||
@ -566,10 +566,12 @@ export const addReceivingFields = [
|
||||
{ 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[] = [
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{ key: 'create', label: '添加收货单', category: 'action', size: 'small', action: 'handleCreateReceiving' },
|
||||
{ key: 'refresh', label: '刷新', category: 'refresh', size: 'small', loadingKey: 'loading', action: 'loadData' },
|
||||
{
|
||||
key: 'export',
|
||||
label: '导出',
|
||||
@ -583,7 +585,7 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{ 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',
|
||||
label: '显示详情',
|
||||
@ -592,6 +594,16 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||
size: 'small',
|
||||
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',
|
||||
label: '完成收货',
|
||||
@ -600,34 +612,10 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||
disabledKey: 'hasNoSelection',
|
||||
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',
|
||||
label: '快捷入库',
|
||||
type: 'success',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'singleSelectionOnly',
|
||||
loadingKey: 'quickPutawayLoading',
|
||||
@ -636,9 +624,25 @@ export const receivingToolbarButtons: ToolbarButtonConfig[] = [
|
||||
{
|
||||
key: 'print',
|
||||
label: '打印收货单',
|
||||
type: 'info',
|
||||
category: 'action',
|
||||
size: 'small',
|
||||
disabledKey: 'hasNoSelection',
|
||||
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>
|
||||
<div class="stockout-product-container">
|
||||
<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>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
|
||||
@ -72,12 +72,17 @@ import { ref, watch, onMounted } from 'vue'
|
||||
import { availableFields, detailpanel } from '../stockout-config'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Picture, Check, Refresh } from '@element-plus/icons-vue'
|
||||
import * as stockoutApi from '@/api/storage.stockout/stockout'
|
||||
|
||||
const props = defineProps<{
|
||||
id: string | number,
|
||||
row?: any
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
refresh: []
|
||||
}>()
|
||||
|
||||
const form = ref<any>({})
|
||||
|
||||
const saveLoading = ref(false)
|
||||
@ -85,8 +90,24 @@ const saveLoading = ref(false)
|
||||
const handleSave = async () => {
|
||||
try {
|
||||
saveLoading.value = true
|
||||
// 这里调用 API 保存
|
||||
ElMessage.success('保存成功')
|
||||
const id = form.value.id || props.id
|
||||
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) {
|
||||
ElMessage.error('保存失败')
|
||||
} finally {
|
||||
|
||||
@ -18,17 +18,14 @@
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<el-button size="small" @click="handleCreateStockout">新建出库单</el-button>
|
||||
<el-button size="small" :disabled="!hasSelection" @click="confirmBatchCancel">批量作废</el-button>
|
||||
<ExportModeDropdown :loading="exportLoading" @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>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<!-- <el-input size="small" placeholder="搜索出库单号" v-model="quickSearch" style="width:220px" @keyup.enter="onQuickSearch" /> -->
|
||||
<order-toolbar-button-group
|
||||
:buttons="stockoutToolbarButtons"
|
||||
:resolve-disabled="resolveButtonDisabled"
|
||||
:resolve-loading="resolveButtonLoading"
|
||||
:resolve-label="resolveButtonLabel"
|
||||
:layout-key="toolbarLayoutKey"
|
||||
@action="handleToolbarButtonClick"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -56,9 +53,9 @@
|
||||
@refresh="loadData"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-status="{ row }">
|
||||
<el-tag v-if="row.status" :type="statusConfig[row.status as keyof typeof statusConfig]?.tagType || 'info'" size="small">
|
||||
{{ statusConfig[row.status as keyof typeof statusConfig]?.text || row.status }}
|
||||
<template #column-order_status="{ row }">
|
||||
<el-tag v-if="row.order_status" :type="statusConfig[row.order_status as keyof typeof statusConfig]?.tagType || 'info'" size="small">
|
||||
{{ statusConfig[row.order_status as keyof typeof statusConfig]?.text || row.order_status }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
@ -118,6 +115,10 @@ import { useRoute } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import OrderToolbarButtonGroup from '@/views/order/orderManagement/component/OrderToolbarButtonGroup.vue'
|
||||
import type { ToolbarButtonConfig } from '@/views/order/orderManagement/config/order-common-config'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
import * as XLSX from 'xlsx'
|
||||
import * as indexApi from '@/api/index/index'
|
||||
import * as stockoutApi from '@/api/storage.stockout/stockout' //现有的对应 API
|
||||
|
||||
@ -126,14 +127,13 @@ import {
|
||||
entryColums,
|
||||
statusConfig,
|
||||
syncStatusConfig,
|
||||
stockoutToolbarButtons,
|
||||
formatStockoutData,
|
||||
} from './stockout-config'
|
||||
|
||||
import stockoutdetail from './component/stockoutdetail.vue'
|
||||
import product from './component/product.vue'
|
||||
import log from './component/log.vue'
|
||||
import ExportModeDropdown from '@/components/ExportModeDropdown.vue'
|
||||
import * as XLSX from 'xlsx'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { useSettingsStore } from '@/stores/modules/settings'
|
||||
|
||||
@ -195,6 +195,61 @@ const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
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 currentSort = reactive({ prop: '', order: '' })
|
||||
const currentCondition = ref<any>(null)
|
||||
@ -244,7 +299,7 @@ async function loadData() {
|
||||
const params: any = {
|
||||
pagination: { page: pagination.currentPage, pageSize: pagination.pageSize },
|
||||
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) {
|
||||
@ -435,6 +490,60 @@ async function confirmBatchCancel() {
|
||||
} 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') {
|
||||
const sourceRows = selectionRows.value.length ? selectionRows.value : list.value
|
||||
if (!sourceRows.length) {
|
||||
@ -450,7 +559,7 @@ async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
||||
const data = sourceRows.map((row: any) =>
|
||||
exportColumns.map((col: any) => {
|
||||
const val = row[col.prop]
|
||||
if (col.prop === 'status') {
|
||||
if (col.prop === 'order_status') {
|
||||
return statusConfig[val as keyof typeof statusConfig]?.text || val || ''
|
||||
}
|
||||
if (col.prop === 'sync_status') {
|
||||
@ -475,7 +584,7 @@ async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
||||
const listData = Array.isArray(items) ? items : []
|
||||
listData.forEach((item: any) => {
|
||||
detailRows.push({
|
||||
'出库单号': row.stockout_number || row.order_code || row.id,
|
||||
'出库单号': row.stockout_order_code || row.id,
|
||||
'商品编码': item.item_code || item.product_code || '',
|
||||
'商品名称': item.item_name || item.product_name || '',
|
||||
'计划数量': 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 基础信息分组(对齐收货单排版) */
|
||||
export const STOCKOUT_SCAN_BASIC_INFO_GROUP = '基础信息'
|
||||
|
||||
@ -43,18 +106,27 @@ export const stockoutScanBoxConfig = {
|
||||
}
|
||||
|
||||
export const statusConfig: Record<string, { text: string; tagType: string }> = {
|
||||
created: { text: '已创建', tagType: 'success' },
|
||||
pedding: { text: '待出库', tagType: 'warning' },
|
||||
CREATED: { text: '已创建', tagType: '' },
|
||||
PENDING: { text: '待出库', tagType: 'warning' },
|
||||
PROCESSING: { text: '出库中', tagType: 'primary' },
|
||||
COMPLETED: { text: '已完成', tagType: 'success' },
|
||||
CANCELLED: { text: '已作废', tagType: 'danger' },
|
||||
// 兼容旧小写
|
||||
created: { text: '已创建', tagType: '' },
|
||||
pending: { text: '待出库', tagType: 'warning' },
|
||||
processing: { text: '出库中', tagType: 'primary' },
|
||||
completed: { text: '已完成', tagType: 'success' },
|
||||
cancelled: { text: '已作废', tagType: 'danger' }
|
||||
}
|
||||
|
||||
// sync_status 实际值(接口存在拼写:padding)
|
||||
// sync_status 实际值(接口返回大写;兼容旧小写与拼写)
|
||||
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' },
|
||||
padding: { text: '待同步', tagType: 'info' },
|
||||
success: { text: '同步成功', tagType: 'success' },
|
||||
failed: { text: '同步失败', tagType: 'danger' }
|
||||
}
|
||||
@ -78,34 +150,30 @@ export function formatDateTime(dateStr: string): string {
|
||||
}
|
||||
|
||||
export const entryColums = [
|
||||
{ prop: 'delivery_order_code', label: '出库单号', width: '180', fixed: 'left' },
|
||||
{ prop: 'status', label: '出库状态', width: '100' },
|
||||
{ prop: 'stockout_order_code', label: '出库单号', width: '220', fixed: 'left' },
|
||||
{ prop: 'order_status', label: '出库状态', width: '100' },
|
||||
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
||||
{ prop: 'order_type', label: '单据类型', width: '100' },
|
||||
{ prop: 'source_platform_name', label: '来源平台', width: '110' },
|
||||
{ prop: 'buyer_nick', label: '买家', width: '130' },
|
||||
{ prop: 'name', label: '收货人', width: '100' },
|
||||
{ prop: 'mobile', label: '联系电话', width: '130' },
|
||||
{ prop: 'logistics_name', label: '物流公司', width: '130' },
|
||||
{ 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: 'source_type', label: '来源类型', width: '100' },
|
||||
{ prop: 'total_order_lines', label: '订单行数', width: '90' },
|
||||
{ prop: 'remark', label: '备注', minWidth: '150' },
|
||||
{ prop: 'order_create_time', label: '下单时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.order_create_time) },
|
||||
{ prop: 'created_at', label: '创建时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.created_at) },
|
||||
{ prop: 'updated_at', label: '更新时间', width: '160', sortable: true, formatter: (row: any) => formatDateTime(row.updated_at) }
|
||||
]
|
||||
|
||||
export const availableFields: StockoutScanFieldConfig[] = [
|
||||
// ===== 基础信息 =====
|
||||
stockoutScanBasicField({ value: 'delivery_order_code', label: '出库单号', type: 'text' }),
|
||||
stockoutScanBasicField({ value: 'stockout_order_code', label: '出库单号', type: 'text' }),
|
||||
stockoutScanBasicField({
|
||||
value: 'order_type',
|
||||
label: '单据类型',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '其他出库', value: 'QTCK' },
|
||||
{ label: '交易出库', value: 'JYCK' },
|
||||
{ label: '调拨出库', value: 'TRANSFER' },
|
||||
{ label: '退货出库', value: 'RETURN' },
|
||||
{ label: '其他出库', value: 'OTHER' }
|
||||
{ label: '退货出库', value: 'RETURN' }
|
||||
]
|
||||
}),
|
||||
stockoutScanBasicField({
|
||||
@ -116,17 +184,26 @@ export const availableFields: StockoutScanFieldConfig[] = [
|
||||
filterable: true,
|
||||
options: []
|
||||
}),
|
||||
stockoutScanBasicField({
|
||||
value: 'source_type',
|
||||
label: '来源类型',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ label: '奇门', value: 'QM' }
|
||||
]
|
||||
}),
|
||||
|
||||
// ===== 流程状态(合并为一组,对齐波次列表 ScanBox) =====
|
||||
// ===== 流程状态 =====
|
||||
stockoutScanWorkflowField({
|
||||
value: 'status',
|
||||
value: 'order_status',
|
||||
label: '出库状态',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: 'pedding', label: '待出库' },
|
||||
{ value: 'processing', label: '出库中' },
|
||||
{ value: 'completed', label: '已完成' },
|
||||
{ value: 'cancelled', label: '已作废' }
|
||||
{ value: 'CREATED', label: '已创建' },
|
||||
{ value: 'PENDING', label: '待出库' },
|
||||
{ value: 'PROCESSING', label: '出库中' },
|
||||
{ value: 'COMPLETED', label: '已完成' },
|
||||
{ value: 'CANCELLED', label: '已作废' }
|
||||
]
|
||||
}),
|
||||
stockoutScanWorkflowField({
|
||||
@ -134,21 +211,15 @@ export const availableFields: StockoutScanFieldConfig[] = [
|
||||
label: '同步状态',
|
||||
type: 'select',
|
||||
options: [
|
||||
{ value: 'padding', label: '待同步' },
|
||||
{ value: 'success', label: '同步成功' },
|
||||
{ value: 'failed', label: '同步失败' }
|
||||
{ value: 'PENDING', label: '待同步' },
|
||||
{ value: 'SUCCESS', 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({
|
||||
value: 'place_order_time',
|
||||
value: 'order_create_time',
|
||||
label: '下单时间',
|
||||
type: 'daterange',
|
||||
startPlaceholder: '开始时间',
|
||||
@ -158,18 +229,13 @@ export const availableFields: StockoutScanFieldConfig[] = [
|
||||
|
||||
// 详情面板表单配置
|
||||
export const detailpanel = [
|
||||
{ prop: 'delivery_order_code', label: '出库单号', type: 'input', disabled: true },
|
||||
{ prop: 'order_type', label: '单据类型', type: 'input', disabled: true },
|
||||
{ prop: 'status', label: '出库状态', type: 'select', disabled: true },
|
||||
{ prop: 'source_platform_name', label: '来源平台', type: 'input', disabled: true },
|
||||
{ prop: 'buyer_nick', label: '买家', type: 'input', disabled: true },
|
||||
{ prop: 'name', label: '收货人', type: 'input', disabled: true },
|
||||
{ prop: 'mobile', label: '联系电话', type: 'input', disabled: true },
|
||||
{ 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 }
|
||||
{ prop: 'stockout_order_code', label: '出库单号', type: 'input', disabled: true },
|
||||
{ prop: 'order_status', label: '出库状态', type: 'select', disabled: true },
|
||||
{ prop: 'express_code', label: '运单号', type: 'input', disabled: false },
|
||||
{ prop: 'express_codes', label: '运单号列表', type: 'textarea', disabled: false },
|
||||
{ prop: 'qimen_owner_code', label: '奇门货主编码', type: 'input', disabled: true },
|
||||
{ prop: 'qimen_warehouse_code', label: '奇门仓库编码', type: 'input', disabled: true },
|
||||
{ prop: 'remark', label: '备注', type: 'textarea' },
|
||||
]
|
||||
|
||||
export const productColumns = [
|
||||
@ -204,9 +270,7 @@ export function formatStockoutListItems(list: any[] = []) {
|
||||
export function formatStockoutData(list: any[] = []) {
|
||||
return (list || []).map(item => ({
|
||||
...item,
|
||||
status: item.status || 'pedding',
|
||||
sync_status: item.sync_status || 'padding',
|
||||
// 接口返回 create_at,统一为 created_at
|
||||
created_at: item.created_at || item.create_at
|
||||
order_status: item.order_status || 'PENDING',
|
||||
sync_status: item.sync_status || 'PENDING',
|
||||
}))
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@ import {
|
||||
storeExpressBindingPolicyDel,
|
||||
storeExpressBindingPolicyEdit,
|
||||
storeExpressBindingPolicyList
|
||||
} from '@/api/setting.storeExpressBindingPolicy/storeExpressBindingPolicy'
|
||||
} from '@/api/storeexpressbindingpolicy/storeExpressBindingPolicy'
|
||||
import { expressIndexGetExpressList } from '@/api/setting.express/express'
|
||||
import { getProhibitedType } from '@/api/stock/stock'
|
||||
import { loadStores } from '@/api/index/index'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user