修改复核列表页面

This commit is contained in:
zm2000 2026-07-19 18:17:38 +08:00
parent bdb44a385b
commit 9cf1b2331c
3 changed files with 204 additions and 56 deletions

View File

@ -453,6 +453,14 @@ export default {
isSystemApi: true
}
},
deliveryOrder: {
list: {
path: "order.deliveryOrder.list",
auth: true,
method: "POST",
isSystemApi: true
}
},
detail: {
path: "order.detail",
auth: true,

4
env.js
View File

@ -1,4 +1,4 @@
// export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
// export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
export const API_URL = `${BASE_URL}/system` //后台接口域名
export const IMG_URL = 'https://ye4s.file.gzxunren.com' //全局网络图片地址变量,css背景图片地址变量在uni.scss

View File

@ -85,70 +85,95 @@
<!-- 散单模式:订单列表 -->
<template v-if="isScatterMode">
<view
v-for="item in listData"
:key="item.order_id"
v-for="(item, index) in listData"
:key="'scatter-' + index"
class="record-item"
>
<text class="record-simple-text">
{{ item.delivery_order_code || '--' }}
<text
class="record-simple-status"
:class="item.pick_status === 'printed' ? 'record-simple-status--done' : 'record-simple-status--pending'"
>({{ getPickStatusText(item.pick_status) }})</text>
</text>
<template v-if="currentSubTab === 1">
<view class="record-main">
<view class="record-index-box">{{ String(index + 1).padStart(2, '0') }}</view>
<view class="record-waybill">
<text class="record-waybill-text">
{{ (item.waybill_codes && item.waybill_codes[0]) || '--' }}
</text>
</view>
<view class="record-wave-box">
<text class="record-wave-text">{{ item.wave_no || '--' }}</text>
</view>
</view>
</template>
<template v-else>
<text class="record-simple-text">
{{ item.delivery_order_code || '--' }}
<text
class="record-simple-status"
:class="item.pick_status === 'printed' ? 'record-simple-status--done' : 'record-simple-status--pending'"
>({{ getPickStatusText(item.pick_status) }})</text>
</text>
</template>
</view>
</template>
<!-- 团购模式:波次汇总列表 -->
<template v-else>
<view
v-for="item in listData"
:key="item.wave_id"
v-for="(item, index) in listData"
:key="'group-' + index"
class="record-item"
:class="{ 'record-item--reviewed': item.review_assignment_status === 'reviewed' }"
>
<view class="record-main">
<view class="record-left">
<view class="record-line">
<text class="record-label">波次号:</text>
<text class="record-value">{{ item.wave_no || '--' }}</text>
<template v-if="currentSubTab === 1">
<view class="record-main">
<view class="record-index-box">{{ String(index + 1).padStart(2, '0') }}</view>
<view class="record-waybill">
<text class="record-waybill-text">{{ item.wave_no || '--' }}</text>
</view>
<view class="record-line">
<text class="record-label">总单数:</text>
<text class="record-value">{{ item.order_count || 0 }}</text>
<text class="record-label" style="margin-left:20rpx">已复核:</text>
<text class="record-value">{{ item.reviewed_count || 0 }}</text>
</view>
<view class="record-line record-line--split">
<view class="record-half">
<text class="record-half-label">未复核:</text>
<text class="record-half-value">{{ item.unreviewed_count || 0 }}</text>
</view>
</template>
<template v-else>
<view class="record-main">
<view class="record-left">
<view class="record-line">
<text class="record-label">波次号:</text>
<text class="record-value">{{ item.wave_no || '--' }}</text>
</view>
<view class="record-half">
<text class="record-half-label">状态:</text>
<text class="record-half-value">{{ reviewStatusText(item.review_assignment_status) }}</text>
<view class="record-line">
<text class="record-label">总单数:</text>
<text class="record-value">{{ item.order_count || 0 }}</text>
<text class="record-label" style="margin-left:20rpx">已复核:</text>
<text class="record-value">{{ item.reviewed_count || 0 }}</text>
</view>
<view class="record-line record-line--split">
<view class="record-half">
<text class="record-half-label">未复核:</text>
<text class="record-half-value">{{ item.unreviewed_count || 0 }}</text>
</view>
<view class="record-half">
<text class="record-half-label">状态:</text>
<text class="record-half-value">{{ reviewStatusText(item.review_assignment_status) }}</text>
</view>
</view>
</view>
<view class="record-right">
<text
class="record-status"
:class="getWaveStatusClass(item.review_assignment_status)"
>{{ reviewStatusText(item.review_assignment_status) }}</text>
</view>
</view>
<view class="record-right">
<text
class="record-status"
:class="getWaveStatusClass(item.review_assignment_status)"
>{{ reviewStatusText(item.review_assignment_status) }}</text>
<view class="record-footer">
<text class="record-time">{{ item.create_time || '--' }}</text>
<view v-if="item.review_assignment_status !== 'reviewed'" class="record-actions">
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#e74c3c', borderColor: '#e74c3c', fontSize: '26rpx', height: '60rpx', lineHeight: '60rpx', padding: '0 20rpx' }"
@click="handleStartReview(item)"
>
开始复核
</u-button>
</view>
</view>
</view>
<view class="record-footer">
<text class="record-time">{{ item.create_time || '--' }}</text>
<view v-if="item.review_assignment_status !== 'reviewed'" class="record-actions">
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#e74c3c', borderColor: '#e74c3c', fontSize: '26rpx', height: '60rpx', lineHeight: '60rpx', padding: '0 20rpx' }"
@click="handleStartReview(item)"
>
开始复核
</u-button>
</view>
</view>
</template>
</view>
</template>
</view>
@ -250,6 +275,76 @@ export default {
this.fetchList();
},
async fetchList() {
// 已复核列表 — 调用 order.deliveryOrder.list 接口
if (this.currentSubTab === 1) {
uni.showLoading({ title: '加载中...' });
try {
const today = new Date();
const yesterday = new Date(today);
yesterday.setDate(yesterday.getDate() - 1);
const fmtDate = (d) => {
const y = d.getFullYear();
const m = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return `${y}-${m}-${day}`;
};
const pagination = {
page: this.currentPage,
pageSize: this.pageSize
};
const where = {
create_at: {
operator: 'between',
type: 'datetimerange',
value: [
`${fmtDate(yesterday)} 00:00:00`,
`${fmtDate(today)} 23:59:59`
]
}
};
const response = await this.$http('order.deliveryOrder.list', {
pagination,
where,
sort: {
sortField: 'updated_at',
sortOrder: 'DESC'
}
});
const data = response?.data || response || {};
let rawList = Array.isArray(data.list) ? data.list : [];
// 根据模式过滤波次前缀
if (this.currentMode === 'scatter') {
rawList = rawList.filter(item => {
const w = (item.wave_no || '').toUpperCase();
return w.startsWith('E') || w.startsWith('D');
});
} else {
rawList = rawList.filter(item => {
const w = (item.wave_no || '').toUpperCase();
return w.startsWith('B');
});
// 团购模式同波次号去重
const seen = new Set();
rawList = rawList.filter(item => {
const key = item.wave_no || '';
if (seen.has(key)) return false;
seen.add(key);
return true;
});
}
this.listData = rawList;
const pag = data.pagination || {};
this.paginationTotal = pag.total || 0;
} catch (error) {
console.error('[orderReviewList] fetch reviewed list error:', error);
this.listData = [];
this.paginationTotal = 0;
} finally {
uni.hideLoading();
}
return;
}
// 待复核列表
uni.showLoading({ title: '加载中...' });
try {
const where = {};
@ -261,8 +356,6 @@ export default {
}
if (this.currentSubTab === 0) {
where.review_assignment_status = ['unreviewed', 'partially_reviewed'];
} else {
where.review_assignment_status = 'reviewed';
}
}
const pagination = {
@ -271,7 +364,7 @@ export default {
};
const requestParams = this.currentMode === 'scatter'
? { where: {}, pagination }
: { where, pagination, list_type: 'group' };
: { where: {}, pagination, list_type: 'group' };
console.log('[orderReviewList] fetchList params:', JSON.stringify(requestParams));
// 散单模式使用散单复核接口,团购模式使用原有接口
const apiName = this.currentMode === 'scatter'
@ -576,10 +669,11 @@ export default {
}
.record-simple-text {
font-size: 30rpx;
font-size: 34rpx;
color: #000000;
font-weight: 500;
padding: 0 24rpx;
padding: 0 16rpx;
word-break: break-all;
}
.record-simple-status {
@ -598,7 +692,6 @@ export default {
.record-main {
display: flex;
justify-content: space-between;
}
.record-left {
@ -606,6 +699,36 @@ export default {
min-width: 0;
}
.record-index-box {
font-size: 34rpx;
color: #fff;
font-weight: 500;
width: 2em;
text-align: center;
flex-shrink: 0;
background: #2979ff;
display: flex;
align-items: center;
justify-content: center;
margin: -20rpx 0;
padding: 20rpx 0;
}
.record-waybill {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
padding: 0 16rpx;
}
.record-waybill-text {
font-size: 34rpx;
color: #000000;
font-weight: 500;
word-break: break-all;
}
.record-line {
margin-bottom: 12rpx;
display: flex;
@ -676,6 +799,23 @@ export default {
background: #f0f9eb;
}
.record-wave-box {
background: #e74c3c;
margin: -20rpx 0;
padding: 20rpx 0;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 320rpx;
}
.record-wave-text {
font-size: 34rpx;
color: #fff;
word-break: break-all;
}
.record-footer {
display: flex;
justify-content: space-between;