修改订单拣货、复核发货页面
This commit is contained in:
parent
207631e7ef
commit
6c80c0b65f
@ -61,6 +61,10 @@
|
||||
<text class="metric-product">{{ item.planQty || 0 }}</text>
|
||||
<text class="metric-scanned">{{ item.scannedQty || 0 }}</text>
|
||||
</view>
|
||||
<view v-if="item.packageRequirement && item.packageRequirement !== '--'" class="goods-pack-row goods-pack-row--grid">
|
||||
<text class="goods-pack-label">包装:</text>
|
||||
<text class="goods-pack-value">{{ item.packageRequirement }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 列表模式 -->
|
||||
@ -115,6 +119,10 @@
|
||||
<text class="list-card-space">{{' '}}</text>
|
||||
<text class="list-card-tag">{{ item.location || '--' }}</text>
|
||||
</view>
|
||||
<view v-if="item.packageRequirement && item.packageRequirement !== '--'" class="goods-pack-row">
|
||||
<text class="goods-pack-label">包装:</text>
|
||||
<text class="goods-pack-value">{{ item.packageRequirement }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -188,7 +196,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -1218,6 +1226,61 @@ import voice from '@/core/utils/voice';
|
||||
height: calc(30rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.review-pack-row {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0 16rpx;
|
||||
padding: 4rpx 16rpx;
|
||||
background: #fef0f0;
|
||||
border-radius: 6rpx;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.goods-pack-row {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.goods-pack-row--grid {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.review-pack-label {
|
||||
flex-shrink: 0;
|
||||
font-size: 24rpx;
|
||||
color: #e64242;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.goods-pack-label {
|
||||
flex-shrink: 0;
|
||||
font-size: 28rpx;
|
||||
color: #e64242;
|
||||
}
|
||||
|
||||
.review-pack-value {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 24rpx;
|
||||
color: #e64242;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.goods-pack-value {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 28rpx;
|
||||
color: #e64242;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.package-info-hint {
|
||||
flex-shrink: 0;
|
||||
padding: 10rpx 24rpx;
|
||||
|
||||
@ -456,7 +456,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
printTargetList: [],
|
||||
goodsInfoList: [],
|
||||
orderList: [],
|
||||
listType: '',
|
||||
listType: '', packingRequirements: '',
|
||||
totalOrders: 0,
|
||||
taskId: '',
|
||||
scanPickerName: '',
|
||||
@ -467,6 +467,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
_debugLogs: [],
|
||||
_autoSelectFirst: false,
|
||||
_scanKeyword: '',
|
||||
_dprefixedBarcodeVerified: false,
|
||||
packageBindingCancelled: false,
|
||||
skipPackagePopupOnAllScanned: false,
|
||||
showDetailView: false,
|
||||
@ -491,7 +492,8 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
interceptStatus: '',
|
||||
printStationId: '',
|
||||
printStationName: '',
|
||||
boxNo: ''
|
||||
boxNo: '',
|
||||
packingRequirements: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -1373,6 +1375,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
if (this.isDprefixedWave) {
|
||||
const matchedOrder = this.findOrderByProductBarcode(text);
|
||||
if (matchedOrder) {
|
||||
this._dprefixedBarcodeVerified = true;
|
||||
this.goPickGoodsDetail(matchedOrder);
|
||||
return;
|
||||
}
|
||||
@ -2324,6 +2327,18 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
};
|
||||
});
|
||||
|
||||
// 提取包装要求(取第一个 stock 的 packing_requirements)
|
||||
let packingRequirements = '';
|
||||
for (let i = 0; i < rawItems.length; i++) {
|
||||
const raw = rawItems[i];
|
||||
const stockItem = raw?.stock_id ? raw : (Array.isArray(raw?.stock) && raw.stock.length > 0 ? raw.stock[0] : null);
|
||||
const req = stockItem?.packing_requirements || raw?.packing_requirements || '';
|
||||
if (req) {
|
||||
packingRequirements = String(req).trim();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 设置详情数据
|
||||
this.detailGoodsList = goodsList;
|
||||
this.detailInfo = {
|
||||
@ -2352,7 +2367,8 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
orderCount: Number(item?.orderCount ?? 0),
|
||||
listType: String(this.listType || ''),
|
||||
itemsWeight: Number(item?.itemsWeight ?? 0),
|
||||
suggestedPkg: item?.suggestedPkg || null
|
||||
suggestedPkg: item?.suggestedPkg || null,
|
||||
packingRequirements
|
||||
};
|
||||
|
||||
// 缓存当前订单在列表中的索引
|
||||
@ -2361,16 +2377,26 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
this.showDetailView = true;
|
||||
this.listExpanded = false;
|
||||
|
||||
// D前缀波次:自动标记所有商品为已扫,跳过逐件扫描
|
||||
// D前缀波次:仅当通过商品条码扫描匹配进入时,自动标记所有商品为已扫并触发复核发货
|
||||
// 从订单列表抽屉点击进入时(无条码校验),仅展示详情,需手动扫描商品条码复核
|
||||
// 已复核订单不再触发自动复核/打印,仅展示只读详情
|
||||
if (this.isDprefixedWave && this.detailGoodsList.length > 0 && !item.isReviewed) {
|
||||
this.detailGoodsList = this.detailGoodsList.map(g => ({
|
||||
...g,
|
||||
scannedQty: g.planQty
|
||||
}));
|
||||
this.$nextTick(() => {
|
||||
this.handleDetailAllScanned();
|
||||
});
|
||||
if (this._dprefixedBarcodeVerified) {
|
||||
this.detailGoodsList = this.detailGoodsList.map(g => ({
|
||||
...g,
|
||||
scannedQty: g.planQty
|
||||
}));
|
||||
this.$nextTick(() => {
|
||||
this.handleDetailAllScanned();
|
||||
});
|
||||
} else {
|
||||
// 非扫码进入:不自动标记,等待用户扫描商品条码
|
||||
uni.showToast({
|
||||
title: '请扫描商品条码进行复核',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 先打印后复核:进入详情时自动触发未打印订单的打印
|
||||
@ -2389,6 +2415,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
backToList() {
|
||||
this.showDetailView = false;
|
||||
this.detailGoodsList = [];
|
||||
this._dprefixedBarcodeVerified = false;
|
||||
// 从详情返回后刷新列表
|
||||
// D波次:keyword 是商品条码,scanOrder 不支持,依赖本地已更新的 orderList
|
||||
if (this.keyword && !this.isDprefixedWave) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<template>
|
||||
<template>
|
||||
<view class="order-picking-page">
|
||||
<view class="normar_container">
|
||||
<page-nav :title="title" @click.native="handleTitleClick">
|
||||
@ -70,6 +70,10 @@
|
||||
<view class="pick-row"><text class="pick-label">应拣总数:</text><text class="pick-value">{{ selectedPickItem.totalQty }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="selectedPickItem && selectedPickItem.packingRequirements" class="packing-req-banner" @click="showPackingReqPopup = true">
|
||||
<text class="packing-req-banner__label">包装:</text>
|
||||
<text class="packing-req-banner__value">{{ selectedPickItem.packingRequirements }}</text>
|
||||
</view>
|
||||
<view class="alloc-panel">
|
||||
<view class="pick-row pick-row--top">
|
||||
<text class="pick-label">分配篮号:</text>
|
||||
@ -272,6 +276,19 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
<!-- 包装弹窗 -->
|
||||
<u-popup :show="showPackingReqPopup" mode="center" :closeable="true" :closeOnClickOverlay="true" border-radius="20" @close="showPackingReqPopup = false">
|
||||
<view class="packing-req-popup">
|
||||
<view class="packing-req-popup__title">包装</view>
|
||||
<view class="packing-req-popup__body">
|
||||
<text class="packing-req-popup__text">{{ (selectedPickItem && selectedPickItem.packingRequirements) || '' }}</text>
|
||||
</view>
|
||||
<view class="packing-req-popup__footer">
|
||||
<view class="packing-req-popup__close" @click="showPackingReqPopup = false">关闭</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -318,6 +335,7 @@ import voice from '@/core/utils/voice';
|
||||
showCancelPickPopup: false,
|
||||
showCompletePickPopup: false,
|
||||
showWaveListPopup: false,
|
||||
showPackingReqPopup: false,
|
||||
submittingWavePickTask: false,
|
||||
currentWavePickSubmitPromise: null,
|
||||
wavePickSubmitQueue: [],
|
||||
@ -330,6 +348,7 @@ import voice from '@/core/utils/voice';
|
||||
taskId: '',
|
||||
taskNo: '',
|
||||
batchNo: '',
|
||||
waveNo: '',
|
||||
status: 0,
|
||||
creatorId: '',
|
||||
creatorName: ''
|
||||
@ -341,6 +360,7 @@ import voice from '@/core/utils/voice';
|
||||
distinctSpaces: 0,
|
||||
distinctItems: 0
|
||||
},
|
||||
packingRequirements: '',
|
||||
pickingView: {
|
||||
modeCode: '',
|
||||
modeName: '--',
|
||||
@ -374,6 +394,10 @@ import voice from '@/core/utils/voice';
|
||||
return this.pickingView.modeName || '--';
|
||||
},
|
||||
waveBatchDisplay() {
|
||||
const waveNo = this.taskInfo.waveNo || '';
|
||||
if (waveNo) {
|
||||
return waveNo;
|
||||
}
|
||||
const boxes = this.boxList;
|
||||
if (Array.isArray(boxes) && boxes.length > 0) {
|
||||
const firstRefLabel = boxes[0]?.ref_label || '';
|
||||
@ -385,6 +409,10 @@ import voice from '@/core/utils/voice';
|
||||
return this.taskInfo.batchNo || '';
|
||||
},
|
||||
waveBatchPrefix() {
|
||||
const waveNo = this.taskInfo.waveNo || '';
|
||||
if (waveNo) {
|
||||
return waveNo;
|
||||
}
|
||||
const boxes = this.boxList;
|
||||
if (Array.isArray(boxes) && boxes.length > 0) {
|
||||
const firstRefLabel = boxes[0]?.ref_label || '';
|
||||
@ -1439,9 +1467,9 @@ import voice from '@/core/utils/voice';
|
||||
});
|
||||
voice.speak('拣货完成');
|
||||
// 通知列表页更新该波次状态为已复核
|
||||
const completedBatchNo = String(this.taskInfo?.batchNo || '').trim();
|
||||
if (completedBatchNo) {
|
||||
uni.setStorageSync('pick_completed_wave', completedBatchNo);
|
||||
const completedWaveNo = String(this.taskInfo?.waveNo || this.taskInfo?.batchNo || '').trim();
|
||||
if (completedWaveNo) {
|
||||
uni.setStorageSync('pick_completed_wave', completedWaveNo);
|
||||
}
|
||||
this.taskId = '';
|
||||
this.keyword = '';
|
||||
@ -1449,6 +1477,7 @@ import voice from '@/core/utils/voice';
|
||||
taskId: '',
|
||||
taskNo: '',
|
||||
batchNo: '',
|
||||
waveNo: '',
|
||||
status: 0,
|
||||
creatorId: '',
|
||||
creatorName: ''
|
||||
@ -1460,6 +1489,7 @@ import voice from '@/core/utils/voice';
|
||||
distinctSpaces: 0,
|
||||
distinctItems: 0
|
||||
};
|
||||
this.packingRequirements = '';
|
||||
this.pickingView = {
|
||||
modeCode: '',
|
||||
modeName: '--',
|
||||
@ -1537,6 +1567,7 @@ import voice from '@/core/utils/voice';
|
||||
taskId: '',
|
||||
taskNo: '',
|
||||
batchNo: '',
|
||||
waveNo: '',
|
||||
status: 0,
|
||||
creatorId: '',
|
||||
creatorName: ''
|
||||
@ -1564,6 +1595,20 @@ import voice from '@/core/utils/voice';
|
||||
extractTaskDetailPayload(response) {
|
||||
return response?.data?.data || response?.data || response?.result || response || {};
|
||||
},
|
||||
extractPackingRequirements(payload = {}) {
|
||||
const details = Array.isArray(payload?.picking_details) ? payload.picking_details : [];
|
||||
const map = {};
|
||||
for (let i = 0; i < details.length; i += 1) {
|
||||
const detail = details[i];
|
||||
const stockId = detail?.stock_id ?? detail?.stock?.id ?? '';
|
||||
const req = detail?.stock?.packing_requirements ?? '';
|
||||
if (stockId && req) {
|
||||
const key = String(stockId).trim();
|
||||
map[key] = String(req).trim();
|
||||
}
|
||||
}
|
||||
return map;
|
||||
},
|
||||
extractCurrentTaskIdFromResponse(response) {
|
||||
const payload = response?.data?.data || response?.data || response?.result || response || {};
|
||||
const candidate = payload?.task_id ?? payload?.taskId ?? payload?.task?.task_id ?? payload?.task?.taskId ?? null;
|
||||
@ -1602,6 +1647,7 @@ import voice from '@/core/utils/voice';
|
||||
taskId: task?.task_id ?? this.taskId,
|
||||
taskNo: task?.task_no || '',
|
||||
batchNo: task?.batch_no || '',
|
||||
waveNo: task?.wave_no || '',
|
||||
status: Number(task?.status || 0),
|
||||
creatorId: String(creatorId || '').trim(),
|
||||
creatorName: String(creatorName || '').trim()
|
||||
@ -1613,24 +1659,30 @@ import voice from '@/core/utils/voice';
|
||||
distinctSpaces: Number(summary?.distinct_spaces || 0),
|
||||
distinctItems: Number(summary?.distinct_items || 0)
|
||||
};
|
||||
this.packingRequirements = '';
|
||||
const packingReqMap = this.extractPackingRequirements(payload);
|
||||
this.pickingView = {
|
||||
modeCode: view?.mode_code ?? '',
|
||||
modeName: view?.mode_name || '--',
|
||||
items: viewItems.map(item => ({
|
||||
spaceId: item?.space_id ?? '',
|
||||
spaceName: item?.space_name || item?.location_space?.custom_name || '--',
|
||||
spaceBarcode: item?.location_space?.custom_barcode || '--',
|
||||
itemCode: item?.item_code || '--',
|
||||
itemName: item?.item_name || '--',
|
||||
stockId: Number(item?.stock_id || item?.item_snapshot?.stock_id || 0),
|
||||
totalQty: Number(item?.total_qty || 0),
|
||||
storeRemark: item?.store_remark || '',
|
||||
boxAllocations: (Array.isArray(item?.box_allocations) ? item.box_allocations : []).map(alloc => ({
|
||||
boxId: alloc?.box_id ?? '',
|
||||
boxNo: alloc?.box_no ?? '--',
|
||||
allocatedQty: Number(alloc?.allocated_qty || 0)
|
||||
}))
|
||||
}))
|
||||
items: viewItems.map(item => {
|
||||
const itemStockId = String(item?.stock_id || item?.item_snapshot?.stock_id || '').trim();
|
||||
return {
|
||||
spaceId: item?.space_id ?? '',
|
||||
spaceName: item?.space_name || item?.location_space?.custom_name || '--',
|
||||
spaceBarcode: item?.location_space?.custom_barcode || '--',
|
||||
itemCode: item?.item_code || '--',
|
||||
itemName: item?.item_name || '--',
|
||||
stockId: Number(item?.stock_id || item?.item_snapshot?.stock_id || 0),
|
||||
totalQty: Number(item?.total_qty || 0),
|
||||
storeRemark: item?.store_remark || '',
|
||||
packingRequirements: packingReqMap[itemStockId] || '',
|
||||
boxAllocations: (Array.isArray(item?.box_allocations) ? item.box_allocations : []).map(alloc => ({
|
||||
boxId: alloc?.box_id ?? '',
|
||||
boxNo: alloc?.box_no ?? '--',
|
||||
allocatedQty: Number(alloc?.allocated_qty || 0)
|
||||
}))
|
||||
};
|
||||
})
|
||||
};
|
||||
this.restorePickedStateForCurrentTask();
|
||||
this.restoreConfirmedOrderIdsForCurrentTask();
|
||||
@ -2144,6 +2196,73 @@ import voice from '@/core/utils/voice';
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.packing-req-banner {
|
||||
flex: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
background: #fef0f0;
|
||||
border: 1rpx solid #fde2e2;
|
||||
border-radius: 8rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
}
|
||||
|
||||
.packing-req-banner__label {
|
||||
flex-shrink: 0;
|
||||
font-size: 24rpx;
|
||||
color: #e64242;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.packing-req-banner__value {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 24rpx;
|
||||
color: #e64242;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.packing-req-popup {
|
||||
padding: 32rpx 24rpx 24rpx;
|
||||
max-width: 600rpx;
|
||||
}
|
||||
|
||||
.packing-req-popup__title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
text-align: center;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.packing-req-popup__body {
|
||||
padding: 24rpx;
|
||||
background: #fef0f0;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.packing-req-popup__text {
|
||||
font-size: 32rpx;
|
||||
color: #e64242;
|
||||
line-height: 1.8;
|
||||
word-break: break-all;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.packing-req-popup__footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.packing-req-popup__close {
|
||||
display: inline-block;
|
||||
font-size: 28rpx;
|
||||
color: #2979ff;
|
||||
padding: 12rpx 48rpx;
|
||||
}
|
||||
|
||||
.wave-list-popup {
|
||||
padding: 32rpx 24rpx 24rpx;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user