Adjust relocation flow and product query UI

This commit is contained in:
zm2000 2026-04-16 18:20:39 +08:00
parent 4bc4120c55
commit a18eb08408
4 changed files with 81 additions and 40 deletions

View File

@ -314,9 +314,19 @@
const menuName = String(item?.name || '').trim();
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
const rawPath = item?.component || item?.path || '';
const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '';
const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation';
if (isRelocation) {
uni.showToast({
title: '该功能只支持在商品查询页面使用!',
icon: 'none',
duration: 2500
});
return;
}
const targetPath = isGoodsQuery
? '/pages/work/product/query'
: (rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '');
: normalizedPath;
if (!targetPath) {
uni.showToast({

View File

@ -1121,9 +1121,19 @@
const menuName = String(item?.name || '').trim();
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
const rawPath = item?.component || item?.path || '';
const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '';
const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation';
if (isRelocation) {
uni.showToast({
title: '该功能只支持在商品查询页面使用!',
icon: 'none',
duration: 2500
});
return;
}
const targetPath = isGoodsQuery
? '/pages/work/product/query'
: (rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '');
: normalizedPath;
if (!targetPath) {
uni.showToast({

View File

@ -58,7 +58,7 @@
<view v-else class="list-wrap">
<view class="goods-item" v-for="(item, index) in list" :key="getGoodsItemKey(item, index)">
<view class="item-summary" :style="{ zIndex: 10 + index }">
<view class="item-summary">
<view class="item-title-row">
<text class="goods-name">{{ item.item_name || item.product_name || item.name || '未命名商品' }}</text>
</view>
@ -162,7 +162,14 @@
>
<text class="storage-col storage-col--space">{{ getStorageSpaceText(storageItem) }}</text>
<text class="storage-col storage-col--qty">{{ getStorageQuantityText(storageItem) }}</text>
<text class="storage-col storage-col--qty storage-col--highlight storage-col--action" @click.stop="openRelocationPage(item, storageItem, 'available')">{{ getStorageAvailableText(storageItem) }}</text>
<text
class="storage-col storage-col--qty"
:class="{
'storage-col--highlight storage-col--action': !(queryMode === 'nonBatch' && isBatchManagedItem(item, storageItem)),
'storage-col--disabled': queryMode === 'nonBatch' && isBatchManagedItem(item, storageItem)
}"
@click.stop="openRelocationPage(item, storageItem, 'available')"
>{{ getStorageAvailableText(storageItem) }}</text>
</view>
</template>
<view v-else class="storage-table__row storage-table__row--empty">
@ -385,11 +392,7 @@
};
},
getLocalStorageHeadWrapStyle(sectionKey, zIndex = 1) {
const meta = (this.storageSectionMetas || []).find(item => item && item.key === sectionKey);
const top = Math.max(
Number((meta && meta.summaryHeight) || 0) + Number((meta && meta.summaryGap) || 0),
0
);
const top = 0;
return {
top: `${top}px`,
'--storage-head-offset': `${top}px`,
@ -1241,6 +1244,13 @@
}
const isNonBatchMode = this.queryMode === 'nonBatch';
if (isNonBatchMode && this.isBatchManagedItem(productItem, storageItem)) {
uni.showToast({
title: '该商品已开启批次管理,请在批次模式下移库!',
icon: 'none'
});
return;
}
const relocationStorageId = this.getRelocationStorageId(storageItem) || this.getRelocationStorageId(productItem);
const relocationProductStockId = this.getRelocationProductStockId(storageItem) || this.getRelocationProductStockId(productItem);
const sourceSpaceId = this.normalizePositiveId(
@ -1284,6 +1294,10 @@
url: `/pages/work/storage/relocation?cacheKey=${cacheKey}`
});
},
isBatchManagedItem(productItem, storageItem) {
const candidates = [productItem, storageItem].filter(item => item && typeof item === 'object');
return candidates.some(item => item.is_batch_mgmt_enabled === true);
},
getExtraImageCount(item) {
const total = this.getImageList(item).length;
return total > 4 ? total - 4 : 0;
@ -1583,8 +1597,7 @@
}
.item-summary {
position: sticky;
top: 0;
position: relative;
background: #fff;
padding-bottom: 10rpx;
margin-bottom: 4rpx;
@ -1719,7 +1732,7 @@
}
.storage-head-fixed {
position: sticky;
position: relative;
left: 0;
overflow: visible;
margin-bottom: 0;
@ -1728,19 +1741,11 @@
border-radius: 10rpx 10rpx 0 0;
background: #edf4ff;
box-sizing: border-box;
z-index: 20;
z-index: 1;
isolation: isolate;
&::before {
content: '';
position: absolute;
left: -2rpx;
right: -2rpx;
top: calc(var(--storage-head-offset, 0px) * -1);
height: calc(var(--storage-head-offset, 0px) + 2rpx);
background: #fff;
pointer-events: none;
z-index: 19;
display: none;
}
}
@ -1797,7 +1802,7 @@
}
.storage-table--batch .storage-col--space {
flex: 0.68;
flex: 0.95;
}
.storage-table__row {
@ -1814,7 +1819,7 @@
}
.storage-table--batch .storage-table__row {
grid-template-columns: minmax(0, 0.62fr) minmax(0, 0.68fr) minmax(0, 0.46fr) minmax(0, 0.46fr);
grid-template-columns: minmax(0, 0.65fr) minmax(0, 0.85fr) minmax(0, 0.4fr) minmax(0, 0.4fr);
}
.storage-table__row:last-child {
@ -1892,6 +1897,12 @@
}
}
.storage-col--disabled {
color: #606266;
font-weight: 400;
text-decoration: none;
}
.storage-table--batch .storage-col--qty {
padding-left: 1rpx;
padding-right: 1rpx;
@ -1952,7 +1963,7 @@
.end-tip {
padding: 8rpx 0 20rpx;
text-align: center;
font-size: 22rpx;
font-size: 28rpx;
color: #c0c4cc;
}
</style>

View File

@ -48,12 +48,13 @@
</view>
</u-form-item>
<u-form-item class="move-quantity-item" label="移库数量" required>
<u-form-item class="move-quantity-item" label="移库数量" required label-width="200rpx">
<view class="quantity-input-wrap">
<u-input
class="move-quantity-input"
v-model="formData.moveQuantity"
type="number"
fontSize="36rpx"
fontSize="42rpx"
placeholder="请输入移库数量"
@input="handleMoveQuantityInput"
@blur="handleMoveQuantityBlur"
@ -94,7 +95,7 @@
</view>
</view>
<u-form-item label="备注">
<u-form-item class="remark-item" label="备注" label-width="110rpx">
<u-input v-model="formData.remark" type="textarea" placeholder="请输入备注信息" height="120"></u-input>
</u-form-item>
</view>
@ -236,7 +237,11 @@
return;
}
this.applyScanResult(rawCode, this.activeScanField || 'productKeyword');
const field = this.resolveBroadcastField();
this.applyScanResult(rawCode, field);
},
resolveBroadcastField() {
return 'targetSpace';
},
handleFieldScan(field) {
this.setActiveScanField(field);
@ -842,17 +847,19 @@
.move-quantity-item {
::v-deep .u-form-item__body__left__content__label,
::v-deep .u-form-item__body__left__content__label-text {
font-size: 36rpx !important;
font-weight: 600;
font-size: 40rpx !important;
font-weight: 700;
}
::v-deep .u-input__content__field-wrapper__field {
font-size: 36rpx !important;
font-weight: 600;
::v-deep .move-quantity-input .u-input__content__field-wrapper__field,
::v-deep .move-quantity-input .u-input__content__field-wrapper__field input,
::v-deep .move-quantity-input input {
font-size: 42rpx !important;
font-weight: 700 !important;
}
::v-deep .u-input__content {
min-height: 76rpx;
min-height: 72rpx;
}
}
@ -868,7 +875,7 @@
box-shadow: 0 4rpx 12rpx rgba(41, 121, 255, 0.18);
text {
font-size: 22rpx;
font-size: 28rpx;
font-weight: 500;
color: #ffffff;
line-height: 1;
@ -917,7 +924,7 @@
}
&__title {
font-size: 30rpx;
font-size: 34rpx;
font-weight: 600;
color: #303133;
flex: 1;
@ -929,14 +936,17 @@
margin-top: 10rpx;
.label {
width: 140rpx;
font-size: 26rpx;
width: auto;
font-size: 30rpx;
color: #606266;
white-space: nowrap;
margin-right: 8rpx;
flex-shrink: 0;
}
.value {
flex: 1;
font-size: 26rpx;
font-size: 30rpx;
color: #303133;
word-break: break-all;
}