修改复核列表页面
This commit is contained in:
parent
788ee2e1e4
commit
f063287083
@ -82,54 +82,110 @@
|
||||
<text class="empty-text">{{ currentSubTab === 0 ? '暂无待复核订单' : '暂无已复核订单' }}</text>
|
||||
</view>
|
||||
<view v-else class="record-list">
|
||||
<view
|
||||
v-for="item in listData"
|
||||
:key="item.id"
|
||||
class="record-item"
|
||||
:class="{ 'record-item--reviewed': currentSubTab === 1 }"
|
||||
>
|
||||
<view class="record-main">
|
||||
<view class="record-left">
|
||||
<view class="record-line">
|
||||
<text class="record-label">订单号:</text>
|
||||
<text class="record-value">{{ item.orderNo || '--' }}</text>
|
||||
</view>
|
||||
<view class="record-line">
|
||||
<text class="record-label">快递单号:</text>
|
||||
<text class="record-value">{{ item.waybillNo || '--' }}</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.goodsCount || 0 }}</text>
|
||||
<!-- 散单模式:订单列表 -->
|
||||
<template v-if="isScatterMode">
|
||||
<view
|
||||
v-for="item in listData"
|
||||
:key="item.order_id"
|
||||
class="record-item"
|
||||
:class="{ 'record-item--reviewed': item.recheck_status === 'fin' }"
|
||||
>
|
||||
<view class="record-main">
|
||||
<view class="record-left">
|
||||
<view class="record-line">
|
||||
<text class="record-label">订单号:</text>
|
||||
<text class="record-value">{{ item.delivery_order_code || '--' }}</text>
|
||||
</view>
|
||||
<view class="record-half">
|
||||
<text class="record-half-label">数量:</text>
|
||||
<text class="record-half-value">{{ item.totalQty || 0 }}</text>
|
||||
<view class="record-line">
|
||||
<text class="record-label">{{ item.logistics_name || '--' }}</text>
|
||||
<text v-if="item.shop_nick" class="record-shop">[{{ item.shop_nick }}]</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.items_count || 0 }}</text>
|
||||
</view>
|
||||
<view class="record-half">
|
||||
<text class="record-half-label">数量:</text>
|
||||
<text class="record-half-value">{{ item.items_total || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-right">
|
||||
<text
|
||||
class="record-status"
|
||||
:class="item.recheck_status === 'fin' ? 'record-status--done' : 'record-status--pending'"
|
||||
>{{ item.recheck_status === 'fin' ? '已复核' : '待复核' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-right">
|
||||
<text
|
||||
class="record-status"
|
||||
:class="currentSubTab === 0 ? 'record-status--pending' : 'record-status--done'"
|
||||
>{{ currentSubTab === 0 ? '待复核' : '已复核' }}</text>
|
||||
<view class="record-footer">
|
||||
<text class="record-time">{{ item.create_at || item.pick_time || '--' }}</text>
|
||||
<view v-if="item.recheck_status !== 'fin'" 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.reviewTime || item.createTime || '--' }}</text>
|
||||
<view v-if="currentSubTab === 0" 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>
|
||||
</template>
|
||||
<!-- 团购模式:波次汇总列表 -->
|
||||
<template v-else>
|
||||
<view
|
||||
v-for="item in listData"
|
||||
:key="item.wave_id"
|
||||
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>
|
||||
</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>
|
||||
<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-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>
|
||||
</template>
|
||||
</view>
|
||||
<view class="safe-area-bottom"></view>
|
||||
</scroll-view>
|
||||
@ -168,6 +224,14 @@ export default {
|
||||
paginationTotal: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isScatterMode() {
|
||||
return this.currentMode === 'scatter';
|
||||
},
|
||||
isGroupMode() {
|
||||
return this.currentMode === 'group';
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchList();
|
||||
},
|
||||
@ -220,25 +284,77 @@ export default {
|
||||
this.currentPage = 1;
|
||||
this.fetchList();
|
||||
},
|
||||
fetchList() {
|
||||
const params = {
|
||||
mode: this.currentMode,
|
||||
status: this.currentSubTab === 0 ? 'pending' : 'reviewed',
|
||||
keyword: this.keyword,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize
|
||||
};
|
||||
console.log('[orderReviewList] fetchList params:', params);
|
||||
// TODO: 对接实际API接口,更新 listData 和 paginationTotal
|
||||
async fetchList() {
|
||||
uni.showLoading({ title: '加载中...' });
|
||||
try {
|
||||
const listType = this.currentMode === 'group' ? 'group' : 'single';
|
||||
const where = {};
|
||||
if (this.keyword) {
|
||||
where.keyword = this.keyword;
|
||||
}
|
||||
// 待复核/已复核筛选
|
||||
if (this.currentMode === 'scatter') {
|
||||
if (this.currentSubTab === 0) {
|
||||
where.recheck_status = 'pending';
|
||||
} else {
|
||||
where.recheck_status = 'fin';
|
||||
}
|
||||
} else {
|
||||
if (this.currentSubTab === 0) {
|
||||
where.review_assignment_status = ['unreviewed', 'partially_reviewed'];
|
||||
} else {
|
||||
where.review_assignment_status = 'reviewed';
|
||||
}
|
||||
}
|
||||
const params = {
|
||||
list_type: listType,
|
||||
where,
|
||||
pagination: {
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize
|
||||
}
|
||||
};
|
||||
console.log('[orderReviewList] fetchList params:', JSON.stringify(params));
|
||||
const response = await this.$http('order.recheckOrder.recheckOrderList', params);
|
||||
const data = response?.data || response || {};
|
||||
this.listData = Array.isArray(data.list) ? data.list : [];
|
||||
const pag = data.pagination || {};
|
||||
this.paginationTotal = pag.total || 0;
|
||||
} catch (error) {
|
||||
console.error('[orderReviewList] fetchList error:', error);
|
||||
this.listData = [];
|
||||
this.paginationTotal = 0;
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
handlePageChange(page) {
|
||||
this.currentPage = page;
|
||||
this.fetchList();
|
||||
},
|
||||
reviewStatusText(status) {
|
||||
const map = {
|
||||
'unreviewed': '未复核',
|
||||
'partially_reviewed': '部分复核',
|
||||
'reviewed': '已复核'
|
||||
};
|
||||
return map[status] || status || '--';
|
||||
},
|
||||
getWaveStatusClass(status) {
|
||||
if (status === 'reviewed') return 'record-status--done';
|
||||
if (status === 'partially_reviewed') return 'record-status--partial';
|
||||
return 'record-status--pending';
|
||||
},
|
||||
handleStartReview(item) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/work/order/order-review?orderId=${item.id}&mode=${this.currentMode}`
|
||||
});
|
||||
if (this.currentMode === 'scatter') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/work/order/order-review?orderId=${item.order_id}`
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: `/pages/work/order/order-review?waveId=${item.wave_id}&mode=group`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -552,6 +668,11 @@ export default {
|
||||
background: #fdf6ec;
|
||||
}
|
||||
|
||||
.record-status--partial {
|
||||
color: #2979ff;
|
||||
background: #ecf5ff;
|
||||
}
|
||||
|
||||
.record-status--done {
|
||||
color: #67c23a;
|
||||
background: #f0f9eb;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user