529
This commit is contained in:
parent
1494b3b7dc
commit
8a1cc63a09
@ -40,6 +40,32 @@ export type QueryOrderLogListParams = {
|
||||
orderId?: string | number
|
||||
}
|
||||
|
||||
export type UpdateExpressWeighingWeightParams = {
|
||||
order_id: number | string
|
||||
waybill_code?: string
|
||||
weighing_weight: number | string
|
||||
}
|
||||
|
||||
export type BindExpressPackageMaterialParams = {
|
||||
order_id: number | string
|
||||
waybill_code: string
|
||||
package_material_code: string
|
||||
}
|
||||
|
||||
export type OrderExportParams = {
|
||||
table_type?: string
|
||||
tableType?: string
|
||||
module?: string
|
||||
module_name?: string
|
||||
where?: Record<string, any>
|
||||
sort?: OrderListParams['sort']
|
||||
}
|
||||
|
||||
export type OrderExportTaskProgressParams = {
|
||||
task_id?: string
|
||||
taskId?: string
|
||||
}
|
||||
|
||||
/** order.queryOrderLogList 单条日志 */
|
||||
export type OrderLogListItem = {
|
||||
id: number
|
||||
@ -125,6 +151,62 @@ export function orderQueryOrderLogList(data: QueryOrderLogListParams): Promise<a
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderUpdateExpressWeighingWeight(data: UpdateExpressWeighingWeightParams): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.updateExpressWeighingWeight',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderBindExpressPackageMaterial(data: BindExpressPackageMaterialParams): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.bindExpressPackageMaterial',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderExport(data: OrderExportParams = {}): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.export',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
export function orderExportTaskProgress(data: OrderExportTaskProgressParams): Promise<any> {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.exportTaskProgress',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data,
|
||||
isSystemApi: true
|
||||
} as any)
|
||||
}
|
||||
|
||||
/** 订单明细行(历史接口 order.detail,未纳入远端 module 清单) */
|
||||
export function orderDetail(data: Record<string, any> = {}): Promise<any> {
|
||||
return request({
|
||||
@ -146,5 +228,9 @@ export const order = {
|
||||
badgeCount: orderBadgeCount,
|
||||
queryOrderLogs: orderQueryOrderLogs,
|
||||
queryOrderLogList: orderQueryOrderLogList,
|
||||
updateExpressWeighingWeight: orderUpdateExpressWeighingWeight,
|
||||
bindExpressPackageMaterial: orderBindExpressPackageMaterial,
|
||||
export: orderExport,
|
||||
exportTaskProgress: orderExportTaskProgress,
|
||||
detail: orderDetail
|
||||
}
|
||||
|
||||
107
src/api/setting.packagematerial/packagematerial.ts
Normal file
107
src/api/setting.packagematerial/packagematerial.ts
Normal file
@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type PackageMaterialPagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export type PackageMaterialGetParams = {
|
||||
pagination?: PackageMaterialPagination
|
||||
where?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export type PackageMaterialCreatePayload = {
|
||||
material_code: string
|
||||
material_name: string
|
||||
material_type?: string
|
||||
spec?: string
|
||||
length?: number
|
||||
width?: number
|
||||
height?: number
|
||||
weight?: number
|
||||
cost_price?: number
|
||||
status?: number
|
||||
}
|
||||
|
||||
export type PackageMaterialUpdatePayload = {
|
||||
id: number
|
||||
material_id?: number
|
||||
materialId?: number
|
||||
material_code?: string
|
||||
material_name?: string
|
||||
material_type?: string
|
||||
spec?: string
|
||||
length?: number
|
||||
width?: number
|
||||
height?: number
|
||||
weight?: number
|
||||
cost_price?: number
|
||||
status?: number
|
||||
}
|
||||
|
||||
export function packageMaterialCreate(data: PackageMaterialCreatePayload) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageMaterial.create',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function packageMaterialUpdate(data: PackageMaterialUpdatePayload) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageMaterial.update',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function packageMaterialDelete(data: { ids: Array<number | string> | string | number }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageMaterial.delete',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function packageMaterialGet(data?: PackageMaterialGetParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageMaterial.get',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
|
||||
export function packageMaterialList(data?: PackageMaterialGetParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageMaterial.list',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
97
src/api/setting.packagesupplier/packagesupplier.ts
Normal file
97
src/api/setting.packagesupplier/packagesupplier.ts
Normal file
@ -0,0 +1,97 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const v = '1.0'
|
||||
|
||||
export type PackageSupplierPagination = {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export type PackageSupplierGetParams = {
|
||||
pagination?: PackageSupplierPagination
|
||||
where?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export type PackageSupplierCreatePayload = {
|
||||
supplier_code: string
|
||||
supplier_name: string
|
||||
contact_name?: string
|
||||
contact_phone?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export type PackageSupplierUpdatePayload = {
|
||||
id: number
|
||||
supplier_id?: number
|
||||
supplierId?: number
|
||||
supplier_code?: string
|
||||
supplier_name?: string
|
||||
contact_name?: string
|
||||
contact_phone?: string
|
||||
status?: number
|
||||
}
|
||||
|
||||
export function packageSupplierCreate(data: PackageSupplierCreatePayload) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageSupplier.create',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function packageSupplierUpdate(data: PackageSupplierUpdatePayload) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageSupplier.update',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function packageSupplierDelete(data: { ids: Array<number | string> | string | number }) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageSupplier.delete',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function packageSupplierGet(data?: PackageSupplierGetParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageSupplier.get',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
|
||||
export function packageSupplierList(data?: PackageSupplierGetParams) {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'setting.packageSupplier.list',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data || {}
|
||||
})
|
||||
}
|
||||
202
src/composables/useOrderAsyncExport.ts
Normal file
202
src/composables/useOrderAsyncExport.ts
Normal file
@ -0,0 +1,202 @@
|
||||
import { computed, onBeforeUnmount, reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { orderExport, orderExportTaskProgress } from '@/api/order.index/orderindex'
|
||||
import {
|
||||
downloadOrderExportFile,
|
||||
isOrderIndexApiSuccess,
|
||||
parseOrderExportTaskPayload
|
||||
} from '@/views/order/orderManagement/utils/order-index-helpers'
|
||||
|
||||
export type OrderAsyncExportPayload = {
|
||||
table_type?: string
|
||||
tableType?: string
|
||||
module?: string
|
||||
module_name?: string
|
||||
where?: Record<string, unknown>
|
||||
sort?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export function useOrderAsyncExport(storageKey?: string) {
|
||||
const exportLoading = ref(false)
|
||||
const exportDialogVisible = ref(false)
|
||||
const exportTaskProgress = reactive({
|
||||
taskId: '',
|
||||
status: 'submitted',
|
||||
progress: 0,
|
||||
message: '',
|
||||
error: '',
|
||||
downloadUrl: '',
|
||||
updateTime: 0
|
||||
})
|
||||
|
||||
let exportPollingTimer: number | null = null
|
||||
|
||||
function resetExportProgress() {
|
||||
exportTaskProgress.taskId = ''
|
||||
exportTaskProgress.status = 'submitted'
|
||||
exportTaskProgress.progress = 0
|
||||
exportTaskProgress.message = ''
|
||||
exportTaskProgress.error = ''
|
||||
exportTaskProgress.downloadUrl = ''
|
||||
exportTaskProgress.updateTime = 0
|
||||
}
|
||||
|
||||
function stopExportPolling() {
|
||||
if (exportPollingTimer) {
|
||||
window.clearTimeout(exportPollingTimer)
|
||||
exportPollingTimer = null
|
||||
}
|
||||
}
|
||||
|
||||
function scheduleExportPolling(delay = 1500) {
|
||||
stopExportPolling()
|
||||
exportPollingTimer = window.setTimeout(() => {
|
||||
void refreshExportTaskProgress()
|
||||
}, delay)
|
||||
}
|
||||
|
||||
function saveExportTaskId(taskId: string) {
|
||||
if (!storageKey || !taskId) return
|
||||
try {
|
||||
window.localStorage.setItem(storageKey, taskId)
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
function clearSavedExportTaskId() {
|
||||
if (!storageKey) return
|
||||
try {
|
||||
window.localStorage.removeItem(storageKey)
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshExportTaskProgress() {
|
||||
if (!exportTaskProgress.taskId) return
|
||||
try {
|
||||
const res: any = await orderExportTaskProgress({ task_id: exportTaskProgress.taskId })
|
||||
if (!isOrderIndexApiSuccess(res)) {
|
||||
scheduleExportPolling()
|
||||
return
|
||||
}
|
||||
const payload = parseOrderExportTaskPayload(res)
|
||||
exportTaskProgress.status = String(payload.status || exportTaskProgress.status)
|
||||
exportTaskProgress.progress = Number.isFinite(Number(payload.progress))
|
||||
? Number(payload.progress)
|
||||
: exportTaskProgress.progress
|
||||
exportTaskProgress.message = String(payload.message || '')
|
||||
exportTaskProgress.error = String(payload.error || '')
|
||||
exportTaskProgress.downloadUrl = String(payload.download_url || payload.downloadUrl || '')
|
||||
exportTaskProgress.updateTime = Number(payload.update_time || payload.updateTime || 0)
|
||||
|
||||
if (exportTaskProgress.status === 'success') {
|
||||
stopExportPolling()
|
||||
exportLoading.value = false
|
||||
clearSavedExportTaskId()
|
||||
try {
|
||||
if (exportTaskProgress.downloadUrl) {
|
||||
downloadOrderExportFile(exportTaskProgress.downloadUrl)
|
||||
ElMessage.success(exportTaskProgress.message || '导出完成,文件已开始下载')
|
||||
} else {
|
||||
ElMessage.warning(exportTaskProgress.message || '导出完成,但未返回下载地址')
|
||||
}
|
||||
} finally {
|
||||
window.setTimeout(() => {
|
||||
exportDialogVisible.value = false
|
||||
resetExportProgress()
|
||||
}, 1200)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (exportTaskProgress.status === 'failed' || exportTaskProgress.status === 'not_found') {
|
||||
stopExportPolling()
|
||||
exportLoading.value = false
|
||||
clearSavedExportTaskId()
|
||||
ElMessage.error(exportTaskProgress.error || exportTaskProgress.message || '导出任务失败')
|
||||
return
|
||||
}
|
||||
|
||||
scheduleExportPolling()
|
||||
} catch {
|
||||
scheduleExportPolling(2000)
|
||||
}
|
||||
}
|
||||
|
||||
async function submitExportTask(payload: OrderAsyncExportPayload) {
|
||||
if (exportLoading.value) return
|
||||
exportLoading.value = true
|
||||
resetExportProgress()
|
||||
exportDialogVisible.value = true
|
||||
try {
|
||||
const res: any = await orderExport(payload)
|
||||
if (!isOrderIndexApiSuccess(res)) {
|
||||
throw new Error(res?.message || '导出任务提交失败')
|
||||
}
|
||||
const data = parseOrderExportTaskPayload(res)
|
||||
const taskId = String(data.task_id || data.taskId || '').trim()
|
||||
if (!taskId) {
|
||||
throw new Error(res?.message || '导出任务提交失败')
|
||||
}
|
||||
exportTaskProgress.taskId = taskId
|
||||
exportTaskProgress.status = String(data.status || 'submitted')
|
||||
exportTaskProgress.progress = Number.isFinite(Number(data.progress)) ? Number(data.progress) : 0
|
||||
exportTaskProgress.message = String(data.message || '任务已受理')
|
||||
exportTaskProgress.error = String(data.error || '')
|
||||
exportTaskProgress.updateTime = Number(data.update_time || data.updateTime || 0)
|
||||
saveExportTaskId(taskId)
|
||||
scheduleExportPolling(800)
|
||||
} catch (error: any) {
|
||||
exportLoading.value = false
|
||||
exportDialogVisible.value = false
|
||||
resetExportProgress()
|
||||
ElMessage.error(error?.message || '导出任务提交失败')
|
||||
}
|
||||
}
|
||||
|
||||
const exportProgressPercent = computed(() => {
|
||||
const value = Number(exportTaskProgress.progress || 0)
|
||||
if (!Number.isFinite(value)) return 0
|
||||
return Math.max(0, Math.min(100, value))
|
||||
})
|
||||
|
||||
const exportProgressStatus = computed(() => {
|
||||
if (exportTaskProgress.status === 'failed' || exportTaskProgress.status === 'not_found') {
|
||||
return 'exception'
|
||||
}
|
||||
if (exportTaskProgress.status === 'success' || exportProgressPercent.value >= 100) {
|
||||
return 'success'
|
||||
}
|
||||
return undefined
|
||||
})
|
||||
|
||||
const exportStatusLabel = computed(() => {
|
||||
const map: Record<string, string> = {
|
||||
submitted: '已提交',
|
||||
running: '执行中',
|
||||
success: '已完成',
|
||||
failed: '失败',
|
||||
not_found: '未找到'
|
||||
}
|
||||
return map[exportTaskProgress.status] || exportTaskProgress.status || '—'
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
stopExportPolling()
|
||||
})
|
||||
|
||||
return {
|
||||
exportLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
submitExportTask,
|
||||
refreshExportTaskProgress,
|
||||
resetExportProgress,
|
||||
stopExportPolling
|
||||
}
|
||||
}
|
||||
@ -61,6 +61,8 @@ export default {
|
||||
// 'StoreIndex':'Store',
|
||||
'expressinterface':'Express Interface',
|
||||
'shops':'Shops',
|
||||
'packageMaterial':'Package Material',
|
||||
'packageSupplier':'Package Supplier',
|
||||
},
|
||||
"login": {
|
||||
"title": "Login",
|
||||
|
||||
@ -62,6 +62,8 @@ export default {
|
||||
// 'StoreIndex':'货主',
|
||||
'expressinterface':'快递接口',
|
||||
'shops':'店铺管理',
|
||||
'packageMaterial':'包材管理',
|
||||
'packageSupplier':'包装供应商',
|
||||
},
|
||||
"login": {
|
||||
"title": "登录",
|
||||
|
||||
@ -39,4 +39,6 @@ export const componentMap: Record<string, any> = {
|
||||
'system/setting/expressinterface/index':() => import('@/views/system/setting/expressinterface/index.vue'),
|
||||
'system/setting/encoding/index':() => import('@/views/system/setting/encoding/index.vue'),
|
||||
'system/setting/shops/index':() => import('@/views/system/setting/shops/index.vue'),
|
||||
'material/packageMaterial/index':() => import('@/views/material/packageMaterial/index.vue'),
|
||||
'material/packageSupplier/index':() => import('@/views/material/packageSupplier/index.vue'),
|
||||
};
|
||||
578
src/views/material/packageMaterial/index.vue
Normal file
578
src/views/material/packageMaterial/index.vue
Normal file
@ -0,0 +1,578 @@
|
||||
<template>
|
||||
<div class="package-material-container" :style="{ height: containerHeight }">
|
||||
<scan-box
|
||||
ref="scanBox"
|
||||
width="250px"
|
||||
:tree-props="{ children: 'children', label: 'label' }"
|
||||
:auto-submit="false"
|
||||
:preset-tree="presetTree"
|
||||
:available-fields="availableFieldsRef"
|
||||
@condition-change="handleConditionChange"
|
||||
@reset="handleConditionReset"
|
||||
@condition-clear="handleConditionClear"
|
||||
@submit="handleSubmit"
|
||||
/>
|
||||
|
||||
<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-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
|
||||
</div>
|
||||
<el-button type="success" size="small" @click="openCreate">新增包材</el-button>
|
||||
</div>
|
||||
|
||||
<div class="upper-wrapper">
|
||||
<upper-table
|
||||
ref="upperTable"
|
||||
title="包材列表"
|
||||
table-id="material-package-material"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-selection="true"
|
||||
:show-actions="true"
|
||||
:loading="loading"
|
||||
:query-time="queryTime"
|
||||
row-key="id"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="loadList"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-dimensions="{ row }">
|
||||
{{ formatDimensions(row) }}
|
||||
</template>
|
||||
|
||||
<template #column-weight="{ row }">
|
||||
{{ formatNumber(row.weight) }}
|
||||
</template>
|
||||
|
||||
<template #column-cost_price="{ row }">
|
||||
{{ formatNumber(row.cost_price) }}
|
||||
</template>
|
||||
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="formatPackageMaterialStatus(row.status).type" size="small">
|
||||
{{ formatPackageMaterialStatus(row.status).text }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-actions="{ row }">
|
||||
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
|
||||
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无包材数据,可调整左侧筛选条件</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogMode === 'create' ? '新增包材' : '编辑包材'"
|
||||
width="720px"
|
||||
align-center
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="16">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="包材编码" prop="material_code">
|
||||
<el-input
|
||||
v-model="formData.material_code"
|
||||
placeholder="大写字母/数字,仓库内唯一"
|
||||
:disabled="dialogMode === 'edit'"
|
||||
@blur="normalizeMaterialCode"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="包材名称" prop="material_name">
|
||||
<el-input v-model="formData.material_name" placeholder="请输入包材名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="包材类型" prop="material_type">
|
||||
<el-input v-model="formData.material_type" placeholder="如 纸箱、气泡袋" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="规格" prop="spec">
|
||||
<el-input v-model="formData.spec" placeholder="如 60×40×30cm" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="长度" prop="length">
|
||||
<el-input-number
|
||||
v-model="formData.length"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="宽度" prop="width">
|
||||
<el-input-number
|
||||
v-model="formData.width"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="高度" prop="height">
|
||||
<el-input-number
|
||||
v-model="formData.height"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input-number
|
||||
v-model="formData.weight"
|
||||
:min="0"
|
||||
:precision="3"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成本价" prop="cost_price">
|
||||
<el-input-number
|
||||
v-model="formData.cost_price"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="1">启用</el-radio>
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import {
|
||||
packageMaterialCreate,
|
||||
packageMaterialDelete,
|
||||
packageMaterialGet,
|
||||
packageMaterialUpdate
|
||||
} from '@/api/setting.packagematerial/packagematerial'
|
||||
import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import {
|
||||
buildPackageMaterialListPayload,
|
||||
parsePackageMaterialListResponse,
|
||||
formatDimensions,
|
||||
formatNumber,
|
||||
formatPackageMaterialStatus,
|
||||
normalizePackageMaterialScanConditionToWhere,
|
||||
packageMaterialColumns,
|
||||
packageMaterialScanFields,
|
||||
type PackageMaterialRecord
|
||||
} from './package-material-config'
|
||||
|
||||
const settingsStore = useSettingsStore()
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
|
||||
const presetTree = ref<any[]>([])
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(packageMaterialScanFields)))
|
||||
|
||||
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
|
||||
const containerHeight = computed(() =>
|
||||
shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)'
|
||||
)
|
||||
|
||||
const columns = packageMaterialColumns
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const batchDeleting = ref(false)
|
||||
const selectedIds = ref<number[]>([])
|
||||
const tableData = ref<PackageMaterialRecord[]>([])
|
||||
const queryTime = ref(0)
|
||||
const tableSize = ref<'small' | 'default' | 'large'>('small')
|
||||
const currentConditionRaw = ref<any>(null)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogMode = ref<'create' | 'edit'>('create')
|
||||
const formRef = ref<FormInstance>()
|
||||
const formData = reactive({
|
||||
id: undefined as number | undefined,
|
||||
material_code: '',
|
||||
material_name: '',
|
||||
material_type: '',
|
||||
spec: '',
|
||||
length: undefined as number | undefined,
|
||||
width: undefined as number | undefined,
|
||||
height: undefined as number | undefined,
|
||||
weight: undefined as number | undefined,
|
||||
cost_price: undefined as number | undefined,
|
||||
status: 1
|
||||
})
|
||||
|
||||
const rules: FormRules = {
|
||||
material_code: [{ required: true, message: '请输入包材编码', trigger: 'blur' }],
|
||||
material_name: [{ required: true, message: '请输入包材名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const isSuccess = (res: any) => res && [0, 1, 200].includes(res.code)
|
||||
|
||||
function normalizeMaterialCode() {
|
||||
formData.material_code = String(formData.material_code || '').trim().toUpperCase()
|
||||
}
|
||||
|
||||
function onSelectionChange(rows: PackageMaterialRecord[]) {
|
||||
selectedIds.value = (rows || [])
|
||||
.map((r) => r.id)
|
||||
.filter((id): id is number => id != null && Number.isFinite(Number(id)))
|
||||
.map((id) => Number(id))
|
||||
}
|
||||
|
||||
function pickOptionalNumber(value: number | undefined) {
|
||||
return value === undefined || value === null ? undefined : value
|
||||
}
|
||||
|
||||
function buildCreatePayload() {
|
||||
const payload: Record<string, unknown> = {
|
||||
material_code: formData.material_code.trim(),
|
||||
material_name: formData.material_name.trim(),
|
||||
status: formData.status
|
||||
}
|
||||
const materialType = formData.material_type.trim()
|
||||
const spec = formData.spec.trim()
|
||||
if (materialType) payload.material_type = materialType
|
||||
if (spec) payload.spec = spec
|
||||
const length = pickOptionalNumber(formData.length)
|
||||
const width = pickOptionalNumber(formData.width)
|
||||
const height = pickOptionalNumber(formData.height)
|
||||
const weight = pickOptionalNumber(formData.weight)
|
||||
const costPrice = pickOptionalNumber(formData.cost_price)
|
||||
if (length !== undefined) payload.length = length
|
||||
if (width !== undefined) payload.width = width
|
||||
if (height !== undefined) payload.height = height
|
||||
if (weight !== undefined) payload.weight = weight
|
||||
if (costPrice !== undefined) payload.cost_price = costPrice
|
||||
return payload
|
||||
}
|
||||
|
||||
function buildUpdatePayload() {
|
||||
if (!formData.id) return null
|
||||
const payload: Record<string, unknown> = { id: formData.id }
|
||||
const materialName = formData.material_name.trim()
|
||||
if (materialName) payload.material_name = materialName
|
||||
const materialType = formData.material_type.trim()
|
||||
const spec = formData.spec.trim()
|
||||
payload.material_type = materialType || ''
|
||||
payload.spec = spec || ''
|
||||
const length = pickOptionalNumber(formData.length)
|
||||
const width = pickOptionalNumber(formData.width)
|
||||
const height = pickOptionalNumber(formData.height)
|
||||
const weight = pickOptionalNumber(formData.weight)
|
||||
const costPrice = pickOptionalNumber(formData.cost_price)
|
||||
if (length !== undefined) payload.length = length
|
||||
if (width !== undefined) payload.width = width
|
||||
if (height !== undefined) payload.height = height
|
||||
if (weight !== undefined) payload.weight = weight
|
||||
if (costPrice !== undefined) payload.cost_price = costPrice
|
||||
payload.status = formData.status
|
||||
return payload
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const where = normalizePackageMaterialScanConditionToWhere(currentConditionRaw.value)
|
||||
const res: any = await packageMaterialGet(
|
||||
buildPackageMaterialListPayload({
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize,
|
||||
where
|
||||
})
|
||||
)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '获取包材列表失败')
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
return
|
||||
}
|
||||
const data = parsePackageMaterialListResponse(res)
|
||||
tableData.value = data.list
|
||||
pagination.total = data.total
|
||||
if (data.page) pagination.currentPage = data.page
|
||||
if (data.pageSize) pagination.pageSize = data.pageSize
|
||||
} catch {
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取包材列表失败')
|
||||
} finally {
|
||||
queryTime.value = Date.now() - start
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleConditionChange(condition: any) {
|
||||
currentConditionRaw.value = condition
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleConditionClear() {
|
||||
currentConditionRaw.value = null
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleConditionReset() {
|
||||
currentConditionRaw.value = null
|
||||
pagination.currentPage = 1
|
||||
if (scanBox.value?.reset) {
|
||||
scanBox.value.reset()
|
||||
} else if (scanBox.value?.clear) {
|
||||
scanBox.value.clear()
|
||||
}
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
pagination.currentPage = page
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handlePageSizeChange(size: number) {
|
||||
pagination.pageSize = size
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.id = undefined
|
||||
formData.material_code = ''
|
||||
formData.material_name = ''
|
||||
formData.material_type = ''
|
||||
formData.spec = ''
|
||||
formData.length = undefined
|
||||
formData.width = undefined
|
||||
formData.height = undefined
|
||||
formData.weight = undefined
|
||||
formData.cost_price = undefined
|
||||
formData.status = 1
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
function openCreate() {
|
||||
dialogMode.value = 'create'
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
}
|
||||
|
||||
function openEdit(row: PackageMaterialRecord) {
|
||||
if (!row.id) return
|
||||
dialogMode.value = 'edit'
|
||||
dialogVisible.value = true
|
||||
formData.id = row.id
|
||||
formData.material_code = row.material_code || ''
|
||||
formData.material_name = row.material_name || ''
|
||||
formData.material_type = row.material_type || ''
|
||||
formData.spec = row.spec || ''
|
||||
formData.length = row.length
|
||||
formData.width = row.width
|
||||
formData.height = row.height
|
||||
formData.weight = row.weight
|
||||
formData.cost_price = row.cost_price
|
||||
formData.status = row.status === 0 ? 0 : 1
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
if (!formRef.value || saving.value) return
|
||||
const valid = await formRef.value.validate().catch(() => false)
|
||||
if (!valid) return
|
||||
|
||||
normalizeMaterialCode()
|
||||
saving.value = true
|
||||
try {
|
||||
if (dialogMode.value === 'create') {
|
||||
const res: any = await packageMaterialCreate(buildCreatePayload() as any)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '新增失败')
|
||||
return
|
||||
}
|
||||
ElMessage.success('新增成功')
|
||||
} else {
|
||||
const payload = buildUpdatePayload()
|
||||
if (!payload) return
|
||||
const res: any = await packageMaterialUpdate(payload as any)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '更新失败')
|
||||
return
|
||||
}
|
||||
ElMessage.success('更新成功')
|
||||
}
|
||||
dialogVisible.value = false
|
||||
loadList()
|
||||
} catch {
|
||||
ElMessage.error('保存失败')
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteByIds(ids: number[]) {
|
||||
if (!ids.length) return
|
||||
const res: any = await packageMaterialDelete({ ids })
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '删除失败')
|
||||
return false
|
||||
}
|
||||
ElMessage.success('删除成功')
|
||||
return true
|
||||
}
|
||||
|
||||
function handleDelete(row: PackageMaterialRecord) {
|
||||
if (!row.id) return
|
||||
const name = row.material_name || row.material_code || String(row.id)
|
||||
ElMessageBox.confirm(`确认删除包材「${name}」吗?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
const ok = await deleteByIds([row.id as number])
|
||||
if (!ok) return
|
||||
if (tableData.value.length === 1 && pagination.currentPage > 1) {
|
||||
pagination.currentPage -= 1
|
||||
}
|
||||
selectedIds.value = selectedIds.value.filter((id) => id !== row.id)
|
||||
loadList()
|
||||
})
|
||||
.catch(() => undefined)
|
||||
}
|
||||
|
||||
function handleBatchDelete() {
|
||||
if (!selectedIds.value.length || batchDeleting.value) return
|
||||
ElMessageBox.confirm(`确认删除选中的 ${selectedIds.value.length} 条包材吗?`, '提示', {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
batchDeleting.value = true
|
||||
try {
|
||||
const ok = await deleteByIds([...selectedIds.value])
|
||||
if (!ok) return
|
||||
selectedIds.value = []
|
||||
if (upperTable.value?.clearSelection) {
|
||||
upperTable.value.clearSelection()
|
||||
}
|
||||
loadList()
|
||||
} finally {
|
||||
batchDeleting.value = false
|
||||
}
|
||||
})
|
||||
.catch(() => undefined)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.package-material-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
background-color: #f0f2f5;
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
padding: 5px 8px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
background-color: #fff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.upper-wrapper {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.upper-wrapper :deep(.upper-table-container) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
252
src/views/material/packageMaterial/package-material-config.ts
Normal file
252
src/views/material/packageMaterial/package-material-config.ts
Normal file
@ -0,0 +1,252 @@
|
||||
export type PackageMaterialRecord = {
|
||||
id?: number
|
||||
material_code?: string
|
||||
material_name?: string
|
||||
material_type?: string
|
||||
spec?: string
|
||||
length?: number
|
||||
width?: number
|
||||
height?: number
|
||||
weight?: number
|
||||
cost_price?: number
|
||||
status?: number
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
||||
export const packageMaterialColumns = [
|
||||
{ prop: 'id', label: 'ID', width: '80', sortable: true },
|
||||
{ prop: 'material_code', label: '包材编码', minWidth: '130', showOverflowTooltip: true },
|
||||
{ prop: 'material_name', label: '包材名称', minWidth: '150', showOverflowTooltip: true },
|
||||
{ prop: 'material_type', label: '包材类型', minWidth: '110', showOverflowTooltip: true },
|
||||
{ prop: 'spec', label: '规格', minWidth: '120', showOverflowTooltip: true },
|
||||
{ prop: 'dimensions', label: '尺寸(L×W×H)', minWidth: '140', align: 'center' },
|
||||
{ prop: 'weight', label: '重量', width: '90', align: 'right' },
|
||||
{ prop: 'cost_price', label: '成本价', width: '100', align: 'right' },
|
||||
{ prop: 'status', label: '状态', width: '90', align: 'center' },
|
||||
{ prop: 'actions', label: '操作', width: '150', align: 'center', fixed: 'right' }
|
||||
]
|
||||
|
||||
export const packageMaterialScanFields = [
|
||||
{
|
||||
value: 'quickWhere',
|
||||
label: '关键词',
|
||||
type: 'text',
|
||||
placeholder: '编码/名称/类型',
|
||||
operators: ['contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'material_code',
|
||||
label: '包材编码',
|
||||
type: 'text',
|
||||
placeholder: '请输入包材编码',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'material_name',
|
||||
label: '包材名称',
|
||||
type: 'text',
|
||||
placeholder: '请输入包材名称',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'material_type',
|
||||
label: '包材类型',
|
||||
type: 'text',
|
||||
placeholder: '请输入包材类型',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'status',
|
||||
label: '状态',
|
||||
type: 'select',
|
||||
clearable: true,
|
||||
options: [
|
||||
{ label: '启用', value: '1' },
|
||||
{ label: '停用', value: '0' }
|
||||
]
|
||||
},
|
||||
{
|
||||
value: 'id',
|
||||
label: 'ID',
|
||||
type: 'number',
|
||||
placeholder: '包材 ID',
|
||||
operators: ['eq', 'ne'],
|
||||
defaultOperator: 'eq'
|
||||
}
|
||||
]
|
||||
|
||||
function getFieldConfig(key: string, fields: typeof packageMaterialScanFields) {
|
||||
return fields.find((f) => f.value === key)
|
||||
}
|
||||
|
||||
function mapFieldType(type: string, value: unknown) {
|
||||
if (type === 'daterange' || Array.isArray(value)) return 'daterange'
|
||||
if (type === 'number' || typeof value === 'number') return 'number'
|
||||
return 'text'
|
||||
}
|
||||
|
||||
function processConditionValue(key: string, raw: any, fields: typeof packageMaterialScanFields) {
|
||||
if (key === 'quickWhere') {
|
||||
const val = raw?.value !== undefined ? raw.value : raw
|
||||
const text = val == null ? '' : String(val).trim()
|
||||
return text ? text : null
|
||||
}
|
||||
|
||||
const config = getFieldConfig(key, fields)
|
||||
const fieldType = config?.type || 'text'
|
||||
|
||||
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||
const op = raw.operator || (fieldType === 'select' ? 'eq' : fieldType === 'number' ? 'eq' : 'contains')
|
||||
const type = raw.type || mapFieldType(fieldType, raw.value)
|
||||
|
||||
if (['isnull', 'isnotnull'].includes(op)) {
|
||||
return { operator: op, value: null, type }
|
||||
}
|
||||
|
||||
const val = raw.value !== undefined ? raw.value : raw
|
||||
if (val === null || val === undefined || val === '' || (Array.isArray(val) && val.length === 0)) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (fieldType === 'select') {
|
||||
return { operator: op || 'eq', value: val, type: 'text' }
|
||||
}
|
||||
|
||||
return { operator: op, value: val, type }
|
||||
}
|
||||
|
||||
if (raw === null || raw === undefined || raw === '' || (Array.isArray(raw) && raw.length === 0)) {
|
||||
return null
|
||||
}
|
||||
|
||||
const simpleOp = fieldType === 'select' || fieldType === 'number' ? 'eq' : 'contains'
|
||||
return { operator: simpleOp, value: raw, type: mapFieldType(fieldType, raw) }
|
||||
}
|
||||
|
||||
export function normalizePackageMaterialScanConditionToWhere(
|
||||
condition: any,
|
||||
fields: typeof packageMaterialScanFields = packageMaterialScanFields
|
||||
): Record<string, unknown> {
|
||||
if (!condition) return {}
|
||||
|
||||
const conds =
|
||||
condition?.conditions && typeof condition.conditions === 'object'
|
||||
? condition.conditions
|
||||
: condition && typeof condition === 'object'
|
||||
? condition
|
||||
: null
|
||||
|
||||
if (!conds) return {}
|
||||
|
||||
const where: Record<string, unknown> = {}
|
||||
for (const key of Object.keys(conds)) {
|
||||
const result = processConditionValue(key, conds[key], fields)
|
||||
if (result == null) continue
|
||||
if (key === 'quickWhere' && typeof result === 'string') {
|
||||
where.quickWhere = result
|
||||
} else {
|
||||
where[key] = result
|
||||
}
|
||||
}
|
||||
return where
|
||||
}
|
||||
|
||||
export function formatPackageMaterialStatus(status: string | number | undefined) {
|
||||
const raw = String(status ?? '').trim()
|
||||
if (!raw) return { text: '--', type: 'info' as const }
|
||||
if (['1', 'ACTIVE', 'ENABLED', 'ENABLE'].includes(raw)) {
|
||||
return { text: '启用', type: 'success' as const }
|
||||
}
|
||||
if (['0', 'INACTIVE', 'DISABLED', 'DISABLE'].includes(raw)) {
|
||||
return { text: '停用', type: 'danger' as const }
|
||||
}
|
||||
return { text: String(status), type: 'info' as const }
|
||||
}
|
||||
|
||||
export function formatDimensions(row: PackageMaterialRecord): string {
|
||||
const parts = [row.length, row.width, row.height].map((v) => {
|
||||
if (v === null || v === undefined) return null
|
||||
return String(v)
|
||||
})
|
||||
const valid = parts.filter(Boolean)
|
||||
return valid.length ? valid.join(' × ') : '--'
|
||||
}
|
||||
|
||||
export function formatNumber(value: unknown, digits = 2): string {
|
||||
if (value === null || value === undefined || value === '') return '--'
|
||||
const num = Number(value)
|
||||
if (!Number.isFinite(num)) return String(value)
|
||||
return Number.isInteger(num) ? String(num) : num.toFixed(digits)
|
||||
}
|
||||
|
||||
export function buildPackageMaterialListPayload(options: {
|
||||
page: number
|
||||
pageSize: number
|
||||
where?: Record<string, unknown>
|
||||
}) {
|
||||
const payload: Record<string, unknown> = {
|
||||
page: options.page,
|
||||
pageSize: options.pageSize,
|
||||
pagination: {
|
||||
page: options.page,
|
||||
pageSize: options.pageSize
|
||||
}
|
||||
}
|
||||
if (options.where && Object.keys(options.where).length) {
|
||||
payload.where = options.where
|
||||
}
|
||||
return payload
|
||||
}
|
||||
|
||||
/** 兼容 setting.packageMaterial.get 扁平响应与 data 嵌套响应 */
|
||||
export function parsePackageMaterialListResponse(res: any): {
|
||||
list: PackageMaterialRecord[]
|
||||
total: number
|
||||
page?: number
|
||||
pageSize?: number
|
||||
} {
|
||||
const pick = (obj: any) => {
|
||||
if (Array.isArray(obj)) {
|
||||
return { list: obj as PackageMaterialRecord[], total: obj.length, page: undefined, pageSize: undefined }
|
||||
}
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return { list: [] as PackageMaterialRecord[], total: 0, page: undefined, pageSize: undefined }
|
||||
}
|
||||
const list = Array.isArray(obj.list)
|
||||
? obj.list
|
||||
: Array.isArray(obj.records)
|
||||
? obj.records
|
||||
: Array.isArray(obj.items)
|
||||
? obj.items
|
||||
: []
|
||||
const total = Number(obj.pagination?.total ?? obj.total ?? obj.count ?? 0)
|
||||
const page = Number(obj.page ?? obj.pagination?.page)
|
||||
const pageSize = Number(obj.page_size ?? obj.pageSize ?? obj.pagination?.pageSize)
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : list.length,
|
||||
page: Number.isFinite(page) && page > 0 ? page : undefined,
|
||||
pageSize: Number.isFinite(pageSize) && pageSize > 0 ? pageSize : undefined
|
||||
}
|
||||
}
|
||||
|
||||
const nested = res?.data
|
||||
if (Array.isArray(nested)) return pick(nested)
|
||||
if (
|
||||
nested &&
|
||||
typeof nested === 'object' &&
|
||||
(Array.isArray(nested.list) ||
|
||||
nested.total !== undefined ||
|
||||
nested.page !== undefined ||
|
||||
nested.page_size !== undefined)
|
||||
) {
|
||||
return pick(nested)
|
||||
}
|
||||
|
||||
return pick(res)
|
||||
}
|
||||
456
src/views/material/packageSupplier/index.vue
Normal file
456
src/views/material/packageSupplier/index.vue
Normal file
@ -0,0 +1,456 @@
|
||||
<template>
|
||||
<div class="package-supplier-container" :style="{ height: containerHeight }">
|
||||
<scan-box
|
||||
ref="scanBox"
|
||||
width="250px"
|
||||
:tree-props="{ children: 'children', label: 'label' }"
|
||||
:auto-submit="false"
|
||||
:preset-tree="presetTree"
|
||||
:available-fields="availableFieldsRef"
|
||||
@condition-change="handleConditionChange"
|
||||
@reset="handleConditionReset"
|
||||
@condition-clear="handleConditionClear"
|
||||
@submit="handleSubmit"
|
||||
/>
|
||||
|
||||
<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-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
|
||||
</div>
|
||||
<el-button type="success" size="small" @click="openCreate">新增供应商</el-button>
|
||||
</div>
|
||||
|
||||
<div class="upper-wrapper">
|
||||
<upper-table
|
||||
ref="upperTable"
|
||||
title="包装供应商列表"
|
||||
table-id="material-package-supplier"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-selection="true"
|
||||
:show-actions="true"
|
||||
:loading="loading"
|
||||
:query-time="queryTime"
|
||||
row-key="id"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="loadList"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="formatPackageSupplierStatus(row.status).type" size="small">
|
||||
{{ formatPackageSupplierStatus(row.status).text }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-actions="{ row }">
|
||||
<el-button link type="primary" size="small" @click.stop="openEdit(row)">编辑</el-button>
|
||||
<el-button link type="danger" size="small" @click.stop="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无供应商数据,可调整左侧筛选条件</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogMode === 'create' ? '新增包装供应商' : '编辑包装供应商'"
|
||||
width="560px"
|
||||
align-center
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form ref="formRef" :model="formData" :rules="rules" label-width="110px">
|
||||
<el-form-item label="供应商编码" prop="supplier_code">
|
||||
<el-input
|
||||
v-model="formData.supplier_code"
|
||||
placeholder="大写字母/数字,仓库内唯一"
|
||||
:disabled="dialogMode === 'edit'"
|
||||
@blur="normalizeSupplierCode"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="supplier_name">
|
||||
<el-input v-model="formData.supplier_name" placeholder="请输入供应商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contact_name">
|
||||
<el-input v-model="formData.contact_name" placeholder="选填" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="contact_phone">
|
||||
<el-input v-model="formData.contact_phone" placeholder="选填" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="1">启用</el-radio>
|
||||
<el-radio :label="0">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="saving" @click="submitForm">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import {
|
||||
packageSupplierCreate,
|
||||
packageSupplierDelete,
|
||||
packageSupplierGet,
|
||||
packageSupplierUpdate
|
||||
} from '@/api/setting.packagesupplier/packagesupplier'
|
||||
import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import {
|
||||
buildPackageSupplierListPayload,
|
||||
parsePackageSupplierListResponse,
|
||||
formatPackageSupplierStatus,
|
||||
normalizePackageSupplierScanConditionToWhere,
|
||||
packageSupplierColumns,
|
||||
packageSupplierScanFields,
|
||||
type PackageSupplierRecord
|
||||
} from './package-supplier-config'
|
||||
|
||||
const settingsStore = useSettingsStore()
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
|
||||
const presetTree = ref<any[]>([])
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(packageSupplierScanFields)))
|
||||
|
||||
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
|
||||
const containerHeight = computed(() =>
|
||||
shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)'
|
||||
)
|
||||
|
||||
const columns = packageSupplierColumns
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const batchDeleting = ref(false)
|
||||
const selectedIds = ref<number[]>([])
|
||||
const tableData = ref<PackageSupplierRecord[]>([])
|
||||
const queryTime = ref(0)
|
||||
const tableSize = ref<'small' | 'default' | 'large'>('small')
|
||||
const currentConditionRaw = ref<any>(null)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const dialogMode = ref<'create' | 'edit'>('create')
|
||||
const formRef = ref<FormInstance>()
|
||||
const formData = reactive({
|
||||
id: undefined as number | undefined,
|
||||
supplier_code: '',
|
||||
supplier_name: '',
|
||||
contact_name: '',
|
||||
contact_phone: '',
|
||||
status: 1
|
||||
})
|
||||
|
||||
const rules: FormRules = {
|
||||
supplier_code: [{ required: true, message: '请输入供应商编码', trigger: 'blur' }],
|
||||
supplier_name: [{ required: true, message: '请输入供应商名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const isSuccess = (res: any) => res && [0, 1, 200].includes(res.code)
|
||||
|
||||
function normalizeSupplierCode() {
|
||||
formData.supplier_code = String(formData.supplier_code || '').trim().toUpperCase()
|
||||
}
|
||||
|
||||
function onSelectionChange(rows: PackageSupplierRecord[]) {
|
||||
selectedIds.value = (rows || [])
|
||||
.map((r) => r.id)
|
||||
.filter((id): id is number => id != null && Number.isFinite(Number(id)))
|
||||
.map((id) => Number(id))
|
||||
}
|
||||
|
||||
function buildCreatePayload() {
|
||||
const payload: Record<string, unknown> = {
|
||||
supplier_code: formData.supplier_code.trim(),
|
||||
supplier_name: formData.supplier_name.trim(),
|
||||
status: formData.status
|
||||
}
|
||||
const contactName = formData.contact_name.trim()
|
||||
const contactPhone = formData.contact_phone.trim()
|
||||
if (contactName) payload.contact_name = contactName
|
||||
if (contactPhone) payload.contact_phone = contactPhone
|
||||
return payload
|
||||
}
|
||||
|
||||
function buildUpdatePayload() {
|
||||
if (!formData.id) return null
|
||||
const payload: Record<string, unknown> = { id: formData.id }
|
||||
const supplierName = formData.supplier_name.trim()
|
||||
if (supplierName) payload.supplier_name = supplierName
|
||||
payload.contact_name = formData.contact_name.trim()
|
||||
payload.contact_phone = formData.contact_phone.trim()
|
||||
payload.status = formData.status
|
||||
return payload
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const where = normalizePackageSupplierScanConditionToWhere(currentConditionRaw.value)
|
||||
const res: any = await packageSupplierGet(
|
||||
buildPackageSupplierListPayload({
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize,
|
||||
where
|
||||
})
|
||||
)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '获取供应商列表失败')
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
return
|
||||
}
|
||||
const data = parsePackageSupplierListResponse(res)
|
||||
tableData.value = data.list
|
||||
pagination.total = data.total
|
||||
if (data.page) pagination.currentPage = data.page
|
||||
if (data.pageSize) pagination.pageSize = data.pageSize
|
||||
} catch {
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取供应商列表失败')
|
||||
} finally {
|
||||
queryTime.value = Date.now() - start
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleConditionChange(condition: any) {
|
||||
currentConditionRaw.value = condition
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleSubmit() {
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleConditionClear() {
|
||||
currentConditionRaw.value = null
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleConditionReset() {
|
||||
currentConditionRaw.value = null
|
||||
pagination.currentPage = 1
|
||||
if (scanBox.value?.reset) {
|
||||
scanBox.value.reset()
|
||||
} else if (scanBox.value?.clear) {
|
||||
scanBox.value.clear()
|
||||
}
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
pagination.currentPage = page
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handlePageSizeChange(size: number) {
|
||||
pagination.pageSize = size
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.id = undefined
|
||||
formData.supplier_code = ''
|
||||
formData.supplier_name = ''
|
||||
formData.contact_name = ''
|
||||
formData.contact_phone = ''
|
||||
formData.status = 1
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
function openCreate() {
|
||||
dialogMode.value = 'create'
|
||||
dialogVisible.value = true
|
||||
resetForm()
|
||||
}
|
||||
|
||||
function openEdit(row: PackageSupplierRecord) {
|
||||
if (!row.id) return
|
||||
dialogMode.value = 'edit'
|
||||
dialogVisible.value = true
|
||||
formData.id = row.id
|
||||
formData.supplier_code = row.supplier_code || ''
|
||||
formData.supplier_name = row.supplier_name || ''
|
||||
formData.contact_name = row.contact_name || ''
|
||||
formData.contact_phone = row.contact_phone || ''
|
||||
formData.status = row.status === 0 ? 0 : 1
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
async function submitForm() {
|
||||
if (!formRef.value || saving.value) return
|
||||
const valid = await formRef.value.validate().catch(() => false)
|
||||
if (!valid) return
|
||||
|
||||
normalizeSupplierCode()
|
||||
saving.value = true
|
||||
try {
|
||||
if (dialogMode.value === 'create') {
|
||||
const res: any = await packageSupplierCreate(buildCreatePayload() as any)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '新增失败')
|
||||
return
|
||||
}
|
||||
ElMessage.success('新增成功')
|
||||
} else {
|
||||
const payload = buildUpdatePayload()
|
||||
if (!payload) return
|
||||
const res: any = await packageSupplierUpdate(payload as any)
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '更新失败')
|
||||
return
|
||||
}
|
||||
ElMessage.success('更新成功')
|
||||
}
|
||||
dialogVisible.value = false
|
||||
loadList()
|
||||
} catch {
|
||||
ElMessage.error('保存失败')
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteByIds(ids: number[]) {
|
||||
if (!ids.length) return
|
||||
const res: any = await packageSupplierDelete({ ids })
|
||||
if (!isSuccess(res)) {
|
||||
ElMessage.error(res?.message || '删除失败')
|
||||
return false
|
||||
}
|
||||
ElMessage.success('删除成功')
|
||||
return true
|
||||
}
|
||||
|
||||
function handleDelete(row: PackageSupplierRecord) {
|
||||
if (!row.id) return
|
||||
const name = row.supplier_name || row.supplier_code || String(row.id)
|
||||
ElMessageBox.confirm(`确认删除供应商「${name}」吗?`, '提示', { type: 'warning' })
|
||||
.then(async () => {
|
||||
const ok = await deleteByIds([row.id as number])
|
||||
if (!ok) return
|
||||
if (tableData.value.length === 1 && pagination.currentPage > 1) {
|
||||
pagination.currentPage -= 1
|
||||
}
|
||||
selectedIds.value = selectedIds.value.filter((id) => id !== row.id)
|
||||
loadList()
|
||||
})
|
||||
.catch(() => undefined)
|
||||
}
|
||||
|
||||
function handleBatchDelete() {
|
||||
if (!selectedIds.value.length || batchDeleting.value) return
|
||||
ElMessageBox.confirm(`确认删除选中的 ${selectedIds.value.length} 条供应商吗?`, '提示', {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(async () => {
|
||||
batchDeleting.value = true
|
||||
try {
|
||||
const ok = await deleteByIds([...selectedIds.value])
|
||||
if (!ok) return
|
||||
selectedIds.value = []
|
||||
if (upperTable.value?.clearSelection) {
|
||||
upperTable.value.clearSelection()
|
||||
}
|
||||
loadList()
|
||||
} finally {
|
||||
batchDeleting.value = false
|
||||
}
|
||||
})
|
||||
.catch(() => undefined)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.package-supplier-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
background-color: #f0f2f5;
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
padding: 5px 8px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
background-color: #fff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.upper-wrapper {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.upper-wrapper :deep(.upper-table-container) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
236
src/views/material/packageSupplier/package-supplier-config.ts
Normal file
236
src/views/material/packageSupplier/package-supplier-config.ts
Normal file
@ -0,0 +1,236 @@
|
||||
export type PackageSupplierRecord = {
|
||||
id?: number
|
||||
supplier_code?: string
|
||||
supplier_name?: string
|
||||
contact_name?: string
|
||||
contact_phone?: string
|
||||
status?: number
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
||||
export const packageSupplierColumns = [
|
||||
{ prop: 'id', label: 'ID', width: '80', sortable: true },
|
||||
{ prop: 'supplier_code', label: '供应商编码', minWidth: '130', showOverflowTooltip: true },
|
||||
{ prop: 'supplier_name', label: '供应商名称', minWidth: '160', showOverflowTooltip: true },
|
||||
{ prop: 'contact_name', label: '联系人', minWidth: '120', showOverflowTooltip: true },
|
||||
{ prop: 'contact_phone', label: '联系电话', minWidth: '140', showOverflowTooltip: true },
|
||||
{ prop: 'status', label: '状态', width: '90', align: 'center' },
|
||||
{ prop: 'actions', label: '操作', width: '150', align: 'center', fixed: 'right' }
|
||||
]
|
||||
|
||||
export const packageSupplierScanFields = [
|
||||
{
|
||||
value: 'quickWhere',
|
||||
label: '关键词',
|
||||
type: 'text',
|
||||
placeholder: '编码/名称/联系人/电话',
|
||||
operators: ['contains'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'supplier_code',
|
||||
label: '供应商编码',
|
||||
type: 'text',
|
||||
placeholder: '请输入供应商编码',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'supplier_name',
|
||||
label: '供应商名称',
|
||||
type: 'text',
|
||||
placeholder: '请输入供应商名称',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'contact_name',
|
||||
label: '联系人',
|
||||
type: 'text',
|
||||
placeholder: '请输入联系人',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'contact_phone',
|
||||
label: '联系电话',
|
||||
type: 'text',
|
||||
placeholder: '请输入联系电话',
|
||||
operators: ['eq', 'contains', 'like'],
|
||||
defaultOperator: 'contains'
|
||||
},
|
||||
{
|
||||
value: 'status',
|
||||
label: '状态',
|
||||
type: 'select',
|
||||
clearable: true,
|
||||
options: [
|
||||
{ label: '启用', value: '1' },
|
||||
{ label: '停用', value: '0' }
|
||||
]
|
||||
},
|
||||
{
|
||||
value: 'id',
|
||||
label: 'ID',
|
||||
type: 'number',
|
||||
placeholder: '供应商 ID',
|
||||
operators: ['eq', 'ne'],
|
||||
defaultOperator: 'eq'
|
||||
}
|
||||
]
|
||||
|
||||
function getFieldConfig(key: string, fields: typeof packageSupplierScanFields) {
|
||||
return fields.find((f) => f.value === key)
|
||||
}
|
||||
|
||||
function mapFieldType(type: string, value: unknown) {
|
||||
if (type === 'daterange' || Array.isArray(value)) return 'daterange'
|
||||
if (type === 'number' || typeof value === 'number') return 'number'
|
||||
return 'text'
|
||||
}
|
||||
|
||||
function processConditionValue(key: string, raw: any, fields: typeof packageSupplierScanFields) {
|
||||
if (key === 'quickWhere') {
|
||||
const val = raw?.value !== undefined ? raw.value : raw
|
||||
const text = val == null ? '' : String(val).trim()
|
||||
return text ? text : null
|
||||
}
|
||||
|
||||
const config = getFieldConfig(key, fields)
|
||||
const fieldType = config?.type || 'text'
|
||||
|
||||
if (raw && typeof raw === 'object' && !Array.isArray(raw)) {
|
||||
const op = raw.operator || (fieldType === 'select' ? 'eq' : fieldType === 'number' ? 'eq' : 'contains')
|
||||
const type = raw.type || mapFieldType(fieldType, raw.value)
|
||||
|
||||
if (['isnull', 'isnotnull'].includes(op)) {
|
||||
return { operator: op, value: null, type }
|
||||
}
|
||||
|
||||
const val = raw.value !== undefined ? raw.value : raw
|
||||
if (val === null || val === undefined || val === '' || (Array.isArray(val) && val.length === 0)) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (fieldType === 'select') {
|
||||
return { operator: op || 'eq', value: val, type: 'text' }
|
||||
}
|
||||
|
||||
return { operator: op, value: val, type }
|
||||
}
|
||||
|
||||
if (raw === null || raw === undefined || raw === '' || (Array.isArray(raw) && raw.length === 0)) {
|
||||
return null
|
||||
}
|
||||
|
||||
const simpleOp = fieldType === 'select' || fieldType === 'number' ? 'eq' : 'contains'
|
||||
return { operator: simpleOp, value: raw, type: mapFieldType(fieldType, raw) }
|
||||
}
|
||||
|
||||
export function normalizePackageSupplierScanConditionToWhere(
|
||||
condition: any,
|
||||
fields: typeof packageSupplierScanFields = packageSupplierScanFields
|
||||
): Record<string, unknown> {
|
||||
if (!condition) return {}
|
||||
|
||||
const conds =
|
||||
condition?.conditions && typeof condition.conditions === 'object'
|
||||
? condition.conditions
|
||||
: condition && typeof condition === 'object'
|
||||
? condition
|
||||
: null
|
||||
|
||||
if (!conds) return {}
|
||||
|
||||
const where: Record<string, unknown> = {}
|
||||
for (const key of Object.keys(conds)) {
|
||||
const result = processConditionValue(key, conds[key], fields)
|
||||
if (result == null) continue
|
||||
if (key === 'quickWhere' && typeof result === 'string') {
|
||||
where.quickWhere = result
|
||||
} else {
|
||||
where[key] = result
|
||||
}
|
||||
}
|
||||
return where
|
||||
}
|
||||
|
||||
export function formatPackageSupplierStatus(status: string | number | undefined) {
|
||||
const raw = String(status ?? '').trim()
|
||||
if (!raw) return { text: '--', type: 'info' as const }
|
||||
if (['1', 'ACTIVE', 'ENABLED', 'ENABLE'].includes(raw)) {
|
||||
return { text: '启用', type: 'success' as const }
|
||||
}
|
||||
if (['0', 'INACTIVE', 'DISABLED', 'DISABLE'].includes(raw)) {
|
||||
return { text: '停用', type: 'danger' as const }
|
||||
}
|
||||
return { text: String(status), type: 'info' as const }
|
||||
}
|
||||
|
||||
export function buildPackageSupplierListPayload(options: {
|
||||
page: number
|
||||
pageSize: number
|
||||
where?: Record<string, unknown>
|
||||
}) {
|
||||
const payload: Record<string, unknown> = {
|
||||
page: options.page,
|
||||
pageSize: options.pageSize,
|
||||
pagination: {
|
||||
page: options.page,
|
||||
pageSize: options.pageSize
|
||||
}
|
||||
}
|
||||
if (options.where && Object.keys(options.where).length) {
|
||||
payload.where = options.where
|
||||
}
|
||||
return payload
|
||||
}
|
||||
|
||||
/** 兼容 setting.packageSupplier.get 扁平响应与 data 嵌套响应 */
|
||||
export function parsePackageSupplierListResponse(res: any): {
|
||||
list: PackageSupplierRecord[]
|
||||
total: number
|
||||
page?: number
|
||||
pageSize?: number
|
||||
} {
|
||||
const pick = (obj: any) => {
|
||||
if (Array.isArray(obj)) {
|
||||
return { list: obj as PackageSupplierRecord[], total: obj.length, page: undefined, pageSize: undefined }
|
||||
}
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return { list: [] as PackageSupplierRecord[], total: 0, page: undefined, pageSize: undefined }
|
||||
}
|
||||
const list = Array.isArray(obj.list)
|
||||
? obj.list
|
||||
: Array.isArray(obj.records)
|
||||
? obj.records
|
||||
: Array.isArray(obj.items)
|
||||
? obj.items
|
||||
: []
|
||||
const total = Number(obj.pagination?.total ?? obj.total ?? obj.count ?? 0)
|
||||
const page = Number(obj.page ?? obj.pagination?.page)
|
||||
const pageSize = Number(obj.page_size ?? obj.pageSize ?? obj.pagination?.pageSize)
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : list.length,
|
||||
page: Number.isFinite(page) && page > 0 ? page : undefined,
|
||||
pageSize: Number.isFinite(pageSize) && pageSize > 0 ? pageSize : undefined
|
||||
}
|
||||
}
|
||||
|
||||
const nested = res?.data
|
||||
if (Array.isArray(nested)) return pick(nested)
|
||||
if (
|
||||
nested &&
|
||||
typeof nested === 'object' &&
|
||||
(Array.isArray(nested.list) ||
|
||||
nested.total !== undefined ||
|
||||
nested.page !== undefined ||
|
||||
nested.page_size !== undefined)
|
||||
) {
|
||||
return pick(nested)
|
||||
}
|
||||
|
||||
return pick(res)
|
||||
}
|
||||
@ -82,7 +82,7 @@
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="履约记录" name="fulfillment" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
@ -112,6 +112,17 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -137,7 +148,8 @@ import {
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -152,7 +164,6 @@ const activeTab = ref('detail')
|
||||
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -221,21 +232,12 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizeArchiveListWhere(where)
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
where: buildWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
@ -282,6 +284,43 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizeArchiveListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'archiveOrder',
|
||||
buildWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '归档订单',
|
||||
storageKey: 'orderManagement:archiveOrder:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes, expressRes]: any = await Promise.all([
|
||||
@ -339,36 +378,18 @@ function onQuickSearch() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `归档订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openColumnConfigPanel() {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
}
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({}))
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoSelection: selectionRows.value.length === 0
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
|
||||
@ -377,6 +398,7 @@ const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
const { actionMap: toolbarActionMap } = createSimpleListToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible
|
||||
})
|
||||
|
||||
@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="express-waybill-panel" v-loading="loading">
|
||||
<template v-if="orderId">
|
||||
<div class="toolbar">
|
||||
<el-button size="small" :loading="loading" @click="loadDetail">刷新运单</el-button>
|
||||
<el-tag v-if="waybillCodesText" size="small" type="info">运单汇总:{{ waybillCodesText }}</el-tag>
|
||||
</div>
|
||||
|
||||
<el-table :data="expressRows" border stripe size="small" empty-text="暂无运单信息">
|
||||
<el-table-column prop="waybill_code" label="运单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="logistics_name" label="物流公司" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="称重(kg)" width="110" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ formatWeight(row.weighing_weight) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="包材" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ row.package_material_name_snapshot || row.package_material_code || '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="openWeighingDialog(row)">称重</el-button>
|
||||
<el-button link type="success" size="small" @click="openBindDialog(row)">绑定包材</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
<div v-else class="empty-tip">请从上方列表中选择订单</div>
|
||||
|
||||
<el-dialog v-model="weighingDialogVisible" title="更新运单称重" width="420px" align-center @closed="resetWeighingForm">
|
||||
<el-form label-width="96px">
|
||||
<el-form-item label="运单号">
|
||||
<el-input :model-value="weighingForm.waybill_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="称重(kg)">
|
||||
<el-input-number
|
||||
v-model="weighingForm.weighing_weight"
|
||||
:min="0.001"
|
||||
:precision="3"
|
||||
:step="0.1"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="weighingDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="weighingSaving" @click="submitWeighing">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="bindDialogVisible" title="绑定运单包材" width="480px" align-center @closed="resetBindForm">
|
||||
<el-form label-width="96px">
|
||||
<el-form-item label="运单号">
|
||||
<el-input :model-value="bindForm.waybill_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="包材编码">
|
||||
<el-select
|
||||
v-model="bindForm.package_material_code"
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
reserve-keyword
|
||||
placeholder="输入编码/名称搜索"
|
||||
:remote-method="searchPackageMaterials"
|
||||
:loading="materialLoading"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.material_code"
|
||||
:label="`${item.material_code} / ${item.material_name}`"
|
||||
:value="item.material_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="bindDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="bindSaving" @click="submitBind">绑定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {
|
||||
orderBindExpressPackageMaterial,
|
||||
orderDetail,
|
||||
orderUpdateExpressWeighingWeight
|
||||
} from '@/api/order.index/orderindex'
|
||||
import { packageMaterialGet } from '@/api/setting.packagematerial/packagematerial'
|
||||
import { isOrderIndexApiSuccess, parseOrderDetailPayload } from '../utils/order-index-helpers'
|
||||
import { parsePackageMaterialListResponse } from '@/views/material/packageMaterial/package-material-config'
|
||||
|
||||
const props = defineProps<{
|
||||
row: Record<string, any> | null
|
||||
tableType?: string
|
||||
}>()
|
||||
|
||||
const loading = ref(false)
|
||||
const weighingSaving = ref(false)
|
||||
const bindSaving = ref(false)
|
||||
const materialLoading = ref(false)
|
||||
const weighingDialogVisible = ref(false)
|
||||
const bindDialogVisible = ref(false)
|
||||
const expressRows = ref<any[]>([])
|
||||
const waybillCodesText = ref('')
|
||||
const materialOptions = ref<Array<{ material_code: string; material_name: string }>>([])
|
||||
|
||||
const weighingForm = reactive({
|
||||
waybill_code: '',
|
||||
weighing_weight: undefined as number | undefined
|
||||
})
|
||||
|
||||
const bindForm = reactive({
|
||||
waybill_code: '',
|
||||
package_material_code: ''
|
||||
})
|
||||
|
||||
const orderId = computed(() => props.row?.id)
|
||||
|
||||
function formatWeight(value: unknown) {
|
||||
if (value === null || value === undefined || value === '') return '—'
|
||||
const num = Number(value)
|
||||
return Number.isFinite(num) ? String(num) : String(value)
|
||||
}
|
||||
|
||||
function normalizeExpressRows(data: Record<string, any>) {
|
||||
const expresses = Array.isArray(data.expresses) ? data.expresses : []
|
||||
if (expresses.length) {
|
||||
return expresses.map((item: any) => ({
|
||||
waybill_code: String(item.waybill_code || item.express_code || item.code || '').trim(),
|
||||
logistics_name: item.logistics_name || item.logisticsName || '',
|
||||
weighing_weight: item.weighing_weight,
|
||||
package_material_code: item.package_material_code,
|
||||
package_material_name_snapshot: item.package_material_name_snapshot
|
||||
})).filter((item) => item.waybill_code)
|
||||
}
|
||||
|
||||
const codes = Array.isArray(data.waybill_codes)
|
||||
? data.waybill_codes
|
||||
: Array.isArray(data.order?.waybill_codes)
|
||||
? data.order.waybill_codes
|
||||
: []
|
||||
if (codes.length) {
|
||||
return codes.map((code: any) => ({
|
||||
waybill_code: String(code).trim(),
|
||||
logistics_name: data.order?.logistics_name || data.detail?.logistics_name || '',
|
||||
weighing_weight: undefined,
|
||||
package_material_code: '',
|
||||
package_material_name_snapshot: ''
|
||||
}))
|
||||
}
|
||||
|
||||
const expressCode = data.order?.express_code || data.detail?.express_code
|
||||
if (expressCode) {
|
||||
return [{
|
||||
waybill_code: String(expressCode).trim(),
|
||||
logistics_name: data.order?.logistics_name || data.detail?.logistics_name || '',
|
||||
weighing_weight: undefined,
|
||||
package_material_code: '',
|
||||
package_material_name_snapshot: ''
|
||||
}]
|
||||
}
|
||||
return []
|
||||
}
|
||||
|
||||
async function loadDetail() {
|
||||
if (!orderId.value) {
|
||||
expressRows.value = []
|
||||
waybillCodesText.value = ''
|
||||
return
|
||||
}
|
||||
loading.value = true
|
||||
try {
|
||||
const res: any = await orderDetail({
|
||||
id: orderId.value,
|
||||
ids: [orderId.value],
|
||||
tableType: props.tableType || 'order'
|
||||
})
|
||||
if (!isOrderIndexApiSuccess(res)) {
|
||||
throw new Error(res?.message || '获取运单信息失败')
|
||||
}
|
||||
const data = parseOrderDetailPayload(res)
|
||||
expressRows.value = normalizeExpressRows(data)
|
||||
waybillCodesText.value = expressRows.value.map((item) => item.waybill_code).join(', ')
|
||||
} catch (error: any) {
|
||||
expressRows.value = []
|
||||
waybillCodesText.value = ''
|
||||
ElMessage.error(error?.message || '获取运单信息失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openWeighingDialog(row: any) {
|
||||
weighingForm.waybill_code = row.waybill_code
|
||||
weighingForm.weighing_weight = row.weighing_weight ? Number(row.weighing_weight) : undefined
|
||||
weighingDialogVisible.value = true
|
||||
}
|
||||
|
||||
function openBindDialog(row: any) {
|
||||
bindForm.waybill_code = row.waybill_code
|
||||
bindForm.package_material_code = row.package_material_code || ''
|
||||
materialOptions.value = []
|
||||
bindDialogVisible.value = true
|
||||
if (bindForm.package_material_code) {
|
||||
searchPackageMaterials(bindForm.package_material_code)
|
||||
}
|
||||
}
|
||||
|
||||
function resetWeighingForm() {
|
||||
weighingForm.waybill_code = ''
|
||||
weighingForm.weighing_weight = undefined
|
||||
}
|
||||
|
||||
function resetBindForm() {
|
||||
bindForm.waybill_code = ''
|
||||
bindForm.package_material_code = ''
|
||||
materialOptions.value = []
|
||||
}
|
||||
|
||||
async function searchPackageMaterials(query: string) {
|
||||
const keyword = String(query || '').trim()
|
||||
if (!keyword) {
|
||||
materialOptions.value = []
|
||||
return
|
||||
}
|
||||
materialLoading.value = true
|
||||
try {
|
||||
const res: any = await packageMaterialGet({
|
||||
pagination: { page: 1, pageSize: 50 },
|
||||
where: { quickWhere: keyword }
|
||||
})
|
||||
const data = parsePackageMaterialListResponse(res)
|
||||
materialOptions.value = (data.list || [])
|
||||
.map((item: any) => ({
|
||||
material_code: String(item.material_code || '').trim(),
|
||||
material_name: String(item.material_name || '').trim()
|
||||
}))
|
||||
.filter((item) => item.material_code)
|
||||
} catch {
|
||||
materialOptions.value = []
|
||||
} finally {
|
||||
materialLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function submitWeighing() {
|
||||
if (!orderId.value || weighingSaving.value) return
|
||||
if (!weighingForm.weighing_weight || weighingForm.weighing_weight <= 0) {
|
||||
ElMessage.warning('请输入大于 0 的称重重量')
|
||||
return
|
||||
}
|
||||
weighingSaving.value = true
|
||||
try {
|
||||
const payload: Record<string, unknown> = {
|
||||
order_id: orderId.value,
|
||||
weighing_weight: weighingForm.weighing_weight
|
||||
}
|
||||
if (expressRows.value.length > 1 || weighingForm.waybill_code) {
|
||||
payload.waybill_code = weighingForm.waybill_code
|
||||
}
|
||||
const res: any = await orderUpdateExpressWeighingWeight(payload as any)
|
||||
if (!isOrderIndexApiSuccess(res)) {
|
||||
throw new Error(res?.message || '更新称重失败')
|
||||
}
|
||||
ElMessage.success('称重重量已更新')
|
||||
weighingDialogVisible.value = false
|
||||
await loadDetail()
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error?.message || '更新称重失败')
|
||||
} finally {
|
||||
weighingSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function submitBind() {
|
||||
if (!orderId.value || bindSaving.value) return
|
||||
const code = String(bindForm.package_material_code || '').trim().toUpperCase()
|
||||
if (!code) {
|
||||
ElMessage.warning('请选择包材编码')
|
||||
return
|
||||
}
|
||||
bindSaving.value = true
|
||||
try {
|
||||
const res: any = await orderBindExpressPackageMaterial({
|
||||
order_id: orderId.value,
|
||||
waybill_code: bindForm.waybill_code,
|
||||
package_material_code: code
|
||||
})
|
||||
if (!isOrderIndexApiSuccess(res)) {
|
||||
throw new Error(res?.message || '绑定包材失败')
|
||||
}
|
||||
ElMessage.success('包材绑定成功')
|
||||
bindDialogVisible.value = false
|
||||
await loadDetail()
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error?.message || '绑定包材失败')
|
||||
} finally {
|
||||
bindSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => orderId.value,
|
||||
() => {
|
||||
loadDetail()
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.express-waybill-panel {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:model-value="visible"
|
||||
title="订单导出进度"
|
||||
width="520px"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
:show-close="!loading"
|
||||
@update:model-value="emit('update:visible', $event)"
|
||||
>
|
||||
<div class="export-progress-panel">
|
||||
<el-progress
|
||||
:percentage="progressPercent"
|
||||
:status="progressStatus"
|
||||
:stroke-width="16"
|
||||
striped
|
||||
striped-flow
|
||||
/>
|
||||
<div class="export-progress-panel__meta">
|
||||
<span>任务状态:{{ statusLabel }}</span>
|
||||
<span>任务ID:{{ taskId || '—' }}</span>
|
||||
</div>
|
||||
<div v-if="message || error" class="export-progress-panel__message">
|
||||
{{ error || message }}
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button :disabled="loading" @click="emit('update:visible', false)">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
visible: boolean
|
||||
loading: boolean
|
||||
progressPercent: number
|
||||
progressStatus?: '' | 'success' | 'exception' | 'warning'
|
||||
statusLabel: string
|
||||
taskId: string
|
||||
message: string
|
||||
error: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.export-progress-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.export-progress-panel__meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
color: #606266;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.export-progress-panel__message {
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
title="订单统一查询(order.list)"
|
||||
width="1180px"
|
||||
align-center
|
||||
destroy-on-close
|
||||
@open="handleOpen"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<div class="workbench-list-dialog">
|
||||
<div class="toolbar">
|
||||
<el-input
|
||||
v-model="quickSearch"
|
||||
size="small"
|
||||
clearable
|
||||
placeholder="发货单号关键词"
|
||||
style="width: 240px"
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
<el-button size="small" type="primary" :loading="loading" @click="handleSearch">查询</el-button>
|
||||
<el-tag size="small" type="info">共 {{ pagination.total }} 条</el-tag>
|
||||
</div>
|
||||
|
||||
<div class="split-layout">
|
||||
<div class="list-pane">
|
||||
<upper-table
|
||||
title="订单总列表"
|
||||
table-id="order-workbench-list"
|
||||
:data="list"
|
||||
:columns="columns"
|
||||
table-size="small"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:loading="loading"
|
||||
:query-time="queryTime"
|
||||
row-key="id"
|
||||
highlight-current-row
|
||||
@current-change="handleRowClick"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="loadList"
|
||||
>
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="getTagType('status', row.status)" size="small">
|
||||
{{ translateOrderField('status', row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无订单数据,可调整筛选条件后查询</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
<div class="detail-pane">
|
||||
<div class="detail-pane__title">订单详情(order.detail)</div>
|
||||
<workbench-order-detail :row="selectedRow" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import { orderList } from '@/api/order.index/orderindex'
|
||||
import WorkbenchOrderDetail from './WorkbenchOrderDetail.vue'
|
||||
import {
|
||||
getTagType,
|
||||
translateOrderField,
|
||||
workbenchColumns
|
||||
} from '../config/order-common-config'
|
||||
import {
|
||||
buildOrderWhereConditions,
|
||||
parseOrderListResponse,
|
||||
sanitizeOrderListWhere
|
||||
} from '../utils/order-index-helpers'
|
||||
|
||||
const dialogVisible = defineModel<boolean>({ default: false })
|
||||
|
||||
const loading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
const quickSearch = ref('')
|
||||
const list = ref<any[]>([])
|
||||
const selectedId = ref<number | string | null>(null)
|
||||
const columns = workbenchColumns
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
|
||||
const selectedRow = computed(() => {
|
||||
return list.value.find((item) => item.id === selectedId.value) || null
|
||||
})
|
||||
|
||||
function buildWhere() {
|
||||
const where = sanitizeOrderListWhere(
|
||||
buildOrderWhereConditions(
|
||||
quickSearch.value
|
||||
? {
|
||||
delivery_order_code: {
|
||||
operator: 'contains',
|
||||
value: quickSearch.value.trim(),
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
: {}
|
||||
)
|
||||
)
|
||||
return where
|
||||
}
|
||||
|
||||
async function loadList() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const res: any = await orderList({
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where: buildWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}
|
||||
})
|
||||
const data = parseOrderListResponse(res)
|
||||
list.value = data.list
|
||||
pagination.total = data.total
|
||||
pagination.currentPage = data.page
|
||||
pagination.pageSize = data.pageSize
|
||||
if (selectedId.value && !list.value.some((item) => item.id === selectedId.value)) {
|
||||
selectedId.value = list.value[0]?.id ?? null
|
||||
}
|
||||
} catch {
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
ElMessage.error('获取订单总列表失败')
|
||||
} finally {
|
||||
queryTime.value = Date.now() - start
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
pagination.currentPage = page
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handlePageSizeChange(size: number) {
|
||||
pagination.pageSize = size
|
||||
pagination.currentPage = 1
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleRowClick(row: any) {
|
||||
selectedId.value = row?.id ?? null
|
||||
}
|
||||
|
||||
function handleOpen() {
|
||||
pagination.currentPage = 1
|
||||
selectedId.value = null
|
||||
loadList()
|
||||
}
|
||||
|
||||
function handleClosed() {
|
||||
quickSearch.value = ''
|
||||
list.value = []
|
||||
selectedId.value = null
|
||||
pagination.total = 0
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.workbench-list-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
min-height: 560px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.split-layout {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
|
||||
gap: 12px;
|
||||
min-height: 520px;
|
||||
}
|
||||
|
||||
.list-pane,
|
||||
.detail-pane {
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.list-pane :deep(.upper-table-container) {
|
||||
height: 520px;
|
||||
}
|
||||
|
||||
.detail-pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.detail-pane__title {
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.detail-pane :deep(.workbench-order-detail) {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
padding: 16px;
|
||||
}
|
||||
</style>
|
||||
@ -41,7 +41,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
||||
import { orderManualOutboundOrder } from '@/api/order.index/orderindex'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'success', data: any): void
|
||||
@ -80,7 +80,7 @@ async function submitManualOutbound() {
|
||||
manualLoading.value = true
|
||||
emit('loading-change', true)
|
||||
try {
|
||||
const res: any = await orderOutboundOrder.manualOutboundOrder(buildPayload())
|
||||
const res: any = await orderManualOutboundOrder(buildPayload())
|
||||
if (!res || ![1, 200].includes(res.code)) {
|
||||
throw new Error(res?.message || '手动出库迁移失败')
|
||||
}
|
||||
|
||||
@ -63,6 +63,7 @@
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { orderDetail } from '@/api/order.index/orderindex'
|
||||
import { parseOrderDetailPayload } from '../utils/order-index-helpers'
|
||||
|
||||
const props = defineProps<{
|
||||
row: Record<string, any> | null
|
||||
@ -152,7 +153,7 @@ async function loadDetail() {
|
||||
if (!response || ![1, 200].includes(response.code)) {
|
||||
throw new Error(response?.message || 'order.detail 请求失败')
|
||||
}
|
||||
const data = response.data || {}
|
||||
const data = parseOrderDetailPayload(response)
|
||||
detailOrder.value = data.order || data.detail || null
|
||||
orderItems.value = normalizeItems(data)
|
||||
expresses.value = normalizeExpresses(data)
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</el-button-group>
|
||||
|
||||
<el-table
|
||||
:data="displayRows"
|
||||
:data="tableData"
|
||||
border
|
||||
stripe
|
||||
style="width: 100%; height: 100%"
|
||||
@ -100,23 +100,15 @@ import { computed, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Refresh } from '@element-plus/icons-vue'
|
||||
import RequestData from '@/components/RequestData/index.vue'
|
||||
import { orderQueryOrderLogList } from '@/api/order.index/orderindex'
|
||||
import { orderQueryOrderLogs } from '@/api/order.index/orderindex'
|
||||
|
||||
const props = defineProps<{
|
||||
/** 当前选中订单行(与其它订单页一致,使用 id 作为 order_id) */
|
||||
data?: Record<string, any> | null
|
||||
/**
|
||||
* 自定义日志查询(兼容旧 order.queryOrderLogs 分页形态)。
|
||||
* 不传时默认调用 order.queryOrderLogList,并在前端对 list 分页展示。
|
||||
*/
|
||||
request?: ((params: { id: string; page?: number; pageSize?: number }) => Promise<any>) | null
|
||||
}>()
|
||||
|
||||
const loading = ref(false)
|
||||
/** 默认接口:全量列表,前端分页 */
|
||||
const allRows = ref<any[]>([])
|
||||
/** 自定义 request:服务端当前页 */
|
||||
const serverRows = ref<any[]>([])
|
||||
const tableData = ref<any[]>([])
|
||||
|
||||
const showRequestData = ref(false)
|
||||
const requestId = ref(0)
|
||||
@ -128,20 +120,12 @@ const pagination = reactive({
|
||||
total: 0
|
||||
})
|
||||
|
||||
const useServerPagination = computed(() => typeof props.request === 'function')
|
||||
|
||||
const orderId = computed(() => {
|
||||
const id = props.data?.id
|
||||
if (id === undefined || id === null || id === '') return ''
|
||||
return String(id)
|
||||
})
|
||||
|
||||
const displayRows = computed(() => {
|
||||
if (useServerPagination.value) return serverRows.value
|
||||
const start = (pagination.page - 1) * pagination.pageSize
|
||||
return allRows.value.slice(start, start + pagination.pageSize)
|
||||
})
|
||||
|
||||
function extractLogListPayload(res: any): { list: any[]; total: number } {
|
||||
if (!res) return { list: [], total: 0 }
|
||||
const inner = res.data && typeof res.data === 'object' && !Array.isArray(res.data) ? res.data : res
|
||||
@ -179,10 +163,9 @@ watch(
|
||||
(newOrderId) => {
|
||||
if (newOrderId) {
|
||||
pagination.page = 1
|
||||
loadLogsFromServer()
|
||||
loadOrderLogs()
|
||||
} else {
|
||||
allRows.value = []
|
||||
serverRows.value = []
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
},
|
||||
@ -191,49 +174,40 @@ watch(
|
||||
|
||||
async function handlePageChange(page: number) {
|
||||
pagination.page = page
|
||||
if (useServerPagination.value) await loadLogsFromServer()
|
||||
await loadOrderLogs()
|
||||
}
|
||||
|
||||
async function handlePageSizeChange(pageSize: number) {
|
||||
pagination.pageSize = pageSize
|
||||
pagination.page = 1
|
||||
if (useServerPagination.value) await loadLogsFromServer()
|
||||
await loadOrderLogs()
|
||||
}
|
||||
|
||||
async function handleRefresh() {
|
||||
pagination.page = 1
|
||||
await loadLogsFromServer()
|
||||
await loadOrderLogs()
|
||||
}
|
||||
|
||||
async function loadLogsFromServer() {
|
||||
async function loadOrderLogs() {
|
||||
if (!orderId.value) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
if (useServerPagination.value && props.request) {
|
||||
const response: any = await props.request({
|
||||
id: orderId.value,
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize
|
||||
})
|
||||
if (!response || ![1, 200].includes(response.code)) {
|
||||
throw new Error(response?.message || '请求失败')
|
||||
}
|
||||
const { list, total } = extractLogListPayload(response)
|
||||
serverRows.value = list
|
||||
pagination.total = total
|
||||
} else {
|
||||
// 成功态已在 request 拦截器中校验(code ∈ SUCCESS_CODES)
|
||||
const response: any = await orderQueryOrderLogList({ id: orderId.value })
|
||||
const { list, total } = extractLogListPayload(response)
|
||||
allRows.value = list
|
||||
pagination.total = total
|
||||
const response: any = await orderQueryOrderLogs({
|
||||
id: orderId.value,
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize
|
||||
})
|
||||
if (response && ![1, 200].includes(response.code)) {
|
||||
throw new Error(response?.message || '请求失败')
|
||||
}
|
||||
const { list, total } = extractLogListPayload(response)
|
||||
tableData.value = list
|
||||
pagination.total = total
|
||||
} catch (error: any) {
|
||||
console.error('order logs query failed:', error)
|
||||
ElMessage.error(error?.message || '获取订单操作日志失败')
|
||||
allRows.value = []
|
||||
serverRows.value = []
|
||||
console.error('order.queryOrderLogs failed:', error)
|
||||
ElMessage.error(error?.message || '获取订单日志失败')
|
||||
tableData.value = []
|
||||
pagination.total = 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
|
||||
@ -209,6 +209,14 @@ export interface ToolbarApiActionConfig {
|
||||
export const ORDER_TOOLBAR_BUTTONS: Record<string, ToolbarButtonConfig> = {
|
||||
refresh: { key: 'refresh', label: '刷新', type: 'primary', size: 'small', action: 'loadData' },
|
||||
export: { key: 'export', label: '导出', size: 'small', loadingKey: 'exportLoading', action: 'handleExport' },
|
||||
exportSelection: {
|
||||
key: 'exportSelection',
|
||||
label: '导出选中',
|
||||
size: 'small',
|
||||
loadingKey: 'exportSelectionLoading',
|
||||
disabledKey: 'hasNoSelection',
|
||||
action: 'handleExportSelection'
|
||||
},
|
||||
columnConfig: { key: 'columnConfig', label: '字段设置', size: 'small', action: 'openColumnConfigPanel' },
|
||||
toggleDetail: { key: 'toggleDetail', label: '显示详情', dynamicLabelKey: 'detailToggleLabel', size: 'small', action: 'toggleDetailVisible' },
|
||||
reverseReview: { key: 'reverseReview', label: '反审回待审核', size: 'small', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleReverseReview' },
|
||||
@ -443,6 +451,7 @@ export const ORDER_DETAIL_TIME_FIELDS = new Set([
|
||||
export const simpleListToolbarButtonKeys = [
|
||||
'refresh',
|
||||
'export',
|
||||
'exportSelection',
|
||||
'columnConfig',
|
||||
'toggleDetail'
|
||||
]
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="履约记录" name="fulfillment" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
@ -112,6 +112,17 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -137,7 +148,8 @@ import {
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -152,7 +164,6 @@ const activeTab = ref('detail')
|
||||
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -221,21 +232,12 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizeDeliveryExpectionListWhere(where)
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
where: buildWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
@ -282,6 +284,43 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizeDeliveryExpectionListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'deliveryException',
|
||||
buildWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '配送异常',
|
||||
storageKey: 'orderManagement:deliveryException:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes, expressRes]: any = await Promise.all([
|
||||
@ -339,36 +378,18 @@ function onQuickSearch() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `配送异常-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openColumnConfigPanel() {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
}
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({}))
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoSelection: selectionRows.value.length === 0
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
|
||||
@ -377,6 +398,7 @@ const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
const { actionMap: toolbarActionMap } = createSimpleListToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible
|
||||
})
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
@ -159,6 +159,17 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -184,7 +195,8 @@ import {
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -196,7 +208,6 @@ const availableFieldsRef = reactive(JSON.parse(JSON.stringify(deliveryAvailableF
|
||||
const activeTab = ref('detail')
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -313,21 +324,12 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizeDeliveryListWhere(where)
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
where: buildWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
@ -374,6 +376,43 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizeDeliveryListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'deliveryOrder',
|
||||
buildWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '配送订单',
|
||||
storageKey: 'orderManagement:deliveryOrder:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
function handleConditionChange() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
@ -414,36 +453,18 @@ function onQuickSearch() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `配送订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openColumnConfigPanel() {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
}
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({}))
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoSelection: selectionRows.value.length === 0
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
|
||||
@ -452,6 +473,7 @@ const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
const { actionMap: toolbarActionMap } = createSimpleListToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible
|
||||
})
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="履约记录" name="fulfillment" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
@ -112,6 +112,17 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -137,7 +148,8 @@ import {
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -152,7 +164,6 @@ const activeTab = ref('detail')
|
||||
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -221,21 +232,12 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizeEntrustListWhere(where)
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
where: buildWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
@ -282,6 +284,43 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizeEntrustListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'entrustWarehouse',
|
||||
buildWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '委托外仓',
|
||||
storageKey: 'orderManagement:entrustWarehouse:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes, expressRes]: any = await Promise.all([
|
||||
@ -339,36 +378,18 @@ function onQuickSearch() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `委托外仓-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openColumnConfigPanel() {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
}
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({}))
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoSelection: selectionRows.value.length === 0
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
detailToggleLabel: detailVisible.value ? '隐藏详情' : '显示详情'
|
||||
@ -377,6 +398,7 @@ const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
const { actionMap: toolbarActionMap } = createSimpleListToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible
|
||||
})
|
||||
|
||||
@ -223,7 +223,7 @@
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
@ -328,6 +328,17 @@
|
||||
<excel-import-pending-order-dialog v-model="importOrderDialogVisible" @success="loadData" />
|
||||
<qrcode-dialog v-model:visible="qrDialogVisible" :code="currentWaybillCode" />
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -348,21 +359,12 @@ import {
|
||||
exceptionToolbarButtons,
|
||||
type ToolbarButtonConfig,
|
||||
translateOrderField,
|
||||
formatOrderTime,
|
||||
getTagType,
|
||||
fillExpressCompanyScanFieldOptions,
|
||||
fillStoreScanFieldOptions,
|
||||
extractStoreListFromResponse
|
||||
} from './config/order-common-config'
|
||||
|
||||
const EXPORT_TIME_PROPS = new Set([
|
||||
'create_at',
|
||||
'updated_at',
|
||||
'pay_time',
|
||||
'place_order_time',
|
||||
'operate_time',
|
||||
'delivery_time'
|
||||
])
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import log from './component/log.vue'
|
||||
@ -372,7 +374,8 @@ import AllocateExpressForm from './form/AllocateExpressForm.vue'
|
||||
import StorageAllocateForm from './form/StorageAllocateForm.vue'
|
||||
import UpdateOrderMetaForm from './form/UpdateOrderMetaForm.vue'
|
||||
import CloneOrderForm from './form/CloneOrderForm.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createPendingToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -388,7 +391,6 @@ const activeTab = ref('detail')
|
||||
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const actionLoading = ref(false)
|
||||
@ -601,21 +603,12 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizeExpectionListWhere(where)
|
||||
const params = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
where: buildExportWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
@ -662,6 +655,43 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildExportWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizeExpectionListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'exceptionOrder',
|
||||
buildWhere: buildExportWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '异常订单',
|
||||
storageKey: 'orderManagement:exceptionOrder:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const storesRes: any = await indexApi.loadStores({ type: 'order' })
|
||||
@ -798,8 +828,7 @@ async function submitResolveException() {
|
||||
// 统一执行命令
|
||||
function handleCommand(commandName: string, subCommand?: string) {
|
||||
const handlers: Record<string, Function> = {
|
||||
handleExpectionOperation,
|
||||
handleExport
|
||||
handleExpectionOperation
|
||||
}
|
||||
const handler = handlers[commandName]
|
||||
if (handler) {
|
||||
@ -821,28 +850,6 @@ async function handleExpectionOperation(command: string) {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `异常订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) =>
|
||||
EXPORT_TIME_PROPS.has(String(prop)) ? formatOrderTime(value) : translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openColumnConfigPanel() {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
}
|
||||
@ -856,7 +863,7 @@ function openImportOrderDialog() {
|
||||
}
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoSelection: !hasSelection.value,
|
||||
hasNoSelection: selectionRows.value.length === 0,
|
||||
notSingleSelection: selectionRows.value.length !== 1
|
||||
}))
|
||||
|
||||
@ -904,6 +911,7 @@ const {
|
||||
} = createPendingToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible,
|
||||
openManualCreateDialog,
|
||||
@ -928,6 +936,7 @@ const toolbarActionMap: Record<string, () => void | Promise<void>> = {
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value,
|
||||
actionLoading: actionLoading.value,
|
||||
storageAllocateLoading: storageAllocateLoading.value,
|
||||
allocateLoading: allocateLoading.value,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
||||
<div class="tabs-header-action">
|
||||
<el-button size="small" @click="workbenchDialogVisible = true">统一查询</el-button>
|
||||
<el-button size="small" :loading="badgeLoading" @click="refreshBadgeCounts">刷新角标</el-button>
|
||||
</div>
|
||||
<!-- 使用 keep-alive 强制保留所有标签 -->
|
||||
@ -35,6 +36,8 @@
|
||||
</keep-alive>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<order-workbench-list-dialog v-model="workbenchDialogVisible" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -51,12 +54,14 @@ import DeliveryOrder from './deliveryOrder.vue'
|
||||
import EntrustWarehouse from './entrustWarehouse.vue'
|
||||
import DeliveryException from './deliveryException.vue'
|
||||
import ArchiveOrder from './archiveOrder.vue'
|
||||
import OrderWorkbenchListDialog from './component/OrderWorkbenchListDialog.vue'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const settingsStore = useSettingsStore()
|
||||
const badgeLoading = ref(false)
|
||||
const workbenchDialogVisible = ref(false)
|
||||
|
||||
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
|
||||
const containerHeight = computed(() => shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)')
|
||||
|
||||
@ -124,7 +124,8 @@
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
<el-tab-pane label="运单作业" name="waybill" />
|
||||
<el-tab-pane label="手动出库" name="manualOutbound" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
@ -140,6 +141,9 @@
|
||||
<div v-else-if="activeTab === 'logs'" class="detail-page order-log-wrapper">
|
||||
<log :data="selectedRow" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'waybill'" class="detail-page order-waybill-wrapper">
|
||||
<express-waybill-panel :row="selectedRow" table-type="order" />
|
||||
</div>
|
||||
<div v-else class="detail-page order-manual-outbound-wrapper">
|
||||
<outbound-manual-outbound-form
|
||||
ref="manualOutboundRef"
|
||||
@ -167,6 +171,17 @@
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -192,7 +207,9 @@ import log from './component/log.vue'
|
||||
import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import OutboundManualOutboundForm from './component/OutboundManualOutboundForm.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import ExpressWaybillPanel from './component/ExpressWaybillPanel.vue'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createSimpleListToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -205,7 +222,6 @@ const activeTab = ref('detail')
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const manualLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(outboundAvailableFields)))
|
||||
@ -288,6 +304,31 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'outboundOrder',
|
||||
buildWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '待出库订单',
|
||||
storageKey: 'orderManagement:outboundOrder:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
async function loadData() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
@ -382,27 +423,6 @@ function onQuickSearch() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `待出库订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openColumnConfigPanel() {
|
||||
upperTable.value?.openColumnConfig?.()
|
||||
}
|
||||
@ -458,11 +478,13 @@ async function loadOrderMetaOptions() {
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value,
|
||||
manualLoading: manualLoading.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoOutboundTarget: selectedOrderId.value == null || selectedOrderId.value === ''
|
||||
hasNoOutboundTarget: selectedOrderId.value == null || selectedOrderId.value === '',
|
||||
hasNoSelection: selectionRows.value.length === 0
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
@ -472,6 +494,7 @@ const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
const { actionMap: baseToolbarActionMap } = createSimpleListToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible
|
||||
})
|
||||
@ -518,6 +541,7 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||
|
||||
.order-detail-wrapper,
|
||||
.order-log-wrapper,
|
||||
.order-waybill-wrapper,
|
||||
.order-manual-outbound-wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@ -167,7 +167,8 @@
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<!-- <el-tab-pane label="配货信息" name="picking" /> -->
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
<el-tab-pane label="运单作业" name="waybill" />
|
||||
<!-- <el-tab-pane label="归档订单" name="archive" /> -->
|
||||
</el-tabs>
|
||||
</div>
|
||||
@ -189,9 +190,12 @@
|
||||
:delivery-order-code="selectedRow?.delivery_order_code || ''"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="detail-page order-log-wrapper">
|
||||
<div v-else-if="activeTab === 'logs'" class="detail-page order-log-wrapper">
|
||||
<log :data="selectedRow" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'waybill'" class="detail-page order-waybill-wrapper">
|
||||
<express-waybill-panel :row="selectedRow" table-type="order" />
|
||||
</div>
|
||||
</KeepAlive>
|
||||
</div>
|
||||
</div>
|
||||
@ -256,6 +260,17 @@
|
||||
<excel-import-pending-order-dialog v-model="importOrderDialogVisible" @success="loadData" />
|
||||
<qrcode-dialog v-model:visible="qrDialogVisible" :code="currentWaybillCode" />
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -291,7 +306,9 @@ import StorageAllocateForm from './form/StorageAllocateForm.vue'
|
||||
import UpdateOrderMetaForm from './form/UpdateOrderMetaForm.vue'
|
||||
import CloneOrderForm from './form/CloneOrderForm.vue'
|
||||
import SyncOrderIdsForm from './form/SyncOrderIdsForm.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import ExpressWaybillPanel from './component/ExpressWaybillPanel.vue'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createPendingToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -319,7 +336,6 @@ const activeTab = ref('detail')
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const actionLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -437,30 +453,12 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
const routeWaveNo = String(route.query.wave_no || '').trim()
|
||||
if (routeWaveNo) {
|
||||
where.wave_no = {
|
||||
operator: 'eq',
|
||||
value: routeWaveNo,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizePendingListWhere(where)
|
||||
|
||||
const queryParams = {
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
where,
|
||||
where: buildExportWhere(),
|
||||
sort: {
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC' as const
|
||||
@ -508,6 +506,51 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildExportWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
const routeWaveNo = String(route.query.wave_no || '').trim()
|
||||
if (routeWaveNo) {
|
||||
where.wave_no = {
|
||||
operator: 'eq',
|
||||
value: routeWaveNo,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizePendingListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'pendingOrder',
|
||||
buildWhere: buildExportWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '待处理订单',
|
||||
storageKey: 'orderManagement:pendingOrder:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
function handleConditionChange() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
@ -618,6 +661,7 @@ const {
|
||||
} = createPendingToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible,
|
||||
openManualCreateDialog,
|
||||
@ -637,6 +681,7 @@ const {
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value,
|
||||
actionLoading: actionLoading.value,
|
||||
storageAllocateLoading: storageAllocateLoading.value,
|
||||
allocateLoading: allocateLoading.value,
|
||||
@ -811,27 +856,6 @@ async function loadStoreOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `待处理订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSelectedIds(): number[] {
|
||||
const ids: number[] = []
|
||||
for (const item of selectionRows.value) {
|
||||
@ -877,7 +901,8 @@ function getSelectedIds(): number[] {
|
||||
.order-detail-wrapper,
|
||||
.order-picking-wrapper,
|
||||
.order-archive-wrapper,
|
||||
.order-log-wrapper {
|
||||
.order-log-wrapper,
|
||||
.order-waybill-wrapper {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
<el-tab-pane label="订单明细" name="detail" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="收货信息" name="receiver" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
<el-tab-pane label="订单日志" name="logs" />
|
||||
<el-tab-pane label="订单审核" name="review" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
@ -141,6 +141,16 @@
|
||||
<manual-create-pending-order-dialog v-model="manualCreateDialogVisible" @success="loadData" />
|
||||
</div>
|
||||
|
||||
<order-export-progress-dialog
|
||||
v-model:visible="exportDialogVisible"
|
||||
:loading="exportLoading"
|
||||
:progress-percent="exportProgressPercent"
|
||||
:progress-status="exportProgressStatus"
|
||||
:status-label="exportStatusLabel"
|
||||
:task-id="exportTaskProgress.taskId"
|
||||
:message="exportTaskProgress.message"
|
||||
:error="exportTaskProgress.error"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -167,7 +177,8 @@ import PendingOrderDetailPanel from './component/PendingOrderDetailPanel.vue'
|
||||
import OrderItemsDetailPanel from './component/OrderItemsDetailPanel.vue'
|
||||
import ManualCreatePendingOrderDialog from './component/ManualCreatePendingOrderDialog.vue'
|
||||
import log from './component/log.vue'
|
||||
import { exportUpperTableRows } from './utils/export'
|
||||
import OrderExportProgressDialog from './component/OrderExportProgressDialog.vue'
|
||||
import { createOrderPageExport } from './utils/order-page-export'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
import { createReviewToolbarController } from './utils/toolbar-actions'
|
||||
import { safeInvoke } from '@/utils/safe-invoke'
|
||||
@ -194,7 +205,6 @@ const activeTab = ref('detail')
|
||||
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
const pagination = reactive({ currentPage: 1, pageSize: 20, total: 0 })
|
||||
@ -284,15 +294,7 @@ async function loadData() {
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
where = sanitizeReviewListWhere(where)
|
||||
let where = buildExportWhere()
|
||||
|
||||
const queryParams = {
|
||||
pagination: {
|
||||
@ -343,6 +345,43 @@ function buildWhereConditions(rawConditions: Record<string, any>) {
|
||||
return where
|
||||
}
|
||||
|
||||
function buildExportWhere() {
|
||||
let where = buildWhereConditions(scanBox.value?.getConditions?.() || {})
|
||||
if (quickSearch.value) {
|
||||
where.delivery_order_code = {
|
||||
operator: 'like',
|
||||
value: quickSearch.value,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
return sanitizeReviewListWhere(where)
|
||||
}
|
||||
|
||||
const pageExport = createOrderPageExport({
|
||||
scopeKey: 'reviewOrder',
|
||||
buildWhere: buildExportWhere,
|
||||
buildSort: () => ({
|
||||
sortField: 'updated_at',
|
||||
sortOrder: 'DESC'
|
||||
}),
|
||||
selectionRows,
|
||||
columns,
|
||||
fileNamePrefix: '待审核订单',
|
||||
storageKey: 'orderManagement:reviewOrder:exportTaskId'
|
||||
})
|
||||
|
||||
const {
|
||||
exportLoading,
|
||||
exportSelectionLoading,
|
||||
exportDialogVisible,
|
||||
exportTaskProgress,
|
||||
exportProgressPercent,
|
||||
exportProgressStatus,
|
||||
exportStatusLabel,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
} = pageExport
|
||||
|
||||
function handleConditionChange() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
@ -398,11 +437,12 @@ function toggleDetailVisible() {
|
||||
|
||||
const buttonLoadingMap = computed<Record<string, boolean>>(() => ({
|
||||
exportLoading: exportLoading.value,
|
||||
exportSelectionLoading: exportSelectionLoading.value,
|
||||
reviewSubmitting: reviewSubmitting.value
|
||||
}))
|
||||
|
||||
const buttonDisabledMap = computed<Record<string, boolean>>(() => ({
|
||||
hasNoSelection: !hasSelection.value
|
||||
hasNoSelection: selectionRows.value.length === 0
|
||||
}))
|
||||
|
||||
const buttonLabelMap = computed<Record<string, string>>(() => ({
|
||||
@ -416,6 +456,7 @@ const {
|
||||
} = createReviewToolbarController({
|
||||
loadData,
|
||||
handleExport,
|
||||
handleExportSelection,
|
||||
openColumnConfigPanel,
|
||||
toggleDetailVisible,
|
||||
openManualCreateDialog,
|
||||
@ -452,27 +493,6 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) {
|
||||
safeInvoke(() => handler())
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
if (!selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: selectionRows.value,
|
||||
columns: columns.value,
|
||||
fileName: `待审核订单-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('导出完成')
|
||||
} catch (error) {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSingleReview() {
|
||||
if (!selectedRow.value?.id) {
|
||||
ElMessage.warning('请先选择订单')
|
||||
|
||||
164
src/views/order/orderManagement/utils/order-index-helpers.ts
Normal file
164
src/views/order/orderManagement/utils/order-index-helpers.ts
Normal file
@ -0,0 +1,164 @@
|
||||
export type OrderExportScope = {
|
||||
table_type?: string
|
||||
tableType?: string
|
||||
module?: string
|
||||
module_name?: string
|
||||
}
|
||||
|
||||
/** 各订单子页与 order.export 入参映射 */
|
||||
export const ORDER_INDEX_EXPORT_SCOPES: Record<string, OrderExportScope> = {
|
||||
reviewOrder: { table_type: 'revieworder', module: 'reviewOrder' },
|
||||
pendingOrder: { table_type: 'current', module: 'pendingOrder' },
|
||||
exceptionOrder: { table_type: 'current', module: 'expectionOrder' },
|
||||
outboundOrder: { table_type: 'current', module: 'outboundOrder' },
|
||||
entrustWarehouse: { table_type: 'outsourced', module: 'entrustOrder' },
|
||||
deliveryOrder: { table_type: 'dispatch', module: 'deliveryOrder' },
|
||||
deliveryException: { table_type: 'dispatch', module: 'deliveryExpectionOrder' },
|
||||
archiveOrder: { table_type: 'history', module: 'archiveOrder' }
|
||||
}
|
||||
|
||||
export function isOrderIndexApiSuccess(res: any) {
|
||||
return !!res && [0, 1, 200, 20000].includes(res.code)
|
||||
}
|
||||
|
||||
export function parseOrderListResponse(res: any): {
|
||||
list: any[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
} {
|
||||
const pick = (obj: any) => {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return { list: [] as any[], total: 0, page: 1, pageSize: 20 }
|
||||
}
|
||||
const list = Array.isArray(obj.list)
|
||||
? obj.list
|
||||
: Array.isArray(obj.records)
|
||||
? obj.records
|
||||
: []
|
||||
const pagination = obj.pagination && typeof obj.pagination === 'object' ? obj.pagination : {}
|
||||
const total = Number(pagination.total ?? obj.total ?? obj.count ?? list.length)
|
||||
const page = Number(pagination.page ?? obj.page ?? 1)
|
||||
const pageSize = Number(pagination.pageSize ?? obj.page_size ?? 20)
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : list.length,
|
||||
page: Number.isFinite(page) && page > 0 ? page : 1,
|
||||
pageSize: Number.isFinite(pageSize) && pageSize > 0 ? pageSize : 20
|
||||
}
|
||||
}
|
||||
|
||||
const nested = res?.data
|
||||
if (nested && typeof nested === 'object') {
|
||||
if (Array.isArray(nested.list) || nested.pagination || nested.total !== undefined) {
|
||||
return pick(nested)
|
||||
}
|
||||
if (nested.data && typeof nested.data === 'object') {
|
||||
return pick(nested.data)
|
||||
}
|
||||
}
|
||||
return pick(res)
|
||||
}
|
||||
|
||||
export function parseOrderDetailPayload(res: any): Record<string, any> {
|
||||
if (!res || typeof res !== 'object') return {}
|
||||
const nested = res.data
|
||||
if (nested && typeof nested === 'object' && !Array.isArray(nested)) {
|
||||
if (nested.order || nested.detail || nested.expresses || nested.orderItems || nested.items) {
|
||||
return nested
|
||||
}
|
||||
if (nested.data && typeof nested.data === 'object') {
|
||||
return nested.data
|
||||
}
|
||||
}
|
||||
return nested && typeof nested === 'object' ? nested : res
|
||||
}
|
||||
|
||||
export function parseOrderLogsResponse(res: any): { list: any[]; total: number } {
|
||||
const pick = (obj: any) => {
|
||||
if (!obj || typeof obj !== 'object') return { list: [], total: 0 }
|
||||
const list = Array.isArray(obj.list)
|
||||
? obj.list
|
||||
: Array.isArray(obj.records)
|
||||
? obj.records
|
||||
: []
|
||||
const pagination = obj.pagination && typeof obj.pagination === 'object' ? obj.pagination : {}
|
||||
const total = Number(pagination.total ?? obj.total ?? list.length)
|
||||
return {
|
||||
list,
|
||||
total: Number.isFinite(total) ? total : list.length
|
||||
}
|
||||
}
|
||||
|
||||
const level1 = res?.data
|
||||
if (level1 && typeof level1 === 'object') {
|
||||
if (Array.isArray(level1.list) || level1.pagination) return pick(level1)
|
||||
if (level1.data && typeof level1.data === 'object') return pick(level1.data)
|
||||
}
|
||||
if (Array.isArray(res?.list)) {
|
||||
return pick(res)
|
||||
}
|
||||
return pick(level1)
|
||||
}
|
||||
|
||||
export function parseOrderExportTaskPayload(res: any): Record<string, any> {
|
||||
if (!res || typeof res !== 'object') return {}
|
||||
const nested = res.data
|
||||
if (nested && typeof nested === 'object' && !Array.isArray(nested)) {
|
||||
if (nested.task_id || nested.taskId || nested.status) return nested
|
||||
if (nested.data && typeof nested.data === 'object') return nested.data
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
export function normalizeOrderDownloadUrl(fileUrl: string) {
|
||||
if (!fileUrl) return ''
|
||||
if (/^https?:\/\//i.test(fileUrl)) return fileUrl
|
||||
const normalizedPath = fileUrl.startsWith('/') ? fileUrl : `/${fileUrl}`
|
||||
const baseApi = String(import.meta.env.VITE_APP_BASE_API || '')
|
||||
const normalizedBase = baseApi.endsWith('/') ? baseApi.slice(0, -1) : baseApi
|
||||
if (normalizedBase.startsWith('/')) {
|
||||
return `${window.location.origin}${normalizedBase}${normalizedPath}`
|
||||
}
|
||||
return `${window.location.origin}${normalizedPath}`
|
||||
}
|
||||
|
||||
export function downloadOrderExportFile(url: string) {
|
||||
const finalUrl = normalizeOrderDownloadUrl(url)
|
||||
if (!finalUrl) throw new Error('导出文件地址为空')
|
||||
const link = document.createElement('a')
|
||||
link.href = finalUrl
|
||||
link.target = '_blank'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
}
|
||||
|
||||
export function sanitizeOrderListWhere(where: Record<string, unknown>) {
|
||||
const next = { ...where }
|
||||
delete next.warehouse_id
|
||||
delete next.warehouseId
|
||||
return next
|
||||
}
|
||||
|
||||
export function buildOrderWhereConditions(rawConditions: Record<string, any>) {
|
||||
const where: Record<string, any> = {}
|
||||
Object.keys(rawConditions || {}).forEach((key) => {
|
||||
const condition = rawConditions[key]
|
||||
const normalizedKey = key === 'order_code' ? 'delivery_order_code' : key
|
||||
if (condition && typeof condition === 'object' && 'operator' in condition) {
|
||||
where[normalizedKey] = Array.isArray(condition.value)
|
||||
? { ...condition, value: condition.value[0] ?? '', type: 'text' }
|
||||
: condition
|
||||
return
|
||||
}
|
||||
if (condition !== undefined && condition !== null && condition !== '') {
|
||||
where[normalizedKey] = {
|
||||
operator: 'eq',
|
||||
value: Array.isArray(condition) ? condition[0] ?? '' : condition,
|
||||
type: 'text'
|
||||
}
|
||||
}
|
||||
})
|
||||
return where
|
||||
}
|
||||
60
src/views/order/orderManagement/utils/order-page-export.ts
Normal file
60
src/views/order/orderManagement/utils/order-page-export.ts
Normal file
@ -0,0 +1,60 @@
|
||||
import { ref, type Ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useOrderAsyncExport } from '@/composables/useOrderAsyncExport'
|
||||
import { ORDER_INDEX_EXPORT_SCOPES, sanitizeOrderListWhere } from './order-index-helpers'
|
||||
import { exportUpperTableRows } from './export'
|
||||
import { translateOrderField } from '../config/order-common-config'
|
||||
|
||||
export function createOrderPageExport(options: {
|
||||
scopeKey: keyof typeof ORDER_INDEX_EXPORT_SCOPES
|
||||
buildWhere: () => Record<string, unknown>
|
||||
buildSort?: () => Record<string, unknown> | undefined
|
||||
selectionRows: Ref<any[]>
|
||||
columns: Ref<any[]>
|
||||
fileNamePrefix: string
|
||||
storageKey?: string
|
||||
}) {
|
||||
const asyncExport = useOrderAsyncExport(options.storageKey)
|
||||
const exportSelectionLoading = ref(false)
|
||||
|
||||
async function handleExport() {
|
||||
const scope = ORDER_INDEX_EXPORT_SCOPES[options.scopeKey]
|
||||
if (!scope) {
|
||||
ElMessage.error('未配置导出范围')
|
||||
return
|
||||
}
|
||||
await asyncExport.submitExportTask({
|
||||
...scope,
|
||||
where: sanitizeOrderListWhere(options.buildWhere()),
|
||||
sort: options.buildSort?.()
|
||||
})
|
||||
}
|
||||
|
||||
async function handleExportSelection() {
|
||||
if (!options.selectionRows.value.length) {
|
||||
ElMessage.warning('请先勾选要导出的订单')
|
||||
return
|
||||
}
|
||||
exportSelectionLoading.value = true
|
||||
try {
|
||||
exportUpperTableRows({
|
||||
rows: options.selectionRows.value,
|
||||
columns: options.columns.value,
|
||||
fileName: `${options.fileNamePrefix}-${Date.now()}.xlsx`,
|
||||
transformCell: (prop, value) => translateOrderField(prop, value)
|
||||
})
|
||||
ElMessage.success('选中数据导出完成')
|
||||
} catch {
|
||||
ElMessage.error('导出失败')
|
||||
} finally {
|
||||
exportSelectionLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...asyncExport,
|
||||
exportSelectionLoading,
|
||||
handleExport,
|
||||
handleExportSelection
|
||||
}
|
||||
}
|
||||
@ -124,6 +124,7 @@ export function createReviewToolbarActionMap(params: {
|
||||
export function createReviewToolbarController(params: {
|
||||
loadData: () => Promise<void>
|
||||
handleExport: () => Promise<void>
|
||||
handleExportSelection?: () => Promise<void>
|
||||
openColumnConfigPanel: () => void
|
||||
toggleDetailVisible: () => void
|
||||
openManualCreateDialog: () => void
|
||||
@ -137,6 +138,7 @@ export function createReviewToolbarController(params: {
|
||||
baseActions: {
|
||||
loadData: params.loadData,
|
||||
handleExport: params.handleExport,
|
||||
...(params.handleExportSelection ? { handleExportSelection: params.handleExportSelection } : {}),
|
||||
openColumnConfigPanel: params.openColumnConfigPanel,
|
||||
toggleDetailVisible: params.toggleDetailVisible,
|
||||
openManualCreateDialog: params.openManualCreateDialog
|
||||
@ -251,6 +253,7 @@ function getApiResponsePayload<T = Record<string, any>>(response: any): T {
|
||||
export function createPendingToolbarController(params: {
|
||||
loadData: () => Promise<void>
|
||||
handleExport: () => Promise<void>
|
||||
handleExportSelection?: () => Promise<void>
|
||||
openColumnConfigPanel: () => void
|
||||
toggleDetailVisible: () => void
|
||||
openManualCreateDialog: () => void
|
||||
@ -372,6 +375,7 @@ export function createPendingToolbarController(params: {
|
||||
baseActions: {
|
||||
loadData: params.loadData,
|
||||
handleExport: params.handleExport,
|
||||
...(params.handleExportSelection ? { handleExportSelection: params.handleExportSelection } : {}),
|
||||
openColumnConfigPanel: params.openColumnConfigPanel,
|
||||
toggleDetailVisible: params.toggleDetailVisible,
|
||||
openStorageAllocateDialog: () => openStorageDialog('allocate'),
|
||||
@ -765,12 +769,14 @@ export function createPendingToolbarController(params: {
|
||||
export function createSimpleListToolbarController(params: {
|
||||
loadData: () => Promise<void>
|
||||
handleExport: () => Promise<void>
|
||||
handleExportSelection?: () => Promise<void>
|
||||
openColumnConfigPanel: () => void
|
||||
toggleDetailVisible: () => void
|
||||
}) {
|
||||
const actionMap: Record<string, () => void | Promise<void>> = {
|
||||
loadData: params.loadData,
|
||||
handleExport: params.handleExport,
|
||||
...(params.handleExportSelection ? { handleExportSelection: params.handleExportSelection } : {}),
|
||||
openColumnConfigPanel: params.openColumnConfigPanel,
|
||||
toggleDetailVisible: params.toggleDetailVisible
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import pcasCodeData from 'china-division/dist/pcas-code.json'
|
||||
import type { ExpressInterfaceCreateParams } from '@/api/setting.expressInterface/expressInterface'
|
||||
import type { ExpressInterfaceCreateParams } from '@/api/setting.expressinterface/expressInterface'
|
||||
|
||||
/** setting.expressInterface.list 单条记录字段顺序(与接口返回一致) */
|
||||
export const expressInterfaceListFieldOrder = [
|
||||
|
||||
@ -492,7 +492,7 @@ import {
|
||||
expressInterfaceListByWarehousePlatformCode,
|
||||
expressInterfaceUpdate,
|
||||
getPrintPlatformList
|
||||
} from '@/api/setting.expressInterface/expressInterface'
|
||||
} from '@/api/setting.expressinterface/expressInterface'
|
||||
import { useUserStore } from '@/stores/modules/user'
|
||||
import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import { useVerticalSplitPane } from '@/composables/useVerticalSplitPane'
|
||||
|
||||
@ -153,7 +153,7 @@ 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 { getPrintPlatformList } from '@/api/setting.expressInterface/expressInterface'
|
||||
import { getPrintPlatformList } from '@/api/setting.expressinterface/expressInterface'
|
||||
import { getPlatformOauthLink } from '@/api/index/index'
|
||||
import {
|
||||
shopGetAuthorizeSessionKey,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,11 @@
|
||||
# 接口
|
||||
|
||||
- 更新时间: 2026-05-26 09:31:23
|
||||
- 更新时间: 2026-05-29 09:12:17
|
||||
- 扫描目录: `src\api`
|
||||
- 模块数: 38
|
||||
- API 文件数: 38
|
||||
- 接口数: 309
|
||||
- 已启用: 276
|
||||
- 模块数: 40
|
||||
- API 文件数: 40
|
||||
- 接口数: 324
|
||||
- 已启用: 291
|
||||
- 占位接口: 2
|
||||
|
||||
## 模块统计
|
||||
@ -21,10 +21,10 @@
|
||||
| order.deliveryorder | 1 | 2 | 2 | 0 |
|
||||
| order.entrustorder | 1 | 2 | 2 | 0 |
|
||||
| order.expectionorder | 1 | 3 | 3 | 0 |
|
||||
| order.index | 1 | 6 | 5 | 0 |
|
||||
| order.index | 1 | 10 | 9 | 0 |
|
||||
| order.outboundorder | 1 | 3 | 3 | 0 |
|
||||
| order.pendingorder | 1 | 16 | 16 | 0 |
|
||||
| order.print | 1 | 2 | 2 | 0 |
|
||||
| order.print | 1 | 3 | 3 | 0 |
|
||||
| order.recheckorder | 1 | 3 | 2 | 0 |
|
||||
| order.revieworder | 1 | 3 | 3 | 0 |
|
||||
| order.wave | 1 | 30 | 29 | 0 |
|
||||
@ -34,6 +34,8 @@
|
||||
| setting.account | 1 | 7 | 7 | 0 |
|
||||
| setting.express | 1 | 7 | 7 | 0 |
|
||||
| setting.expressinterface | 1 | 6 | 6 | 0 |
|
||||
| setting.packagematerial | 1 | 5 | 5 | 0 |
|
||||
| setting.packagesupplier | 1 | 5 | 5 | 0 |
|
||||
| setting.permission | 1 | 4 | 4 | 0 |
|
||||
| setting.platform | 1 | 5 | 5 | 0 |
|
||||
| setting.printtemplate | 1 | 13 | 13 | 0 |
|
||||
@ -100,11 +102,15 @@
|
||||
| order.expectionorder | orderExpectionOrderList | order.expectionOrder.list | POST | 是 | 否 | order.expectionorder/orderexpectionorder.ts | |
|
||||
| order.expectionorder | orderExpectionOrderResolveException | order.expectionOrder.resolveException | POST | 是 | 否 | order.expectionorder/orderexpectionorder.ts | |
|
||||
| order.index | orderBadgeCount | order.badgeCount | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderBindExpressPackageMaterial | order.bindExpressPackageMaterial | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderDetail | order.detail | POST | 否 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderExport | order.export | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderExportTaskProgress | order.exportTaskProgress | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderList | order.list | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderManualOutboundOrder | order.manualOutboundOrder | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderQueryOrderLogList | order.queryOrderLogList | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderQueryOrderLogs | order.queryOrderLogs | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.index | orderUpdateExpressWeighingWeight | order.updateExpressWeighingWeight | POST | 是 | 否 | order.index/orderindex.ts | |
|
||||
| order.outboundorder | orderOutboundOrderDetail | order.outboundOrder.detail | POST | 是 | 否 | order.outboundorder/orderoutboundOrder.ts | |
|
||||
| order.outboundorder | orderOutboundOrderList | order.outboundOrder.list | POST | 是 | 否 | order.outboundorder/orderoutboundOrder.ts | |
|
||||
| order.outboundorder | orderOutboundOrderManualOutboundOrder | order.outboundOrder.manualOutboundOrder | POST | 是 | 否 | order.outboundorder/orderoutboundOrder.ts | |
|
||||
@ -126,6 +132,7 @@
|
||||
| order.pendingorder | orderPendingOrderUpdateOrderPlatform | order.pendingOrder.updateOrderPlatform | POST | 是 | 否 | order.pendingorder/orderpendingOrder.ts | |
|
||||
| order.print | getWavePlatformPrintData | order.print.getWavePlatformPrintData | POST | 是 | 否 | order.print/orderprint.ts | |
|
||||
| order.print | getWavePrintData | order.print.getWavePrintData | POST | 是 | 否 | order.print/orderprint.ts | |
|
||||
| order.print | unlockWavePlatformPrintDataByGroup | order.print.unlockWavePlatformPrintDataByGroup | POST | 是 | 否 | order.print/orderprint.ts | |
|
||||
| order.recheckorder | confirmRecheck | order.recheckOrder.confirmRecheck | POST | 是 | 否 | order.recheckorder/recheckOrder.ts | |
|
||||
| order.recheckorder | scanOrder | order.recheckOrder.scanOrder | POST | 是 | 否 | order.recheckorder/recheckOrder.ts | |
|
||||
| order.recheckorder | scanWaybill | order.recheckOrder.scanWaybill | POST | 否 | 否 | order.recheckorder/recheckOrder.ts | |
|
||||
@ -209,6 +216,16 @@
|
||||
| setting.expressinterface | expressInterfaceList | setting.expressInterface.list | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.expressinterface | expressInterfaceListByWarehousePlatformCode | setting.expressInterface.listByWarehousePlatformCode | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.expressinterface | expressInterfaceUpdate | setting.expressInterface.update | POST | 是 | 否 | setting.expressinterface/expressInterface.ts | |
|
||||
| setting.packagematerial | packageMaterialCreate | setting.packageMaterial.create | POST | 是 | 否 | setting.packagematerial/packagematerial.ts | |
|
||||
| setting.packagematerial | packageMaterialDelete | setting.packageMaterial.delete | POST | 是 | 否 | setting.packagematerial/packagematerial.ts | |
|
||||
| setting.packagematerial | packageMaterialGet | setting.packageMaterial.get | POST | 是 | 否 | setting.packagematerial/packagematerial.ts | |
|
||||
| setting.packagematerial | packageMaterialList | setting.packageMaterial.list | POST | 是 | 否 | setting.packagematerial/packagematerial.ts | |
|
||||
| setting.packagematerial | packageMaterialUpdate | setting.packageMaterial.update | POST | 是 | 否 | setting.packagematerial/packagematerial.ts | |
|
||||
| setting.packagesupplier | packageSupplierCreate | setting.packageSupplier.create | POST | 是 | 否 | setting.packagesupplier/packagesupplier.ts | |
|
||||
| setting.packagesupplier | packageSupplierDelete | setting.packageSupplier.delete | POST | 是 | 否 | setting.packagesupplier/packagesupplier.ts | |
|
||||
| setting.packagesupplier | packageSupplierGet | setting.packageSupplier.get | POST | 是 | 否 | setting.packagesupplier/packagesupplier.ts | |
|
||||
| setting.packagesupplier | packageSupplierList | setting.packageSupplier.list | POST | 是 | 否 | setting.packagesupplier/packagesupplier.ts | |
|
||||
| setting.packagesupplier | packageSupplierUpdate | setting.packageSupplier.update | POST | 是 | 否 | setting.packagesupplier/packagesupplier.ts | |
|
||||
| setting.permission | permissionAdd | setting.permission.add | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
| setting.permission | permissionDelete | setting.permission.delete | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
| setting.permission | permissionList | setting.permission.list | POST | 是 | 否 | setting.permission/permission.ts | |
|
||||
|
||||
@ -8,17 +8,28 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "order.print.getWavePrintData",
|
||||
"method": "order.queryOrderLogs",
|
||||
"body": {
|
||||
"id": 6474
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "order.queryOrderLogList",
|
||||
"body": {
|
||||
"id": "6487"
|
||||
}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "order.print.getWavePlatformPrintData",
|
||||
"body": {
|
||||
"warehouse_id": 100000,
|
||||
"wave_ids": [
|
||||
1777970280348803
|
||||
]
|
||||
}
|
||||
"method": "",
|
||||
"body": {}
|
||||
},
|
||||
{
|
||||
"method": "",
|
||||
"body": {}
|
||||
}
|
||||
],
|
||||
"successMessages": [
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -12,31 +12,206 @@
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"moduleCount": 38,
|
||||
"totalInterfaceCount": 270,
|
||||
"moduleCount": 40,
|
||||
"totalInterfaceCount": 285,
|
||||
"changes": {
|
||||
"summary": {
|
||||
"moduleAdded": 0,
|
||||
"moduleAdded": 2,
|
||||
"moduleDeleted": 0,
|
||||
"moduleUpdated": 0,
|
||||
"interfaceAdded": 0,
|
||||
"moduleUpdated": 2,
|
||||
"interfaceAdded": 15,
|
||||
"interfaceDeleted": 0,
|
||||
"interfaceParamsUpdated": 0,
|
||||
"interfaceResponseUpdated": 0
|
||||
},
|
||||
"moduleUpdates": {
|
||||
"added": [],
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"methods": [
|
||||
"setting.packageMaterial.create",
|
||||
"setting.packageMaterial.delete",
|
||||
"setting.packageMaterial.get",
|
||||
"setting.packageMaterial.list",
|
||||
"setting.packageMaterial.update"
|
||||
],
|
||||
"interfaceCount": 5
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"methods": [
|
||||
"setting.packageSupplier.create",
|
||||
"setting.packageSupplier.delete",
|
||||
"setting.packageSupplier.get",
|
||||
"setting.packageSupplier.list",
|
||||
"setting.packageSupplier.update"
|
||||
],
|
||||
"interfaceCount": 5
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"updated": []
|
||||
"updated": [
|
||||
{
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
"folder": "order.index",
|
||||
"previousModuleName": "订单工作台入口模块",
|
||||
"previousModuleKey": "order.index",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"order.bindExpressPackageMaterial",
|
||||
"order.export",
|
||||
"order.exportTaskProgress",
|
||||
"order.updateExpressWeighingWeight"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"moduleName": "订单打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"folder": "order.print",
|
||||
"previousModuleName": "订单打印模块",
|
||||
"previousModuleKey": "order.print",
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"order.print.unlockWavePlatformPrintDataByGroup"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"interfaceUpdates": {
|
||||
"added": [],
|
||||
"added": [
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"method": "setting.packageMaterial.create"
|
||||
},
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"method": "setting.packageMaterial.delete"
|
||||
},
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"method": "setting.packageMaterial.get"
|
||||
},
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"method": "setting.packageMaterial.list"
|
||||
},
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"method": "setting.packageMaterial.update"
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"method": "setting.packageSupplier.create"
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"method": "setting.packageSupplier.delete"
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"method": "setting.packageSupplier.get"
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"method": "setting.packageSupplier.list"
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"method": "setting.packageSupplier.update"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
"folder": "order.index",
|
||||
"method": "order.bindExpressPackageMaterial"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
"folder": "order.index",
|
||||
"method": "order.export"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
"folder": "order.index",
|
||||
"method": "order.exportTaskProgress"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
"folder": "order.index",
|
||||
"method": "order.updateExpressWeighingWeight"
|
||||
},
|
||||
{
|
||||
"moduleName": "订单打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"folder": "order.print",
|
||||
"method": "order.print.unlockWavePlatformPrintDataByGroup"
|
||||
}
|
||||
],
|
||||
"deleted": [],
|
||||
"paramsUpdated": [],
|
||||
"responseUpdated": []
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"moduleName": "包材管理模块",
|
||||
"moduleKey": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"interfaceCount": 5,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "setting.packageMaterial.create"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.update"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.delete"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.get"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.list"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "仓库模块",
|
||||
"moduleKey": "warehouse",
|
||||
@ -401,13 +576,16 @@
|
||||
"moduleName": "订单打印模块",
|
||||
"moduleKey": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 2,
|
||||
"interfaceCount": 3,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.print.getWavePrintData"
|
||||
},
|
||||
{
|
||||
"method": "order.print.getWavePlatformPrintData"
|
||||
},
|
||||
{
|
||||
"method": "order.print.unlockWavePlatformPrintDataByGroup"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -463,7 +641,7 @@
|
||||
"moduleName": "订单工作台入口模块",
|
||||
"moduleKey": "order.index",
|
||||
"folder": "order.index",
|
||||
"interfaceCount": 6,
|
||||
"interfaceCount": 10,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "order.list"
|
||||
@ -482,6 +660,18 @@
|
||||
},
|
||||
{
|
||||
"method": "order.queryOrderLogList"
|
||||
},
|
||||
{
|
||||
"method": "order.updateExpressWeighingWeight"
|
||||
},
|
||||
{
|
||||
"method": "order.bindExpressPackageMaterial"
|
||||
},
|
||||
{
|
||||
"method": "order.export"
|
||||
},
|
||||
{
|
||||
"method": "order.exportTaskProgress"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -1150,6 +1340,29 @@
|
||||
"method": "order.wave.batchList"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"moduleName": "package-supplier-module",
|
||||
"moduleKey": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"interfaceCount": 5,
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "setting.packageSupplier.create"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.update"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.delete"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.get"
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.list"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,14 +16,19 @@
|
||||
"name": "订单工作台入口模块",
|
||||
"key": "order.index",
|
||||
"folder": "order.index",
|
||||
"interfaceCount": 6
|
||||
"interfaceCount": 10
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"addedMethods": [
|
||||
"order.bindExpressPackageMaterial",
|
||||
"order.export",
|
||||
"order.exportTaskProgress",
|
||||
"order.updateExpressWeighingWeight"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
@ -407,6 +412,324 @@
|
||||
"description": "日志列表(全量返回,无分页)。每项字段与 stock.warehouse.queryStockLogs 保持一致,典型字段包括 id、action、message、actor、created_at、warehouse_id 等。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.updateExpressWeighingWeight",
|
||||
"title": "更新订单运单称重重量。规则:订单仅一个运单时,直接写入该运单重量;多运单时,必须传 waybill_code 并按运单写入。",
|
||||
"description": "更新订单运单称重重量。规则:订单仅一个运单时,直接写入该运单重量;多运单时,必须传 waybill_code 并按运单写入。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number|string",
|
||||
"required": true,
|
||||
"description": "订单ID,必填且必须为正整数。"
|
||||
},
|
||||
{
|
||||
"name": "waybill_code",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "运单号;订单仅一个运单时可不传且会被忽略,多运单时必填并需匹配订单下运单。"
|
||||
},
|
||||
{
|
||||
"name": "weighing_weight",
|
||||
"type": "number|string",
|
||||
"required": true,
|
||||
"description": "称重重量(kg),必填,必须大于 0,最多支持 3 位小数。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "订单ID(成功时返回于 data 对象中)。"
|
||||
},
|
||||
{
|
||||
"name": "waybill_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "写入重量的运单号(成功时返回于 data 对象中)。"
|
||||
},
|
||||
{
|
||||
"name": "weighing_weight",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "已写入的称重重量(kg,成功时返回于 data 对象中)。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.bindExpressPackageMaterial",
|
||||
"title": "按订单ID+运单号匹配 wms_order_express,按包材编码匹配包材,并将 package_material_id 与 package_material_name_snapshot 绑定到订单运单记录。",
|
||||
"description": "按订单ID+运单号匹配 wms_order_express,按包材编码匹配包材,并将 package_material_id 与 package_material_name_snapshot 绑定到订单运单记录。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number|string",
|
||||
"required": true,
|
||||
"description": "订单ID,必填。"
|
||||
},
|
||||
{
|
||||
"name": "waybill_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "运单号,必填。"
|
||||
},
|
||||
{
|
||||
"name": "package_material_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "包材编码,必填。"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "order_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "订单ID(成功时返回于 data 对象中)。"
|
||||
},
|
||||
{
|
||||
"name": "waybill_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "运单号(成功时返回于 data 对象中)。"
|
||||
},
|
||||
{
|
||||
"name": "package_material_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "绑定后的包材ID(成功时返回于 data 对象中)。"
|
||||
},
|
||||
{
|
||||
"name": "package_material_name_snapshot",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "绑定时写入的包材名称快照(成功时返回于 data 对象中)。"
|
||||
},
|
||||
{
|
||||
"name": "package_material_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "绑定成功的包材编码(成功时返回于 data 对象中)。"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.export",
|
||||
"title": "提交订单导出任务(异步)。入参支持 table_type/tableType 与 module/module_name;where 与 sort 语义与 order.list 一致。提交后立即返回 task_id,后台异步执行,导出进度/下载请通过 order.exportTaskProgress 查询。",
|
||||
"description": "提交订单导出任务(异步)。入参支持 table_type/tableType 与 module/module_name;where 与 sort 语义与 order.list 一致。提交后立即返回 task_id,后台异步执行,导出进度/下载请通过 order.exportTaskProgress 查询。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "table_type / tableType",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "导出表类型,枚举:current/history/dispatch/outsourced;兼容订单模块别名(order/reviewOrder/pendingOrder 等);支持 table_type 与 tableType 两种写法"
|
||||
},
|
||||
{
|
||||
"name": "module / module_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "订单模块名,兼容 module(驼峰)与 module_name(下划线)两种写法"
|
||||
},
|
||||
{
|
||||
"name": "where",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "查询条件,语义与 order.list 的 where 一致(推荐使用 { operator, value, type } 标准结构);禁止传入 warehouse_id/warehouseId"
|
||||
},
|
||||
{
|
||||
"name": "sort",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "排序参数,语义与 order.list 的 sort 一致"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务 ID(后端生成)"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务状态,枚举:submitted/running/success/failed/not_found"
|
||||
},
|
||||
{
|
||||
"name": "progress",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "当前进度百分比(0-100)"
|
||||
},
|
||||
{
|
||||
"name": "current_count",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "当前已处理记录数"
|
||||
},
|
||||
{
|
||||
"name": "total_count",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "总记录数(若有)"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务提示信息"
|
||||
},
|
||||
{
|
||||
"name": "result",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "任务执行结果(可选,可能包含文件 url/fileKey 等)"
|
||||
},
|
||||
{
|
||||
"name": "error",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "失败时的错误信息(可选)"
|
||||
},
|
||||
{
|
||||
"name": "update_time",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务更新时间(Unix ms 或 ISO 字符串)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.exportTaskProgress",
|
||||
"title": "按 task_id 查询订单导出任务进度,返回 task_id、status、progress、current_count、total_count、message、error、download_url、update_time;上传完成后 download_url 返回下载链接;未找到时 status=not_found。",
|
||||
"description": "按 task_id 查询订单导出任务进度,返回 task_id、status、progress、current_count、total_count、message、error、download_url、update_time;上传完成后 download_url 返回下载链接;未找到时 status=not_found。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "task_id / taskId",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务 ID,兼容 taskId"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "task_id",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务 ID"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务状态:submitted/running/success/failed/not_found"
|
||||
},
|
||||
{
|
||||
"name": "progress",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "进度百分比(0-100)"
|
||||
},
|
||||
{
|
||||
"name": "current_count",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "当前已处理记录数"
|
||||
},
|
||||
{
|
||||
"name": "total_count",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "总记录数"
|
||||
},
|
||||
{
|
||||
"name": "message",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "额外提示信息"
|
||||
},
|
||||
{
|
||||
"name": "error",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "失败信息(可选)"
|
||||
},
|
||||
{
|
||||
"name": "download_url",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "任务完成后下载链接(若有)"
|
||||
},
|
||||
{
|
||||
"name": "update_time",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "最近一次状态更新时间(Unix ms 或 ISO 字符串)"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-05 09:15:19",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
@ -16,14 +16,16 @@
|
||||
"name": "订单打印模块",
|
||||
"key": "order.print",
|
||||
"folder": "order.print",
|
||||
"interfaceCount": 2
|
||||
"interfaceCount": 3
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": false,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [],
|
||||
"addedMethods": [
|
||||
"order.print.unlockWavePlatformPrintDataByGroup"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
@ -156,6 +158,90 @@
|
||||
"description": "扩展字段"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "order.print.unlockWavePlatformPrintDataByGroup",
|
||||
"title": "按分组解锁波次平台打印锁:按传入的 groups 条件匹配已锁定订单并将其 print_lock_status 置为 none,返回解锁统计与解锁订单列表。",
|
||||
"description": "按分组解锁波次平台打印锁:按传入的 groups 条件匹配已锁定订单并将其 print_lock_status 置为 none,返回解锁统计与解锁订单列表。",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "warehouse_id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "仓库ID(必须与当前用户上下文 store_id 一致)"
|
||||
},
|
||||
{
|
||||
"name": "wave_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "波次ID列表(支持数字或字符串,内部自动去重与归一化)"
|
||||
},
|
||||
{
|
||||
"name": "group_type",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "分组类型,支持 platform、platform_express、order;默认 platform_express"
|
||||
},
|
||||
{
|
||||
"name": "unlock_scope",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "解锁范围,支持 group、wave;默认 group"
|
||||
},
|
||||
{
|
||||
"name": "groups",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "分组条件列表。元素为对象,可包含字段:wave_id(必填)、platform(平台编码)、sys_logistics_code(系统快递编码)、order_ids(订单ID数组)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "summary",
|
||||
"type": "object",
|
||||
"required": true,
|
||||
"description": "解锁操作的汇总统计"
|
||||
},
|
||||
{
|
||||
"name": "wave_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "通过过滤的波次ID数组"
|
||||
},
|
||||
{
|
||||
"name": "unlocked_order_ids",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "被解锁的订单ID数组"
|
||||
},
|
||||
{
|
||||
"name": "unlocked_orders",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "被解锁订单简要信息列表"
|
||||
},
|
||||
{
|
||||
"name": "ext",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "扩展字段"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-20 08:59:09",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": "2026-04-17 19:16:50"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-09 09:52:14",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 17:23:48",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:37:49",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 20:21:27",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "包材管理模块",
|
||||
"key": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial"
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-29 09:07:53",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
@ -0,0 +1,285 @@
|
||||
{
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
"value": "web",
|
||||
"label": "网页端"
|
||||
},
|
||||
"project": {
|
||||
"value": "all",
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"name": "包材管理模块",
|
||||
"key": "setting.packageMaterial",
|
||||
"folder": "setting.packagematerial",
|
||||
"interfaceCount": 5
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": true,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"setting.packageMaterial.create",
|
||||
"setting.packageMaterial.delete",
|
||||
"setting.packageMaterial.get",
|
||||
"setting.packageMaterial.list",
|
||||
"setting.packageMaterial.update"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "setting.packageMaterial.create",
|
||||
"title": "创建包材(当前仓库范围)",
|
||||
"description": "创建包材(当前仓库范围)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "material_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "包材编码(大写且在当前仓库唯一)"
|
||||
},
|
||||
{
|
||||
"name": "material_name",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "包材名称"
|
||||
},
|
||||
{
|
||||
"name": "material_type",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "包材类型"
|
||||
},
|
||||
{
|
||||
"name": "spec",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "规格"
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "长度"
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "宽度"
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "高度"
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "重量"
|
||||
},
|
||||
{
|
||||
"name": "cost_price",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "成本价"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "状态 0/1,默认 1"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "包材 ID"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.update",
|
||||
"title": "更新包材(按 id 更新,支持部分字段)",
|
||||
"description": "更新包材(按 id 更新,支持部分字段)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "包材 ID(也兼容 material_id/materialId)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "包材 ID"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.delete",
|
||||
"title": "删除包材(支持 ids 数组或逗号分隔字符串,兼容 id/material_id/materialId)",
|
||||
"description": "删除包材(支持 ids 数组或逗号分隔字符串,兼容 id/material_id/materialId)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "ids",
|
||||
"type": "array|number|string",
|
||||
"required": true,
|
||||
"description": "要删除的 ID 列表"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "deleted",
|
||||
"type": "boolean",
|
||||
"required": true,
|
||||
"description": "是否删除成功"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.get",
|
||||
"title": "查询包材列表,支持 where + pagination(兼容旧别名 list,建议使用 get)",
|
||||
"description": "查询包材列表,支持 where + pagination(兼容旧别名 list,建议使用 get)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "分页参数,支持 page/pageSize"
|
||||
},
|
||||
{
|
||||
"name": "where",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "筛选条件,支持 material_code/material_name/material_type/status/quickWhere"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "page",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "当前页"
|
||||
},
|
||||
{
|
||||
"name": "page_size",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "每页大小"
|
||||
},
|
||||
{
|
||||
"name": "total",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "总数"
|
||||
},
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "包材项数组"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageMaterial.list",
|
||||
"title": "兼容旧称 list,内部转发至 get;建议改用 setting.packageMaterial.get",
|
||||
"description": "兼容旧称 list,内部转发至 get;建议改用 setting.packageMaterial.get",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"module": {
|
||||
"name": "package-supplier-module",
|
||||
"key": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier"
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-29 09:07:53",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
@ -0,0 +1,255 @@
|
||||
{
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
"value": "web",
|
||||
"label": "网页端"
|
||||
},
|
||||
"project": {
|
||||
"value": "all",
|
||||
"label": "全部"
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"name": "package-supplier-module",
|
||||
"key": "setting.packageSupplier",
|
||||
"folder": "setting.packagesupplier",
|
||||
"interfaceCount": 5
|
||||
},
|
||||
"changes": {
|
||||
"fromPreviousSnapshot": {
|
||||
"moduleAdded": true,
|
||||
"moduleRenamed": false,
|
||||
"interfaceChanges": {
|
||||
"addedMethods": [
|
||||
"setting.packageSupplier.create",
|
||||
"setting.packageSupplier.delete",
|
||||
"setting.packageSupplier.get",
|
||||
"setting.packageSupplier.list",
|
||||
"setting.packageSupplier.update"
|
||||
],
|
||||
"deletedMethods": [],
|
||||
"paramsUpdatedMethods": [],
|
||||
"responseUpdatedMethods": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"interfaces": [
|
||||
{
|
||||
"method": "setting.packageSupplier.create",
|
||||
"title": "Create package supplier (current warehouse scope)",
|
||||
"description": "Create package supplier (current warehouse scope)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "supplier_code",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Supplier code (uppercased, unique in warehouse)"
|
||||
},
|
||||
{
|
||||
"name": "supplier_name",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Supplier name"
|
||||
},
|
||||
{
|
||||
"name": "contact_name",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "Contact name"
|
||||
},
|
||||
{
|
||||
"name": "contact_phone",
|
||||
"type": "string",
|
||||
"required": false,
|
||||
"description": "Contact phone"
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": "number",
|
||||
"required": false,
|
||||
"description": "Status 0/1, default 1"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "Created supplier id"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.update",
|
||||
"title": "Update package supplier by id (partial update supported)",
|
||||
"description": "Update package supplier by id (partial update supported)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "Supplier id (also supports supplier_id / supplierId)"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "Supplier id"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.delete",
|
||||
"title": "Delete package suppliers (supports ids array or comma-separated string)",
|
||||
"description": "Delete package suppliers (supports ids array or comma-separated string)",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "ids",
|
||||
"type": "array|number|string",
|
||||
"required": true,
|
||||
"description": "IDs to delete"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "deleted",
|
||||
"type": "boolean",
|
||||
"required": true,
|
||||
"description": "Deleted flag"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.get",
|
||||
"title": "Get package supplier list (supports where + pagination). list is an alias to get; prefer get.",
|
||||
"description": "Get package supplier list (supports where + pagination). list is an alias to get; prefer get.",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "pagination",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "Pagination parameters"
|
||||
},
|
||||
{
|
||||
"name": "where",
|
||||
"type": "object",
|
||||
"required": false,
|
||||
"description": "Filter conditions"
|
||||
}
|
||||
],
|
||||
"response": [
|
||||
{
|
||||
"name": "page",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "Current page"
|
||||
},
|
||||
{
|
||||
"name": "page_size",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "Page size"
|
||||
},
|
||||
{
|
||||
"name": "total",
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"description": "Total"
|
||||
},
|
||||
{
|
||||
"name": "list",
|
||||
"type": "array",
|
||||
"required": true,
|
||||
"description": "Supplier array"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"method": "setting.packageSupplier.list",
|
||||
"title": "Compatibility alias for get; internally forwards to get. Prefer setting.packageSupplier.get.",
|
||||
"description": "Compatibility alias for get; internally forwards to get. Prefer setting.packageSupplier.get.",
|
||||
"endpoint": "/system",
|
||||
"authRequired": false,
|
||||
"loginRequired": true,
|
||||
"status": {
|
||||
"isUsed": false,
|
||||
"isPlaceholder": false
|
||||
},
|
||||
"headers": [
|
||||
{
|
||||
"name": "Authorization",
|
||||
"type": "string",
|
||||
"required": true,
|
||||
"description": "Bearer token"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"response": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-17 19:16:50",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-04 09:11:04",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-05-25 17:05:16",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatedAt": "2026-05-28 14:47:12",
|
||||
"generatedAtLocal": "2026-05-28 14:47:12",
|
||||
"generatedAt": "2026-05-29 09:07:53",
|
||||
"generatedAtLocal": "2026-05-29 09:07:53",
|
||||
"source": "remote",
|
||||
"filter": {
|
||||
"platform": {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
},
|
||||
"status": "active",
|
||||
"createdAt": "2026-04-16 11:15:05",
|
||||
"updatedAt": "2026-05-28 14:47:12",
|
||||
"updatedAt": "2026-05-29 09:07:53",
|
||||
"deletedAt": null,
|
||||
"restoredAt": null
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user