修改订单拣货页面
This commit is contained in:
parent
9672a315b6
commit
24d455a2e8
@ -64,9 +64,21 @@
|
|||||||
<text class="pick-name">{{ selectedPickItem.itemName || '--' }}</text>
|
<text class="pick-name">{{ selectedPickItem.itemName || '--' }}</text>
|
||||||
<text v-if="boundCartNo" class="pick-cart-tag">拣货车:{{ boundCartNo }}{{ boundCartName ? `(${boundCartName})` : '' }}</text>
|
<text v-if="boundCartNo" class="pick-cart-tag">拣货车:{{ boundCartNo }}{{ boundCartName ? `(${boundCartName})` : '' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="pick-row"><text class="pick-label">货主:</text><text class="pick-value">{{ selectedPickItem.storeRemark || '--' }}</text></view>
|
<view class="pick-row pick-row--compact"><text class="pick-label">货主:</text><text class="pick-value">{{ selectedPickItem.storeRemark || '--' }}</text></view>
|
||||||
<view class="pick-row"><text class="pick-label">商品条码:</text><text class="pick-value">{{ selectedItemBarcodeLoading ? '条码加载中...' : (selectedItemBarcode || '--') }}</text></view>
|
<view class="pick-row pick-row--barcode pick-row--compact">
|
||||||
<view class="pick-row"><text class="pick-label">库位:</text><text class="pick-value pick-value--highlight">{{ selectedPickItem.spaceName || '--' }}</text></view>
|
<text v-if="!isBarcodeTooLong || selectedItemBarcodeLoading" class="pick-label">条码:</text>
|
||||||
|
<text
|
||||||
|
class="pick-value"
|
||||||
|
:class="{ 'pick-value--clamp': isBarcodeTooLong && !barcodeExpanded }"
|
||||||
|
@click.stop="toggleBarcodeExpand"
|
||||||
|
>{{ selectedItemBarcodeLoading ? '条码加载中...' : (selectedItemBarcode || '--') }}</text>
|
||||||
|
<text
|
||||||
|
v-if="isBarcodeTooLong && !selectedItemBarcodeLoading"
|
||||||
|
class="barcode-toggle-btn"
|
||||||
|
@click.stop="toggleBarcodeExpand"
|
||||||
|
>{{ barcodeExpanded ? '收起' : '展开' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="pick-row pick-row--compact"><text class="pick-label">库位:</text><text class="pick-value pick-value--highlight">{{ selectedPickItem.spaceName || '--' }}</text></view>
|
||||||
<view class="pick-row"><text class="pick-label">应拣总数:</text><text class="pick-value">{{ selectedPickItem.totalQty }}</text></view>
|
<view class="pick-row"><text class="pick-label">应拣总数:</text><text class="pick-value">{{ selectedPickItem.totalQty }}</text></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -314,6 +326,8 @@ import voice from '@/core/utils/voice';
|
|||||||
selectedItemBarcodeLoading: false,
|
selectedItemBarcodeLoading: false,
|
||||||
selectedItemBarcode: '',
|
selectedItemBarcode: '',
|
||||||
itemBarcodeCache: {},
|
itemBarcodeCache: {},
|
||||||
|
barcodeExpanded: false,
|
||||||
|
barcodeClampLength: 14,
|
||||||
pickedItemKeys: [],
|
pickedItemKeys: [],
|
||||||
pickedStateStorageKey: 'order_picking_picked_state_v1',
|
pickedStateStorageKey: 'order_picking_picked_state_v1',
|
||||||
confirmedOrderIds: [],
|
confirmedOrderIds: [],
|
||||||
@ -460,6 +474,12 @@ import voice from '@/core/utils/voice';
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return this.filteredPickItems[this.selectedIndex] || this.filteredPickItems[0];
|
return this.filteredPickItems[this.selectedIndex] || this.filteredPickItems[0];
|
||||||
|
},
|
||||||
|
selectedBarcodeText() {
|
||||||
|
return this.selectedItemBarcodeLoading ? '' : String(this.selectedItemBarcode || '').trim();
|
||||||
|
},
|
||||||
|
isBarcodeTooLong() {
|
||||||
|
return this.selectedBarcodeText.length > this.barcodeClampLength;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -474,6 +494,7 @@ import voice from '@/core/utils/voice';
|
|||||||
},
|
},
|
||||||
selectedPickItem: {
|
selectedPickItem: {
|
||||||
handler(item) {
|
handler(item) {
|
||||||
|
this.barcodeExpanded = false;
|
||||||
this.loadSelectedItemImage(item);
|
this.loadSelectedItemImage(item);
|
||||||
this.loadSelectedItemBarcode(item);
|
this.loadSelectedItemBarcode(item);
|
||||||
},
|
},
|
||||||
@ -484,6 +505,7 @@ import voice from '@/core/utils/voice';
|
|||||||
this.initWavePickSubmitNetworkStatus();
|
this.initWavePickSubmitNetworkStatus();
|
||||||
this.bindNetworkStatusChange();
|
this.bindNetworkStatusChange();
|
||||||
this.restoreBasketDisplayMode();
|
this.restoreBasketDisplayMode();
|
||||||
|
this.updateBarcodeClampLength();
|
||||||
this.$store.dispatch('broadcast/setCallbacks', {
|
this.$store.dispatch('broadcast/setCallbacks', {
|
||||||
onResult: this.handleBroadcastScan
|
onResult: this.handleBroadcastScan
|
||||||
});
|
});
|
||||||
@ -1952,6 +1974,32 @@ import voice from '@/core/utils/voice';
|
|||||||
}
|
}
|
||||||
return String(entry.barcode || entry.code || '').trim();
|
return String(entry.barcode || entry.code || '').trim();
|
||||||
},
|
},
|
||||||
|
// 按屏幕宽度估算一行可容纳的条码字符数,作为展开/收起的触发阈值
|
||||||
|
updateBarcodeClampLength() {
|
||||||
|
let estimated = 16;
|
||||||
|
try {
|
||||||
|
const info = uni.getSystemInfoSync();
|
||||||
|
const screenWidth = info.windowWidth || 375;
|
||||||
|
const rpx = screenWidth / 750;
|
||||||
|
// 条码文本可用宽度(rpx) = 750 - 24*2(页面左右padding) - 200(商品图) - 16(detail-main gap) - 170(标签列)
|
||||||
|
const availableRpx = 316;
|
||||||
|
// 数字/字母平均字符宽 ≈ 字号 * 0.58
|
||||||
|
const charWidthRpx = 34 * 0.58;
|
||||||
|
if (availableRpx > 0 && charWidthRpx > 0) {
|
||||||
|
estimated = Math.floor(availableRpx / charWidthRpx);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// 异常时使用兜底估算值
|
||||||
|
}
|
||||||
|
// 减去容差:宁可稍早触发展开,也不让“一行放不下却看不到按钮”
|
||||||
|
this.barcodeClampLength = Math.max(10, estimated - 2);
|
||||||
|
},
|
||||||
|
toggleBarcodeExpand() {
|
||||||
|
if (!this.isBarcodeTooLong) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.barcodeExpanded = !this.barcodeExpanded;
|
||||||
|
},
|
||||||
async loadSelectedItemBarcode(item) {
|
async loadSelectedItemBarcode(item) {
|
||||||
if (!item) {
|
if (!item) {
|
||||||
this.selectedItemBarcode = '';
|
this.selectedItemBarcode = '';
|
||||||
@ -2201,13 +2249,17 @@ import voice from '@/core/utils/voice';
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 8rpx;
|
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content-wrap > * + * {
|
||||||
|
margin-top: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.top-detail-panel {
|
.top-detail-panel {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
margin: 0 -12rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wave-banner {
|
.wave-banner {
|
||||||
@ -2562,7 +2614,7 @@ import voice from '@/core/utils/voice';
|
|||||||
}
|
}
|
||||||
|
|
||||||
.pick-name {
|
.pick-name {
|
||||||
font-size: 36rpx;
|
font-size: 34rpx;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -2589,12 +2641,12 @@ import voice from '@/core/utils/voice';
|
|||||||
.detail-main {
|
.detail-main {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 16rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.detail-main-left {
|
.detail-main-left {
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
min-width: 200rpx;
|
min-width: 200rpx;
|
||||||
|
margin-right: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-image {
|
.goods-image {
|
||||||
@ -2641,6 +2693,8 @@ import voice from '@/core/utils/voice';
|
|||||||
.detail-main-right--matched {
|
.detail-main-right--matched {
|
||||||
background: #ecf5ff;
|
background: #ecf5ff;
|
||||||
box-shadow: inset 0 0 0 2rpx #2979ff;
|
box-shadow: inset 0 0 0 2rpx #2979ff;
|
||||||
|
padding: 5rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pick-image-empty {
|
.pick-image-empty {
|
||||||
@ -2692,6 +2746,12 @@ import voice from '@/core/utils/voice';
|
|||||||
color: #909399;
|
color: #909399;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pick-row--compact .pick-label {
|
||||||
|
width: auto;
|
||||||
|
min-width: auto;
|
||||||
|
margin-right: 5rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.pick-value {
|
.pick-value {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
@ -2703,6 +2763,29 @@ import voice from '@/core/utils/voice';
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pick-row--barcode {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pick-value--clamp {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
word-break: keep-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.barcode-toggle-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 12rpx;
|
||||||
|
margin-top: 4rpx;
|
||||||
|
padding: 0 16rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
color: #2979ff;
|
||||||
|
background: #ecf5ff;
|
||||||
|
border-radius: 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.index-grid {
|
.index-grid {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user