修改拣货。复核发货模块

This commit is contained in:
zm2000 2026-06-15 18:41:30 +08:00
parent 6c2f8895a6
commit ddc61a3ac8
5 changed files with 258 additions and 212 deletions

View File

@ -57,41 +57,43 @@
<u-popup v-if="showPrintPopup" :show="showPrintPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="handlePrintPopupClose">
<view class="print-popup">
<view class="print-popup-title">打印设置</view>
<view class="print-row print-row--station">
<text class="print-label">打印台</text>
<view class="print-picker" @click="togglePrintStationDropdown">
<text class="print-picker-value">{{ printStationName || '--' }}</text>
<u-icon :name="showPrintStationDropdown ? 'arrow-up' : 'arrow-down'" size="24" color="#909399"></u-icon>
</view>
<view v-if="showPrintStationDropdown" class="print-station-dropdown">
<view
v-for="station in printStationList"
:key="station.id"
class="print-station-option"
:class="{ 'print-station-option--active': station.id === printStationId }"
@click.stop="handlePrintStationSelect(station)"
>
{{ station.name }}
<scroll-view scroll-y class="print-popup-scroll">
<view class="print-popup-title">打印设置</view>
<view class="print-row print-row--station">
<text class="print-label">打印台</text>
<view class="print-picker" @click="togglePrintStationDropdown">
<text class="print-picker-value">{{ printStationName || '--' }}</text>
<u-icon :name="showPrintStationDropdown ? 'arrow-up' : 'arrow-down'" size="24" color="#909399"></u-icon>
</view>
<view v-if="showPrintStationDropdown" class="print-station-dropdown">
<view
v-for="station in printStationList"
:key="station.id"
class="print-station-option"
:class="{ 'print-station-option--active': station.id === printStationId }"
@click.stop="handlePrintStationSelect(station)"
>
{{ station.name }}
</view>
</view>
</view>
</view>
<view class="print-row print-row--action">
<text class="print-label">打印</text>
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
@click="handleConfirmPrint"
@tap="handleConfirmPrint"
>
打印
</u-button>
</view>
<view class="print-row print-row--message">
<text class="print-label">打印消息</text>
<text class="print-message">{{ printMessage || '暂无打印消息' }}</text>
</view>
<view class="print-row print-row--action">
<text class="print-label">打印</text>
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
@click="handleConfirmPrint"
@tap="handleConfirmPrint"
>
打印
</u-button>
</view>
<view class="print-row print-row--message">
<text class="print-label">打印消息</text>
<text class="print-message">{{ printMessage || '暂无打印消息' }}</text>
</view>
</scroll-view>
</view>
</u-popup>
</view>
@ -836,10 +838,18 @@
}
.print-popup {
padding: 24rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
height: 70vh;
background: #ffffff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
display: flex;
flex-direction: column;
}
.print-popup-scroll {
flex: 1;
padding: 24rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.print-popup-title {

View File

@ -128,37 +128,41 @@
<u-popup v-if="showPrintPopup" :show="showPrintPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showPrintPopup = false">
<view class="print-popup">
<view class="print-popup-title">打印设置</view>
<view class="print-row print-row--station">
<text class="print-label">打印台</text>
<view class="print-station-input-wrap">
<u-input
v-model="printStationInputKeyword"
placeholder="请输入或扫描打印台编号"
:clearable="true"
:customStyle="{ fontSize: '28rpx', height: '80rpx', lineHeight: '80rpx', padding: '0 20rpx', background: '#fafafa', borderRadius: '10rpx' }"
@input="handlePrintStationInput"
@focus="handlePrintStationInputFocus"
@blur="handlePrintStationInputBlur"
@confirm="handlePrintStationInputConfirm"
></u-input>
<view v-if="showPrintStationDropdown && printStationFilteredList.length > 0" class="print-station-dropdown">
<view
v-for="station in printStationFilteredList"
:key="station.id"
class="print-station-option print-station-option--row"
:class="{ 'print-station-option--active': station.id === printStationId }"
@mousedown.stop="handlePrintStationSelect(station)"
>
<text class="station-option-name">{{ station.name }}</text>
<text v-if="station.customBarcode" class="station-option-code">{{ station.customBarcode }}</text>
<scroll-view scroll-y class="print-popup-scroll">
<view class="print-popup-title">打印设置</view>
<view class="print-row print-row--station">
<text class="print-label">打印台</text>
<view class="print-station-input-wrap">
<u-input
v-model="printStationInputKeyword"
placeholder="请输入或扫描打印台编号"
:clearable="true"
:customStyle="{ fontSize: '28rpx', height: '80rpx', lineHeight: '80rpx', padding: '0 20rpx', background: '#fafafa', borderRadius: '10rpx' }"
@input="handlePrintStationInput"
@focus="handlePrintStationInputFocus"
@blur="handlePrintStationInputBlur"
@confirm="handlePrintStationInputConfirm"
></u-input>
<view v-if="showPrintStationDropdown && printStationFilteredList.length > 0" class="print-station-dropdown">
<scroll-view scroll-y class="print-station-dropdown-scroll">
<view
v-for="station in printStationFilteredList"
:key="station.id"
class="print-station-option print-station-option--row"
:class="{ 'print-station-option--active': station.id === printStationId }"
@mousedown.stop="handlePrintStationSelect(station)"
>
<text class="station-option-name">{{ station.name }}</text>
<text v-if="station.customBarcode" class="station-option-code">{{ station.customBarcode }}</text>
</view>
</scroll-view>
</view>
<view v-if="showPrintStationDropdown && printStationInputKeyword && printStationFilteredList.length === 0" class="print-station-dropdown">
<view class="print-station-option print-station-option--empty">未匹配到打印台</view>
</view>
</view>
<view v-if="showPrintStationDropdown && printStationInputKeyword && printStationFilteredList.length === 0" class="print-station-dropdown">
<view class="print-station-option print-station-option--empty">未匹配到打印台</view>
</view>
</view>
</view>
</scroll-view>
</view>
</u-popup>
@ -2291,11 +2295,18 @@
}
.print-popup {
padding: 48rpx 32rpx calc(40rpx + env(safe-area-inset-bottom));
height: 70vh;
background: #ffffff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
min-height: 500rpx;
display: flex;
flex-direction: column;
}
.print-popup-scroll {
flex: 1;
padding: 48rpx 32rpx calc(40rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.print-popup-title {
@ -2347,12 +2358,18 @@
right: 0;
top: 100%;
max-height: 600rpx;
overflow-y: auto;
background: #ffffff;
border: 1rpx solid #ebeef5;
border-radius: 10rpx;
z-index: 10091;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
display: flex;
flex-direction: column;
}
.print-station-dropdown-scroll {
flex: 1;
max-height: 600rpx;
}
.print-station-option {

View File

@ -1236,6 +1236,11 @@
title: '完成成功',
icon: 'none'
});
// 通知列表页更新该波次状态为已复核
const completedBatchNo = String(this.taskInfo?.batchNo || '').trim();
if (completedBatchNo) {
uni.setStorageSync('pick_completed_wave', completedBatchNo);
}
this.taskId = '';
this.keyword = '';
this.taskInfo = {

View File

@ -20,7 +20,7 @@
<text class="page-head-picker">拣货人:{{ detailInfo.pickerName }}</text>
<view class="page-head-actions">
<view class="page-head-btn" @click="handleReprint">面单补打</view>
<view class="page-head-btn page-head-btn--primary" @click="handleWeigh">称重</view>
<view class="page-head-btn page-head-btn--primary" :class="{ 'page-head-btn--disabled': detailInfo.listType === 'single' }" @click="handleWeigh" :disabled="detailInfo.listType === 'single'">称重</view>
</view>
</view>
</view>
@ -36,12 +36,11 @@
<view class="goods-image-name-row">
<view class="goods-thumb" @click.stop="previewCurrentGoodsImage">
<u-image
v-if="getCurrentGoodsImageList().length <= 1"
class="goods-image"
:src="currentGoods.imageUrl || ''"
mode="aspectFill"
width="240rpx"
height="240rpx"
width="168rpx"
height="168rpx"
>
<template #error>
<view class="image-placeholder image-placeholder--large">
@ -49,35 +48,8 @@
</view>
</template>
</u-image>
<view v-else class="goods-image-grid">
<view
v-for="(img, imgIndex) in getCurrentGoodsImageGridList()"
:key="img.url + '-' + imgIndex"
class="grid-cell"
:class="{ 'grid-cell--empty': !img.url }"
>
<template v-if="img.url">
<u-image
class="grid-image"
:src="img.url"
mode="aspectFill"
width="100%"
height="100%"
>
<template #error>
<view class="image-placeholder image-placeholder--small">
<u-icon name="photo" size="24" color="#c0c4cc"></u-icon>
</view>
</template>
</u-image>
<view v-if="imgIndex === 3 && getCurrentGoodsExtraImageCount() > 0" class="more-mask">
<text class="more-text">+{{ getCurrentGoodsExtraImageCount() }}</text>
</view>
</template>
<view v-else class="image-placeholder image-placeholder--small image-placeholder--empty">
<u-icon name="photo" size="24" color="#c0c4cc"></u-icon>
</view>
</view>
<view v-if="getCurrentGoodsImageList().length > 1" class="image-badge">
<text class="image-badge-text">1/{{ getCurrentGoodsImageList().length }}</text>
</view>
</view>
<text class="goods-name">{{ currentGoods.skuName || '--' }}</text>
@ -760,11 +732,18 @@
} catch (e) {
console.warn('[confirmRecheck] 缓存复核完成数据失败:', e);
}
// 复核成功后弹出称重弹窗
this._weighAfterReview = true;
setTimeout(() => {
this.handleWeigh();
}, 800);
// 复核成功后弹出称重弹窗(散单模式不弹窗)
if (this.detailInfo.listType !== 'single') {
this._weighAfterReview = true;
setTimeout(() => {
this.handleWeigh();
}, 800);
} else {
this._weighAfterReview = false;
setTimeout(() => {
uni.navigateBack({ delta: 1 });
}, 800);
}
} catch (error) {
uni.showToast({
title: this.getApiErrorMessage(error, '确认复核失败'),
@ -966,8 +945,8 @@
this.weighWeight = parseInt(digits, 10);
},
async handleWeighSave() {
if (this.weighWeight < 100) {
uni.showToast({ title: '重量至少输入三位数', icon: 'none' });
if (this.weighWeight <= 0) {
uni.showToast({ title: '请输入有效重量', icon: 'none' });
return;
}
@ -1200,6 +1179,12 @@
opacity: 0.7;
}
.page-head-btn--disabled {
background: #c0c4cc;
pointer-events: none;
opacity: 0.6;
}
.page-head-item {
flex: 1;
display: flex;
@ -1224,9 +1209,9 @@
display: flex;
flex-wrap: nowrap;
width: 100%;
margin-top: 14rpx;
margin-top: 8rpx;
font-size: 36rpx;
line-height: 58rpx;
line-height: 44rpx;
}
.barcode-value {
@ -1382,85 +1367,46 @@
}
.goods-thumb {
width: 240rpx;
height: 240rpx;
position: relative;
width: 168rpx;
height: 168rpx;
flex-shrink: 0;
}
.goods-image {
width: 240rpx;
height: 240rpx;
width: 168rpx;
height: 168rpx;
flex-shrink: 0;
border-radius: 10rpx;
overflow: hidden;
background: #f5f7fa;
}
.goods-image-grid {
width: 240rpx;
height: 240rpx;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
}
.grid-cell {
position: relative;
width: 116rpx;
height: 116rpx;
border-radius: 10rpx;
overflow: hidden;
background: #f5f7fa;
}
.grid-cell--empty {
border: 1rpx dashed #dcdfe6;
box-sizing: border-box;
background: #fafafa;
}
.grid-image {
width: 100%;
height: 100%;
border-radius: 10rpx;
overflow: hidden;
}
.image-placeholder {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #f5f7fa;
}
.image-placeholder--large {
height: 240rpx;
}
.image-placeholder--small {
height: 116rpx;
}
.image-placeholder--empty {
background: #fafafa;
}
.more-mask {
.image-badge {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
min-width: 36rpx;
height: 32rpx;
padding: 0 8rpx;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.35);
background: rgba(0, 0, 0, 0.5);
border-top-left-radius: 8rpx;
}
.more-text {
font-size: 38rpx;
.image-badge-text {
font-size: 28rpx;
line-height: 1;
color: #ffffff;
font-weight: 600;
@ -1470,18 +1416,18 @@
flex: 1;
min-width: 0;
font-size: 42rpx;
line-height: 56rpx;
line-height: 44rpx;
font-weight: 700;
color: #303133;
}
.top-info {
width: 100%;
margin-top: 22rpx;
margin-top: 14rpx;
}
.goods-row--pick-btn {
margin-top: 12rpx;
margin-top: 6rpx;
justify-content: flex-end;
}

View File

@ -31,7 +31,7 @@
<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)">
@ -41,7 +41,7 @@
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</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>
@ -52,7 +52,7 @@
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
@click.native.stop="handlePrintAllUnreviewed(item)"
>
打印所有未复核订单
打印所有未拣货订单
</u-button>
</view>
</view>
@ -79,40 +79,42 @@
<u-popup v-if="showPrintPopup" :show="showPrintPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showPrintPopup = false">
<view class="print-popup">
<view class="print-popup-title">打印设置</view>
<view class="print-row print-row--station">
<text class="print-label">打印台</text>
<view class="print-picker" @click="togglePrintStationDropdown">
<text class="print-picker-value">{{ printStationName || '--' }}</text>
<u-icon :name="showPrintStationDropdown ? 'arrow-up' : 'arrow-down'" size="24" color="#909399"></u-icon>
</view>
<view v-if="showPrintStationDropdown" class="print-station-dropdown">
<view
v-for="station in printStationList"
:key="station.id"
class="print-station-option"
:class="{ 'print-station-option--active': station.id === printStationId }"
@click.stop="handlePrintStationSelect(station)"
>
{{ station.name }}
<scroll-view scroll-y class="print-popup-scroll">
<view class="print-popup-title">打印设置</view>
<view class="print-row print-row--station">
<text class="print-label">打印台</text>
<view class="print-picker" @click="togglePrintStationDropdown">
<text class="print-picker-value">{{ printStationName || '--' }}</text>
<u-icon :name="showPrintStationDropdown ? 'arrow-up' : 'arrow-down'" size="24" color="#909399"></u-icon>
</view>
<view v-if="showPrintStationDropdown" class="print-station-dropdown">
<view
v-for="station in printStationList"
:key="station.id"
class="print-station-option"
:class="{ 'print-station-option--active': station.id === printStationId }"
@click.stop="handlePrintStationSelect(station)"
>
{{ station.name }}
</view>
</view>
</view>
</view>
<view class="print-row print-row--action">
<text class="print-label">打印</text>
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
@click="handleConfirmPrint"
>
打印
</u-button>
</view>
<view class="print-row print-row--message">
<text class="print-label">打印消息</text>
<text class="print-message">{{ printMessage || '暂无打印消息' }}</text>
</view>
<view class="print-row print-row--action">
<text class="print-label">打印</text>
<u-button
type="primary"
size="mini"
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
@click="handleConfirmPrint"
>
打印
</u-button>
</view>
<view class="print-row print-row--message">
<text class="print-label">打印消息</text>
<text class="print-message">{{ printMessage || '暂无打印消息' }}</text>
</view>
</scroll-view>
</view>
</u-popup>
</view>
@ -122,7 +124,7 @@
export default {
data() {
return {
title: '拣货详情(未复核)',
title: '拣货详情(未拣货)',
grabCount: 0,
keyword: '',
onlyMine: false,
@ -162,29 +164,79 @@
? Math.max(0, parsedGrabCount)
: 5;
this.loadBatchWaveNoList(1);
// 监听订单复核完成事件
uni.$on('orderReviewCompleted', this.handleOrderReviewCompleted);
},
onUnload() {
this.safeDispatchBroadcast('stop');
uni.$off('orderReviewCompleted', this.handleOrderReviewCompleted);
},
onShow() {
this.safeDispatchBroadcast('setCallbacks', {
onResult: this.handleBroadcastResult
});
this.safeDispatchBroadcast('resume');
// 检查是否有刚完成的拣货/复核任务,更新列表状态
this.updateCompletedWaveStatus();
this.updateReviewCompletedStatus();
},
onHide() {
this.safeDispatchBroadcast('pause');
},
onUnload() {
this.safeDispatchBroadcast('stop');
},
methods: {
updateCompletedWaveStatus() {
const completedWaveNo = uni.getStorageSync('pick_completed_wave');
if (completedWaveNo && Array.isArray(this.orderList)) {
const index = this.orderList.findIndex(item => item.waveNo === completedWaveNo);
if (index >= 0) {
const updated = { ...this.orderList[index], status: '已复核', unreviewedCount: 0 };
if (typeof this.$set === 'function') {
this.$set(this.orderList, index, updated);
} else {
this.orderList.splice(index, 1, updated);
}
}
uni.removeStorageSync('pick_completed_wave');
}
},
updateReviewCompletedStatus() {
const completedData = uni.getStorageSync('pendingReviewComplete');
if (completedData && completedData.waveNo && Array.isArray(this.orderList)) {
const index = this.orderList.findIndex(item => item.waveNo === completedData.waveNo);
if (index >= 0) {
const updated = { ...this.orderList[index], status: '已复核', unreviewedCount: 0 };
if (typeof this.$set === 'function') {
this.$set(this.orderList, index, updated);
} else {
this.orderList.splice(index, 1, updated);
}
}
uni.removeStorageSync('pendingReviewComplete');
}
},
handleOrderReviewCompleted(data) {
if (data && data.waveNo && Array.isArray(this.orderList)) {
const index = this.orderList.findIndex(item => item.waveNo === data.waveNo);
if (index >= 0) {
const updated = { ...this.orderList[index], status: '已复核', unreviewedCount: 0 };
if (typeof this.$set === 'function') {
this.$set(this.orderList, index, updated);
} else {
this.orderList.splice(index, 1, updated);
}
}
}
},
normalizeReviewAssignmentStatus(status) {
const rawValue = status ?? '';
const normalized = String(rawValue).trim();
const lowerValue = normalized.toLowerCase();
const statusMap = {
'0': '未复核',
unreviewed: '未复核',
pending: '未复核',
todo: '未复核',
'0': '未拣货',
unreviewed: '未拣货',
pending: '未拣货',
todo: '未拣货',
'1': '部分复核',
partial: '部分复核',
partial_reviewed: '部分复核',
@ -202,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 = {
@ -575,6 +627,14 @@
if (!item) {
return;
}
// 已复核的波次不再创建拣货任务
if (item.status === '已复核') {
uni.showToast({
title: '该波次已复核',
icon: 'none'
});
return;
}
const waveKeyword = String(item.waveNo || '').trim();
const waybillKeyword = String(item.waybillCode || '').trim();
const keyword = waybillKeyword || waveKeyword;
@ -652,7 +712,7 @@
const target = item && typeof item === 'object' ? item : null;
if (!target) {
uni.showToast({
title: '暂无未复核订单可打印',
title: '暂无未拣货订单可打印',
icon: 'none'
});
return;
@ -682,7 +742,7 @@
});
}
this.pendingPrintCount = Number(target.unreviewedCount || 0);
this.printMessage = `待打印未复核订单 ${this.pendingPrintCount} 条`;
this.printMessage = `待打印未拣货订单 ${this.pendingPrintCount} 条`;
this.showPrintStationDropdown = false;
this.showPrintPopup = true;
},
@ -730,7 +790,7 @@
if (!success) {
throw new Error(response?.message || response?.msg || '打印失败');
}
this.printMessage = `打印已发送,未复核订单 ${effectivePrintCount} 条`;
this.printMessage = `打印已发送,未拣货订单 ${effectivePrintCount} 条`;
uni.showToast({
title: `已发起打印${effectivePrintCount}条`,
icon: 'none'
@ -972,10 +1032,18 @@
}
.print-popup {
padding: 24rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
height: 70vh;
background: #ffffff;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
display: flex;
flex-direction: column;
}
.print-popup-scroll {
flex: 1;
padding: 24rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.print-popup-title {