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 menuName = String(item?.name || '').trim();
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询')); const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
const rawPath = item?.component || item?.path || ''; 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 const targetPath = isGoodsQuery
? '/pages/work/product/query' ? '/pages/work/product/query'
: (rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : ''); : normalizedPath;
if (!targetPath) { if (!targetPath) {
uni.showToast({ uni.showToast({

View File

@ -1121,9 +1121,19 @@
const menuName = String(item?.name || '').trim(); const menuName = String(item?.name || '').trim();
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询')); const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
const rawPath = item?.component || item?.path || ''; 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 const targetPath = isGoodsQuery
? '/pages/work/product/query' ? '/pages/work/product/query'
: (rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : ''); : normalizedPath;
if (!targetPath) { if (!targetPath) {
uni.showToast({ uni.showToast({

View File

@ -58,7 +58,7 @@
<view v-else class="list-wrap"> <view v-else class="list-wrap">
<view class="goods-item" v-for="(item, index) in list" :key="getGoodsItemKey(item, index)"> <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"> <view class="item-title-row">
<text class="goods-name">{{ item.item_name || item.product_name || item.name || '未命名商品' }}</text> <text class="goods-name">{{ item.item_name || item.product_name || item.name || '未命名商品' }}</text>
</view> </view>
@ -162,7 +162,14 @@
> >
<text class="storage-col storage-col--space">{{ getStorageSpaceText(storageItem) }}</text> <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">{{ 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> </view>
</template> </template>
<view v-else class="storage-table__row storage-table__row--empty"> <view v-else class="storage-table__row storage-table__row--empty">
@ -385,11 +392,7 @@
}; };
}, },
getLocalStorageHeadWrapStyle(sectionKey, zIndex = 1) { getLocalStorageHeadWrapStyle(sectionKey, zIndex = 1) {
const meta = (this.storageSectionMetas || []).find(item => item && item.key === sectionKey); const top = 0;
const top = Math.max(
Number((meta && meta.summaryHeight) || 0) + Number((meta && meta.summaryGap) || 0),
0
);
return { return {
top: `${top}px`, top: `${top}px`,
'--storage-head-offset': `${top}px`, '--storage-head-offset': `${top}px`,
@ -1241,6 +1244,13 @@
} }
const isNonBatchMode = this.queryMode === 'nonBatch'; 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 relocationStorageId = this.getRelocationStorageId(storageItem) || this.getRelocationStorageId(productItem);
const relocationProductStockId = this.getRelocationProductStockId(storageItem) || this.getRelocationProductStockId(productItem); const relocationProductStockId = this.getRelocationProductStockId(storageItem) || this.getRelocationProductStockId(productItem);
const sourceSpaceId = this.normalizePositiveId( const sourceSpaceId = this.normalizePositiveId(
@ -1284,6 +1294,10 @@
url: `/pages/work/storage/relocation?cacheKey=${cacheKey}` 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) { getExtraImageCount(item) {
const total = this.getImageList(item).length; const total = this.getImageList(item).length;
return total > 4 ? total - 4 : 0; return total > 4 ? total - 4 : 0;
@ -1583,8 +1597,7 @@
} }
.item-summary { .item-summary {
position: sticky; position: relative;
top: 0;
background: #fff; background: #fff;
padding-bottom: 10rpx; padding-bottom: 10rpx;
margin-bottom: 4rpx; margin-bottom: 4rpx;
@ -1719,7 +1732,7 @@
} }
.storage-head-fixed { .storage-head-fixed {
position: sticky; position: relative;
left: 0; left: 0;
overflow: visible; overflow: visible;
margin-bottom: 0; margin-bottom: 0;
@ -1728,19 +1741,11 @@
border-radius: 10rpx 10rpx 0 0; border-radius: 10rpx 10rpx 0 0;
background: #edf4ff; background: #edf4ff;
box-sizing: border-box; box-sizing: border-box;
z-index: 20; z-index: 1;
isolation: isolate; isolation: isolate;
&::before { &::before {
content: ''; display: none;
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;
} }
} }
@ -1797,7 +1802,7 @@
} }
.storage-table--batch .storage-col--space { .storage-table--batch .storage-col--space {
flex: 0.68; flex: 0.95;
} }
.storage-table__row { .storage-table__row {
@ -1814,7 +1819,7 @@
} }
.storage-table--batch .storage-table__row { .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 { .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 { .storage-table--batch .storage-col--qty {
padding-left: 1rpx; padding-left: 1rpx;
padding-right: 1rpx; padding-right: 1rpx;
@ -1952,7 +1963,7 @@
.end-tip { .end-tip {
padding: 8rpx 0 20rpx; padding: 8rpx 0 20rpx;
text-align: center; text-align: center;
font-size: 22rpx; font-size: 28rpx;
color: #c0c4cc; color: #c0c4cc;
} }
</style> </style>

View File

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