修改目录结构

This commit is contained in:
zm2000 2026-05-27 18:24:09 +08:00
parent 64f36ce3a2
commit 0d35987428
8 changed files with 239 additions and 158 deletions

View File

@ -61,3 +61,11 @@ export function fetchOrderList(params: OrderListParams = {}, options?: RequestOp
...params,
}, options)
}
/** 查询单个订单详情(订单头、商品明细、运单信息) */
export function fetchOrderDetail(id: string | number, options?: RequestOptions) {
return request<ApiBody>('order.detail', {
...workerPayload,
id,
}, options)
}

View File

@ -48,9 +48,10 @@
</view>
</view>
<scroll-view v-if="activeLeftAction === 'currentWave'" class="left-reviewed-list" scroll-y>
<scroll-view v-if="activeLeftAction === 'currentWave'" class="left-reviewed-list left-reviewed-list--current-wave" scroll-y>
<view class="table-wrap table-wrap--current-wave">
<view class="table-header">
<view class="table-header table-header--sticky">
<text class="table-cell cell-index">序号</text>
<text class="table-cell cell-pending-order">待处理订单号</text>
</view>
@ -60,8 +61,14 @@
v-else
v-for="(item, index) in displayCurrentWaveOrders"
:key="`${item.pendingOrderNo}-${index}`"
class="table-row"
:class="[
'table-row',
index % 2 === 1 ? 'table-row--alt' : '',
selectedPendingOrderKey === getPendingOrderKey(item) ? 'table-row--selected' : '',
]"
@click="handlePendingOrderClick(item)"
>
<text class="table-cell cell-index">{{ (orderPagination.page - 1) * orderPagination.pageSize + index + 1 }}</text>
<text class="table-cell cell-pending-order">{{ item.pendingOrderNo }}</text>
</view>
</view>
@ -80,7 +87,7 @@
<scroll-view v-else-if="activeLeftAction === 'reviewedList'" class="left-reviewed-list" scroll-y>
<view class="table-wrap table-wrap--reviewed">
<view class="table-header">
<view class="table-header table-header--sticky">
<text class="table-cell cell-index">序号</text>
<text class="table-cell cell-order-no">订单号</text>
<text class="table-cell cell-wave-no">波次号</text>
@ -88,7 +95,12 @@
<view class="table-body">
<view v-if="displayReviewedOrders.length === 0" class="empty">暂无匹配数据</view>
<view v-else v-for="(item, index) in displayReviewedOrders" :key="`${item.orderNo}-${index}`" class="table-row">
<view
v-else
v-for="(item, index) in displayReviewedOrders"
:key="`${item.orderNo}-${index}`"
:class="['table-row', index % 2 === 1 ? 'table-row--alt' : '']"
>
<text class="table-cell cell-index">{{ index + 1 }}</text>
<text class="table-cell cell-order-no">{{ item.orderNo }}</text>
<text class="table-cell cell-wave-no">{{ item.waveNo }}</text>
@ -120,9 +132,9 @@
</view>
<view class="panel-right">
<scroll-view class="table-scroll" scroll-x>
<view class="table-wrap">
<view class="table-header">
<scroll-view class="table-scroll table-scroll--detail" scroll-x scroll-y>
<view class="table-wrap table-wrap--detail">
<view class="table-header table-header--sticky">
<text class="table-cell cell-blue-no">蓝号</text>
<text class="table-cell cell-qty">数量</text>
<text class="table-cell cell-scan">扫描记</text>
@ -134,7 +146,12 @@
<view class="table-body">
<view v-if="displayOrders.length === 0" class="empty">暂无匹配数据</view>
<view v-else v-for="order in displayOrders" :key="order.barcode" class="table-row">
<view
v-else
v-for="(order, index) in displayOrders"
:key="order.barcode"
:class="['table-row', index % 2 === 1 ? 'table-row--alt' : '']"
>
<text class="table-cell cell-blue-no">{{ order.blueNo }}</text>
<text class="table-cell cell-qty">{{ order.quantity }}</text>
<text class="table-cell cell-scan">{{ order.scanMark }}</text>
@ -155,7 +172,7 @@
<script>
import TopNav from '@/components/top-nav.vue'
import { fetchOrderList } from '@/api/order'
import { fetchOrderDetail, fetchOrderList } from '@/api/order'
export default {
name: 'OrderReviewOnePage',
@ -194,10 +211,13 @@ export default {
{ orderNo: 'DD202605190003', waveNo: 'WC002' },
],
allCurrentWaveOrders: [
{ pendingOrderNo: 'DD202605190101' },
{ pendingOrderNo: 'DD202605190102' },
{ pendingOrderNo: 'DD202605190103' },
{ id: '1', pendingOrderNo: 'DD202605190101' },
{ id: '2', pendingOrderNo: 'DD202605190102' },
{ id: '3', pendingOrderNo: 'DD202605190103' },
],
selectedPendingOrderKey: '',
currentOrderHeader: null,
currentWaybillInfo: null,
}
},
created() {
@ -228,17 +248,43 @@ export default {
}
return ''
},
getPendingOrderKey(order) {
return String(this.getRowValue(order, ['id', 'pendingOrderNo']))
},
normalizeOrderRow(row) {
return {
blueNo: this.getRowValue(row, ['blueNo', 'blue_no', 'lanhao', 'lan_hao']),
quantity: this.getRowValue(row, ['quantity', 'qty', 'num']),
blueNo: this.getRowValue(row, ['blueNo', 'blue_no', 'lanhao', 'lan_hao', 'blue_no_code']),
quantity: this.getRowValue(row, ['plan_qty', 'quantity', 'qty', 'num', 'count']),
scanMark: this.getRowValue(row, ['scanMark', 'scan_mark', 'scanStatus', 'scan_status']),
barcode: this.getRowValue(row, ['barcode', 'bar_code', 'goods_barcode']),
productName: this.getRowValue(row, ['productName', 'product_name', 'goods_name', 'sku_name']),
barcode: this.getRowValue(row, ['barcode', 'bar_code', 'goods_barcode', 'sku_barcode']),
productName: this.getRowValue(row, ['productName', 'product_name', 'goods_name', 'sku_name', 'item_name']),
color: this.getRowValue(row, ['color', 'color_name']),
spec: this.getRowValue(row, ['spec', 'spec_name', 'size']),
spec: this.getRowValue(row, ['sku_property', 'spec', 'spec_name', 'size', 'sku_spec']),
}
},
parseItemSnapshot(snapshotRaw) {
if (!snapshotRaw) {
return {}
}
if (typeof snapshotRaw === 'string') {
try {
const parsed = JSON.parse(snapshotRaw)
return typeof parsed === 'object' && parsed ? parsed : {}
} catch (error) {
return {}
}
}
return typeof snapshotRaw === 'object' ? snapshotRaw : {}
},
normalizeOrderDetailItem(item) {
const snapshot = this.parseItemSnapshot(this.getRowValue(item, ['item_snapshot', 'itemSnapshot']))
return this.normalizeOrderRow({
...item,
...snapshot,
})
},
buildOrderWhere() {
const query = this.keyword.trim()
if (!query) {
@ -273,6 +319,7 @@ export default {
const pendingOrders = list
.map((item) => {
return {
id: this.getRowValue(item, ['id', 'order_id']),
pendingOrderNo: this.getRowValue(item, ['delivery_order_code']),
}
})
@ -340,6 +387,32 @@ export default {
this.loadOrderList(1)
},
async handlePendingOrderClick(order) {
this.selectedPendingOrderKey = this.getPendingOrderKey(order)
const id = this.getRowValue(order, ['id'])
if (!id) {
uni.showToast({
title: '订单ID缺失',
icon: 'none',
})
return
}
try {
const body = await fetchOrderDetail(id)
const payload = body?.data || body?.result || body || {}
const items = Array.isArray(payload?.items) ? payload.items : []
this.currentOrderHeader = payload?.order || payload?.orderHeader || null
this.currentWaybillInfo = payload?.waybill || payload?.waybillInfo || null
this.displayOrders = items.map((item) => this.normalizeOrderDetailItem(item))
} catch (error) {
uni.showToast({
title: '订单详情加载失败',
icon: 'none',
})
}
},
},
}
</script>
@ -405,7 +478,11 @@ export default {
.left-reviewed-list {
margin-top: 14rpx;
max-height: 520rpx;
max-height: 1100rpx;
}
.left-reviewed-list--current-wave {
max-height: 1100rpx;
}
.settings-panel {
@ -521,6 +598,10 @@ export default {
width: 100%;
}
.table-scroll--detail {
max-height: 520rpx;
}
.pagination-bar {
margin-top: 16rpx;
display: flex;
@ -563,6 +644,18 @@ export default {
min-width: 620rpx;
}
.table-wrap--detail .table-cell {
align-self: stretch;
display: flex;
align-items: center;
border-right: 1rpx solid #eef2f8;
box-sizing: border-box;
}
.table-wrap--detail .table-cell:last-child {
border-right: none;
}
.table-header,
.table-row {
display: flex;
@ -576,6 +669,12 @@ export default {
background-color: #f6f8fc;
}
.table-header--sticky {
position: sticky;
top: 0;
z-index: 2;
}
.table-body {
border: 1rpx solid #e6ebf5;
}
@ -589,6 +688,15 @@ export default {
border-top: none;
}
.table-row--alt {
background-color: #fafafa;
}
.table-row--selected {
background-color: #eaf3ff;
border-left: 6rpx solid #2f7de1;
}
.table-cell {
padding: 0 12rpx;
font-size: 24rpx;
@ -625,7 +733,7 @@ export default {
}
.cell-spec {
width: 110rpx;
width: 240rpx;
}
.cell-index {
@ -642,7 +750,8 @@ export default {
}
.cell-pending-order {
width: 100%;
flex: 1;
min-width: 0;
}
.empty {
@ -651,4 +760,34 @@ export default {
font-size: 26rpx;
padding: 24rpx 0;
}
@media screen and (max-width: 1024px) {
.page {
min-width: 760px;
}
.page-main {
padding: 8rpx 20rpx 18rpx;
}
.container {
padding: 20rpx;
}
.content-panel {
gap: 14rpx;
}
.panel-left {
width: 620rpx;
}
.search-bar {
margin-bottom: 18rpx;
}
.table-scroll--detail {
max-height: 460rpx;
}
}
</style>

View File

@ -2,20 +2,23 @@
<view class="page">
<top-nav />
<view class="page-main">
<returns-view compact-top />
<view class="dynamic-view dynamic-view--returns">
<view class="module-card">
<text class="module-card-title">退件</text>
<text class="module-card-desc">退件模块页面(待对接业务接口)</text>
</view>
</view>
</view>
</view>
</template>
<script>
import ReturnsView from '@/views/returns/index.vue'
import TopNav from '@/components/top-nav.vue'
export default {
name: 'ReturnsPage',
components: {
TopNav,
ReturnsView,
},
}
</script>
@ -31,4 +34,30 @@ export default {
padding: 8rpx 32rpx 32rpx;
box-sizing: border-box;
}
.dynamic-view--returns {
width: 100%;
}
.module-card {
background-color: #fff;
border-radius: 16rpx;
padding: 32rpx;
box-sizing: border-box;
}
.module-card-title {
display: block;
font-size: 32rpx;
color: #333;
font-weight: 600;
margin-bottom: 12rpx;
}
.module-card-desc {
display: block;
font-size: 26rpx;
color: #888;
line-height: 1.5;
}
</style>

View File

@ -2,20 +2,23 @@
<view class="page">
<top-nav />
<view class="page-main">
<catch-weight-view compact-top />
<view class="dynamic-view dynamic-view--catch-weight">
<view class="module-card">
<text class="module-card-title">称重</text>
<text class="module-card-desc">称重模块页面(待对接业务接口)</text>
</view>
</view>
</view>
</view>
</template>
<script>
import CatchWeightView from '@/views/catch-weight/index.vue'
import TopNav from '@/components/top-nav.vue'
export default {
name: 'WeighingPage',
components: {
TopNav,
CatchWeightView,
},
}
</script>
@ -31,4 +34,30 @@ export default {
padding: 8rpx 32rpx 32rpx;
box-sizing: border-box;
}
.dynamic-view--catch-weight {
width: 100%;
}
.module-card {
background-color: #fff;
border-radius: 16rpx;
padding: 32rpx;
box-sizing: border-box;
}
.module-card-title {
display: block;
font-size: 32rpx;
color: #333;
font-weight: 600;
margin-bottom: 12rpx;
}
.module-card-desc {
display: block;
font-size: 26rpx;
color: #888;
line-height: 1.5;
}
</style>

View File

@ -1,6 +1,6 @@
import OrderView from '@/views/order/index.vue'
import CatchWeightView from '@/views/catch-weight/index.vue'
import ReturnsView from '@/views/returns/index.vue'
import OrderPage from '@/pages/order/index.vue'
import CatchWeightPage from '@/pages/weighing/index.vue'
import ReturnsPage from '@/pages/returns/index.vue'
/** 将 user.info 中 menus[].path 规范为以 / 开头的路径 */
export function normalizeMenuPath(path) {
@ -13,12 +13,12 @@ export function normalizeMenuPath(path) {
/**
* 后端动态菜单 path -> 本地页面组件
* 新增菜单时在此注册对应 views 组件
* 新增菜单时在此注册对应页面组件
*/
const menuRouteMap = {
'/order': OrderView,
'/catchWeight': CatchWeightView,
'/returns': ReturnsView,
'/order': OrderPage,
'/catchWeight': CatchWeightPage,
'/returns': ReturnsPage,
}
/** 根据菜单 path 解析要渲染的页面组件 */

View File

@ -1,48 +0,0 @@
<template>
<view class="dynamic-view dynamic-view--catch-weight">
<view class="module-card">
<text class="module-card-title">称重</text>
<text class="module-card-desc">称重模块页面(待对接业务接口)</text>
</view>
</view>
</template>
<script>
export default {
name: 'CatchWeightMenuView',
props: {
compactTop: {
type: Boolean,
default: true,
},
},
}
</script>
<style>
.dynamic-view--catch-weight {
width: 100%;
}
.module-card {
background-color: #fff;
border-radius: 16rpx;
padding: 32rpx;
box-sizing: border-box;
}
.module-card-title {
display: block;
font-size: 32rpx;
color: #333;
font-weight: 600;
margin-bottom: 12rpx;
}
.module-card-desc {
display: block;
font-size: 26rpx;
color: #888;
line-height: 1.5;
}
</style>

View File

@ -1,28 +0,0 @@
<template>
<view class="dynamic-view dynamic-view--order">
<order-page />
</view>
</template>
<script>
import OrderPage from '@/pages/order/index.vue'
export default {
name: 'OrderMenuView',
components: {
OrderPage,
},
props: {
compactTop: {
type: Boolean,
default: true,
},
},
}
</script>
<style>
.dynamic-view--order {
width: 100%;
}
</style>

View File

@ -1,48 +0,0 @@
<template>
<view class="dynamic-view dynamic-view--returns">
<view class="module-card">
<text class="module-card-title">退件</text>
<text class="module-card-desc">退件模块页面(待对接业务接口)</text>
</view>
</view>
</template>
<script>
export default {
name: 'ReturnsMenuView',
props: {
compactTop: {
type: Boolean,
default: true,
},
},
}
</script>
<style>
.dynamic-view--returns {
width: 100%;
}
.module-card {
background-color: #fff;
border-radius: 16rpx;
padding: 32rpx;
box-sizing: border-box;
}
.module-card-title {
display: block;
font-size: 32rpx;
color: #333;
font-weight: 600;
margin-bottom: 12rpx;
}
.module-card-desc {
display: block;
font-size: 26rpx;
color: #888;
line-height: 1.5;
}
</style>