修改拣货模块

This commit is contained in:
zm2000 2026-06-17 15:01:31 +08:00
parent 502a4df4cb
commit b54d70b497
3 changed files with 99 additions and 94 deletions

View File

@ -17,10 +17,10 @@
<view class="record-main">
<view class="record-left">
<view class="record-line"><text class="record-label">波次号:</text><text class="record-value">{{ item.waveNo || '--' }}</text></view>
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</text></view>
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</text><text class="record-logistics">{{ item.logisticsName || '--' }}</text></view>
</view>
<view class="record-right">
<text class="record-count">未复核 {{ item.pendingCount }}</text>
<text class="record-count">{{ item.status === '已复核' ? '已复核' : '未复核' }} {{ item.pendingCount }}</text>
<text class="record-status">{{ getStatusText(item.status) }}</text>
</view>
</view>
@ -28,7 +28,7 @@
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '30rpx', height: '80rpx', lineHeight: '80rpx', padding: '0 20rpx' }"
@click.native.stop="showRecordDetail(item)"
>
打印面单
@ -233,6 +233,7 @@
const pendingCount = Number(source.unreviewed_order_count ?? source.unreviewedOrderCount ?? source.pending_count ?? source.pendingCount ?? source.unreviewed_count ?? source.unreviewedCount ?? 0);
const reviewAssignmentStatus = this.normalizeReviewAssignmentStatus(source.review_assignment_status ?? source.reviewAssignmentStatus ?? source.status);
const assigneeId = String((source.picker_id ?? source.pickerId ?? source.user_id ?? source.userId) || '').trim();
const logisticsName = String(source.logistics_name || '').trim();
return {
id: String(rowId || ''),
waveId: typeof waveId === 'number' ? waveId : String(waveId || '').trim(),
@ -241,7 +242,8 @@
totalOrderCount: Number.isFinite(totalOrderCount) ? totalOrderCount : 0,
pendingCount: Number.isFinite(pendingCount) ? pendingCount : 0,
status: reviewAssignmentStatus,
isMine: !!this.currentUserId && !!assigneeId && assigneeId === this.currentUserId
isMine: !!this.currentUserId && !!assigneeId && assigneeId === this.currentUserId,
logisticsName
};
})
.filter(item => !!item.waveNo)
@ -796,6 +798,13 @@
color: #303133;
}
.record-logistics {
color: #303133;
font-size: 30rpx;
margin-left: 16rpx;
flex-shrink: 0;
}
.record-right {
min-width: 180rpx;
display: flex;

View File

@ -33,37 +33,18 @@
<view v-else class="pick-card">
<view class="detail-main">
<view class="detail-main-left">
<view
v-if="getSelectedImageList().length > 1"
class="goods-image-grid"
@click="previewSelectedItemImage"
>
<view
v-for="(img, imgIndex) in getSelectedImageThumbList()"
:key="img + '-' + imgIndex"
class="pick-grid-cell"
>
<u-image
class="pick-grid-image"
:src="img"
mode="aspectFill"
width="58rpx"
height="58rpx"
></u-image>
<view v-if="imgIndex === 3 && getSelectedImageExtraCount() > 0" class="pick-more-mask">
<text class="pick-more-text">+{{ getSelectedImageExtraCount() }}</text>
</view>
<view v-if="getSelectedImageList().length > 0" class="goods-image-single" @click="handleImageClick">
<u-image
class="goods-image"
:src="getCurrentDisplayImage()"
width="200rpx"
height="200rpx"
mode="aspectFill"
></u-image>
<view v-if="getSelectedImageList().length > 1" class="image-index-badge">
<text class="image-index-text">{{ currentImageIndex + 1 }}/{{ getSelectedImageList().length }}</text>
</view>
</view>
<u-image
v-else-if="selectedItemImageUrl"
class="goods-image"
:src="selectedItemImageUrl"
width="120rpx"
height="120rpx"
mode="aspectFill"
@click="previewSelectedItemImage"
></u-image>
<view v-else class="pick-image-empty">{{ selectedItemImageLoading ? '图片加载中...' : '暂无商品图片' }}</view>
</view>
<view
@ -180,6 +161,7 @@
selectedItemImageLoading: false,
selectedItemImageUrl: '',
selectedItemImageUrls: [],
currentImageIndex: 0,
itemImageCache: {},
itemImageListCache: {},
selectedItemBarcodeLoading: false,
@ -407,12 +389,25 @@
}
return [];
},
getSelectedImageThumbList() {
return this.getSelectedImageList().slice(0, 4);
getCurrentDisplayImage() {
const list = this.getSelectedImageList();
if (!list.length) {
return '';
}
const index = Math.min(this.currentImageIndex, list.length - 1);
return list[index] || list[0] || '';
},
getSelectedImageExtraCount() {
const total = this.getSelectedImageList().length;
return total > 4 ? total - 4 : 0;
handleImageClick() {
const list = this.getSelectedImageList();
if (list.length <= 1) {
this.previewSelectedItemImage();
return;
}
if (this.currentImageIndex < list.length - 1) {
this.currentImageIndex += 1;
} else {
this.currentImageIndex = 0;
}
},
normalizeScanResult(scanResult) {
if (!scanResult) {
@ -1535,6 +1530,7 @@
if (!item) {
this.selectedItemImageUrl = '';
this.selectedItemImageUrls = [];
this.currentImageIndex = 0;
this.selectedItemImageLoading = false;
return;
}
@ -1542,18 +1538,21 @@
if (!imageKey) {
this.selectedItemImageUrl = '';
this.selectedItemImageUrls = [];
this.currentImageIndex = 0;
this.selectedItemImageLoading = false;
return;
}
if (Object.prototype.hasOwnProperty.call(this.itemImageCache, imageKey)) {
this.selectedItemImageUrl = this.itemImageCache[imageKey] || '';
this.selectedItemImageUrls = Array.isArray(this.itemImageListCache[imageKey]) ? this.itemImageListCache[imageKey] : [];
this.currentImageIndex = 0;
this.selectedItemImageLoading = false;
return;
}
this.selectedItemImageLoading = true;
this.selectedItemImageUrl = '';
this.selectedItemImageUrls = [];
this.currentImageIndex = 0;
try {
const stockId = Number(item.stockId || 0);
const response = await this.$http('common.getImages', {
@ -1571,6 +1570,7 @@
if (this.getSelectedItemImageKey(this.selectedPickItem) === imageKey) {
this.selectedItemImageUrl = firstUrl || '';
this.selectedItemImageUrls = urls;
this.currentImageIndex = 0;
}
} catch (error) {
this.$set(this.itemImageCache, imageKey, '');
@ -1578,6 +1578,7 @@
if (this.getSelectedItemImageKey(this.selectedPickItem) === imageKey) {
this.selectedItemImageUrl = '';
this.selectedItemImageUrls = [];
this.currentImageIndex = 0;
}
} finally {
if (this.getSelectedItemImageKey(this.selectedPickItem) === imageKey) {
@ -1879,18 +1880,18 @@
}
.pick-name {
font-size: 32rpx;
font-size: 36rpx;
color: #303133;
font-weight: 600;
flex: 1;
}
.pick-cart-tag {
padding: 4rpx 12rpx;
padding: 6rpx 16rpx;
border-radius: 999rpx;
background: #f0f9eb;
color: #67c23a;
font-size: 22rpx;
font-size: 28rpx;
line-height: 1.4;
border: 1rpx solid #d9f0cf;
}
@ -1898,8 +1899,8 @@
.pick-row {
display: flex;
align-items: center;
font-size: 28rpx;
line-height: 44rpx;
font-size: 34rpx;
line-height: 52rpx;
margin-top: 6rpx;
}
@ -1910,8 +1911,8 @@
}
.detail-main-left {
width: 120rpx;
min-width: 120rpx;
width: 200rpx;
min-width: 200rpx;
}
.goods-image {
@ -1920,45 +1921,31 @@
background: #f5f7fa;
}
.goods-image-grid {
width: 120rpx;
height: 120rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
}
.pick-grid-cell {
.goods-image-single {
position: relative;
width: 58rpx;
height: 58rpx;
border-radius: 8rpx;
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
overflow: hidden;
background: #f5f7fa;
}
.pick-grid-image {
border-radius: 8rpx;
overflow: hidden;
}
.pick-more-mask {
.image-index-badge {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.45);
right: 8rpx;
bottom: 8rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 16rpx;
padding: 2rpx 12rpx;
display: flex;
align-items: center;
justify-content: center;
}
.pick-more-text {
.image-index-text {
font-size: 22rpx;
color: #fff;
font-weight: 600;
color: #ffffff;
font-weight: 500;
}
.detail-main-right {
@ -1975,8 +1962,8 @@
}
.pick-image-empty {
width: 120rpx;
height: 120rpx;
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
border: 1rpx dashed #dcdfe6;
color: #909399;
@ -2006,8 +1993,8 @@
}
.pick-label {
width: 150rpx;
min-width: 150rpx;
width: 170rpx;
min-width: 170rpx;
color: #909399;
}
@ -2040,12 +2027,12 @@
}
.alloc-text {
font-size: 24rpx;
font-size: 30rpx;
color: #2979ff;
}
.alloc-empty {
font-size: 26rpx;
font-size: 30rpx;
color: #909399;
margin-top: 8rpx;
}

View File

@ -31,17 +31,17 @@
<scroll-view class="detail-scroll" scroll-y>
<view v-if="displayOrderList.length === 0" class="empty-state">
<u-icon name="list" size="86" color="#c0c4cc"></u-icon>
<text class="empty-text">暂无未拣货订单</text>
<text class="empty-text">暂无未复核订单</text>
</view>
<view v-else class="record-list">
<view v-for="item in displayOrderList" :key="item.id" class="record-item" @click="goPickGoodsDetail(item)">
<view class="record-main">
<view class="record-left">
<view class="record-line"><text class="record-label">波次号:</text><text class="record-value">{{ item.waveNo || '--' }}</text></view>
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</text></view>
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</text><text class="record-logistics">{{ item.logisticsName || '--' }}</text></view>
</view>
<view class="record-right">
<text class="record-count">未拣货 {{ item.unreviewedCount }}</text>
<text class="record-count">未复核 {{ item.unreviewedCount }}</text>
<text class="record-status">{{ getStatusText(item.status) }}</text>
</view>
</view>
@ -49,10 +49,10 @@
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '30rpx', height: '80rpx', lineHeight: '80rpx', padding: '0 20rpx' }"
@click.native.stop="handlePrintAllUnreviewed(item)"
>
打印所有未拣货订单
打印所有未复核订单
</u-button>
</view>
</view>
@ -124,7 +124,7 @@
export default {
data() {
return {
title: '拣货详情(未拣货)',
title: '散单拣货详情',
grabCount: 0,
keyword: '',
onlyMine: false,
@ -233,10 +233,10 @@
const normalized = String(rawValue).trim();
const lowerValue = normalized.toLowerCase();
const statusMap = {
'0': '未拣货',
unreviewed: '未拣货',
pending: '未拣货',
todo: '未拣货',
'0': '未复核',
unreviewed: '未复核',
pending: '未复核',
todo: '未复核',
'1': '部分复核',
partial: '部分复核',
partial_reviewed: '部分复核',
@ -254,10 +254,10 @@
if (statusMap[lowerValue]) {
return statusMap[lowerValue];
}
if (['未拣货', '部分复核', '已复核'].includes(normalized)) {
if (['未复核', '部分复核', '已复核'].includes(normalized)) {
return normalized;
}
return normalized || '未拣货';
return normalized || '未复核';
},
buildBatchListParams(page = this.currentPage) {
const where = {
@ -330,6 +330,7 @@
const unreviewedCount = Number(source.unreviewed_order_count ?? source.unreviewedOrderCount ?? source.unreviewed_count ?? source.unreviewedCount ?? source.pending_count ?? source.pendingCount ?? 0);
const reviewAssignmentStatus = this.normalizeReviewAssignmentStatus(source.review_assignment_status ?? source.reviewAssignmentStatus ?? source.status);
const assigneeId = String((source.picker_id ?? source.pickerId ?? source.user_id ?? source.userId) || '').trim();
const logisticsName = String(source.logistics_name || '').trim();
return {
id: String(rowId || `batch-${this.currentPage}-${index + 1}`),
waveId: typeof waveId === 'number' ? waveId : String(waveId || '').trim(),
@ -340,7 +341,8 @@
unreviewedCount: Number.isFinite(unreviewedCount) ? unreviewedCount : 0,
status: reviewAssignmentStatus,
waybillCode: String(source.waybill_no || source.waybillCode || source.waybill_code || ''),
isMine: !!this.currentUserId && !!assigneeId && assigneeId === this.currentUserId
isMine: !!this.currentUserId && !!assigneeId && assigneeId === this.currentUserId,
logisticsName
};
})
.filter(item => !!item.waveNo);
@ -712,7 +714,7 @@
const target = item && typeof item === 'object' ? item : null;
if (!target) {
uni.showToast({
title: '暂无未拣货订单可打印',
title: '暂无未复核订单可打印',
icon: 'none'
});
return;
@ -742,7 +744,7 @@
});
}
this.pendingPrintCount = Number(target.unreviewedCount || 0);
this.printMessage = `待打印未拣货订单 ${this.pendingPrintCount} 条`;
this.printMessage = `待打印未复核订单 ${this.pendingPrintCount} 条`;
this.showPrintStationDropdown = false;
this.showPrintPopup = true;
},
@ -790,7 +792,7 @@
if (!success) {
throw new Error(response?.message || response?.msg || '打印失败');
}
this.printMessage = `打印已发送,未拣货订单 ${effectivePrintCount} 条`;
this.printMessage = `打印已发送,未复核订单 ${effectivePrintCount} 条`;
uni.showToast({
title: `已发起打印${effectivePrintCount}条`,
icon: 'none'
@ -986,6 +988,13 @@
color: #303133;
}
.record-logistics {
color: #303133;
font-size: 32rpx;
margin-left: 16rpx;
flex-shrink: 0;
}
.record-right {
min-width: 180rpx;
display: flex;