chore(storage): update receiving detail and relocation pages

This commit is contained in:
zm2000 2026-05-04 18:20:37 +08:00
parent 7d81508255
commit 3ad222a2d2
2 changed files with 9 additions and 8 deletions

View File

@ -974,7 +974,7 @@
if(spaceInfo.code==200){ if(spaceInfo.code==200){
if (spaceInfo.total == 1 && this.selectedDetail.space_id!=spaceInfo.data[0].id) { if (spaceInfo.total == 1 && this.selectedDetail.space_id!=spaceInfo.data[0].id) {
const matchedSpace = spaceInfo.data[0] || {}; const matchedSpace = spaceInfo.data[0] || {};
const spaceLabel = matchedSpace.space_code || matchedSpace.custom_name || matchedSpace.custom_barcode || String(data || '').trim(); const spaceLabel = matchedSpace.custom_name || matchedSpace.name || matchedSpace.space_name || matchedSpace.space_code || matchedSpace.custom_barcode || String(data || '').trim();
const updateData = { const updateData = {
...this.selectedDetail, // 保留原有的所有属性 ...this.selectedDetail, // 保留原有的所有属性
space_id: spaceInfo.data[0].id space_id: spaceInfo.data[0].id

View File

@ -122,7 +122,7 @@
</template> </template>
<template v-else> <template v-else>
<text class="popup-item__title">{{ getSpaceName(item) }}</text> <text class="popup-item__title">{{ getSpaceName(item) }}</text>
<text class="popup-item__desc">编码:{{ getSpaceCode(item) }}</text> <text class="popup-item__desc">库位:{{ getSpaceName(item) }}</text>
</template> </template>
</view> </view>
</scroll-view> </scroll-view>
@ -398,14 +398,15 @@
applySpaceSelection(field, item) { applySpaceSelection(field, item) {
const isSource = field === 'sourceSpace'; const isSource = field === 'sourceSpace';
this.formData[isSource ? 'sourceSpaceId' : 'targetSpaceId'] = item?.id || item?.space_id || null; this.formData[isSource ? 'sourceSpaceId' : 'targetSpaceId'] = item?.id || item?.space_id || null;
this.formData[isSource ? 'sourceSpaceName' : 'targetSpaceName'] = this.getSpaceName(item); const spaceName = this.getSpaceName(item);
this.formData[isSource ? 'sourceSpaceKeyword' : 'targetSpaceKeyword'] = this.getSpaceCode(item); this.formData[isSource ? 'sourceSpaceName' : 'targetSpaceName'] = spaceName;
this.formData[isSource ? 'sourceSpaceKeyword' : 'targetSpaceKeyword'] = spaceName;
if (isSource) { if (isSource) {
return; return;
} }
const targetInputText = String(this.formData.targetSpaceKeyword || this.formData.targetSpaceName || '').trim(); const targetNameText = String(this.formData.targetSpaceName || this.formData.targetSpaceKeyword || '').trim();
this.speakMessage(`已识别移入库位,${targetInputText || this.getSpaceName(item)}`); this.speakMessage(`已识别移入库位,${targetNameText || spaceName}`);
}, },
async searchStock(keyword) { async searchStock(keyword) {
const rawKeyword = String(keyword || '').trim(); const rawKeyword = String(keyword || '').trim();
@ -476,7 +477,7 @@
if (prefillData.sourceSpace && typeof prefillData.sourceSpace === 'object') { if (prefillData.sourceSpace && typeof prefillData.sourceSpace === 'object') {
this.formData.sourceSpaceId = prefillData.sourceSpace.id || null; this.formData.sourceSpaceId = prefillData.sourceSpace.id || null;
this.formData.sourceSpaceName = prefillData.sourceSpace.name || ''; this.formData.sourceSpaceName = prefillData.sourceSpace.name || '';
this.formData.sourceSpaceKeyword = prefillData.sourceSpace.code || prefillData.sourceSpace.name || ''; this.formData.sourceSpaceKeyword = prefillData.sourceSpace.name || prefillData.sourceSpace.code || '';
if (this.selectedStock && typeof this.selectedStock === 'object') { if (this.selectedStock && typeof this.selectedStock === 'object') {
if (!this.selectedStock.space_name && prefillData.sourceSpace.name) { if (!this.selectedStock.space_name && prefillData.sourceSpace.name) {
this.selectedStock.space_name = prefillData.sourceSpace.name; this.selectedStock.space_name = prefillData.sourceSpace.name;
@ -501,7 +502,7 @@
this.selectorVisible = false; this.selectorVisible = false;
}, },
getSpaceName(item) { getSpaceName(item) {
return item?.name || item?.space_name || item?.title || item?.barcode || item?.code || '未命名库位'; return item?.custom_name || item?.name || item?.space_name || item?.title || item?.space_code || item?.barcode || item?.code || '未命名库位';
}, },
getSpaceCode(item) { getSpaceCode(item) {
return item?.barcode || item?.code || item?.space_code || item?.name || ''; return item?.barcode || item?.code || item?.space_code || item?.name || '';