feat: 领料/拣货/库位/收货/移库页面优化

- 面单波次领料(shippingLabel):手动输入按钮文案改为「输入框」,统一放大各标签、按钮字号(空态 38rpx,其余 36rpx)
- 订单拣货(picking):「拣货车」按钮移至「···」左侧并放大字号(36rpx)、增大间距;「订单未领料 / 领料人不是本人」提示由系统弹窗改为自定义弹窗;加粗样式 600/700 统一为 bold
- 库位查询(locationInquiry):商品条码超过 3 个默认收起,支持展开/收起
- 收货明细(receivingDetail):已完成状态时禁用「完成收货」操作
- 收货单列表(receivingList):单据、状态、明细等字号整体放大
- 移库(relocation):商品条码超过 3 个默认收起支持展开;输入框/按钮字号统一 36rpx、相机图标放大
This commit is contained in:
zm2000 2026-11-24 18:18:58 +08:00
parent 35113f7fe0
commit 0d4de97dfe
6 changed files with 376 additions and 86 deletions

View File

@ -8,7 +8,7 @@
:class="{ 'nav-manual-input--inactive': !showScanInput }" :class="{ 'nav-manual-input--inactive': !showScanInput }"
@click="toggleScanInput" @click="toggleScanInput"
> >
<text class="nav-manual-input-text">{{ showScanInput ? '关闭手动输入' : '手动输入' }}</text> <text class="nav-manual-input-text">输入框</text>
</view> </view>
</template> </template>
</page-nav> </page-nav>
@ -294,7 +294,7 @@
.placeholder-text { .placeholder-text {
margin-top: 24rpx; margin-top: 24rpx;
font-size: 28rpx; font-size: 38rpx;
color: #909399; color: #909399;
} }
@ -309,7 +309,7 @@
border-radius: 12rpx; border-radius: 12rpx;
.unclaimed-wave-count-label { .unclaimed-wave-count-label {
font-size: 32rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #D46B08; color: #D46B08;
} }
@ -339,7 +339,7 @@
background-color: #D9F7BE; background-color: #D9F7BE;
.claim-info-header-text { .claim-info-header-text {
font-size: 32rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #389E0D; color: #389E0D;
} }
@ -392,7 +392,7 @@
} }
.nav-manual-input-text { .nav-manual-input-text {
font-size: 28rpx; font-size: 36rpx;
color: #ffffff; color: #ffffff;
white-space: nowrap; white-space: nowrap;
} }
@ -419,7 +419,7 @@
align-items: baseline; align-items: baseline;
.claim-footer-total-label { .claim-footer-total-label {
font-size: 28rpx; font-size: 36rpx;
color: #606266; color: #606266;
margin-right: 8rpx; margin-right: 8rpx;
} }
@ -437,7 +437,7 @@
border-radius: 8rpx; border-radius: 8rpx;
.claim-footer-btn-text { .claim-footer-btn-text {
font-size: 30rpx; font-size: 36rpx;
color: #ffffff; color: #ffffff;
white-space: nowrap; white-space: nowrap;
} }

View File

