修改库位显示为库位名称

This commit is contained in:
zm2000 2026-06-09 16:33:43 +08:00
parent 31eb640fc3
commit 66ee3043f5
5 changed files with 171 additions and 59 deletions

View File

@ -317,6 +317,12 @@ export default {
} }
}, },
recheckOrder: { recheckOrder: {
recheckOrderList: {
path: "order.recheckOrder.recheckOrderList",
auth: true,
method: "POST",
isSystemApi: true
},
scanOrder: { scanOrder: {
path: "order.recheckOrder.scanOrder", path: "order.recheckOrder.scanOrder",
auth: true, auth: true,

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="order-picking-page"> <view class="order-picking-page">
<view class="normar_container"> <view class="normar_container">
<page-nav :title="title"> <page-nav :title="title" @click.native="handleTitleClick">
<template #right> <template #right>
<view class="nav-right" :class="{ 'nav-right--disabled': !hasActiveTask }"> <view class="nav-right" :class="{ 'nav-right--disabled': !hasActiveTask }">
<view class="nav-action-btn nav-action-btn--bind" @click="openBindCartPopup"> <view class="nav-action-btn nav-action-btn--bind" @click="openBindCartPopup">
@ -111,6 +111,20 @@
</template> </template>
</view> </view>
</view> </view>
<!-- ====== 调试输入框 - 长按标题5次切换 ====== -->
<view v-if="showDebugInput" class="debug-input-bar" @touchstart.stop>
<text class="debug-input-label">调试扫描</text>
<input
class="debug-input-field"
v-model="debugInput"
:focus="debugInputFocus"
placeholder="输入模拟扫描内容"
@confirm="handleDebugSubmit"
@blur="handleDebugSubmit"
/>
<text class="debug-input-btn" @click="handleDebugSubmit">发送</text>
<text class="debug-input-close" @click="showDebugInput = false">✕</text>
</view>
<u-action-sheet :actions="pickActionList" :show="showActionSheet" @select="handleAction" @close="showActionSheet = false"></u-action-sheet> <u-action-sheet :actions="pickActionList" :show="showActionSheet" @select="handleAction" @close="showActionSheet = false"></u-action-sheet>
<u-popup :show="bindCartPopupVisible" mode="bottom" :closeable="true" border-radius="20" @close="closeBindCartPopup"> <u-popup :show="bindCartPopupVisible" mode="bottom" :closeable="true" border-radius="20" @close="closeBindCartPopup">
<view class="bind-cart-popup"> <view class="bind-cart-popup">
@ -156,6 +170,9 @@
title: '订单拣货', title: '订单拣货',
taskId: '', taskId: '',
keyword: '', keyword: '',
debugInput: '',
showDebugInput: false,
debugInputFocus: false,
selectedIndex: 0, selectedIndex: 0,
loadingTaskDetail: false, loadingTaskDetail: false,
selectedItemImageLoading: false, selectedItemImageLoading: false,
@ -962,6 +979,26 @@
} }
this.handleSearch(); this.handleSearch();
}, },
// ====== 调试功能 ======
handleTitleClick() {
this._titleClickCount = (this._titleClickCount || 0) + 1;
if (this._titleClickCount >= 5) {
this._titleClickCount = 0;
this.showDebugInput = !this.showDebugInput;
if (this.showDebugInput) {
this.$nextTick(() => {
this.debugInputFocus = true;
});
}
}
},
handleDebugSubmit() {
if (!this.debugInput) return;
const payload = { data: this.debugInput };
this.handleBroadcastScan(payload);
this.debugInput = '';
this.debugInputFocus = true;
},
handleBroadcastScan(payload) { handleBroadcastScan(payload) {
const scanText = this.normalizeScanResult(payload); const scanText = this.normalizeScanResult(payload);
if (this.bindCartPopupVisible) { if (this.bindCartPopupVisible) {
@ -2176,4 +2213,48 @@
.safe-bottom { .safe-bottom {
height: calc(20rpx + env(safe-area-inset-bottom)); height: calc(20rpx + env(safe-area-inset-bottom));
} }
/* ====== 调试输入框 ====== */
.debug-input-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 9999;
display: flex;
align-items: center;
gap: 12rpx;
padding: 12rpx 20rpx;
padding-bottom: calc(12rpx + env(safe-area-inset-bottom));
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(10px);
}
.debug-input-label {
color: #ff6b6b;
font-size: 24rpx;
font-weight: 600;
white-space: nowrap;
}
.debug-input-field {
flex: 1;
height: 60rpx;
background: #ffffff;
border-radius: 8rpx;
padding: 0 16rpx;
font-size: 26rpx;
color: #303133;
}
.debug-input-btn {
padding: 8rpx 20rpx;
background: #2979ff;
color: #ffffff;
border-radius: 8rpx;
font-size: 24rpx;
font-weight: 600;
}
.debug-input-close {
padding: 8rpx 12rpx;
color: #ffffff;
font-size: 28rpx;
}
</style> </style>

View File

@ -3,7 +3,7 @@
<view class="normar_container"> <view class="normar_container">
<page-nav :title="title"> <page-nav :title="title">
<template #right> <template #right>
<view class="nav-right-action" :class="{ 'nav-right-action--active': showUnboundPrintStationOnly }" @click="toggleUnboundPrintStationOnly">未绑定打印台</view> <view class="nav-right-action" :class="{ 'nav-right-action--active': showUnboundPrintStationOnly, 'nav-right-action--bound': !!printStationId }" @click="toggleUnboundPrintStationOnly">{{ printStationId ? '已绑定打印台' : '未绑定打印台' }}</view>
</template> </template>
</page-nav> </page-nav>
@ -12,7 +12,7 @@
<view class="search-box-inner"> <view class="search-box-inner">
<u-search <u-search
v-model="keyword" v-model="keyword"
placeholder="请输入快递单号/商品条码/车号/数量/打印台" placeholder="请输入快递单号/波次号"
:bg-color="'#f5f5f5'" :bg-color="'#f5f5f5'"
shape="round" shape="round"
:show-action="false" :show-action="false"
@ -95,21 +95,6 @@
<view class="safe-area-bottom"></view> <view class="safe-area-bottom"></view>
</scroll-view> </scroll-view>
<view class="pagination-wrap">
<pagination
:pageNum.sync="currentPage"
:pageSize="pageSize"
:total="paginationTotal"
:showTotal="true"
:prevText="'上一页'"
:nextText="'下一页'"
:showFirstLast="true"
:firstText="'首页'"
:lastText="'末页'"
@change="handlePageChange"
/>
</view>
</view> </view>
<u-popup v-if="showPrintPopup" :show="showPrintPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showPrintPopup = false"> <u-popup v-if="showPrintPopup" :show="showPrintPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showPrintPopup = false">
@ -151,7 +136,7 @@
</view> </view>
</u-popup> </u-popup>
<u-popup :show="showStationListPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showStationListPopup = false"> <u-popup :show="showStationListPopup" mode="bottom" :closeable="true" border-radius="20" :z-index="10090" @close="showStationListPopup = false; selectedStationId = ''">
<view class="print-popup"> <view class="print-popup">
<view class="print-popup-title">打印台列表</view> <view class="print-popup-title">打印台列表</view>
<scroll-view class="station-list-scroll" scroll-y> <scroll-view class="station-list-scroll" scroll-y>
@ -160,9 +145,15 @@
v-for="station in printStationList" v-for="station in printStationList"
:key="station.id" :key="station.id"
class="station-list-item" class="station-list-item"
:class="{ 'station-list-item--selected': selectedStationId === station.id }"
@click="handleStationListItemClick(station)" @click="handleStationListItemClick(station)"
> >
<text class="station-list-item__name">{{ station.name }}</text> <view class="station-list-item__left">
<text class="station-list-item__name" :class="{ 'station-list-item__name--active': selectedStationId === station.id }">{{ station.name }}</text>
</view>
<view v-if="selectedStationId === station.id" class="station-list-item__check">
<u-icon name="checkmark" size="36rpx" color="#2979ff"></u-icon>
</view>
</view> </view>
<view class="safe-bottom-in-popup"></view> <view class="safe-bottom-in-popup"></view>
</scroll-view> </scroll-view>
@ -180,6 +171,16 @@
@change="handleStationListPageChange" @change="handleStationListPageChange"
/> />
</view> </view>
<view class="station-list-confirm">
<u-button
type="primary"
:disabled="!selectedStationId"
:customStyle="{ backgroundColor: selectedStationId ? '#2979ff' : '#a0c4ff', borderColor: selectedStationId ? '#2979ff' : '#a0c4ff', fontSize: '30rpx', height: '80rpx', lineHeight: '80rpx', borderRadius: '12rpx', marginTop: '20rpx' }"
@click="handleStationListConfirm"
>
确定
</u-button>
</view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
@ -203,6 +204,7 @@
printStationName: '--', printStationName: '--',
printStationId: '', printStationId: '',
printStationList: [], printStationList: [],
selectedStationId: '',
stationListPage: 1, stationListPage: 1,
stationListPageSize: 20, stationListPageSize: 20,
stationListTotal: 0, stationListTotal: 0,
@ -238,7 +240,6 @@
? Math.max(0, parsedGrabCount) ? Math.max(0, parsedGrabCount)
: 5; : 5;
this.initializeOrderList(); this.initializeOrderList();
this.goodsInfoList = this.buildMockGoodsInfoList();
}, },
onShow() { onShow() {
this.safeDispatchBroadcast('setCallbacks', { this.safeDispatchBroadcast('setCallbacks', {
@ -338,34 +339,6 @@
}) })
.filter(item => !!item.basketNo || !!item.skuName); .filter(item => !!item.basketNo || !!item.skuName);
}, },
buildMockGoodsInfoList() {
return [
{
id: 'mock-1',
basketNo: 'B001',
planQty: 12,
scannedQty: 3,
imageUrl: '',
skuName: '示例商品A'
},
{
id: 'mock-2',
basketNo: 'B002',
planQty: 6,
scannedQty: 6,
imageUrl: '',
skuName: '示例商品B'
},
{
id: 'mock-3',
basketNo: 'B003',
planQty: 20,
scannedQty: 15,
imageUrl: '',
skuName: '示例商品C'
}
];
},
normalizeBatchWaveList(list) { normalizeBatchWaveList(list) {
if (!Array.isArray(list)) { if (!Array.isArray(list)) {
return []; return [];
@ -546,7 +519,7 @@
}) })
.filter(item => !!item.id && !!item.name); .filter(item => !!item.id && !!item.name);
}, },
async loadPrintStations(page = 1) { async loadPrintStations(page = 1, autoAssign = true) {
const response = await this.$http('print.getList', this.buildPrintRecordParams(page)); const response = await this.$http('print.getList', this.buildPrintRecordParams(page));
const list = this.extractPrintRecordList(response); const list = this.extractPrintRecordList(response);
const total = this.extractPrintRecordTotal(response); const total = this.extractPrintRecordTotal(response);
@ -554,7 +527,7 @@
this.printStationList = stations; this.printStationList = stations;
this.stationListTotal = total; this.stationListTotal = total;
this.stationListPage = Math.max(1, Number(page || 1)); this.stationListPage = Math.max(1, Number(page || 1));
if (stations.length && !this.printStationId) { if (autoAssign && stations.length && !this.printStationId) {
this.printStationId = stations[0]?.id || ''; this.printStationId = stations[0]?.id || '';
this.printStationName = stations[0]?.name || '--'; this.printStationName = stations[0]?.name || '--';
} }
@ -817,16 +790,15 @@
}, },
async toggleUnboundPrintStationOnly() { async toggleUnboundPrintStationOnly() {
this.showUnboundPrintStationOnly = true; this.showUnboundPrintStationOnly = true;
this.selectedStationId = this.printStationId || '';
this.stationListPage = 1; this.stationListPage = 1;
this.stationListTotal = 0; this.stationListTotal = 0;
this.printStationList = []; this.printStationList = [];
this.printStationId = '';
this.printStationName = '--';
uni.showLoading({ uni.showLoading({
title: '加载打印台...' title: '加载打印台...'
}); });
try { try {
await this.loadPrintStations(1); await this.loadPrintStations(1, false);
this.showStationListPopup = true; this.showStationListPopup = true;
} catch (error) { } catch (error) {
uni.showToast({ uni.showToast({
@ -843,13 +815,18 @@
return; return;
} }
this.stationListPage = targetPage; this.stationListPage = targetPage;
this.loadPrintStations(targetPage); this.loadPrintStations(targetPage, false);
}, },
handleStationListItemClick(station) { handleStationListConfirm() {
if (!station || !station.id) { if (!this.selectedStationId) {
return;
}
const station = this.printStationList.find(s => s.id === this.selectedStationId);
if (!station) {
return; return;
} }
this.showStationListPopup = false; this.showStationListPopup = false;
this.selectedStationId = '';
setTimeout(() => { setTimeout(() => {
this.printStationId = String(station.id); this.printStationId = String(station.id);
this.printStationName = String(station.name || '--'); this.printStationName = String(station.name || '--');
@ -859,6 +836,16 @@
}); });
}, 300); }, 300);
}, },
handleStationListItemClick(station) {
if (!station || !station.id) {
return;
}
if (this.selectedStationId === station.id) {
this.selectedStationId = '';
} else {
this.selectedStationId = station.id;
}
},
getStatusText(status) { getStatusText(status) {
const map = { const map = {
pending: '待拣货', pending: '待拣货',
@ -1030,6 +1017,11 @@
background: #1f67e6; background: #1f67e6;
} }
.nav-right-action--bound {
color: #ffffff;
background: #07c160;
}
.detail-scroll { .detail-scroll {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
@ -1437,21 +1429,50 @@
border-bottom: 1rpx solid #f2f3f5; border-bottom: 1rpx solid #f2f3f5;
} }
.station-list-item--selected {
background: #f0f7ff;
}
.station-list-item:active { .station-list-item:active {
background: #f5f6fa; background: #f5f6fa;
} }
.station-list-item--selected:active {
background: #e0f0ff;
}
.station-list-item__left {
flex: 1;
min-width: 0;
}
.station-list-item__name { .station-list-item__name {
font-size: 30rpx; font-size: 30rpx;
color: #303133; color: #303133;
font-weight: 500; font-weight: 500;
} }
.station-list-item__name--active {
color: #2979ff;
font-weight: 600;
}
.station-list-item__check {
flex-shrink: 0;
margin-left: 16rpx;
display: flex;
align-items: center;
}
.station-list-item__id { .station-list-item__id {
font-size: 26rpx; font-size: 26rpx;
color: #909399; color: #909399;
} }
.station-list-confirm {
padding: 16rpx 10rpx calc(10rpx + env(safe-area-inset-bottom));
}
.safe-bottom-in-popup { .safe-bottom-in-popup {
height: calc(10rpx + env(safe-area-inset-bottom)); height: calc(10rpx + env(safe-area-inset-bottom));
} }

View File

@ -1242,7 +1242,9 @@
return '--'; return '--';
} }
return item.space_code return item.custom_name
|| item.space?.custom_name
|| item.space_code
|| item.space?.code || item.space?.code
|| item.space?.space_code || item.space?.space_code
|| item.space?.name || item.space?.name

View File

@ -565,7 +565,9 @@
return isBatchMode && batchText && batchText !== '--'; return isBatchMode && batchText && batchText !== '--';
}, },
getStockSpace(item) { getStockSpace(item) {
return item?.space?.name return item?.custom_name
|| item?.space?.custom_name
|| item?.space?.name
|| item?.space_name || item?.space_name
|| item?.space?.space_name || item?.space?.space_name
|| item?.space_code || item?.space_code