chore(storage): update receiving detail and relocation pages
This commit is contained in:
parent
7d81508255
commit
3ad222a2d2
@ -974,7 +974,7 @@
|
||||
if(spaceInfo.code==200){
|
||||
if (spaceInfo.total == 1 && this.selectedDetail.space_id!=spaceInfo.data[0].id) {
|
||||
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 = {
|
||||
...this.selectedDetail, // 保留原有的所有属性
|
||||
space_id: spaceInfo.data[0].id
|
||||
|
||||
@ -122,7 +122,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -398,14 +398,15 @@
|
||||
applySpaceSelection(field, item) {
|
||||
const isSource = field === 'sourceSpace';
|
||||
this.formData[isSource ? 'sourceSpaceId' : 'targetSpaceId'] = item?.id || item?.space_id || null;
|
||||
this.formData[isSource ? 'sourceSpaceName' : 'targetSpaceName'] = this.getSpaceName(item);
|
||||
this.formData[isSource ? 'sourceSpaceKeyword' : 'targetSpaceKeyword'] = this.getSpaceCode(item);
|
||||
const spaceName = this.getSpaceName(item);
|
||||
this.formData[isSource ? 'sourceSpaceName' : 'targetSpaceName'] = spaceName;
|
||||
this.formData[isSource ? 'sourceSpaceKeyword' : 'targetSpaceKeyword'] = spaceName;
|
||||
if (isSource) {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetInputText = String(this.formData.targetSpaceKeyword || this.formData.targetSpaceName || '').trim();
|
||||
this.speakMessage(`已识别移入库位,${targetInputText || this.getSpaceName(item)}`);
|
||||
const targetNameText = String(this.formData.targetSpaceName || this.formData.targetSpaceKeyword || '').trim();
|
||||
this.speakMessage(`已识别移入库位,${targetNameText || spaceName}`);
|
||||
},
|
||||
async searchStock(keyword) {
|
||||
const rawKeyword = String(keyword || '').trim();
|
||||
@ -476,7 +477,7 @@
|
||||
if (prefillData.sourceSpace && typeof prefillData.sourceSpace === 'object') {
|
||||
this.formData.sourceSpaceId = prefillData.sourceSpace.id || null;
|
||||
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.space_name && prefillData.sourceSpace.name) {
|
||||
this.selectedStock.space_name = prefillData.sourceSpace.name;
|
||||
@ -501,7 +502,7 @@
|
||||
this.selectorVisible = false;
|
||||
},
|
||||
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) {
|
||||
return item?.barcode || item?.code || item?.space_code || item?.name || '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user