修改订单复核、订单商品详情页
This commit is contained in:
parent
173771f60c
commit
0c22b24489
@ -288,6 +288,12 @@ export default {
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
getOrderPrintData: {
|
||||
path: "order.print.getOrderPrintData",
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
}
|
||||
},
|
||||
wave: {
|
||||
@ -323,6 +329,12 @@ export default {
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
scanTask: {
|
||||
path: "order.recheckOrder.scanTask",
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
scanOrder: {
|
||||
path: "order.recheckOrder.scanOrder",
|
||||
auth: true,
|
||||
|
||||
@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<view class="scatter-picking-detail-page">
|
||||
<view class="normar_container">
|
||||
<page-nav :title="title">
|
||||
<template #right>
|
||||
<view class="nav-right-action" :class="{ 'nav-right-action--active': showUnboundPrintStationOnly, 'nav-right-action--bound': !!printStationId }" @click="toggleUnboundPrintStationOnly">{{ printStationId ? '已绑定打印台' : '未绑定打印台' }}</view>
|
||||
</template>
|
||||
</page-nav>
|
||||
<page-nav :title="title"></page-nav>
|
||||
|
||||
<view class="search-filter">
|
||||
<view class="search-box">
|
||||
@ -27,6 +23,52 @@
|
||||
<view class="search-btn" @click="handleSearch">
|
||||
<text class="search-btn__text">搜索</text>
|
||||
</view>
|
||||
<view class="search-divider"></view>
|
||||
<view class="search-btn search-btn--clear" @click="handleClearList">
|
||||
<text class="search-btn__text search-btn__text--clear">清空</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="print-config-row">
|
||||
<view class="print-config-col">
|
||||
<view class="print-station-select" @click="togglePrintStationDropdown(); showPrintModeDropdown = false">
|
||||
<text class="print-station-value" :class="{ 'print-station-value--bound': !!printStationId }">{{ 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-inline">
|
||||
<view v-if="printStationList.length === 0" class="print-station-option print-station-option--empty">暂无可用打印台</view>
|
||||
<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 class="print-config-col">
|
||||
<view class="print-mode-select" @click="showPrintModeDropdown = !showPrintModeDropdown; showPrintStationDropdown = false">
|
||||
<text class="print-mode-value">{{ printMode === 'printFirst' ? '先打印后复核' : '先复核后打印' }}</text>
|
||||
<u-icon :name="showPrintModeDropdown ? 'arrow-up' : 'arrow-down'" size="24" color="#909399"></u-icon>
|
||||
</view>
|
||||
<view v-if="showPrintModeDropdown" class="print-mode-dropdown-inline">
|
||||
<view
|
||||
class="print-mode-dropdown-option"
|
||||
:class="{ 'print-mode-dropdown-option--active': printMode === 'printFirst' }"
|
||||
@click.stop="printMode = 'printFirst'; showPrintModeDropdown = false"
|
||||
>
|
||||
先打印后复核
|
||||
</view>
|
||||
<view
|
||||
class="print-mode-dropdown-option"
|
||||
:class="{ 'print-mode-dropdown-option--active': printMode === 'reviewFirst' }"
|
||||
@click.stop="printMode = 'reviewFirst'; showPrintModeDropdown = false"
|
||||
>
|
||||
先复核后打印
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -69,30 +111,31 @@
|
||||
</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" :class="{ 'record-value--fin': getStatusText(item.status) === '已完成' }">{{ getStatusText(item.status) }}</text></view>
|
||||
<view class="record-line"><text class="record-label">波次号:</text><text class="record-value">{{ item.waveNo || '--' }}</text></view>
|
||||
<view class="record-main record-main--row">
|
||||
<text class="record-value" :class="getReviewStatusText(item) === '已复核' ? 'record-value--reviewed' : 'record-value--unreviewed'">{{ getReviewStatusText(item) }}</text>
|
||||
<text class="record-value record-value--id">{{ listType === 'single' ? (item.waybillNo || '--') : (item.waveNo || '--') }}</text>
|
||||
<view class="record-print-col">
|
||||
<text v-if="getPrintStatusText(item) === '已打印'" class="record-value record-value--printed">已打印</text>
|
||||
<text v-else class="record-value" :class="isPrintDisabled(item) ? 'record-value--print-disabled' : 'record-value--unprinted'" @click.stop="!isPrintDisabled(item) && handlePrintOrder(item)">未打印</text>
|
||||
<text v-if="item.interceptStatus && item.interceptStatus !== 'none'" class="record-value--intercepted">拦截</text>
|
||||
</view>
|
||||
<view class="record-right">
|
||||
<view class="record-line record-line--print"><text class="record-label">打印状态:</text><text class="record-value" :class="{ 'record-value--bound': item.hasBoundPrintStation }">{{ getPrintStatusText(item) }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-footer" @click.stop>
|
||||
<u-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
|
||||
@click.native.stop="handlePrintAllUnreviewed(item)"
|
||||
>
|
||||
打印所有未复核订单
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="safe-area-bottom"></view>
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="orderList.length > 0" class="bottom-stats-bar">
|
||||
<view class="bottom-stats-info">
|
||||
<text class="bottom-stats-text">波次总单数:<text class="bottom-stats-value">{{ totalOrders }}</text></text>
|
||||
<text class="bottom-stats-divider"></text>
|
||||
<text class="bottom-stats-text">剩余未复核:<text class="bottom-stats-value bottom-stats-value--warn">{{ totalUnreviewedCount }}</text></text>
|
||||
</view>
|
||||
<view class="bottom-stats-btn" @click="handleRefreshTask">
|
||||
<text class="bottom-stats-btn__text">刷新任务数据</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<u-popup v-if="showPrintPopup" :show="showPrintPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showPrintPopup = false">
|
||||
@ -201,6 +244,8 @@
|
||||
showPrintStationDropdown: false,
|
||||
printStationName: '--',
|
||||
printStationId: '',
|
||||
printMode: 'printFirst',
|
||||
showPrintModeDropdown: false,
|
||||
printStationList: [],
|
||||
selectedStationId: '',
|
||||
stationListPage: 1,
|
||||
@ -213,7 +258,12 @@
|
||||
printWavePlatformPrintData: null,
|
||||
printTargetList: [],
|
||||
goodsInfoList: [],
|
||||
orderList: []
|
||||
orderList: [],
|
||||
listType: '',
|
||||
totalOrders: 0,
|
||||
totalUnreviewedCount: 0,
|
||||
taskId: '',
|
||||
scanPickerName: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -238,6 +288,7 @@
|
||||
? Math.max(0, parsedGrabCount)
|
||||
: 5;
|
||||
this.initializeOrderList();
|
||||
this.loadPrintStations();
|
||||
},
|
||||
onShow() {
|
||||
this.safeDispatchBroadcast('setCallbacks', {
|
||||
@ -352,6 +403,9 @@
|
||||
const pickerName = String(source.picker_name || source.pickerName || source.user_name || source.userName || '--').trim() || '--';
|
||||
const cartNo = String(source.cart_code || source.cartCode || source.cart_no || source.cartNo || '--').trim() || '--';
|
||||
const unreviewedCount = Number(source.unreviewed_count ?? source.unreviewedCount ?? source.pending_count ?? source.pendingCount ?? 0);
|
||||
const unprintedCount = Number(source.unprinted_count ?? source.unprintedCount ?? 0);
|
||||
const orderCount = Number(source.order_count ?? source.orderCount ?? 0);
|
||||
const interceptStatus = String(source.intercept_status || source.interceptStatus || '').trim();
|
||||
const assigneeId = String((source.picker_id ?? source.pickerId ?? source.user_id ?? source.userId) || '').trim();
|
||||
return {
|
||||
id: String(rowId || `batch-${this.currentPage}-${index + 1}`),
|
||||
@ -360,6 +414,9 @@
|
||||
pickerName,
|
||||
cartNo,
|
||||
unreviewedCount: Number.isFinite(unreviewedCount) ? unreviewedCount : 0,
|
||||
unprintedCount: Number.isFinite(unprintedCount) ? unprintedCount : 0,
|
||||
orderCount: Number.isFinite(orderCount) ? orderCount : 0,
|
||||
interceptStatus,
|
||||
status: String(source.status || 'pending'),
|
||||
waybillCode: String(source.waybill_no || source.waybillCode || source.waybill_code || ''),
|
||||
printStationId: normalizedPrintStationId,
|
||||
@ -632,6 +689,39 @@
|
||||
clearSearch() {
|
||||
this.keyword = '';
|
||||
},
|
||||
handleClearList() {
|
||||
this.keyword = '';
|
||||
this.orderList = [];
|
||||
this.goodsInfoList = [];
|
||||
this.paginationTotal = 0;
|
||||
this.currentPage = 1;
|
||||
this.totalOrders = 0;
|
||||
this.totalUnreviewedCount = 0;
|
||||
this.listType = '';
|
||||
},
|
||||
async handleRefreshTask() {
|
||||
if (!this.taskId) {
|
||||
if (this.keyword) {
|
||||
this.handleSearch();
|
||||
} else {
|
||||
this.initializeOrderList();
|
||||
this.currentPage = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
uni.showLoading({ title: '刷新中...' });
|
||||
try {
|
||||
const response = await this.$http('order.recheckOrder.scanTask', { task_id: Number(this.taskId) });
|
||||
const payload = this.extractScanOrderPayload(response);
|
||||
const result = this.normalizeScanOrderResult(payload);
|
||||
this.handleScanOrderSuccess(result);
|
||||
} catch (error) {
|
||||
const message = String(error?.message || error?.msg || error?.errMsg || '刷新失败');
|
||||
uni.showToast({ title: message, icon: 'none' });
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
buildScanOrderParams(keyword) {
|
||||
const value = this.normalizeKeyword(keyword);
|
||||
return {
|
||||
@ -656,33 +746,62 @@
|
||||
normalizeScanOrderResult(payload) {
|
||||
const listType = String(payload?.list_type || payload?.listType || '').trim();
|
||||
const matchType = String(payload?.match_type || payload?.matchType || '').trim();
|
||||
const taskId = String(payload?.task_id ?? payload?.taskId ?? '').trim();
|
||||
const pickerName = String(payload?.picker_name || payload?.pickerName || '').trim();
|
||||
|
||||
// 扁平化订单列表模式(散单:运单号/波次号命中)
|
||||
const totalOrders = Number(payload?.total_orders ?? payload?.totalOrders ?? 0);
|
||||
const totalUnreviewedCount = Number(payload?.unreviewed_count ?? payload?.unreviewedCount ?? 0);
|
||||
|
||||
if (listType === 'single') {
|
||||
const list = Array.isArray(payload?.list) ? payload.list : [];
|
||||
return {
|
||||
listType: 'single',
|
||||
matchType,
|
||||
list: list.map(item => this.normalizeScanOrderItem(item)),
|
||||
total: Number(payload?.total ?? payload?.count ?? list.length)
|
||||
total: Number(payload?.total ?? payload?.count ?? list.length),
|
||||
totalOrders,
|
||||
totalUnreviewedCount,
|
||||
taskId,
|
||||
pickerName
|
||||
};
|
||||
}
|
||||
|
||||
// 嵌套波次结构模式(团单:车号命中)
|
||||
if (listType === 'group') {
|
||||
const waves = Array.isArray(payload?.waves || payload?.list) ? (payload?.waves || payload?.list) : [];
|
||||
return {
|
||||
listType: 'group',
|
||||
matchType,
|
||||
waves: waves.map(wave => ({
|
||||
const normalizedWaves = waves.map(wave => {
|
||||
const subList = Array.isArray(wave?.list || wave?.items) ? (wave?.list || wave?.items).map(item => this.normalizeScanOrderItem(item)) : [];
|
||||
const waveTotalOrders = Number(wave?.order_count ?? wave?.orderCount ?? subList.length);
|
||||
const waveUnreviewed = Number(wave?.unreviewed_count ?? wave?.unreviewedCount ?? 0);
|
||||
const waveStocks = Array.isArray(wave?.stocks) ? wave.stocks : [];
|
||||
return {
|
||||
waveNo: String(wave?.wave_no || wave?.waveNo || '').trim(),
|
||||
waveId: wave?.wave_id ?? wave?.waveId ?? wave?.id ?? '',
|
||||
cartNo: String(wave?.cart_code || wave?.cartCode || wave?.cart_no || wave?.cartNo || '').trim(),
|
||||
pickerName: String(wave?.picker_name || wave?.pickerName || '').trim(),
|
||||
status: String(wave?.status || 'pending'),
|
||||
list: Array.isArray(wave?.list || wave?.items) ? (wave?.list || wave?.items).map(item => this.normalizeScanOrderItem(item)) : []
|
||||
})),
|
||||
total: Number(payload?.total ?? payload?.count ?? waves.length)
|
||||
unreviewedCount: waveUnreviewed > 0 ? waveUnreviewed : subList.length,
|
||||
unprintedCount: Number(wave?.unprinted_count ?? wave?.unprintedCount ?? 0),
|
||||
orderCount: Number(wave?.order_count ?? wave?.orderCount ?? 0),
|
||||
totalOrders: waveTotalOrders,
|
||||
stocks: waveStocks,
|
||||
orderIds: (Array.isArray(wave?.order_ids) ? wave.order_ids : Array.isArray(wave?.orderIds) ? wave.orderIds : []).map(id => Number(id)),
|
||||
interceptStatus: String(wave?.intercept_status || wave?.interceptStatus || '').trim(),
|
||||
list: subList
|
||||
};
|
||||
});
|
||||
const calcTotalOrders = normalizedWaves.reduce((sum, w) => sum + w.totalOrders, 0);
|
||||
const calcUnreviewed = normalizedWaves.reduce((sum, w) => sum + w.unreviewedCount, 0);
|
||||
return {
|
||||
listType: 'group',
|
||||
matchType,
|
||||
waves: normalizedWaves,
|
||||
total: Number(payload?.total ?? payload?.count ?? waves.length),
|
||||
totalOrders: calcTotalOrders,
|
||||
totalUnreviewedCount: calcUnreviewed,
|
||||
taskId,
|
||||
pickerName
|
||||
};
|
||||
}
|
||||
|
||||
@ -727,6 +846,7 @@
|
||||
waybillNo,
|
||||
order,
|
||||
items,
|
||||
pickerName,
|
||||
expresses: Array.isArray(payload?.expresses) ? payload.expresses : [],
|
||||
logs: Array.isArray(payload?.logs) ? payload.logs : []
|
||||
};
|
||||
@ -742,8 +862,18 @@
|
||||
cartNo: String(item?.cart_code || item?.cartCode || item?.cart_no || item?.cartNo || '').trim(),
|
||||
status: String(item?.status || 'pending'),
|
||||
recheckStatus: String(item?.recheck_status || item?.recheckStatus || '').trim().toLowerCase(),
|
||||
isReviewed: !!item?.is_reviewed || !!item?.isReviewed,
|
||||
isPrinted: !!item?.is_printed || !!item?.isPrinted,
|
||||
interceptStatus: String(item?.intercept_status || item?.interceptStatus || '').trim(),
|
||||
totalOrders: Number(item?.total_orders ?? item?.totalOrders ?? 0),
|
||||
detail: item?.detail && typeof item.detail === 'object' ? item.detail : null,
|
||||
items: Array.isArray(item?.items) ? item.items : [],
|
||||
items: Array.isArray(item?.items) ? item.items
|
||||
: Array.isArray(item?.goods_items) ? item.goods_items
|
||||
: Array.isArray(item?.goodsItems) ? item.goodsItems
|
||||
: Array.isArray(item?.goods) ? item.goods
|
||||
: Array.isArray(item?.stock) ? item.stock
|
||||
: Array.isArray(item?.stocks) ? item.stocks
|
||||
: [],
|
||||
expresses: Array.isArray(item?.expresses) ? item.expresses : [],
|
||||
logs: Array.isArray(item?.logs) ? item.logs : []
|
||||
};
|
||||
@ -757,7 +887,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const listType = result?.listType || '';
|
||||
this.listType = result?.listType || '';
|
||||
this.taskId = result?.taskId || '';
|
||||
this.scanPickerName = result?.pickerName || '';
|
||||
const listType = this.listType;
|
||||
|
||||
// 散单模式(list_type=single):刷新当前页面列表
|
||||
if (listType === 'single') {
|
||||
@ -765,15 +898,23 @@
|
||||
this.orderList = flatList.map((item, index) => ({
|
||||
id: String(item?.id || item?.orderId || `scan-${Date.now()}-${index}`),
|
||||
waveNo: item?.waveNo || '--',
|
||||
waybillNo: item?.waybillNo || '',
|
||||
pickerName: item?.pickerName || '--',
|
||||
cartNo: item?.cartNo || '--',
|
||||
unreviewedCount: item?.recheckStatus === 'fin' ? 0 : 1,
|
||||
status: item?.status || 'pending',
|
||||
waybillCode: item?.waybillNo || '',
|
||||
recheckStatus: item?.recheckStatus || ''
|
||||
recheckStatus: item?.recheckStatus || '',
|
||||
isReviewed: !!item?.isReviewed,
|
||||
isPrinted: !!item?.isPrinted,
|
||||
interceptStatus: String(item?.interceptStatus || '').trim(),
|
||||
totalOrders: Number(item?.totalOrders ?? 0),
|
||||
detailItems: Array.isArray(item?.items) ? item.items : []
|
||||
}));
|
||||
this.paginationTotal = result?.total ?? flatList.length;
|
||||
this.goodsInfoList = [];
|
||||
this.totalOrders = result?.totalOrders ?? 0;
|
||||
this.totalUnreviewedCount = this.orderList.filter(item => !item.isReviewed).length;
|
||||
uni.showToast({
|
||||
title: `共匹配 ${flatList.length} 条订单`,
|
||||
icon: 'none'
|
||||
@ -786,18 +927,27 @@
|
||||
const waves = Array.isArray(result?.waves) ? result.waves : [];
|
||||
this.orderList = waves.map((wave, wi) => {
|
||||
const subList = Array.isArray(wave?.list) ? wave.list : [];
|
||||
const waveUnreviewed = Number(wave?.unreviewedCount ?? 0);
|
||||
return {
|
||||
id: String(wave?.waveId || wave?.waveNo || `wave-${Date.now()}-${wi}`),
|
||||
waveNo: wave?.waveNo || '--',
|
||||
pickerName: wave?.pickerName || '--',
|
||||
cartNo: wave?.cartNo || '--',
|
||||
unreviewedCount: subList.filter(s => String(s?.recheckStatus || '') !== 'fin').length,
|
||||
unreviewedCount: waveUnreviewed > 0 ? waveUnreviewed : subList.length,
|
||||
unprintedCount: Number(wave?.unprintedCount ?? 0),
|
||||
orderCount: Number(wave?.orderCount ?? 0),
|
||||
totalOrders: Number(wave?.orderCount ?? subList.length),
|
||||
stocks: Array.isArray(wave?.stocks) ? wave.stocks : [],
|
||||
orderIds: Array.isArray(wave?.orderIds) ? wave.orderIds.map(id => Number(id)) : [],
|
||||
interceptStatus: String(wave?.interceptStatus || '').trim(),
|
||||
status: wave?.status || 'pending',
|
||||
children: subList
|
||||
};
|
||||
});
|
||||
this.paginationTotal = this.orderList.length;
|
||||
this.goodsInfoList = [];
|
||||
this.totalOrders = this.orderList.reduce((sum, w) => sum + (w.totalOrders || 0), 0);
|
||||
this.totalUnreviewedCount = this.orderList.filter(item => (item.unreviewedCount || 0) > 0).length;
|
||||
uni.showToast({
|
||||
title: `共匹配 ${this.orderList.length} 个波次`,
|
||||
icon: 'none'
|
||||
@ -951,32 +1101,68 @@
|
||||
this.selectedStationId = station.id;
|
||||
}
|
||||
},
|
||||
getStatusText(status) {
|
||||
const map = {
|
||||
pending: '待复核',
|
||||
picking: '复核中',
|
||||
done: '已复核',
|
||||
fin: '已完成',
|
||||
};
|
||||
return map[status] || '待复核';
|
||||
getReviewStatusText(item) {
|
||||
if (!item) return '--';
|
||||
if (this.listType === 'single') {
|
||||
return item.isReviewed ? '已复核' : '未复核';
|
||||
}
|
||||
// group 模式:根据 unreviewedCount 判断
|
||||
return (item.unreviewedCount || 0) === 0 ? '已复核' : '未复核';
|
||||
},
|
||||
isPrintDisabled(item) {
|
||||
if (!item) return true;
|
||||
// 先复核后打印模式下,禁止直接打印
|
||||
if (this.printMode === 'reviewFirst') return true;
|
||||
if (this.listType === 'single') return false;
|
||||
// group 模式:orderCount 和 unprintedCount 都为 0 时禁用
|
||||
return (item.orderCount || 0) === 0 && (item.unprintedCount || 0) === 0;
|
||||
},
|
||||
getPrintStatusText(item) {
|
||||
if (item?.hasBoundPrintStation) {
|
||||
return '已绑定';
|
||||
if (!item) return '--';
|
||||
if (this.listType === 'single') {
|
||||
return item.isPrinted ? '已打印' : '未打印';
|
||||
}
|
||||
return '未绑定';
|
||||
// group 模式:orderCount 和 unprintedCount 都为 0 时显示未打印(无数据可打)
|
||||
if ((item.unprintedCount || 0) === 0 && (item.orderCount || 0) > 0) {
|
||||
return '已打印';
|
||||
}
|
||||
return '未打印';
|
||||
},
|
||||
goPickGoodsDetail(item) {
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
// 缓存商品明细数据
|
||||
let items = [];
|
||||
if (Array.isArray(item?.detailItems)) {
|
||||
items = item.detailItems;
|
||||
} else if (Array.isArray(item?.stocks)) {
|
||||
// group 模式:使用波次的 stocks
|
||||
items = item.stocks;
|
||||
} else if (Array.isArray(item?.children)) {
|
||||
// group 模式:收集所有子订单的 items
|
||||
item.children.forEach(child => {
|
||||
if (Array.isArray(child?.items)) {
|
||||
items = items.concat(child.items);
|
||||
}
|
||||
});
|
||||
}
|
||||
const cacheKey = `order_detail_${Date.now()}_${item.id}`;
|
||||
try {
|
||||
uni.setStorageSync(cacheKey, { items });
|
||||
} catch (error) {
|
||||
console.warn('[OrderReview] 缓存商品明细失败:', error);
|
||||
}
|
||||
const params = [
|
||||
`recordId=${encodeURIComponent(String(item.id || ''))}`,
|
||||
`waveNo=${encodeURIComponent(String(item.waveNo || '--'))}`,
|
||||
`pickerName=${encodeURIComponent(String(item.pickerName || '--'))}`,
|
||||
`waybillNo=${encodeURIComponent(String(item.waybillNo || '--'))}`,
|
||||
`pickerName=${encodeURIComponent(String(this.scanPickerName || item.pickerName || '--'))}`,
|
||||
`cartNo=${encodeURIComponent(String(item.cartNo || '--'))}`,
|
||||
`status=${encodeURIComponent(String(item.status || 'pending'))}`,
|
||||
`unreviewedCount=${encodeURIComponent(String(item.unreviewedCount || 0))}`
|
||||
`unreviewedCount=${encodeURIComponent(String(item.unreviewedCount || 0))}`,
|
||||
`listType=${encodeURIComponent(this.listType)}`,
|
||||
`cacheKey=${encodeURIComponent(cacheKey)}`
|
||||
];
|
||||
this.$tools.routerTo(`/pages/work/order/scatter-pick-goods-detail?${params.join('&')}`);
|
||||
},
|
||||
@ -1003,16 +1189,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.loadPrintStations();
|
||||
} catch (error) {
|
||||
this.printStationList = [];
|
||||
this.printStationName = '--';
|
||||
uni.showToast({
|
||||
title: '打印台加载失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
this.pendingPrintCount = Number(target.unreviewedCount || 0);
|
||||
this.printMessage = `待打印未复核订单 ${this.pendingPrintCount} 条`;
|
||||
this.showPrintStationDropdown = false;
|
||||
@ -1079,6 +1255,89 @@
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
buildOrderPrintDataParams(item) {
|
||||
if (this.listType === 'single') {
|
||||
return {
|
||||
order_ids: [Number(item.id)]
|
||||
};
|
||||
}
|
||||
// group 模式:使用接口返回的 order_ids
|
||||
const orderIds = Array.isArray(item?.orderIds) ? item.orderIds : [];
|
||||
return {
|
||||
order_ids: orderIds.length > 0 ? orderIds : [Number(item.id)]
|
||||
};
|
||||
},
|
||||
extractOrderPrintPayload(response) {
|
||||
const candidates = [
|
||||
response?.data?.data,
|
||||
response?.data,
|
||||
response?.result,
|
||||
response
|
||||
];
|
||||
for (let i = 0; i < candidates.length; i += 1) {
|
||||
const current = candidates[i];
|
||||
if (current && typeof current === 'object') {
|
||||
return current;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
},
|
||||
normalizeOrderPrintGroups(payload) {
|
||||
const groups = Array.isArray(payload?.waveGroups) ? payload.waveGroups : [];
|
||||
if (groups.length) return groups;
|
||||
// 如果返回的不是 waveGroups 结构,尝试包装成 waveGroups
|
||||
if (payload && typeof payload === 'object') {
|
||||
return [payload];
|
||||
}
|
||||
return [];
|
||||
},
|
||||
async handlePrintOrder(item) {
|
||||
if (!item) {
|
||||
uni.showToast({ title: '打印数据无效', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({ title: '处理打印中...' });
|
||||
|
||||
try {
|
||||
// 1. 获取打印数据
|
||||
const params = this.buildOrderPrintDataParams(item);
|
||||
const response = await this.$http('order.print.getOrderPrintData', params);
|
||||
const payload = this.extractOrderPrintPayload(response);
|
||||
const waveGroups = this.normalizeOrderPrintGroups(payload);
|
||||
if (!waveGroups.length) {
|
||||
throw new Error('未获取到可打印数据');
|
||||
}
|
||||
|
||||
// 2. 检查打印台
|
||||
if (!this.printStationId || this.printStationName === '--') {
|
||||
throw new Error('无可用的打印台');
|
||||
}
|
||||
|
||||
// 3. 发送打印
|
||||
this.printRequestCode = this.buildPrintRequestCode();
|
||||
const sendParams = {
|
||||
type: 'express',
|
||||
printStationId: this.printStationId,
|
||||
requestCode: this.printRequestCode,
|
||||
data: {
|
||||
waveGroups
|
||||
}
|
||||
};
|
||||
const sendResponse = await this.$http('print.send', sendParams);
|
||||
const success = sendResponse?.flag !== 'failure' && sendResponse?.code !== '500' && sendResponse?.code !== 500;
|
||||
if (!success) {
|
||||
throw new Error(sendResponse?.message || sendResponse?.msg || '打印发送失败');
|
||||
}
|
||||
|
||||
uni.hideLoading();
|
||||
uni.showToast({ title: '打印已发送', icon: 'success' });
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
const message = String(error?.message || error?.msg || error?.errMsg || '打印失败');
|
||||
uni.showToast({ title: message, icon: 'none' });
|
||||
}
|
||||
},
|
||||
handlePageChange(page) {
|
||||
const targetPage = Math.max(1, Number(page || 1));
|
||||
if (targetPage === this.currentPage) {
|
||||
@ -1142,6 +1401,67 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.bottom-stats-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16rpx 24rpx;
|
||||
padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
|
||||
background: #ffffff;
|
||||
border-top: 1rpx solid #ebeef5;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bottom-stats-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.bottom-stats-text {
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.bottom-stats-value {
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.bottom-stats-value--warn {
|
||||
color: #fa8c16;
|
||||
}
|
||||
|
||||
.bottom-stats-divider {
|
||||
width: 1rpx;
|
||||
height: 24rpx;
|
||||
background: #dcdfe6;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bottom-stats-btn {
|
||||
flex-shrink: 0;
|
||||
margin-left: 16rpx;
|
||||
padding: 8rpx 20rpx;
|
||||
border: none;
|
||||
border-radius: 10rpx;
|
||||
background: #2979ff;
|
||||
}
|
||||
|
||||
.bottom-stats-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.bottom-stats-btn__text {
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.goods-info-section {
|
||||
background: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
@ -1233,12 +1553,94 @@
|
||||
|
||||
.search-filter {
|
||||
background: #ffffff;
|
||||
padding: 20rpx 24rpx;
|
||||
padding: 20rpx 24rpx 16rpx;
|
||||
border: 1rpx solid #f0f0f0;
|
||||
border-top: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.print-config-row {
|
||||
margin-top: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.print-config-col {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.print-station-select,
|
||||
.print-mode-select {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12rpx 16rpx;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 10rpx;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.print-station-value,
|
||||
.print-mode-value {
|
||||
flex: 1;
|
||||
font-size: 26rpx;
|
||||
color: #303133;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.print-station-value--bound {
|
||||
color: #07c160;
|
||||
}
|
||||
|
||||
.print-station-dropdown-inline,
|
||||
.print-mode-dropdown-inline {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 100%;
|
||||
max-height: 300rpx;
|
||||
overflow-y: auto;
|
||||
background: #ffffff;
|
||||
border: 1rpx solid #ebeef5;
|
||||
border-radius: 10rpx;
|
||||
z-index: 100;
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.print-station-option,
|
||||
.print-mode-dropdown-option {
|
||||
padding: 16rpx 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #303133;
|
||||
border-bottom: 1rpx solid #f2f3f5;
|
||||
}
|
||||
|
||||
.print-station-option:last-child,
|
||||
.print-mode-dropdown-option:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.print-station-option--active,
|
||||
.print-mode-dropdown-option--active {
|
||||
color: #2979ff;
|
||||
background: #f0f7ff;
|
||||
}
|
||||
|
||||
.print-station-option--empty {
|
||||
color: #c0c4cc;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.print-station-option:active,
|
||||
.print-mode-dropdown-option:active {
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
position: relative;
|
||||
}
|
||||
@ -1252,7 +1654,7 @@
|
||||
}
|
||||
|
||||
::v-deep .search-box-inner .u-search__content {
|
||||
padding-right: 200rpx;
|
||||
padding-right: 280rpx;
|
||||
}
|
||||
|
||||
::v-deep .search-box-inner .u-search__content__close {
|
||||
@ -1308,6 +1710,10 @@
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.search-btn__text--clear {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.record-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -1331,6 +1737,29 @@
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.record-main--row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 20rpx;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.record-main--row .record-value {
|
||||
flex: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.record-main--row .record-value--id {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.record-left {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@ -1363,6 +1792,53 @@
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.record-value--reviewed {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.record-value--unreviewed {
|
||||
color: #fa8c16;
|
||||
}
|
||||
|
||||
.record-value--printed {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.record-value--unprinted {
|
||||
color: #07c160;
|
||||
padding: 4rpx 16rpx;
|
||||
border: 2rpx solid #07c160;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.4;
|
||||
background: #f0fff5;
|
||||
}
|
||||
|
||||
.record-value--unprinted:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.record-value--print-disabled {
|
||||
color: #c0c4cc;
|
||||
padding: 4rpx 16rpx;
|
||||
border: 2rpx solid #dcdfe6;
|
||||
border-radius: 8rpx;
|
||||
font-size: 26rpx;
|
||||
line-height: 1.4;
|
||||
background: #f5f5f5;
|
||||
}
|
||||
|
||||
.record-value--intercepted {
|
||||
display: inline-block;
|
||||
margin-left: 8rpx;
|
||||
padding: 0 8rpx;
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
line-height: 1.6;
|
||||
background: #f56c6c;
|
||||
}
|
||||
|
||||
.record-right {
|
||||
min-width: 180rpx;
|
||||
display: flex;
|
||||
|
||||
@ -3,14 +3,20 @@
|
||||
<view class="normar_container">
|
||||
<page-nav :title="title">
|
||||
<template #right>
|
||||
<view class="nav-right-complete" @click="handleComplete">确认复核</view>
|
||||
<view class="nav-right-complete" :class="{ 'nav-right-complete--disabled': !canConfirmRecheck }" @click="canConfirmRecheck && handleComplete()">确认复核</view>
|
||||
</template>
|
||||
</page-nav>
|
||||
|
||||
<view class="page-head">
|
||||
<view class="page-head-item">
|
||||
<view class="page-head-label">{{ headMatchLabel }}</view>
|
||||
<text class="page-head-value">{{ headMatchValue }}</text>
|
||||
<view class="page-head-row page-head-row--top">
|
||||
<text class="page-head-value">{{ detailInfo.listType === 'single' ? detailInfo.waybillNo : detailInfo.waveNo }}</text>
|
||||
</view>
|
||||
<view class="page-head-row page-head-row--bottom">
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -74,11 +80,10 @@
|
||||
<view class="top-info">
|
||||
<view class="goods-row" :class="{ 'goods-row--barcode-highlight': isCurrentBarcodeMatched }"><view class="label">条码:</view><text class="value">{{ currentGoods.barcode || '--' }}</text></view>
|
||||
<view class="goods-row"><view class="label">规格:</view><text class="value">{{ currentGoods.location || '--' }}</text></view>
|
||||
<view class="goods-row goods-row--quantity">
|
||||
<view class="label">数量:</view>
|
||||
<text class="value">{{ currentGoods.planQty || 0 }}</text>
|
||||
<view class="pick-list-title-btn" @click="togglePickListSection">拣货列表</view>
|
||||
</view>
|
||||
<view class="goods-row"><view class="label">总数:</view><text class="value">{{ currentGoods.planQty || 0 }}</text></view>
|
||||
<view class="goods-row"><view class="label">已扫:</view><text class="value">{{ currentGoods.scannedQty || 0 }}</text></view>
|
||||
<view class="goods-row"><view class="label label--package">打包要求:</view><text class="value">{{ currentGoods.packageRequirement }}</text></view>
|
||||
<view class="goods-row goods-row--pick-btn"><view class="pick-list-title-btn" @click="togglePickListSection">商品列表</view></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="switch-row">
|
||||
@ -90,7 +95,7 @@
|
||||
</view>
|
||||
|
||||
<scroll-view class="bottom-module" scroll-y>
|
||||
<view class="bottom-module-title" v-show="showPickListSection">拣货列表</view>
|
||||
<view class="bottom-module-title" v-show="showPickListSection">商品列表</view>
|
||||
<view class="pick-list-scroll" v-show="showPickListSection">
|
||||
<view class="pick-list">
|
||||
<view
|
||||
@ -104,6 +109,7 @@
|
||||
<view class="metric-diagonal"></view>
|
||||
<text class="metric-order">{{ item.lineNo || 0 }}</text>
|
||||
<text class="metric-product">{{ item.planQty || 0 }}</text>
|
||||
<text class="metric-scanned">{{ item.scannedQty || 0 }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -111,6 +117,9 @@
|
||||
<view class="safe-area-bottom"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="bottom-summary">
|
||||
<text class="bottom-summary-text">合计:<text class="bottom-summary-value">{{ totalPlanQty }}</text></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -119,7 +128,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '拣货商品详情',
|
||||
title: '订单商品详情',
|
||||
currentGoodsIndex: 0,
|
||||
confirmingRecheck: false,
|
||||
matchedGoodsId: '',
|
||||
@ -177,6 +186,22 @@
|
||||
return false;
|
||||
}
|
||||
return !!this.matchedGoodsState[currentId];
|
||||
},
|
||||
totalPlanQty() {
|
||||
return this.goodsList.reduce((sum, item) => sum + (item.planQty || 0), 0);
|
||||
},
|
||||
isAllMatched() {
|
||||
return this.goodsList.every(item => {
|
||||
const id = String(item?.id || '');
|
||||
if (!id) return false;
|
||||
return !!this.matchedGoodsState[id];
|
||||
});
|
||||
},
|
||||
isAllScanned() {
|
||||
return this.goodsList.every(item => (item.scannedQty || 0) >= (item.planQty || 0));
|
||||
},
|
||||
canConfirmRecheck() {
|
||||
return this.isAllMatched && this.isAllScanned;
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -192,7 +217,8 @@
|
||||
pickerName: options?.pickerName || '--',
|
||||
cartNo: options?.cartNo || '--',
|
||||
status: options?.status || 'pending',
|
||||
unreviewedCount: Number(options?.unreviewedCount || 0)
|
||||
unreviewedCount: Number(options?.unreviewedCount || 0),
|
||||
listType: String(options?.listType || '').trim()
|
||||
};
|
||||
if (this.isRecheckFinished) {
|
||||
uni.showToast({
|
||||
@ -334,9 +360,38 @@
|
||||
this.matchedGoodsState[this.matchedGoodsId] = true;
|
||||
}
|
||||
}
|
||||
uni.showToast({
|
||||
title: '条码匹配成功',
|
||||
icon: 'success'
|
||||
|
||||
const matchedItem = this.goodsList[matchIndex];
|
||||
const itemName = matchedItem?.skuName || '商品';
|
||||
const maxQty = matchedItem?.planQty || 0;
|
||||
const currentScanned = matchedItem?.scannedQty || 0;
|
||||
|
||||
uni.showModal({
|
||||
title: `扫描成功:${itemName}`,
|
||||
content: `请输入数量(共 ${maxQty},已扫 ${currentScanned}):`,
|
||||
editable: true,
|
||||
placeholderText: '请输入数量',
|
||||
success: (res) => {
|
||||
if (!res.confirm) return;
|
||||
const inputQty = this.toPositiveNumber(res.content, 0);
|
||||
if (inputQty <= 0) {
|
||||
uni.showToast({ title: '请输入有效数量', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
const newScanned = Math.min(inputQty, maxQty);
|
||||
if (typeof this.$set === 'function') {
|
||||
this.$set(this.goodsList, matchIndex, {
|
||||
...matchedItem,
|
||||
scannedQty: newScanned
|
||||
});
|
||||
} else {
|
||||
this.goodsList[matchIndex].scannedQty = newScanned;
|
||||
}
|
||||
uni.showToast({
|
||||
title: `已录入 ${newScanned} 个`,
|
||||
icon: 'success'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
toPositiveNumber(value, fallback = 0) {
|
||||
@ -378,9 +433,13 @@
|
||||
buildGoodsListByItems(items) {
|
||||
const sourceList = Array.isArray(items) ? items : [];
|
||||
return sourceList.map((item, index) => {
|
||||
// 判断是否为 stock 对象(直接包含 item_name 等字段)
|
||||
const isStockItem = !!item?.stock_id || (!!item?.item_name && !!item?.plan_qty);
|
||||
const stockItem = isStockItem ? item : (Array.isArray(item?.stock) && item.stock.length > 0 ? item.stock[0] : null);
|
||||
const snapshot = item?.item_snapshot && typeof item.item_snapshot === 'object'
|
||||
? item.item_snapshot
|
||||
: {};
|
||||
const stockImages = stockItem ? (Array.isArray(stockItem.images) ? stockItem.images : []) : [];
|
||||
const snapshotImages = [
|
||||
...(Array.isArray(snapshot?.images) ? snapshot.images : []),
|
||||
...(Array.isArray(snapshot?.image_list) ? snapshot.image_list : [])
|
||||
@ -391,20 +450,28 @@
|
||||
.map(url => String(url || '').trim())
|
||||
.filter(url => !!url);
|
||||
const snapshotSingleImage = String(snapshot?.image || snapshot?.pic || '').trim();
|
||||
const images = snapshotImages.length
|
||||
? snapshotImages
|
||||
: (snapshotSingleImage ? [snapshotSingleImage] : itemImages);
|
||||
const images = stockImages.length
|
||||
? stockImages
|
||||
: (snapshotImages.length
|
||||
? snapshotImages
|
||||
: (snapshotSingleImage ? [snapshotSingleImage] : itemImages));
|
||||
const imageUrl = images.length > 0 ? String(images[0] || '') : '';
|
||||
const planQty = this.toPositiveNumber(item?.plan_qty, 0);
|
||||
const planQty = this.toPositiveNumber(stockItem?.plan_qty ?? item?.plan_qty, 0);
|
||||
const scannedQty = this.toPositiveNumber(item?.scanned_qty ?? item?.finish_qty ?? item?.scannedQty ?? 0, 0);
|
||||
const stockName = stockItem ? String(stockItem.item_name || '').trim() : '';
|
||||
const stockBarcodes = stockItem ? (Array.isArray(stockItem.barcodes) ? stockItem.barcodes : []) : [];
|
||||
|
||||
return {
|
||||
id: String(item?.id || `${this.detailInfo.recordId || 'record'}-${index + 1}`),
|
||||
id: String(item?.id || stockItem?.stock_id || `${this.detailInfo.recordId || 'record'}-${index + 1}`),
|
||||
lineNo: this.toPositiveNumber(item?.order_line_no, index + 1),
|
||||
planQty,
|
||||
skuCode: String(item?.item_code || snapshot?.item_code || ''),
|
||||
skuName: String(snapshot?.item_name || item?.item_name || '--'),
|
||||
location: String(snapshot?.sku_property || item?.sku_property || '--'),
|
||||
barcode: String(snapshot?.barcode || snapshot?.item_code || item?.item_code || '--'),
|
||||
scannedQty,
|
||||
packageRequirement: String(item?.packing_requirements || item?.package_requirement || item?.packageRequirement || item?.packing_requirement || '').trim() || '--',
|
||||
skuCode: String(stockItem?.item_code || item?.item_code || snapshot?.item_code || ''),
|
||||
skuName: stockName || String(snapshot?.item_name || item?.item_name || '--'),
|
||||
location: String(stockItem?.sku_property || snapshot?.sku_property || item?.sku_property || '--'),
|
||||
barcode: stockBarcodes.length > 0 ? stockBarcodes.join(', ') : String(snapshot?.barcode || snapshot?.item_code || item?.item_code || '--'),
|
||||
barcodes: stockBarcodes.length > 0 ? stockBarcodes : (snapshot?.barcode ? [snapshot.barcode] : []),
|
||||
imageUrl,
|
||||
images,
|
||||
pickedQty: 0
|
||||
@ -441,10 +508,11 @@
|
||||
},
|
||||
handleComplete() {
|
||||
if (this.isRecheckFinished) {
|
||||
uni.showToast({
|
||||
title: '该订单已复核完成',
|
||||
icon: 'none'
|
||||
});
|
||||
uni.showToast({ title: '该订单已复核完成', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
if (!this.canConfirmRecheck) {
|
||||
uni.showToast({ title: '请先完成所有商品条码扫描和数量核对', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.confirmRecheck();
|
||||
@ -470,10 +538,11 @@
|
||||
uni.showLoading({
|
||||
title: '确认复核中...'
|
||||
});
|
||||
const params = { order_id: orderId };
|
||||
console.log('[confirmRecheck] 请求参数:', JSON.stringify(params));
|
||||
try {
|
||||
await this.$http('order.recheckOrder.confirmRecheck', {
|
||||
order_id: orderId
|
||||
});
|
||||
const response = await this.$http('order.recheckOrder.confirmRecheck', params);
|
||||
console.log('[confirmRecheck] 返回数据:', JSON.stringify(response));
|
||||
uni.showToast({
|
||||
title: '已确认复核',
|
||||
icon: 'success'
|
||||
@ -493,6 +562,12 @@
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
handleReprint() {
|
||||
uni.showToast({ title: '面单补打', icon: 'none' });
|
||||
},
|
||||
handleWeigh() {
|
||||
uni.showToast({ title: '称重', icon: 'none' });
|
||||
},
|
||||
getStatusText(status) {
|
||||
const map = {
|
||||
pending: '待拣货',
|
||||
@ -506,6 +581,8 @@
|
||||
id: `${this.detailInfo.recordId || 'record'}-${index + 1}`,
|
||||
lineNo: (index % 4) + 1,
|
||||
planQty: (index % 6) + 2,
|
||||
scannedQty: 0,
|
||||
packageRequirement: '--',
|
||||
skuCode: `SKU${String(index + 1).padStart(4, '0')}`,
|
||||
skuName: `模拟商品${index + 1}`,
|
||||
location: `A-${String(index + 1).padStart(2, '0')}`,
|
||||
@ -577,7 +654,12 @@
|
||||
color: #ffffff;
|
||||
padding: 8rpx 18rpx;
|
||||
border-radius: 6rpx;
|
||||
background: #2979ff;
|
||||
background: #07c160;
|
||||
}
|
||||
|
||||
.nav-right-complete--disabled {
|
||||
background: #c0c4cc;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.page-head {
|
||||
@ -585,10 +667,65 @@
|
||||
padding: 16rpx;
|
||||
background: #fff;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.page-head-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page-head-row--top {
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.page-head-row--bottom {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.page-head-value {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.page-head-picker {
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.page-head-actions {
|
||||
display: flex;
|
||||
gap: 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.page-head-actions {
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.page-head-btn {
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
padding: 6rpx 16rpx;
|
||||
border: none;
|
||||
border-radius: 8rpx;
|
||||
background: #fa8c16;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.page-head-btn--primary {
|
||||
background: #2979ff;
|
||||
}
|
||||
|
||||
.page-head-btn:active {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.page-head-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@ -596,22 +733,6 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page-head-label {
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #909399;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap !important;
|
||||
word-break: keep-all;
|
||||
overflow-wrap: normal;
|
||||
}
|
||||
|
||||
.page-head-label::after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
.page-head-value {
|
||||
margin-left: 8rpx;
|
||||
font-size: 36rpx;
|
||||
@ -673,6 +794,11 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.label--package {
|
||||
width: 170rpx;
|
||||
min-width: 170rpx;
|
||||
}
|
||||
|
||||
.value {
|
||||
flex: 1;
|
||||
color: #303133;
|
||||
@ -816,6 +942,11 @@
|
||||
margin-top: 22rpx;
|
||||
}
|
||||
|
||||
.goods-row--pick-btn {
|
||||
margin-top: 12rpx;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.pick-list-title-btn {
|
||||
margin-top: 0;
|
||||
margin-left: auto;
|
||||
@ -918,6 +1049,15 @@
|
||||
color: #2979ff;
|
||||
}
|
||||
|
||||
.metric-scanned {
|
||||
position: absolute;
|
||||
left: 8rpx;
|
||||
bottom: 4rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 36rpx;
|
||||
color: #19be6b;
|
||||
}
|
||||
|
||||
.switch-row {
|
||||
margin-top: 14rpx;
|
||||
display: flex;
|
||||
@ -946,6 +1086,26 @@
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.bottom-summary {
|
||||
padding: 16rpx 24rpx;
|
||||
padding-bottom: calc(16rpx + env(safe-area-inset-bottom));
|
||||
background: #ffffff;
|
||||
border-top: 1rpx solid #ebeef5;
|
||||
text-align: left;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.bottom-summary-text {
|
||||
font-size: 28rpx;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.bottom-summary-value {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #2979ff;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user