4月11号
This commit is contained in:
parent
59474b0394
commit
309357bba7
@ -33,26 +33,26 @@ export function getStoreStats(data: any = {}) {
|
||||
* 获取订单趋势数据
|
||||
*/
|
||||
export function getOrderTrend(data: any = {}) {
|
||||
return getDashboardData('dashboard.orderTrend', data)
|
||||
return getDashboardData('dashboard.order_trend', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取平台分布数据
|
||||
*/
|
||||
export function getPlatformDist(data: any = {}) {
|
||||
return getDashboardData('dashboard.platformDist', data)
|
||||
return getDashboardData('dashboard.platform_distribution', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品排行数据
|
||||
*/
|
||||
export function getHotOrderRank(data: any = {}) {
|
||||
return getDashboardData('dashboard.hotOrderRank', data)
|
||||
return getDashboardData('dashboard.hot_order_rank', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取快递占比数据
|
||||
*/
|
||||
export function getExpressRatio(data: any = {}) {
|
||||
return getDashboardData('dashboard.expressRatio', data)
|
||||
return getDashboardData('dashboard.express_ratio', data)
|
||||
}
|
||||
|
||||
@ -78,3 +78,31 @@ export const getarchiveOrderlist = (data: any): Promise<any> => {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 订单列表接口(接口文档:order.list)
|
||||
export const orderList = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.list',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询订单详情(接口文档:order.detail)
|
||||
export const orderDetail = (data: any): Promise<any> => {
|
||||
return request({
|
||||
url: '/system',
|
||||
method: 'post',
|
||||
params: {
|
||||
method: 'order.detail',
|
||||
v,
|
||||
timestamp: new Date().getTime()
|
||||
},
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
133
src/test.txt
133
src/test.txt
@ -1,120 +1,23 @@
|
||||
接口文档更新:
|
||||
[
|
||||
{
|
||||
"id": "2026.04.08-system-08",
|
||||
"date": "2026-04-08",
|
||||
"method": "storage.inventory.transferByProduct",
|
||||
"type": "added",
|
||||
"summary": "新增按商品维度移库接口",
|
||||
"detail": "新增 storage.inventory.transferByProduct 接口,按库位+商品查找所有库存记录合并移动。入参为 space_id(原库位ID)、stock_id(商品SKU ID,即 wms_stock_warehouse.id)、target_space_id(目标库位ID)、quantity(移库数量)。开启批次管理(is_batch_mgmt=Y)的商品会被拒绝,需使用 transferLocation 按库存记录精确移库。复用 storage_transfer_completed 通知事件,操作日志编码 STORAGE_TRANSFER_BY_PRODUCT。isNeedAuth=true, isNeedLogin=true。"
|
||||
}
|
||||
{
|
||||
"id": "2026.04.08-system-09",
|
||||
"date": "2026-04-08",
|
||||
"method": "storeWarehouse.store.list",
|
||||
"type": "updated",
|
||||
"summary": "补充 storeWarehouse.store.list 完整 response 输出字段说明,移除 api_config / apiConfig",
|
||||
"detail": "从返回结果中移除 api_config 和 apiConfig 字段(代码中 delete serialized.api_config / delete serialized.apiConfig),文档 response 补充完整输出字段列表:id, store_id, store_name, warehouse_id, warehouse_name, counterparty_id, counterparty_name, current_subject_role, auth_status, auth_status_label, apply_reason, review_comment, apply_time, review_time, auth_start, auth_end, actual_end, print_quantity, applied_by, reviewed_by, ended_by, remask, use_status, policy_config, is_auth_valid, remaining_days 以及分页和 current_subject 信息。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-10",
|
||||
"date": "2026-04-08",
|
||||
"method": "storeWarehouse.store.list",
|
||||
"type": "changed",
|
||||
"summary": "货主列表返回新增 has_qimen_config 布尔字段",
|
||||
"detail": "storeWarehouse.store.list 返回的 data.list[] 中新增 has_qimen_config(boolean),表示该货主是否已配置奇门。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-11",
|
||||
"date": "2026-04-08",
|
||||
"method": "stock.warehouse.search",
|
||||
"type": "updated",
|
||||
"summary": "补全 stock.warehouse.search 接口文档,新增 params / response / errors 完整说明",
|
||||
"detail": "入参补充 keyword(string,模糊匹配 item_code / item_name / goods_code / barcode)和 store_id(number,按货主筛选)。响应补充 data 数组各字段(id, item_code, goods_code, item_name, sku_property, stock_unit, quantity, locked_quantity, brand_name, item_type, barcodes, store_stock)以及 total。errors 补充 code=0 搜索失败场景。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-12",
|
||||
"date": "2026-04-08",
|
||||
"method": "stock.warehouse.search",
|
||||
"type": "updated",
|
||||
"summary": "新增 with_stock / is_batch 参数,支持返回关联库存明细(按库位分组或按批次逐条)",
|
||||
"detail": "入参新增 with_stock(boolean,默认 false,是否返回关联库存数据)和 is_batch(boolean,默认 false,仅 with_stock=true 时生效,按批次明细返回)。响应 data[] 新增 storage[] 字段:is_batch=false 时按库位分组汇总(含 space_id、space、inventory_type、quantity、locked_quantity、available_quantity);is_batch=true 时逐条返回批次明细(含 id、stock_id、space_id、batch_no、inventory_type、quantity、locked_quantity、available_quantity、production_date、expiry_date、inbound_time、inbound_order_no、supplier_batch_no、created_at、space)。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-13",
|
||||
"date": "2026-04-08",
|
||||
"method": "wms_stock_transaction",
|
||||
"type": "added",
|
||||
"summary": "新增 wms_stock_transaction 表和模型",
|
||||
"detail": "新增出入库流水记录表 wms_stock_transaction,含 transaction_type(INBOUND/OUTBOUND)、warehouse_id、store_id、stock_id、storage_id、space_id、quantity、batch_no、inventory_type、order_type、order_no、order_id、receiving_id、entry_order_id、operator_id、operator_name、remark 等字段,关联 StockWarehouse 和 Storage 模型。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-14",
|
||||
"date": "2026-04-08",
|
||||
"method": "storage.inventory.quickPutaway,storage.inventory.matchPutaway",
|
||||
"type": "updated",
|
||||
"summary": "quickPutaway 和 matchPutaway 入库时自动写入出入库记录",
|
||||
"detail": "入库操作完成后自动写入 wms_stock_transaction 记录。quickPutaway 写入 order_type='SCRK'(收货入库),matchPutaway 写入 order_type='MATCH'(匹配入库),均自动填充 warehouse_id、store_id、stock_id、storage_id、space_id、quantity、batch_no、inventory_type 等字段。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-15",
|
||||
"date": "2026-04-08",
|
||||
"method": "storage.inventory.list",
|
||||
"type": "added",
|
||||
"summary": "新增 storage.inventory.list 出入库记录列表查询接口",
|
||||
"detail": "出入库记录列表查询,支持 where 条件(transaction_type、stock_id、space_id、store_id、order_type、order_no、inventory_type、operator_name、created_at)、分页(pagination)、排序(sort)和 group_by_batch 参数。默认合并模式按库位+商品聚合返回合计数量与记录条数,group_by_batch=true 时返回每条明细含 batch_no、order_no、operator_name 等完整信息。响应均关联 stockItem(item_code、item_name、sku_property、stock_unit)。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-16",
|
||||
"date": "2026-04-08",
|
||||
"module": "storage",
|
||||
"method": "storage.transaction.list",
|
||||
"type": "rename",
|
||||
"summary": "出入库流水记录查询接口从 storage.inventory.list 改名为 storage.transaction.list",
|
||||
"detail": "将出入库流水记录查询从 storage.inventory.list 迁移到 storage.transaction.list,避免与库存列表概念混淆。功能和参数不变。isNeedAuth=false, isNeedLogin=true, isNeedRight=false。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-17",
|
||||
"date": "2026-04-08",
|
||||
"module": "storage",
|
||||
"method": "storage.inventory.list",
|
||||
"type": "add",
|
||||
"summary": "新增 storage.inventory.list 库存列表查询接口",
|
||||
"detail": "新增库存列表查询接口,查询 wms_storage 表。支持 where 条件(stock_id/space_id/store_id/inventory_type/batch_no/inbound_order_no/available_quantity/inbound_time/created_at)、分页、排序。支持 group_by_batch 参数:默认 false 按库位+商品合并(SUM quantity/locked_quantity/available_quantity),true 返回每条明细含 batch_no/production_date/expiry_date 等。关联 stockItem(商品信息)和 space(库位信息)。isNeedAuth=false, isNeedLogin=true, isNeedRight=false。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-18",
|
||||
"date": "2026-04-08",
|
||||
"module": "storage",
|
||||
"method": "storage.entry.create",
|
||||
"type": "remove",
|
||||
"summary": "移除 storage.entry.create 创建入库单接口",
|
||||
"detail": "不再允许通过 API 创建入库单。入库单仅由快捷入库(quickPutaway)和匹配入库(matchPutaway)等内部流程自动创建。底层 service 实现保留但不再通过 systemMethods 暴露。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-19",
|
||||
"date": "2026-04-08",
|
||||
"module": "storage",
|
||||
"method": "storage.entry.addDetail, storage.entry.deleteDetail, storage.entry.detailChange",
|
||||
"type": "remove",
|
||||
"summary": "移除 storage.entry.addDetail / deleteDetail / detailChange 对外接口",
|
||||
"detail": "入库单明细编辑能力不再通过 systemMethods 对外暴露,入库单模块仅保留 list/get/cancel/completeEntry。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-20",
|
||||
"date": "2026-04-08",
|
||||
"module": "storage",
|
||||
"method": "storage.stockout.list, storage.stockout.toOrder, storage.stockout.listItems",
|
||||
"type": "add",
|
||||
"summary": "新增 storage.stockout 出库单模块(非订单出库单能力)",
|
||||
"detail": "新增 storage.stockout.list / toOrder / listItems 接口,作为非订单出库单的主出口(对应奇门 stockout.create)。storage.delivery.* 仅作为兼容转发保留;底层部分能力仍复用 order 模块。"
|
||||
},
|
||||
{
|
||||
"id": "2026.04.08-system-21",
|
||||
"date": "2026-04-08",
|
||||
"method": "storage.stockout.toOrder",
|
||||
"type": "change",
|
||||
"summary": "将 storage.stockout.toOrder 标记为占位接口",
|
||||
"detail": "storage.stockout.toOrder 当前仅保留方法名用于后续扩展,暂不开放实际逻辑。调用时返回 code=405、message=占位接口,暂未开放。"
|
||||
"version": "2026.04.10-system-01",
|
||||
"date": "2026-04-10",
|
||||
"summary": "订单审核字段由 audit_status 替换为整数字段 step,并添加数据库迁移",
|
||||
"methods": [
|
||||
"order.getreviewOrderlist",
|
||||
"order.reviewOrder.getreviewOrderlist",
|
||||
"order.reviewOrder.reviewOrder",
|
||||
"order.deliveryOrder.getdeliveryOrderlist",
|
||||
"order.list",
|
||||
"order.stats"
|
||||
],
|
||||
"notes": [
|
||||
"字段变更:order 相关审核字段从字符串/枚举 audit_status 替换为整数 step。",
|
||||
"step 映射:0=未审核,1=已审核,2=处理中,3=驳回/异常,4=配送中,5=已完成,9=已关闭。",
|
||||
"reviewOrder 接口在更新 inspection_status 的同时会写入 step 字段。",
|
||||
"必须执行迁移脚本:20260410150000-replace-audit-status-with-step-on-order-delivery-tables.js"
|
||||
],
|
||||
"type": "changed"
|
||||
}
|
||||
]
|
||||
@ -42,6 +42,29 @@ const windowWidth = ref(window.innerWidth)
|
||||
const currentTime = ref(dayjs().format('YYYY-MM-DD HH:mm:ss'))
|
||||
const accessibleModules = ref<any[]>([])
|
||||
|
||||
// // Log current user identity, permissions, and which modules are visible
|
||||
// const logPermissions = (perms: string[], modulesList: any[]) => {
|
||||
// try {
|
||||
// const identity = user.value || {}
|
||||
// console.info('[Dashboard] Current user identity:', identity)
|
||||
// console.info('[Dashboard] Current permissions:', perms)
|
||||
// const visible = modulesList.map(m => ({ name: m.name || m.component, title: m.title }))
|
||||
// console.info('[Dashboard] Modules with display permission:', visible)
|
||||
|
||||
// // Also print which permission keys correspond to visible modules (best-effort)
|
||||
// const visibleKeys = visible.map(v => {
|
||||
// const key = Object.keys(MODULE_CONFIGS.value).find(k => {
|
||||
// const cfg = MODULE_CONFIGS.value[k]
|
||||
// return cfg && (cfg.name === v.name || cfg.component === v.name || cfg.title === v.title)
|
||||
// })
|
||||
// return key || v.name
|
||||
// })
|
||||
// console.info('[Dashboard] Visible permission keys:', visibleKeys)
|
||||
// } catch (e) {
|
||||
// console.warn('[Dashboard] Failed to log permissions', e)
|
||||
// }
|
||||
// }
|
||||
|
||||
// Module Configs computed with i18n
|
||||
const MODULE_CONFIGS = computed(() => {
|
||||
const configs: Record<string, any> = {}
|
||||
@ -147,6 +170,8 @@ const initModules = async () => {
|
||||
}
|
||||
|
||||
accessibleModules.value = modules
|
||||
// 打印当前用户权限以及哪些组件被允许显示
|
||||
// logPermissions(permissions.value || [], modules)
|
||||
}
|
||||
|
||||
const refreshModule = (moduleName: string) => {
|
||||
|
||||
70
src/views/order/orderManagement/component/orderdetail.vue
Normal file
70
src/views/order/orderManagement/component/orderdetail.vue
Normal file
@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div class="order-detail-items">
|
||||
<el-table :data="items" border stripe size="small" style="width: 100%" v-loading="loading">
|
||||
<el-table-column prop="item_code" label="商品编码" width="150" />
|
||||
<el-table-column prop="item_name" label="商品名称" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="ext_code" label="规格编码" width="150" />
|
||||
<el-table-column prop="plan_qty" label="计划数量" width="100" align="center" />
|
||||
<el-table-column prop="actual_price" label="实付单价" width="100" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.actual_price ? parseFloat(row.actual_price).toFixed(2) : '0.00' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="retail_price" label="零售单价" width="100" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ row.retail_price ? parseFloat(row.retail_price).toFixed(2) : '0.00' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inventory_type" label="库存类型" width="100" align="center" />
|
||||
<el-table-column prop="source_order_code" label="平台单号" width="180" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import * as orderApi from '@/api/order/order'
|
||||
|
||||
const props = defineProps<{
|
||||
orderId?: number | string
|
||||
orderCode?: string
|
||||
}>()
|
||||
|
||||
const items = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
|
||||
const loadDetail = async () => {
|
||||
if (!props.orderId && !props.orderCode) {
|
||||
items.value = []
|
||||
return
|
||||
}
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
const params: any = {}
|
||||
if (props.orderId) params.id = props.orderId
|
||||
if (props.orderCode) params.delivery_order_code = props.orderCode
|
||||
|
||||
const res = await orderApi.orderDetail(params)
|
||||
if (res && res.code === 200 && res.data) {
|
||||
items.value = res.data.items || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load order items:', error)
|
||||
items.value = []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watch(() => props.orderId, loadDetail)
|
||||
watch(() => props.orderCode, loadDetail)
|
||||
|
||||
onMounted(loadDetail)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.order-detail-items {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
@ -103,17 +103,22 @@ export const deliveryAvailableFields = [
|
||||
]
|
||||
|
||||
export const deliveryColumns = [
|
||||
{ prop: 'delivery_order_code', label: '出库单号', width: '160' },
|
||||
{ prop: 'pre_delivery_order_code', label: '前置单号', width: '160' },
|
||||
{ prop: 'shop_nick', label: '店铺名称', width: '120' },
|
||||
{ prop: 'buyer_nick', label: '买家昵称', width: '120' },
|
||||
{ prop: 'name', label: '收件人', width: '100' },
|
||||
{ prop: 'mobile', label: '移动电话', width: '120' },
|
||||
{ prop: 'tel', label: '固定电话', width: '120' },
|
||||
{ prop: 'province', label: '省', width: '100' },
|
||||
{ prop: 'city', label: '市', width: '100' },
|
||||
{ prop: 'status', label: '审核状态', width: '100' },
|
||||
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
||||
{ prop: 'total_amount', label: '总金额', width: '100' },
|
||||
{ prop: 'items_count', label: '商品种类', width: '100' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '100' },
|
||||
{ prop: 'create_at', label: '创建日期', width: '160' },
|
||||
{ prop: 'delivery_time', label: '发货时间', width: '160' },
|
||||
{ prop: 'source_platform_name', label: '订单来源', width: '120' },
|
||||
{ prop: 'logistics_name', label: '快递', width: '120' },
|
||||
{ prop: 'pre_delivery_order_code', label: '发货单号', width: '160' },
|
||||
{ prop: 'sync_status', label: '同步', width: '100' },
|
||||
{ prop: 'place_order_time', label: '下单时间', width: '160' },
|
||||
{ prop: 'source_platform_name', label: '平台来源', width: '120' },
|
||||
]
|
||||
|
||||
export const deliverydetail = [
|
||||
|
||||
272
src/views/order/orderManagement/deliveryException.vue
Normal file
272
src/views/order/orderManagement/deliveryException.vue
Normal file
@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<div class="order-sub-container">
|
||||
<scan-box
|
||||
ref="scanBox"
|
||||
width="320px"
|
||||
:tree-props="{ children: 'children', label: 'label' }"
|
||||
:auto-submit="false"
|
||||
:preset-tree="presetTree"
|
||||
:available-fields="availableFieldsRef"
|
||||
@condition-change="handleConditionChange"
|
||||
@reset="handleConditionReset"
|
||||
@condition-clear="handleConditionClear"
|
||||
/>
|
||||
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<el-input size="small" placeholder="搜索订单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="upper-wrapper">
|
||||
<upper-table
|
||||
ref="upperTable"
|
||||
title="配送异常列表"
|
||||
:data="list"
|
||||
:columns="columns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-actions="true"
|
||||
:show-selection="true"
|
||||
:loading="loading"
|
||||
:queryTime="queryTime"
|
||||
@current-change="handleRowClick"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="loadData"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-order_status="{ row }">
|
||||
<el-tag :type="getStatusType(row.order_status)" size="small">
|
||||
{{ translateOrderField('order_status', row.order_status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="row.status === 'finished' ? 'success' : 'info'" size="small">
|
||||
{{ translateOrderField('status', row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无配送异常</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
|
||||
<div class="lower-level" v-if="selectedOrderId" :class="tableSize">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单详情" name="details" />
|
||||
<el-tab-pane label="履约记录" name="fulfillment" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<div v-if="activeTab === 'details'">
|
||||
<detail :data="selectedRow" :config="archiveOrderDetail" :column="3" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'fulfillment'">
|
||||
<p>履约历程加载中...</p>
|
||||
</div>
|
||||
<div v-else>
|
||||
<log :data="selectedRow" />
|
||||
</div>
|
||||
</KeepAlive>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="no-selection" v-else>
|
||||
<div class="empty-tip">
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index'
|
||||
import { getarchiveOrderlist } from '@/api/order/order'
|
||||
|
||||
import {
|
||||
archiveAvailableFields,
|
||||
archiveColumns,
|
||||
archiveOrderDetail,
|
||||
translateOrderField
|
||||
} from './config/order-common-config'
|
||||
import detail from './component/detail.vue'
|
||||
import log from './component/log.vue'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
|
||||
const presetTree = ref<any[]>([])
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(archiveAvailableFields)))
|
||||
|
||||
const activeTab = ref('details')
|
||||
|
||||
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 })
|
||||
const tableSize = ref('small')
|
||||
const columns = ref(archiveColumns)
|
||||
|
||||
|
||||
const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
const selectedOrderId = ref<number | string | null>(null)
|
||||
|
||||
const quickSearch = ref('')
|
||||
|
||||
const selectedRow = computed(() => {
|
||||
return list.value.find((i: any) => i.id === selectedOrderId.value) || null
|
||||
})
|
||||
|
||||
function translateField(fieldValue: string, value: any) {
|
||||
const field = availableFieldsRef.find((f: any) => f.value === fieldValue)
|
||||
if (field && field.options) {
|
||||
const option = field.options.find((opt: any) => opt.value === value)
|
||||
return option ? option.label : value
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
function getStatusType(status: string) {
|
||||
return 'info'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
loadFilterData()
|
||||
})
|
||||
|
||||
async function loadData() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
limit: pagination.pageSize,
|
||||
quickSearch: quickSearch.value,
|
||||
...scanBox.value?.getConditions?.()
|
||||
}
|
||||
const res = await getarchiveOrderlist(params)
|
||||
if (res.code === 200) {
|
||||
list.value = res.data || []
|
||||
pagination.total = res.total || 0
|
||||
} else {
|
||||
throw new Error(res.msg || '接口返回异常')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载配送异常失败,使用模拟数据:', e)
|
||||
const mockData = [
|
||||
{
|
||||
id: 201,
|
||||
delivery_order_code: 'DE20260102001',
|
||||
order_code: 'SO20260102001',
|
||||
shop_nick: '示例店铺',
|
||||
status: 'finished',
|
||||
name: '测试用户',
|
||||
mobile: '13800000001',
|
||||
province: '省份',
|
||||
city: '城市',
|
||||
area: '区县',
|
||||
detail_address: '测试地址',
|
||||
total_amount: 50.00,
|
||||
items_count: 1,
|
||||
items_total: 1,
|
||||
create_at: '2026-01-02 10:00:00',
|
||||
updated_at: '2026-01-02 11:00:00'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
}
|
||||
}
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' })
|
||||
])
|
||||
if (storesRes?.code === 200) {
|
||||
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
||||
if (f) f.options = storesRes.stores || []
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function handleConditionChange() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleConditionClear() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleConditionReset() {
|
||||
pagination.currentPage = 1
|
||||
scanBox.value?.reset?.()
|
||||
loadData()
|
||||
}
|
||||
|
||||
function onSelectionChange(rows: any[]) {
|
||||
selectionRows.value = rows || []
|
||||
hasSelection.value = selectionRows.value.length > 0
|
||||
}
|
||||
|
||||
function handleRowClick(row: any) {
|
||||
selectedOrderId.value = row?.id || null
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
pagination.currentPage = page
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handlePageSizeChange(size: number) {
|
||||
pagination.pageSize = size
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function onQuickSearch() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
exportLoading.value = true
|
||||
setTimeout(() => {
|
||||
exportLoading.value = false
|
||||
ElMessage.success('导出成功')
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "./styles/order-sub.scss";
|
||||
</style>
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="delivery-order-container">
|
||||
<div class="order-sub-container">
|
||||
<scan-box
|
||||
ref="scanBox"
|
||||
width="320px"
|
||||
@ -80,9 +80,9 @@
|
||||
@refresh="loadData"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-order_status="{ row }">
|
||||
<el-tag :type="getStatusType(row.order_status)" size="small">
|
||||
{{ translateOrderField('order_status', row.order_status) }}
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="row.status === 'pedding' ? 'info' : row.status === 'created' ? 'success' : 'warning'" size="small">
|
||||
{{ translateOrderField('status', row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
@ -103,6 +103,7 @@
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单明细" name="details" />
|
||||
<el-tab-pane label="商品明细" name="items" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
@ -110,7 +111,10 @@
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<div v-if="activeTab === 'details'">
|
||||
<detail :data="selectedRow" :config="deliverydetail" :column="3" />
|
||||
<detail :data="selectedDetail" :config="deliverydetail" :column="3" v-loading="detailLoading" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'items'">
|
||||
<orderdetail :orderId="selectedOrderId" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<log :data="selectedRow" />
|
||||
@ -147,6 +151,7 @@ import {
|
||||
} from './config/order-common-config'
|
||||
import detail from './component/detail.vue'
|
||||
import log from './component/log.vue'
|
||||
import orderdetail from './component/orderdetail.vue'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
@ -158,6 +163,7 @@ const activeTab = ref('details')
|
||||
|
||||
const list = ref<any[]>([])
|
||||
const loading = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const exportLoading = ref(false)
|
||||
const queryTime = ref(0)
|
||||
|
||||
@ -169,6 +175,7 @@ const columns = ref(deliveryColumns)
|
||||
const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
const selectedOrderId = ref<number | string | null>(null)
|
||||
const selectedDetail = ref<any>(null)
|
||||
|
||||
const quickSearch = ref('')
|
||||
|
||||
@ -176,6 +183,20 @@ const selectedRow = computed(() => {
|
||||
return list.value.find((i: any) => i.id === selectedOrderId.value) || null
|
||||
})
|
||||
|
||||
async function fetchOrderDetail(id: number | string) {
|
||||
detailLoading.value = true
|
||||
try {
|
||||
const res = await orderApi.orderDetail({ id })
|
||||
if (res && res.code === 200 && res.data) {
|
||||
selectedDetail.value = res.data.order
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Fetch detail error:', e)
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function translateField(fieldValue: string, value: any) {
|
||||
const field = availableFieldsRef.find((f: any) => f.value === fieldValue)
|
||||
if (field && field.options) {
|
||||
@ -206,99 +227,25 @@ async function loadData() {
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize,
|
||||
pagination: {
|
||||
page: pagination.currentPage,
|
||||
pageSize: pagination.pageSize
|
||||
},
|
||||
quickSearch: quickSearch.value,
|
||||
condition: scanBox.value?.getCondition ? scanBox.value.getCondition() : {}
|
||||
where: scanBox.value?.getCondition ? scanBox.value.getCondition() : {}
|
||||
}
|
||||
const res: any = await orderApi.getdeliveryOrderlist(params)
|
||||
if (res && res.code === 200 && res.list) {
|
||||
list.value = res.list
|
||||
pagination.total = res.total || 0
|
||||
const res: any = await orderApi.orderList(params)
|
||||
if (res && res.code === 200 && res.data) {
|
||||
list.value = res.data.list || []
|
||||
pagination.total = res.data.total || (res.data.list ? res.data.list.length : 0)
|
||||
} else {
|
||||
throw new Error('Fallback to mock data')
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
}
|
||||
} catch (e) {
|
||||
// 模拟基于数据库结构扩展后的数据
|
||||
const mockData = [
|
||||
{
|
||||
id: 14,
|
||||
shop_nick: '线下店铺',
|
||||
name: '刘付明仁',
|
||||
mobile: '18022440198',
|
||||
tel: '18022440198',
|
||||
province: '广东省',
|
||||
create_at: '2026-01-13 14:17:35',
|
||||
delivery_time: '2026-01-13 15:00:00',
|
||||
source_platform_name: '线下',
|
||||
logistics_name: '顺丰',
|
||||
pre_delivery_order_code: '2885-831',
|
||||
sync_status: 'padding',
|
||||
total_amount: 0.00,
|
||||
item_amount: 0.00,
|
||||
discount_amount: 0.00,
|
||||
item_name: '示例商品A',
|
||||
items: '101845+5',
|
||||
items_count: 1,
|
||||
items_total: 5,
|
||||
items_weight: 0.00,
|
||||
store_id: 1000016,
|
||||
country_code: 'CN',
|
||||
detail_address: '钟落潭良沙二路32号'
|
||||
},
|
||||
{
|
||||
id: 21,
|
||||
shop_nick: '火火家de小店',
|
||||
name: '刘付明仁',
|
||||
mobile: '18022440198',
|
||||
tel: '18022440198',
|
||||
province: '广东省',
|
||||
create_at: '2026-01-13 15:26:07',
|
||||
delivery_time: '2026-01-13 16:00:00',
|
||||
source_platform_name: '拼多多',
|
||||
logistics_name: '顺丰空运',
|
||||
pre_delivery_order_code: 'JY2026011327233',
|
||||
sync_status: 'padding',
|
||||
total_amount: 10.00,
|
||||
item_amount: 10.00,
|
||||
discount_amount: 0.00,
|
||||
item_name: '示例商品B',
|
||||
items: '101384+10',
|
||||
items_count: 1,
|
||||
items_total: 10,
|
||||
items_weight: 0.00,
|
||||
store_id: 1000000,
|
||||
country_code: 'CN',
|
||||
detail_address: '广东省 广州市 白云区 太和镇 二路32号'
|
||||
},
|
||||
{
|
||||
id: 29,
|
||||
shop_nick: 'af69a68',
|
||||
name: '肖宇玄',
|
||||
mobile: '18727038559',
|
||||
tel: '18727038559',
|
||||
province: '北京',
|
||||
create_at: '2026-01-20 13:02:59',
|
||||
delivery_time: '2026-01-20 14:00:00',
|
||||
source_platform_name: '线下',
|
||||
logistics_name: 'YTO',
|
||||
pre_delivery_order_code: 'CK26012000894',
|
||||
sync_status: 'padding',
|
||||
total_amount: 12990.00,
|
||||
item_amount: 0.00,
|
||||
discount_amount: 0.00,
|
||||
item_name: '示例商品C',
|
||||
items: '101874+100|101875+1@2',
|
||||
items_count: 2,
|
||||
items_total: 101,
|
||||
items_weight: 2.00,
|
||||
store_id: 1000016,
|
||||
country_code: 'CN',
|
||||
detail_address: '湖北省襄阳市宏泰越秀星汇城'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
console.error('loadData error:', e)
|
||||
list.value = []
|
||||
pagination.total = 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
@ -346,6 +293,11 @@ function onSelectionChange(rows: any[]) {
|
||||
|
||||
function handleRowClick(row: any) {
|
||||
selectedOrderId.value = row?.id || null
|
||||
if (selectedOrderId.value) {
|
||||
fetchOrderDetail(selectedOrderId.value)
|
||||
} else {
|
||||
selectedDetail.value = null
|
||||
}
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
@ -431,86 +383,6 @@ function handleDeliveryPrintOperation(command: string) {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.delivery-order-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: #f0f2f5;
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
overflow: hidden;
|
||||
|
||||
.toolbar {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.toolbar-right {
|
||||
display: flex;
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.upper-wrapper {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.upper-wrapper :deep(.upper-table-container) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.upper-wrapper :deep(.table-container) {
|
||||
height: auto !important;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.upper-wrapper :deep(.el-table__body-wrapper) {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.lower-level {
|
||||
height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-top: 1px solid #ebeef5;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
|
||||
.detail-header {
|
||||
padding: 0 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
.detail-tab { margin-bottom: -1px; }
|
||||
}
|
||||
|
||||
.detail-container {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.no-selection {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
.empty-tip { text-align: center; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@use "./styles/order-sub.scss";
|
||||
</style>
|
||||
|
||||
|
||||
272
src/views/order/orderManagement/entrustWarehouse.vue
Normal file
272
src/views/order/orderManagement/entrustWarehouse.vue
Normal file
@ -0,0 +1,272 @@
|
||||
<template>
|
||||
<div class="order-sub-container">
|
||||
<scan-box
|
||||
ref="scanBox"
|
||||
width="320px"
|
||||
:tree-props="{ children: 'children', label: 'label' }"
|
||||
:auto-submit="false"
|
||||
:preset-tree="presetTree"
|
||||
:available-fields="availableFieldsRef"
|
||||
@condition-change="handleConditionChange"
|
||||
@reset="handleConditionReset"
|
||||
@condition-clear="handleConditionClear"
|
||||
/>
|
||||
|
||||
<div class="main-content">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button size="small" type="primary" @click="loadData">刷新</el-button>
|
||||
<el-button size="small" :loading="exportLoading" @click="handleExport">导出</el-button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<el-input size="small" placeholder="搜索订单号" v-model="quickSearch" style="width:220px" @keyup.enter.native="onQuickSearch" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="upper-wrapper">
|
||||
<upper-table
|
||||
ref="upperTable"
|
||||
title="委托外仓列表"
|
||||
:data="list"
|
||||
:columns="columns"
|
||||
:table-size="tableSize"
|
||||
:pagination="pagination"
|
||||
:show-index="true"
|
||||
:show-actions="true"
|
||||
:show-selection="true"
|
||||
:loading="loading"
|
||||
:queryTime="queryTime"
|
||||
@current-change="handleRowClick"
|
||||
@page-change="handlePageChange"
|
||||
@page-size-change="handlePageSizeChange"
|
||||
@refresh="loadData"
|
||||
@selection-change="onSelectionChange"
|
||||
>
|
||||
<template #column-order_status="{ row }">
|
||||
<el-tag :type="getStatusType(row.order_status)" size="small">
|
||||
{{ translateOrderField('order_status', row.order_status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #column-status="{ row }">
|
||||
<el-tag :type="row.status === 'finished' ? 'success' : 'info'" size="small">
|
||||
{{ translateOrderField('status', row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<div class="empty-tip">暂无委托外仓订单</div>
|
||||
</template>
|
||||
</upper-table>
|
||||
</div>
|
||||
|
||||
<div class="lower-level" v-if="selectedOrderId" :class="tableSize">
|
||||
<div class="detail-header">
|
||||
<el-tabs v-model="activeTab" class="detail-tab">
|
||||
<el-tab-pane label="订单详情" name="details" />
|
||||
<el-tab-pane label="履约记录" name="fulfillment" />
|
||||
<el-tab-pane label="操作日志" name="logs" />
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<div class="detail-container">
|
||||
<KeepAlive>
|
||||
<div v-if="activeTab === 'details'">
|
||||
<detail :data="selectedRow" :config="archiveOrderDetail" :column="3" />
|
||||
</div>
|
||||
<div v-else-if="activeTab === 'fulfillment'">
|
||||
<p>履约历程加载中...</p>
|
||||
</div>
|
||||
<div v-else>
|
||||
<log :data="selectedRow" />
|
||||
</div>
|
||||
</KeepAlive>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="no-selection" v-else>
|
||||
<div class="empty-tip">
|
||||
<p>请从上方列表中选择一项查看详情</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import ScanBox from '@/components/ScanBox/index.vue'
|
||||
import UpperTable from '@/components/UpperTable/index.vue'
|
||||
import * as indexApi from '@/api/index'
|
||||
import { getarchiveOrderlist } from '@/api/order/order'
|
||||
|
||||
import {
|
||||
archiveAvailableFields,
|
||||
archiveColumns,
|
||||
archiveOrderDetail,
|
||||
translateOrderField
|
||||
} from './config/order-common-config'
|
||||
import detail from './component/detail.vue'
|
||||
import log from './component/log.vue'
|
||||
|
||||
const scanBox = ref<any>(null)
|
||||
const upperTable = ref<any>(null)
|
||||
|
||||
const presetTree = ref<any[]>([])
|
||||
const availableFieldsRef = reactive(JSON.parse(JSON.stringify(archiveAvailableFields)))
|
||||
|
||||
const activeTab = ref('details')
|
||||
|
||||
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 })
|
||||
const tableSize = ref('small')
|
||||
const columns = ref(archiveColumns)
|
||||
|
||||
|
||||
const selectionRows = ref<any[]>([])
|
||||
const hasSelection = ref(false)
|
||||
const selectedOrderId = ref<number | string | null>(null)
|
||||
|
||||
const quickSearch = ref('')
|
||||
|
||||
const selectedRow = computed(() => {
|
||||
return list.value.find((i: any) => i.id === selectedOrderId.value) || null
|
||||
})
|
||||
|
||||
function translateField(fieldValue: string, value: any) {
|
||||
const field = availableFieldsRef.find((f: any) => f.value === fieldValue)
|
||||
if (field && field.options) {
|
||||
const option = field.options.find((opt: any) => opt.value === value)
|
||||
return option ? option.label : value
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
function getStatusType(status: string) {
|
||||
return 'info'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
loadFilterData()
|
||||
})
|
||||
|
||||
async function loadData() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
const start = Date.now()
|
||||
try {
|
||||
const params = {
|
||||
page: pagination.currentPage,
|
||||
limit: pagination.pageSize,
|
||||
quickSearch: quickSearch.value,
|
||||
...scanBox.value?.getConditions?.()
|
||||
}
|
||||
const res = await getarchiveOrderlist(params)
|
||||
if (res.code === 200) {
|
||||
list.value = res.data || []
|
||||
pagination.total = res.total || 0
|
||||
} else {
|
||||
throw new Error(res.msg || '接口返回异常')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('加载委托外仓失败,使用模拟数据:', e)
|
||||
const mockData = [
|
||||
{
|
||||
id: 101,
|
||||
delivery_order_code: 'EW20260101001',
|
||||
order_code: 'SO20260101001',
|
||||
shop_nick: '示例店铺',
|
||||
status: 'finished',
|
||||
name: '测试用户',
|
||||
mobile: '13800000000',
|
||||
province: '省份',
|
||||
city: '城市',
|
||||
area: '区县',
|
||||
detail_address: '测试地址',
|
||||
total_amount: 100.00,
|
||||
items_count: 2,
|
||||
items_total: 3,
|
||||
create_at: '2026-01-01 10:00:00',
|
||||
updated_at: '2026-01-02 11:00:00'
|
||||
}
|
||||
]
|
||||
list.value = mockData
|
||||
pagination.total = mockData.length
|
||||
} finally {
|
||||
loading.value = false
|
||||
queryTime.value = Date.now() - start
|
||||
}
|
||||
}
|
||||
|
||||
async function loadFilterData() {
|
||||
try {
|
||||
const [storesRes]: any = await Promise.all([
|
||||
indexApi.loadStores({ type: 'order' })
|
||||
])
|
||||
if (storesRes?.code === 200) {
|
||||
const f = availableFieldsRef.find((i: any) => i.value === 'store_id')
|
||||
if (f) f.options = storesRes.stores || []
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
function handleConditionChange() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleConditionClear() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleConditionReset() {
|
||||
pagination.currentPage = 1
|
||||
scanBox.value?.reset?.()
|
||||
loadData()
|
||||
}
|
||||
|
||||
function onSelectionChange(rows: any[]) {
|
||||
selectionRows.value = rows || []
|
||||
hasSelection.value = selectionRows.value.length > 0
|
||||
}
|
||||
|
||||
function handleRowClick(row: any) {
|
||||
selectedOrderId.value = row?.id || null
|
||||
}
|
||||
|
||||
function handlePageChange(page: number) {
|
||||
pagination.currentPage = page
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handlePageSizeChange(size: number) {
|
||||
pagination.pageSize = size
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function onQuickSearch() {
|
||||
pagination.currentPage = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
exportLoading.value = true
|
||||
setTimeout(() => {
|
||||
exportLoading.value = false
|
||||
ElMessage.success('导出成功')
|
||||
}, 1000)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "./styles/order-sub.scss";
|
||||
</style>
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div style="width:100%;height: 100%;">
|
||||
<div class="order-management-wrapper" :style="{ height: containerHeight }">
|
||||
<!-- 使用 keep-alive 强制保留所有标签 -->
|
||||
<el-tabs
|
||||
v-model="activeTab"
|
||||
@ -36,16 +36,23 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { ref, watch, onMounted, computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useSettingsStore } from '@/stores/modules/settings'
|
||||
import ReviewOrder from './reviewOrder.vue'
|
||||
import PendingOrder from './pendingOrder.vue'
|
||||
import ExceptionOrder from './exceptionOrder.vue'
|
||||
import DeliveryOrder from './deliveryOrder.vue'
|
||||
import EntrustWarehouse from './entrustWarehouse.vue'
|
||||
import DeliveryException from './deliveryException.vue'
|
||||
import ArchiveOrder from './archiveOrder.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const settingsStore = useSettingsStore()
|
||||
|
||||
const shortcutExpanded = computed(() => settingsStore.shortcutExpanded)
|
||||
const containerHeight = computed(() => shortcutExpanded.value ? 'calc(100vh - 150px)' : 'calc(100vh - 100px)')
|
||||
|
||||
const activeTab = ref('reviewOrder')
|
||||
const forceRenderAll = ref(false) // 只有 activeTab 对应的组件会被渲染
|
||||
@ -69,12 +76,24 @@ const tabs = ref([
|
||||
count: 3,
|
||||
component: ExceptionOrder
|
||||
},
|
||||
{
|
||||
name: 'entrustWarehouse',
|
||||
label: '委托外仓',
|
||||
count: 0,
|
||||
component: EntrustWarehouse
|
||||
},
|
||||
{
|
||||
name: 'deliveryOrder',
|
||||
label: '配送订单',
|
||||
count: 0,
|
||||
component: DeliveryOrder
|
||||
},
|
||||
{
|
||||
name: 'deliveryException',
|
||||
label: '配送异常',
|
||||
count: 0,
|
||||
component: DeliveryException
|
||||
},
|
||||
{
|
||||
name: 'archiveOrder',
|
||||
label: '归档订单',
|
||||
@ -151,6 +170,11 @@ const handleTabClick = (tab: any) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order-management-wrapper {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@ -13,7 +13,8 @@
|
||||
|
||||
.toolbar {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #ebeef5;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
@ -192,6 +192,21 @@
|
||||
/>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 批量修改库存单位对话框 -->
|
||||
<el-dialog title="批量修改库存单位" align-center v-model="showBatchDialog" width="420px">
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="库存单位">
|
||||
<el-select v-model="batchDialogValue" placeholder="请选择库存单位" filterable>
|
||||
<el-option v-for="opt in batchDialogOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="showBatchDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmBatchDialog">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 抽屉:回收站 -->
|
||||
<el-drawer v-model="showRecycle" :with-header="false" direction="rtl" size="800px">
|
||||
<Recycle :drawer-visible="showRecycle" />
|
||||
@ -239,6 +254,11 @@ const hasPermission = (perm: string) => {
|
||||
// Refs
|
||||
const scanBoxRef = ref()
|
||||
const accountTableRef = ref()
|
||||
// 批量修改对话框状态
|
||||
const showBatchDialog = ref(false)
|
||||
const batchDialogOptions = ref<any[]>([])
|
||||
const batchDialogValue = ref<any>(null)
|
||||
const batchDialogCommand = ref('')
|
||||
|
||||
// State
|
||||
const drawer = ref(false)
|
||||
@ -421,7 +441,15 @@ const handleBatchChange = async (command: string) => {
|
||||
try {
|
||||
let value: any
|
||||
if (config.type === 'select') {
|
||||
const { value: inputValue } = await ElMessageBox.prompt(`请输入${config.title}`, `批量修改${config.title}`, {
|
||||
// 如果是库存单位,使用下拉对话框替代输入框
|
||||
if (command === 'stock_unit') {
|
||||
batchDialogOptions.value = config.options || []
|
||||
batchDialogValue.value = batchDialogOptions.value.length ? batchDialogOptions.value[0].value : ''
|
||||
batchDialogCommand.value = command
|
||||
showBatchDialog.value = true
|
||||
return
|
||||
}
|
||||
const { value: inputValue } = await ElMessageBox.prompt(`请输入${config.title}`, `批量修改${config.title}`, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPlaceholder: config.placeholder,
|
||||
@ -469,6 +497,18 @@ const submitBatchChange = async (command: string, value: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
const confirmBatchDialog = async () => {
|
||||
try {
|
||||
await submitBatchChange(batchDialogCommand.value, batchDialogValue.value)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
} finally {
|
||||
showBatchDialog.value = false
|
||||
batchDialogValue.value = null
|
||||
batchDialogCommand.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
const handleExport = () => {
|
||||
ElMessage.info('导出功能待后端接口确认')
|
||||
}
|
||||
@ -626,3 +666,24 @@ const loadStockUnits = async () => {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.batch-dialog {
|
||||
--dialog-padding-vertical: 18px;
|
||||
}
|
||||
.batch-dialog :deep(.el-dialog__body) {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
.batch-dialog :deep(.el-form-item) {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.batch-dialog :deep(.el-form-item__content) {
|
||||
display: block;
|
||||
}
|
||||
.batch-dialog :deep(.el-select) {
|
||||
width: 100%;
|
||||
}
|
||||
.batch-dialog :deep(.el-dialog__footer) {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
1028
src/接口文档1.txt
1028
src/接口文档1.txt
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user