@ -66,9 +66,16 @@
<text class="line__label">货主</text> <text class="line__label">货主</text>
<text class="line__value">{{ goodsStoreName(goods) }}</text> <text class="line__value">{{ goodsStoreName(goods) }}</text>
</view> </view>
<view class="line line--compact"> <view class="line line--compact line--barcode">
<text class="line__label">商品</text> <text class="line__label">商品</text>
<text class="line__value">{{ goodsName(goods) }}、{{ goodsBarcode(goods) }}</text> <view class="line__value line__value--barcode">
<text class="line__barcode-text">{{ goodsName(goods) }}、{{ goodsBarcodeDisplayText(goods) }}</text>
<text
v-if="hasMoreGoodsBarcodes(goods)"
class="line__barcode-toggle"
@click.stop="toggleGoodsBarcodeExpand(goods)"
>{{ isGoodsBarcodeExpanded(goods) ? '收起' : '展开' }}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -178,7 +185,9 @@ export default {
goodsList: [], goodsList: [],
// 筛选(仅支持:可移库存 > 0 / 库存 > 0) // 筛选(仅支持:可移库存 > 0 / 库存 > 0)
filterVisible: false, filterVisible: false,
filterType: '' filterType: '',
// 条码展开状态(按商品 id 记录),条码超过 3 个时默认收起
barcodeExpandMap: {}
} }
}, },
computed: { computed: {
@ -345,17 +354,58 @@ export default {
const text = String(name ?? '').trim(); const text = String(name ?? '').trim();
return text || (goods?.stock_id ? `商品#${goods.stock_id}` : '--'); return text || (goods?.stock_id ? `商品#${goods.stock_id}` : '--');
}, },
goodsBarcode(goods) { // 归一化商品条码为字符串数组([{barcode, code}] 或字符串)
getGoodsBarcodeList(goods) {
const stock = goods?.stock; const stock = goods?.stock;
const codes = stock?.barcodes; const codes = stock?.barcodes;
if (Array.isArray(codes) && codes.length) { if (Array.isArray(codes)) {
const list = codes.map(c => { return codes.map(c => {
if (typeof c === 'string') return c.trim(); if (typeof c === 'string') return c.trim();
if (c && typeof c === 'object') return String(c.barcode ?? c.code ?? '').trim(); if (c && typeof c === 'object') return String(c.barcode ?? c.code ?? '').trim();
return ''; return '';
}).filter(Boolean); }).filter(Boolean);
if (list.length) return list.join('、');
} }
const fallback = stock?.barcode ?? stock?.code;
if (typeof fallback === 'string' && fallback.trim()) {
return [fallback.trim()];
}
if (Array.isArray(fallback)) {
return fallback.map(c => {
if (typeof c === 'string') return c.trim();
if (c && typeof c === 'object') return String(c.barcode ?? c.code ?? '').trim();
return '';
}).filter(Boolean);
}
return [];
},
getGoodsBarcodeCount(goods) {
return this.getGoodsBarcodeList(goods).length;
},
hasMoreGoodsBarcodes(goods) {
return this.getGoodsBarcodeCount(goods) > 3;
},
getGoodsBarcodeExpandKey(goods) {
if (!goods || typeof goods !== 'object') return 'unknown';
return String(goods.stock_id ?? goods.stock?.id ?? goods.id ?? goods.item_id ?? 'unknown');
},
isGoodsBarcodeExpanded(goods) {
return !!this.barcodeExpandMap[this.getGoodsBarcodeExpandKey(goods)];
},
toggleGoodsBarcodeExpand(goods) {
const key = this.getGoodsBarcodeExpandKey(goods);
this.$set(this.barcodeExpandMap, key, !this.barcodeExpandMap[key]);
},
getGoodsBarcodeDisplayList(goods) {
const list = this.getGoodsBarcodeList(goods);
if (list.length > 3 && !this.isGoodsBarcodeExpanded(goods)) {
return list.slice(0, 3);
}
return list;
},
goodsBarcodeDisplayText(goods) {
const list = this.getGoodsBarcodeDisplayList(goods);
if (list.length) return list.join('、');
const stock = goods?.stock;
return String(stock?.item_code ?? '').trim() || '--'; return String(stock?.item_code ?? '').trim() || '--';
}, },
goodsStoreName(goods) { goodsStoreName(goods) {
@ -951,6 +1001,37 @@ export default {
font-size: 40rpx; font-size: 40rpx;
} }
.line--barcode {
align-items: flex-start;
}
.line__value--barcode {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
}
.line__barcode-text {
flex: 1;
min-width: 0;
font-size: 40rpx;
color: #303133;
word-break: break-all;
overflow-wrap: break-word;
}
.line__barcode-toggle {
flex-shrink: 0;
margin-left: 12rpx;
font-size: 36rpx;
color: #2979ff;
line-height: 1.4;
&:active {
opacity: 0.7;
}
}
.line--count { .line--count {
background: transparent; background: transparent;
padding: 0; padding: 0;

View File

@ -2,12 +2,10 @@
<view class="order-picking-page"> <view class="order-picking-page">
<view class="normar_container"> <view class="normar_container">
<page-nav :title="title" @click.native="handleTitleClick"> <page-nav :title="title" @click.native="handleTitleClick">
<template #left> <template #right>
<view class="nav-action-btn nav-action-btn--bind" @click="openBindCartPopup"> <view class="nav-action-btn nav-action-btn--bind" @click="openBindCartPopup">
<text class="nav-action-btn__text">拣货车</text> <text class="nav-action-btn__text">拣货车</text>
</view> </view>
</template>
<template #right>
<view class="nav-right" :class="{ 'nav-right--disabled': !hasActiveTask }"> <view class="nav-right" :class="{ 'nav-right--disabled': !hasActiveTask }">
<u-icon name="more-dot-fill" size="22" @click="openActionsPopup"></u-icon> <u-icon name="more-dot-fill" size="22" @click="openActionsPopup"></u-icon>
</view> </view>
@ -245,6 +243,20 @@
</view> </view>
</u-popup> </u-popup>
<!-- 未领料提示弹窗(订单未领料 / 领料人不是本人) -->
<u-popup :show="showClaimPromptPopup" mode="center" :closeable="true" :closeOnClickOverlay="false" round="20" @close="showClaimPromptPopup = false">
<view class="claim-prompt-popup">
<view class="claim-prompt-popup__title">提示</view>
<view class="claim-prompt-popup__body">
<text class="claim-prompt-popup__text">{{ claimPromptMessage }}</text>
</view>
<view class="claim-prompt-popup__actions">
<view class="claim-prompt-popup__btn claim-prompt-popup__btn--cancel" @click="showClaimPromptPopup = false">取消</view>
<view class="claim-prompt-popup__btn claim-prompt-popup__btn--confirm" @click="confirmGoToClaim">去领料</view>
</view>
</view>
</u-popup>
<!-- 操作弹窗 --> <!-- 操作弹窗 -->
<u-popup :show="showActionsPopup" mode="bottom" :closeable="true" border-radius="20" @close="showActionsPopup = false"> <u-popup :show="showActionsPopup" mode="bottom" :closeable="true" border-radius="20" @close="showActionsPopup = false">
<view class="actions-popup"> <view class="actions-popup">
@ -358,6 +370,8 @@ import voice from '@/core/utils/voice';
keyboardHeight: 0, keyboardHeight: 0,
showActionsPopup: false, showActionsPopup: false,
showCancelPickConfirm: false, showCancelPickConfirm: false,
showClaimPromptPopup: false,
claimPromptMessage: '',
showNoBarcodePopup: false, showNoBarcodePopup: false,
noBarcodeItemName: '', noBarcodeItemName: '',
noBarcodePickedCount: 0, noBarcodePickedCount: 0,
@ -1554,19 +1568,14 @@ import voice from '@/core/utils/voice';
}; };
}, },
promptGoToClaim(message) { promptGoToClaim(message) {
uni.showModal({ this.claimPromptMessage = String(message || '订单未领料,请先领料后再拣货');
title: '提示', this.showClaimPromptPopup = true;
content: String(message || '订单未领料,请先领料后再拣货'), },
confirmText: '去领料', confirmGoToClaim() {
cancelText: '取消', this.showClaimPromptPopup = false;
success: res => {
if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/claim/shippingLabel' url: '/pages/claim/shippingLabel'
}); });
}
}
});
}, },
showErrorModal(message, title = '提示') { showErrorModal(message, title = '提示') {
uni.showModal({ uni.showModal({
@ -2447,7 +2456,7 @@ import voice from '@/core/utils/voice';
font-size: 36rpx; font-size: 36rpx;
line-height: 1.2; line-height: 1.2;
color: #303133; color: #303133;
font-weight: 600; font-weight: bold;
} }
.empty-desc { .empty-desc {
@ -2595,7 +2604,7 @@ import voice from '@/core/utils/voice';
.pick-req-popup__title { .pick-req-popup__title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
text-align: center; text-align: center;
margin-bottom: 24rpx; margin-bottom: 24rpx;
@ -2638,7 +2647,7 @@ import voice from '@/core/utils/voice';
.packing-req-popup__title { .packing-req-popup__title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
text-align: center; text-align: center;
margin-bottom: 24rpx; margin-bottom: 24rpx;
@ -2676,7 +2685,7 @@ import voice from '@/core/utils/voice';
.wave-list-popup__title { .wave-list-popup__title {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
text-align: center; text-align: center;
margin-bottom: 24rpx; margin-bottom: 24rpx;
@ -2758,13 +2767,13 @@ import voice from '@/core/utils/voice';
border-radius: 8rpx; border-radius: 8rpx;
height: 60rpx; height: 60rpx;
padding: 0 22rpx; padding: 0 22rpx;
margin-left: 20rpx; margin-right: 40rpx;
} }
.nav-action-btn--bind .nav-action-btn__text { .nav-action-btn--bind .nav-action-btn__text {
color: #ffffff; color: #ffffff;
font-size: 28rpx; font-size: 36rpx;
font-weight: 600; font-weight: bold;
} }
.nav-action-btn__text { .nav-action-btn__text {
@ -2791,7 +2800,7 @@ import voice from '@/core/utils/voice';
.actions-popup-title { .actions-popup-title {
font-size: 38rpx; font-size: 38rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
text-align: center; text-align: center;
margin-bottom: 36rpx; margin-bottom: 36rpx;
@ -2905,7 +2914,7 @@ import voice from '@/core/utils/voice';
.pick-name { .pick-name {
font-size: 34rpx; font-size: 34rpx;
color: #303133; color: #303133;
font-weight: 600; font-weight: bold;
flex: 1; flex: 1;
} }
@ -3049,7 +3058,7 @@ import voice from '@/core/utils/voice';
.pick-value--highlight { .pick-value--highlight {
color: #2979ff; color: #2979ff;
font-weight: 700; font-weight: bold;
} }
.pick-row--barcode { .pick-row--barcode {
@ -3178,7 +3187,7 @@ import voice from '@/core/utils/voice';
left: 8rpx; left: 8rpx;
z-index: 1; z-index: 1;
font-size: 38rpx; font-size: 38rpx;
font-weight: 600; font-weight: bold;
color: #ffffff; color: #ffffff;
line-height: 1.2; line-height: 1.2;
} }
@ -3299,7 +3308,7 @@ import voice from '@/core/utils/voice';
.popup-title { .popup-title {
font-size: 32rpx; font-size: 32rpx;
color: #303133; color: #303133;
font-weight: 600; font-weight: bold;
} }
.bind-cart-form { .bind-cart-form {
@ -3372,7 +3381,7 @@ import voice from '@/core/utils/voice';
.bind-cart-item__title { .bind-cart-item__title {
font-size: 28rpx; font-size: 28rpx;
color: #303133; color: #303133;
font-weight: 600; font-weight: bold;
} }
.bind-cart-item__bound { .bind-cart-item__bound {
@ -3436,7 +3445,7 @@ import voice from '@/core/utils/voice';
left: 8rpx; left: 8rpx;
z-index: 1; z-index: 1;
font-size: 34rpx; font-size: 34rpx;
font-weight: 600; font-weight: bold;
color: #ffffff; color: #ffffff;
line-height: 1.2; line-height: 1.2;
} }
@ -3531,7 +3540,7 @@ import voice from '@/core/utils/voice';
.no-barcode-popup__title { .no-barcode-popup__title {
font-size: 42rpx; font-size: 42rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
text-align: center; text-align: center;
margin-bottom: 32rpx; margin-bottom: 32rpx;
@ -3578,6 +3587,67 @@ import voice from '@/core/utils/voice';
color: #ffffff; color: #ffffff;
} }
/* 未领料提示弹窗(订单未领料 / 领料人不是本人) */
.claim-prompt-popup {
width: 640rpx;
padding: 40rpx 32rpx 32rpx;
background: #ffffff;
border-radius: 20rpx;
box-sizing: border-box;
}
.claim-prompt-popup__title {
font-size: 42rpx;
font-weight: bold;
color: #303133;
text-align: center;
margin-bottom: 32rpx;
}
.claim-prompt-popup__body {
margin-bottom: 36rpx;
padding: 24rpx;
background: #f8f9fa;
border-radius: 12rpx;
}
.claim-prompt-popup__text {
font-size: 36rpx;
color: #303133;
line-height: 1.6;
}
.claim-prompt-popup__actions {
display: flex;
align-items: center;
}
.claim-prompt-popup__btn {
flex: 1;
height: 88rpx;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
font-weight: 500;
}
.claim-prompt-popup__btn + .claim-prompt-popup__btn {
margin-left: 20rpx;
}
.claim-prompt-popup__btn--cancel {
background: #f5f7fa;
color: #606266;
border: 1rpx solid #dcdfe6;
}
.claim-prompt-popup__btn--confirm {
background: #2979ff;
color: #ffffff;
}
/* 取消拣货二次确认弹窗 */ /* 取消拣货二次确认弹窗 */
.cancel-pick-confirm-popup { .cancel-pick-confirm-popup {
width: 640rpx; width: 640rpx;
@ -3589,7 +3659,7 @@ import voice from '@/core/utils/voice';
.cancel-pick-confirm-popup__title { .cancel-pick-confirm-popup__title {
font-size: 42rpx; font-size: 42rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
text-align: center; text-align: center;
margin-bottom: 32rpx; margin-bottom: 32rpx;

View File

@ -45,7 +45,9 @@
<view class="action-drawer__item action-drawer__item--primary-outline" @click="handleAction('initData')"> <view class="action-drawer__item action-drawer__item--primary-outline" @click="handleAction('initData')">
<text class="action-drawer__item-text action-drawer__item-text--primary">刷新数据</text> <text class="action-drawer__item-text action-drawer__item-text--primary">刷新数据</text>
</view> </view>
<view class="action-drawer__item action-drawer__item--primary-outline" @click="handleAction('completeReceiving')"> <view class="action-drawer__item action-drawer__item--primary-outline"
:class="{ 'action-drawer__item--disabled': isCompletedStatus }"
@click="handleAction('completeReceiving')">
<text class="action-drawer__item-text action-drawer__item-text--primary">完成收货</text> <text class="action-drawer__item-text action-drawer__item-text--primary">完成收货</text>
</view> </view>
<view class="action-drawer__item action-drawer__item--neutral" @click="handleAction('printReceiving')"> <view class="action-drawer__item action-drawer__item--neutral" @click="handleAction('printReceiving')">
@ -220,6 +222,11 @@
return this.receivingInfo.status === 'receiving'; return this.receivingInfo.status === 'receiving';
}, },
// 判断是否已完成状态
isCompletedStatus() {
return this.receivingInfo.status === 'completed';
},
// 删除确认提示文案 // 删除确认提示文案
deleteConfirmText() { deleteConfirmText() {
return this.pendingDeleteDetail return this.pendingDeleteDetail
@ -745,6 +752,10 @@
// 操作菜单处理 // 操作菜单处理
handleAction(action) { handleAction(action) {
// 已完成时禁止完成收货
if (action === 'completeReceiving' && this.isCompletedStatus) {
return;
}
console.log("菜单点击", action); console.log("菜单点击", action);
this.showActionSheet = false; this.showActionSheet = false;
switch (action) { switch (action) {
@ -1423,6 +1434,10 @@
border: 1rpx solid #b8d4ff; border: 1rpx solid #b8d4ff;
} }
.action-drawer__item--disabled {
opacity: 0.45;
}
.action-drawer__item--danger-outline { .action-drawer__item--danger-outline {
background: #fef0f0; background: #fef0f0;
border: 1rpx solid #fbc4c4; border: 1rpx solid #fbc4c4;

View File

@ -542,7 +542,7 @@
} }
.receiving-number { .receiving-number {
font-size: 32rpx; font-size: 40rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
} }
@ -556,7 +556,7 @@
.status-badge { .status-badge {
padding: 8rpx 20rpx; padding: 8rpx 20rpx;
border-radius: 20rpx; border-radius: 20rpx;
font-size: 24rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
&.receiving { &.receiving {
@ -635,14 +635,16 @@
} }
.label { .label {
width: 140rpx; width: 180rpx;
font-size: 26rpx; flex-shrink: 0;
white-space: nowrap;
font-size: 36rpx;
color: #666; color: #666;
} }
.value { .value {
flex: 1; flex: 1;
font-size: 26rpx; font-size: 36rpx;
color: #333; color: #333;
word-break: break-all; word-break: break-all;
} }
@ -676,7 +678,7 @@
} }
.stats-label { .stats-label {
font-size: 24rpx; font-size: 30rpx;
color: #909399; color: #909399;
} }
} }
@ -689,13 +691,13 @@
padding: 30rpx 30rpx 20rpx; padding: 30rpx 30rpx 20rpx;
.title { .title {
font-size: 30rpx; font-size: 34rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
} }
.count { .count {
font-size: 26rpx; font-size: 30rpx;
color: #909399; color: #909399;
} }
} }
@ -721,7 +723,7 @@
.goods-name { .goods-name {
flex: 1; flex: 1;
font-size: 28rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
color: #333; color: #333;
line-height: 1.4; line-height: 1.4;
@ -731,7 +733,7 @@
margin-left: 20rpx; margin-left: 20rpx;
padding: 6rpx 16rpx; padding: 6rpx 16rpx;
border-radius: 16rpx; border-radius: 16rpx;
font-size: 22rpx; font-size: 36rpx;
&.matched { &.matched {
background-color: #f6ffed; background-color: #f6ffed;
@ -751,20 +753,22 @@
margin-bottom: 12rpx; margin-bottom: 12rpx;
.label { .label {
width: 140rpx; width: 180rpx;
font-size: 26rpx; flex-shrink: 0;
white-space: nowrap;
font-size: 36rpx;
color: #666; color: #666;
} }
.value { .value {
flex: 1; flex: 1;
font-size: 26rpx; font-size: 36rpx;
color: #333; color: #333;
word-break: break-all; word-break: break-all;
&.remark-text { &.remark-text {
color: #909399; color: #909399;
font-size: 24rpx; font-size: 30rpx;
} }
} }
} }
@ -774,7 +778,7 @@
.label { .label {
display: block; display: block;
font-size: 26rpx; font-size: 36rpx;
color: #666; color: #666;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
@ -803,7 +807,7 @@
.time { .time {
display: block; display: block;
font-size: 22rpx; font-size: 34rpx;
color: #909399; color: #909399;
margin-bottom: 5rpx; margin-bottom: 5rpx;

View File

@ -28,6 +28,7 @@
<u-input <u-input
:value="formData.sourceSpaceKeyword || formData.sourceSpaceName" :value="formData.sourceSpaceKeyword || formData.sourceSpaceName"
disabled disabled
fontSize="36rpx"
placeholder="自动带出移出库位" placeholder="自动带出移出库位"
/> />
</view> </view>
@ -38,12 +39,13 @@
<u-input <u-input
v-model="formData.targetSpaceKeyword" v-model="formData.targetSpaceKeyword"
placeholder="请扫描或输入移入库位" placeholder="请扫描或输入移入库位"
fontSize="36rpx"
clearable clearable
@focus="setActiveScanField('targetSpace')" @focus="setActiveScanField('targetSpace')"
@blur="handleSpaceBlur('targetSpace')" @blur="handleSpaceBlur('targetSpace')"
/> />
<view class="scan-camera-btn" @click="handleFieldScan('targetSpace')"> <view class="scan-camera-btn" @click="handleFieldScan('targetSpace')">
<u-icon name="camera" size="34rpx" color="#2979ff"></u-icon> <u-icon name="camera" size="48rpx" color="#2979ff"></u-icon>
</view> </view>
</view> </view>
</u-form-item> </u-form-item>
@ -77,9 +79,16 @@
<text class="label">货主:</text> <text class="label">货主:</text>
<text class="value">{{ getStockOwnerText(selectedStock) }}</text> <text class="value">{{ getStockOwnerText(selectedStock) }}</text>
</view> </view>
<view class="stock-card__row"> <view class="stock-card__row stock-card__row--barcode">
<text class="label">条码:</text> <text class="label">条码:</text>
<text class="value">{{ getStockBarcode(selectedStock) }}</text> <view class="stock-card__barcode-value">
<text class="stock-card__barcode-text">{{ getStockBarcodeDisplayText(selectedStock) }}</text>
<text
v-if="hasMoreStockBarcodes(selectedStock)"
class="stock-card__barcode-toggle"
@click.stop="toggleStockBarcodeExpand(selectedStock)"
>{{ isStockBarcodeExpanded(selectedStock) ? '收起' : '展开' }}</text>
</view>
</view> </view>
<view v-if="shouldShowStockBatch(selectedStock)" class="stock-card__row"> <view v-if="shouldShowStockBatch(selectedStock)" class="stock-card__row">
<text class="label">批次号:</text> <text class="label">批次号:</text>
@ -96,7 +105,7 @@
</view> </view>
<u-form-item class="remark-item" label="备注" label-width="110rpx"> <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" fontSize="36rpx" placeholder="请输入备注信息" height="120"></u-input>
</u-form-item> </u-form-item>
</view> </view>
</u-form> </u-form>
@ -145,6 +154,8 @@
selectorField: '', selectorField: '',
selectorList: [], selectorList: [],
selectedStock: null, selectedStock: null,
// 条码展开状态(按商品 id 记录),条码超过 3 个时默认收起
barcodeExpandMap: {},
formData: { formData: {
sourceSpaceKeyword: '', sourceSpaceKeyword: '',
sourceSpaceId: null, sourceSpaceId: null,
@ -510,10 +521,68 @@
getStockName(item) { getStockName(item) {
return item?.item_name || item?.product_name || item?.name || item?.goods_name || '未命名商品'; return item?.item_name || item?.product_name || item?.name || item?.goods_name || '未命名商品';
}, },
getStockBarcode(item) { // 归一化条码为字符串数组([{barcode, code}] 或字符串)
if (Array.isArray(item?.barcodes) && item.barcodes.length) { getStockBarcodeList(item) {
return item.barcodes.filter(Boolean).join(';'); const barcodes = item?.barcodes;
if (Array.isArray(barcodes)) {
return barcodes.map(c => {
if (typeof c === 'string') return c.trim();
if (c && typeof c === 'object') return String(c.barcode ?? c.code ?? '').trim();
return '';
}).filter(Boolean);
} }
const fallback = item?.barcode ?? item?.goods_code ?? item?.item_code;
if (typeof fallback === 'string' && fallback.trim()) {
return [fallback.trim()];
}
if (Array.isArray(fallback)) {
return fallback.map(c => {
if (typeof c === 'string') return c.trim();
if (c && typeof c === 'object') return String(c.barcode ?? c.code ?? '').trim();
return '';
}).filter(Boolean);
}
return [];
},
getStockBarcodeCount(item) {
return this.getStockBarcodeList(item).length;
},
hasMoreStockBarcodes(item) {
return this.getStockBarcodeCount(item) > 3;
},
getStockBarcodeExpandKey(item) {
if (!item || typeof item !== 'object') return 'unknown';
return String(
item.relocation_product_stock_id
|| item.stock_id
|| item.id
|| item.item_id
|| item.item_code
|| 'unknown'
);
},
isStockBarcodeExpanded(item) {
return !!this.barcodeExpandMap[this.getStockBarcodeExpandKey(item)];
},
toggleStockBarcodeExpand(item) {
const key = this.getStockBarcodeExpandKey(item);
this.$set(this.barcodeExpandMap, key, !this.barcodeExpandMap[key]);
},
getStockBarcodeDisplayList(item) {
const list = this.getStockBarcodeList(item);
if (list.length > 3 && !this.isStockBarcodeExpanded(item)) {
return list.slice(0, 3);
}
return list;
},
getStockBarcodeDisplayText(item) {
const list = this.getStockBarcodeDisplayList(item);
if (list.length) return list.join('、');
return '--';
},
getStockBarcode(item) {
const list = this.getStockBarcodeList(item);
if (list.length) return list.join(';');
return item?.barcode || item?.goods_code || item?.item_code || '--'; return item?.barcode || item?.goods_code || item?.item_code || '--';
}, },
getStockOwnerText(item) { getStockOwnerText(item) {
@ -842,14 +911,14 @@
} }
.nav-submit-btn__text { .nav-submit-btn__text {
font-size: 30rpx; font-size: 36rpx;
font-weight: 600; color: #ffffff;
line-height: 1; line-height: 1;
} }
::v-deep .nav-submit-btn .u-button__text { ::v-deep .nav-submit-btn .u-button__text {
font-size: 30rpx !important; font-size: 36rpx !important;
font-weight: 600; color: #ffffff;
line-height: 1; line-height: 1;
} }
@ -860,6 +929,10 @@
.form-box { .form-box {
padding: 20rpx; padding: 20rpx;
::v-deep .u-form-item__body__left__content__label {
font-size: 36rpx;
}
} }
.section { .section {
@ -869,7 +942,7 @@
margin-bottom: 30rpx; margin-bottom: 30rpx;
.section-title { .section-title {
font-size: 32rpx; font-size: 34rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-bottom: 30rpx; margin-bottom: 30rpx;
@ -887,6 +960,12 @@
::v-deep .u-input { ::v-deep .u-input {
flex: 1; flex: 1;
} }
::v-deep .u-input__content__field-wrapper__field,
::v-deep .u-input__content__field-wrapper__field input,
::v-deep .u-input input {
font-size: 36rpx !important;
}
} }
.quantity-input-wrap { .quantity-input-wrap {
@ -900,18 +979,27 @@
} }
} }
.remark-item {
::v-deep .u-input__content__field-wrapper__field,
::v-deep .u-input__content__field-wrapper__field input,
::v-deep .u-input input,
::v-deep .u-input textarea {
font-size: 36rpx !important;
}
}
.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: 40rpx !important; font-size: 36rpx !important;
font-weight: 700; font-weight: bold;
} }
::v-deep .move-quantity-input .u-input__content__field-wrapper__field, ::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 .u-input__content__field-wrapper__field input,
::v-deep .move-quantity-input input { ::v-deep .move-quantity-input input {
font-size: 42rpx !important; font-size: 42rpx !important;
font-weight: 700 !important; font-weight: bold !important;
} }
::v-deep .u-input__content { ::v-deep .u-input__content {
@ -920,9 +1008,9 @@
} }
.quantity-all-view-btn { .quantity-all-view-btn {
width: 76rpx;
height: 76rpx; height: 76rpx;
border-radius: 12rpx; padding: 0 24rpx;
border-radius: 3px;
background: #2979ff; background: #2979ff;
display: flex; display: flex;
align-items: center; align-items: center;
@ -931,7 +1019,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: 28rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
line-height: 1; line-height: 1;
@ -980,8 +1068,8 @@
} }
&__title { &__title {
font-size: 34rpx; font-size: 36rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
flex: 1; flex: 1;
padding-right: 20rpx; padding-right: 20rpx;
@ -993,7 +1081,7 @@
.label { .label {
width: auto; width: auto;
font-size: 30rpx; font-size: 36rpx;
color: #606266; color: #606266;
white-space: nowrap; white-space: nowrap;
margin-right: 8rpx; margin-right: 8rpx;
@ -1002,11 +1090,43 @@
.value { .value {
flex: 1; flex: 1;
font-size: 30rpx; font-size: 36rpx;
color: #303133; color: #303133;
word-break: break-all; word-break: break-all;
} }
} }
&__row--barcode {
align-items: flex-start;
}
&__barcode-value {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
flex: 1;
min-width: 0;
}
&__barcode-text {
flex: 1;
min-width: 0;
font-size: 36rpx;
color: #303133;
word-break: break-all;
}
&__barcode-toggle {
flex-shrink: 0;
margin-left: 12rpx;
font-size: 36rpx;
color: #2979ff;
line-height: 1.4;
&:active {
opacity: 0.7;
}
}
} }
.selector-popup { .selector-popup {
@ -1019,7 +1139,7 @@
.popup-title { .popup-title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 600; font-weight: bold;
color: #333; color: #333;
} }
@ -1034,7 +1154,7 @@
&__title { &__title {
display: block; display: block;
font-size: 30rpx; font-size: 30rpx;
font-weight: 600; font-weight: bold;
color: #303133; color: #303133;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }