|
|
@@ -48,11 +48,11 @@
|
|
|
</div>
|
|
|
<div class="table-row row-small">
|
|
|
<div class="cell label">质量状态</div>
|
|
|
- <div class="cell value">{{ productInfo.qualityStatus }}</div>
|
|
|
+ <div class="cell value value-small">{{ productInfo.qualityStatus }}</div>
|
|
|
<div class="cell label label-small">属性仓</div>
|
|
|
- <div class="cell value">{{ productInfo.warehouseType }}</div>
|
|
|
+ <div class="cell value value-large">{{ productInfo.warehouseType }}</div>
|
|
|
<div class="cell label label-small">批号</div>
|
|
|
- <div class="cell value"></div>
|
|
|
+ <div class="cell value value-small"></div>
|
|
|
</div>
|
|
|
<div class="table-row">
|
|
|
<div class="cell label">生产日期</div>
|
|
|
@@ -62,7 +62,16 @@
|
|
|
</div>
|
|
|
<div class="table-row">
|
|
|
<div class="cell label">目标库位</div>
|
|
|
- <div class="cell value">{{ productInfo.targetLocationNew }}</div>
|
|
|
+ <div class="cell value input-cell">
|
|
|
+ <van-field
|
|
|
+ ref="targetLocationInputRef"
|
|
|
+ v-model="productInfo.targetLocationNew"
|
|
|
+ placeholder="请扫描目标库位"
|
|
|
+ clearable
|
|
|
+ @click="onTargetLocationClick"
|
|
|
+ @keyup.enter="onTargetLocationEnter"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div class="cell label">移库数量</div>
|
|
|
<div class="cell value editable" @dblclick="editMoveQty">
|
|
|
<template v-if="isEditingMoveQty">
|
|
|
@@ -197,13 +206,14 @@ import { showConfirmDialog } from 'vant'
|
|
|
const store = useStore()
|
|
|
const warehouse = store.warehouse
|
|
|
|
|
|
-// 扫描类型: 1=料箱号, 2=源库位, 3=商品条码
|
|
|
+// 扫描类型: 1=料箱号, 2=源库位, 3=商品条码, 4=目标库位
|
|
|
const scanType = ref(1)
|
|
|
|
|
|
// 输入框引用
|
|
|
const boxCodeInputRef = ref<any>(null)
|
|
|
const sourceLocationInputRef = ref<any>(null)
|
|
|
const barcodeInputRef = ref<any>(null)
|
|
|
+const targetLocationInputRef = ref<any>(null)
|
|
|
|
|
|
// 扫描料箱号
|
|
|
const boxCode = ref('')
|
|
|
@@ -247,6 +257,13 @@ const focusBarcodeInput = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 设置目标库位输入框焦点
|
|
|
+const focusTargetLocationInput = () => {
|
|
|
+ nextTick(() => {
|
|
|
+ targetLocationInputRef.value?.focus()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// 扫描监听
|
|
|
const _handlerScan = (code: string) => {
|
|
|
if (!code) return
|
|
|
@@ -263,6 +280,10 @@ const _handlerScan = (code: string) => {
|
|
|
// 扫描商品条码
|
|
|
scanBarcode.value = code
|
|
|
onBarcodeEnter()
|
|
|
+ } else if (scanType.value === 4) {
|
|
|
+ // 扫描目标库位
|
|
|
+ productInfo.targetLocationNew = code
|
|
|
+ onTargetLocationEnter()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -300,6 +321,17 @@ const onBarcodeClick = () => {
|
|
|
resetProductInfo()
|
|
|
}
|
|
|
|
|
|
+// 目标库位输入框点击
|
|
|
+const onTargetLocationClick = () => {
|
|
|
+ scanType.value = 4
|
|
|
+}
|
|
|
+
|
|
|
+// 目标库位回车
|
|
|
+const onTargetLocationEnter = () => {
|
|
|
+ if (!productInfo.targetLocationNew) return
|
|
|
+ showToast(`已输入目标库位: ${productInfo.targetLocationNew}`)
|
|
|
+}
|
|
|
+
|
|
|
// 当前选中的库存数据(用于提交移库)
|
|
|
const currentInventoryData = ref<any>(null)
|
|
|
|
|
|
@@ -341,6 +373,9 @@ const onBarcodeEnter = async () => {
|
|
|
productInfo.moveQty = inventoryData.quantityAvailable || inventoryData.quantity || ''
|
|
|
|
|
|
showToast('商品信息获取成功')
|
|
|
+ // 切换到扫描目标库位
|
|
|
+ scanType.value = 4
|
|
|
+ focusTargetLocationInput()
|
|
|
} else {
|
|
|
showToast('未找到库存信息')
|
|
|
currentInventoryData.value = null
|
|
|
@@ -935,6 +970,14 @@ const submitMove = () => {
|
|
|
&.span-2 {
|
|
|
flex: 2;
|
|
|
}
|
|
|
+
|
|
|
+ &.value-small {
|
|
|
+ flex: 0.9;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.value-large {
|
|
|
+ flex: 1.4;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|