|
@@ -61,29 +61,28 @@
|
|
|
>
|
|
>
|
|
|
</van-search>
|
|
</van-search>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="barcode-input">
|
|
|
|
|
- <van-search
|
|
|
|
|
- ref="locationRef"
|
|
|
|
|
- v-model="searchLocation"
|
|
|
|
|
- placeholder="请扫描库位编号"
|
|
|
|
|
- @search="_handlerScan(searchLocation)"
|
|
|
|
|
- label="库位编号:"
|
|
|
|
|
- left-icon=""
|
|
|
|
|
- :class="[scanType===3?'search-input-barcode':'','van-hairline--bottom']"
|
|
|
|
|
- @focus="scanType=3"
|
|
|
|
|
- autocomplete="off"
|
|
|
|
|
- >
|
|
|
|
|
- <template #right-icon>
|
|
|
|
|
- <div
|
|
|
|
|
- v-if="systemForcePublishEnabled && barcodeActiveList.length > 0"
|
|
|
|
|
- class="change-location-btn"
|
|
|
|
|
- :class="{ 'change-location-btn--loading': changeLocationLoading }"
|
|
|
|
|
- @click.stop="onChangeLocation"
|
|
|
|
|
- >
|
|
|
|
|
- 换一换
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </van-search>
|
|
|
|
|
|
|
+ <div class="barcode-input barcode-input--location">
|
|
|
|
|
+ <div class="location-row">
|
|
|
|
|
+ <van-search
|
|
|
|
|
+ ref="locationRef"
|
|
|
|
|
+ v-model="searchLocation"
|
|
|
|
|
+ placeholder="请扫描库位编号"
|
|
|
|
|
+ @search="_handlerScan(searchLocation)"
|
|
|
|
|
+ label="库位编号:"
|
|
|
|
|
+ left-icon=""
|
|
|
|
|
+ :class="[scanType === 3 ? 'search-input-barcode' : '', 'location-search']"
|
|
|
|
|
+ @focus="scanType=3"
|
|
|
|
|
+ autocomplete="off"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-show="systemForcePublishEnabled && barcodeActiveList.length > 0"
|
|
|
|
|
+ class="change-location-btn"
|
|
|
|
|
+ :class="{ 'change-location-btn--loading': changeLocationLoading }"
|
|
|
|
|
+ @click.stop="onOpenChangeLocation"
|
|
|
|
|
+ >
|
|
|
|
|
+ 换一换
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="barcode-input">
|
|
<div class="barcode-input">
|
|
|
<van-search
|
|
<van-search
|
|
@@ -167,24 +166,19 @@
|
|
|
<van-cell title="叠装区" @click="onSelectLocationType('DZ')" />
|
|
<van-cell title="叠装区" @click="onSelectLocationType('DZ')" />
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
</van-action-sheet>
|
|
</van-action-sheet>
|
|
|
- <!-- 库位类型-->
|
|
|
|
|
- <location-type-picker
|
|
|
|
|
- ref="changeLocationTypePickerRef"
|
|
|
|
|
- :warehouse="warehouse"
|
|
|
|
|
- description="选择库位类型"
|
|
|
|
|
- @confirm="doChangeLocationWithType"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <!-- 换一换-->
|
|
|
|
|
+ <change-location-picker ref="changeLocationPickerRef" @confirm="doChangeLocation" />
|
|
|
<!-- 组合商品上架数量-->
|
|
<!-- 组合商品上架数量-->
|
|
|
<barcode-combine ref="barcodeCombineRef" @setCombine="setPutawayCombine" @cancel="onCombineCancel" :matched-sku="combineMatchedSku" />
|
|
<barcode-combine ref="barcodeCombineRef" @setCombine="setPutawayCombine" @cancel="onCombineCancel" :matched-sku="combineMatchedSku" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { onMounted, onUnmounted, ref, computed } from 'vue'
|
|
|
|
|
|
|
+import { onMounted, onUnmounted, ref, computed, nextTick } from 'vue'
|
|
|
import { androidFocus, getHeader, goBack, scanError, scanSuccess } from '@/utils/android'
|
|
import { androidFocus, getHeader, goBack, scanError, scanSuccess } from '@/utils/android'
|
|
|
import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
|
|
import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
|
|
|
import LocationList from '@/views/inbound/putaway/components/LocationList.vue'
|
|
import LocationList from '@/views/inbound/putaway/components/LocationList.vue'
|
|
|
import BarcodeCombine from '@/views/inbound/putaway/components/BarcodeCombine.vue'
|
|
import BarcodeCombine from '@/views/inbound/putaway/components/BarcodeCombine.vue'
|
|
|
-import LocationTypePicker from '@/views/inbound/putaway/components/LocationTypePicker.vue'
|
|
|
|
|
|
|
+import ChangeLocationPicker from '@/views/inbound/putaway/components/ChangeLocationPicker.vue'
|
|
|
import { openListener,closeListener,scanInit } from '@/utils/keydownListener.js'
|
|
import { openListener,closeListener,scanInit } from '@/utils/keydownListener.js'
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
@@ -273,6 +267,55 @@ const isLocationInRecommendedList = (locationCode) => {
|
|
|
return isScannedLocationInRecommendedList(locationCode)
|
|
return isScannedLocationInRecommendedList(locationCode)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 库位类型体积(如 0.3-0.4-0.3,三数相乘区分大小)
|
|
|
|
|
+const calcLocationTypeVolume = (typeStr) => {
|
|
|
|
|
+ if (!typeStr) return 0
|
|
|
|
|
+ const parts = String(typeStr).split('-').map(Number)
|
|
|
|
|
+ if (parts.length !== 3 || parts.some(n => Number.isNaN(n))) return 0
|
|
|
|
|
+ return parts[0] * parts[1] * parts[2]
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const getItemLocationTypeName = (item) => item?.locationType || item?.typeName || ''
|
|
|
|
|
+
|
|
|
|
|
+// 从强制/可选库位中取最大或最小库位类型
|
|
|
|
|
+const pickLocationTypeFromList = (larger) => {
|
|
|
|
|
+ const types = [...new Set(
|
|
|
|
|
+ locationList.value
|
|
|
|
|
+ .filter(item => item.displayType === 'FORCE' || item.displayType === 'OPTIONAL')
|
|
|
|
|
+ .map(getItemLocationTypeName)
|
|
|
|
|
+ .filter(Boolean),
|
|
|
|
|
+ )]
|
|
|
|
|
+ if (!types.length) return ''
|
|
|
|
|
+ types.sort((a, b) => calcLocationTypeVolume(a) - calcLocationTypeVolume(b))
|
|
|
|
|
+ return larger ? types[types.length - 1] : types[0]
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 上次换一换方向:true 换大的,false 换小的
|
|
|
|
|
+const lastChangeLocationDirection = ref(null)
|
|
|
|
|
+// 上次换一换使用的库位类型(如 0.3-0.4-0.3)
|
|
|
|
|
+const lastChangeLocationType = ref('')
|
|
|
|
|
+//同步上次换一换使用的库位类型
|
|
|
|
|
+const syncLastChangeLocationTypeFromList = () => {
|
|
|
|
|
+ const type = pickLocationTypeFromList(true) || pickLocationTypeFromList(false)
|
|
|
|
|
+ if (type) lastChangeLocationType.value = type
|
|
|
|
|
+}
|
|
|
|
|
+//换一换使用的库位类型(换大的或换小的)
|
|
|
|
|
+const resolveChangeLocationType = (larger) => {
|
|
|
|
|
+ const fromList = pickLocationTypeFromList(larger)
|
|
|
|
|
+ if (fromList) return fromList
|
|
|
|
|
+ if (larger && lastChangeLocationType.value) return lastChangeLocationType.value
|
|
|
|
|
+ return ''
|
|
|
|
|
+}
|
|
|
|
|
+//换一换使用的库位类型(换大的或换小的)
|
|
|
|
|
+const resolveOverflowLocationType = () => {
|
|
|
|
|
+ return pickLocationTypeFromList(true) || pickLocationTypeFromList(false) || lastChangeLocationType.value || ''
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const resetChangeLocationDirection = () => {
|
|
|
|
|
+ lastChangeLocationDirection.value = null
|
|
|
|
|
+ lastChangeLocationType.value = ''
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 从已排除库位记录中提取 locationId 列表(换一换时使用,INVENTORY 类型不排除)
|
|
// 从已排除库位记录中提取 locationId 列表(换一换时使用,INVENTORY 类型不排除)
|
|
|
const getExcludedLocationIds = (list) => {
|
|
const getExcludedLocationIds = (list) => {
|
|
|
const ids = [...new Set(list.map(loc => {
|
|
const ids = [...new Set(list.map(loc => {
|
|
@@ -395,7 +438,6 @@ const setBarcode = (code, type) => {
|
|
|
formattedTime.value = '00:00:00'
|
|
formattedTime.value = '00:00:00'
|
|
|
totalSeconds.value = 0
|
|
totalSeconds.value = 0
|
|
|
locationType.value = ''
|
|
locationType.value = ''
|
|
|
- changeLocationTypePickerRef.value?.clearCache()
|
|
|
|
|
}
|
|
}
|
|
|
const params = { warehouseId:warehouse, containerId: code }
|
|
const params = { warehouseId:warehouse, containerId: code }
|
|
|
getWaitPutawayListNew(params).then(res => {
|
|
getWaitPutawayListNew(params).then(res => {
|
|
@@ -502,8 +544,8 @@ const switchTask = () => {
|
|
|
inputBarcodeType.value = 'switchTask'
|
|
inputBarcodeType.value = 'switchTask'
|
|
|
back.value = false
|
|
back.value = false
|
|
|
if (systemForcePublishEnabled.value) excludedLocations.value = []
|
|
if (systemForcePublishEnabled.value) excludedLocations.value = []
|
|
|
|
|
+ resetChangeLocationDirection()
|
|
|
locationType.value = ''
|
|
locationType.value = ''
|
|
|
- changeLocationTypePickerRef.value?.clearCache()
|
|
|
|
|
inputBarcodeRef.value?.show('', `请扫描容器号`, '')
|
|
inputBarcodeRef.value?.show('', `请扫描容器号`, '')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -522,7 +564,6 @@ const changeLocationLoading = ref(false)
|
|
|
// 上架区域,默认全部
|
|
// 上架区域,默认全部
|
|
|
const locationType = ref('')
|
|
const locationType = ref('')
|
|
|
const locationTypeSheetShow = ref(false)
|
|
const locationTypeSheetShow = ref(false)
|
|
|
-const changeLocationTypePickerRef = ref(null)
|
|
|
|
|
const locationTypeLabel = computed(() => {
|
|
const locationTypeLabel = computed(() => {
|
|
|
const map = { PICKING: '拣货位', STORAGE: '存储位', RETURN: '退货区', HANGING: '挂装区',ZZ: '周转区', DZ: '叠装区'
|
|
const map = { PICKING: '拣货位', STORAGE: '存储位', RETURN: '退货区', HANGING: '挂装区',ZZ: '周转区', DZ: '叠装区'
|
|
|
}
|
|
}
|
|
@@ -534,6 +575,7 @@ const onSelectLocationType = async (value = '') => {
|
|
|
locationTypeSheetShow.value = false
|
|
locationTypeSheetShow.value = false
|
|
|
if (value !== prev && barcodeActiveList.value.length > 0) {
|
|
if (value !== prev && barcodeActiveList.value.length > 0) {
|
|
|
excludedLocations.value = []
|
|
excludedLocations.value = []
|
|
|
|
|
+ resetChangeLocationDirection()
|
|
|
await _getRecommendedLocation(barcodeActiveList.value[0])
|
|
await _getRecommendedLocation(barcodeActiveList.value[0])
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -547,6 +589,7 @@ const reset = () => {
|
|
|
putawayCombineData.value = null
|
|
putawayCombineData.value = null
|
|
|
combineMatchedSku.value = []
|
|
combineMatchedSku.value = []
|
|
|
excludedLocations.value = []
|
|
excludedLocations.value = []
|
|
|
|
|
+ resetChangeLocationDirection()
|
|
|
forbidForcePutaway.value = true // 重置为默认不强制,待下次推荐接口返回后再更新
|
|
forbidForcePutaway.value = true // 重置为默认不强制,待下次推荐接口返回后再更新
|
|
|
locationType.value = ''
|
|
locationType.value = ''
|
|
|
}
|
|
}
|
|
@@ -630,6 +673,7 @@ const _handlePutawayCombineProduct = (code) => {
|
|
|
const _handlerScan = (code) => {
|
|
const _handlerScan = (code) => {
|
|
|
if (scanType.value === SCAN_TYPE.BARCODE) {
|
|
if (scanType.value === SCAN_TYPE.BARCODE) {
|
|
|
excludedLocations.value = []
|
|
excludedLocations.value = []
|
|
|
|
|
+ resetChangeLocationDirection()
|
|
|
searchBarcode.value = code
|
|
searchBarcode.value = code
|
|
|
oldSearchBarcode.value = code
|
|
oldSearchBarcode.value = code
|
|
|
lotBarcodeList.value = matchingBarcodeItem(dataMap.value, code)
|
|
lotBarcodeList.value = matchingBarcodeItem(dataMap.value, code)
|
|
@@ -648,7 +692,7 @@ const _handlerScan = (code) => {
|
|
|
_handleLocationScan(code)
|
|
_handleLocationScan(code)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+//库位扫描
|
|
|
const _handleLocationScan = async (code) => {
|
|
const _handleLocationScan = async (code) => {
|
|
|
const scannedLocation = barcodeToUpperCase(code)
|
|
const scannedLocation = barcodeToUpperCase(code)
|
|
|
if (!isLocationInRecommendedList(scannedLocation)) {
|
|
if (!isLocationInRecommendedList(scannedLocation)) {
|
|
@@ -657,6 +701,7 @@ const _handleLocationScan = async (code) => {
|
|
|
scanError()
|
|
scanError()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ //库位校验
|
|
|
if (!isScannedLocationInRecommendedList(scannedLocation)) {
|
|
if (!isScannedLocationInRecommendedList(scannedLocation)) {
|
|
|
showLoading()
|
|
showLoading()
|
|
|
const valid = await validateCustomPutawayLocation(scannedLocation)
|
|
const valid = await validateCustomPutawayLocation(scannedLocation)
|
|
@@ -690,19 +735,27 @@ const _getRecommendedLocation = async (item, options = {}) => {
|
|
|
const uniqueLocationIds = fromChangeLocation ? getExcludedLocationIds(excludedLocations.value) : undefined
|
|
const uniqueLocationIds = fromChangeLocation ? getExcludedLocationIds(excludedLocations.value) : undefined
|
|
|
try {
|
|
try {
|
|
|
const total = barcodeQuantity(barcodeActiveList.value)
|
|
const total = barcodeQuantity(barcodeActiveList.value)
|
|
|
- const statisticsKey=barcodeActiveList.value[0].taskNo || barcodeActiveList.value[0].businessNo +'_'+barcodeActiveList.value[0].lotNumber
|
|
|
|
|
const params = { warehouse, lotNum: lotNumber, owner, sku, qty: total, lotAtt08}
|
|
const params = { warehouse, lotNum: lotNumber, owner, sku, qty: total, lotAtt08}
|
|
|
if (locationType.value) params.locationUse = locationType.value
|
|
if (locationType.value) params.locationUse = locationType.value
|
|
|
- if (options.changeTypeName) params.locationType = options.changeTypeName
|
|
|
|
|
- if (fromChangeLocation && uniqueLocationIds) {
|
|
|
|
|
- params.excludedLocations = uniqueLocationIds
|
|
|
|
|
- params.statisticsKey=statisticsKey
|
|
|
|
|
|
|
+ //换一换参数
|
|
|
|
|
+ if (fromChangeLocation) {
|
|
|
|
|
+ const { taskNo, businessNo, lotNum } = item
|
|
|
|
|
+ params.statisticsKey = `${taskNo || businessNo || ''}_${lotNumber || lotNum || ''}`
|
|
|
|
|
+ if (options.changeLocationType) params.locationType = options.changeLocationType
|
|
|
|
|
+ if (options.largerLocationType !== undefined && options.largerLocationType !== null) {
|
|
|
|
|
+ params.largerLocationType = options.largerLocationType
|
|
|
|
|
+ }
|
|
|
|
|
+ //换一换排除库位
|
|
|
|
|
+ if (uniqueLocationIds) {
|
|
|
|
|
+ params.excludedLocations = uniqueLocationIds
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
const res = await getRecommendedLocationNew(params)
|
|
const res = await getRecommendedLocationNew(params)
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
forbidForcePutaway.value = res.data.forbidForcePutaway // 货主策略:是否禁止强制上架
|
|
forbidForcePutaway.value = res.data.forbidForcePutaway // 货主策略:是否禁止强制上架
|
|
|
const loc = res.data.locationList
|
|
const loc = res.data.locationList
|
|
|
locationList.value = loc
|
|
locationList.value = loc
|
|
|
|
|
+ syncLastChangeLocationTypeFromList()
|
|
|
searchCount.value = 1
|
|
searchCount.value = 1
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
@@ -713,21 +766,67 @@ const _getRecommendedLocation = async (item, options = {}) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 换一换:先选库位类型,再请求新的推荐库位
|
|
|
|
|
-const onChangeLocation = () => {
|
|
|
|
|
- if (barcodeActiveList.value.length === 0) return
|
|
|
|
|
- changeLocationTypePickerRef.value?.show(warehouse)
|
|
|
|
|
|
|
+// 换一换
|
|
|
|
|
+const changeLocationPickerRef = ref(null)
|
|
|
|
|
+//换一换禁用状态
|
|
|
|
|
+const getChangeLocationDisabledState = () => {
|
|
|
|
|
+ const noLargerType = !pickLocationTypeFromList(true)
|
|
|
|
|
+ const noSmallerType = !pickLocationTypeFromList(false)
|
|
|
|
|
+ return {
|
|
|
|
|
+ disableLarger: noLargerType && lastChangeLocationDirection.value === true,
|
|
|
|
|
+ disableSmaller: noSmallerType && lastChangeLocationDirection.value === false,
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+//换一换打开
|
|
|
|
|
+const onOpenChangeLocation = () => {
|
|
|
|
|
+ if (barcodeActiveList.value.length === 0 || changeLocationLoading.value) return
|
|
|
|
|
+ changeLocationPickerRef.value?.show(getChangeLocationDisabledState())
|
|
|
}
|
|
}
|
|
|
-const doChangeLocationWithType = async (item) => {
|
|
|
|
|
|
|
+//换一换确认
|
|
|
|
|
+const doChangeLocation = async ({ mode }) => {
|
|
|
if (barcodeActiveList.value.length === 0) return
|
|
if (barcodeActiveList.value.length === 0) return
|
|
|
|
|
+
|
|
|
|
|
+ const reqOpts = { fromChangeLocation: true }
|
|
|
|
|
+
|
|
|
|
|
+ if (mode === 'larger') {
|
|
|
|
|
+ if (getChangeLocationDisabledState().disableLarger) return
|
|
|
|
|
+ const changeLocationType = resolveChangeLocationType(true)
|
|
|
|
|
+ if (!changeLocationType) {
|
|
|
|
|
+ showToast({ duration: 2000, message: '当前无可用库位类型' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ reqOpts.largerLocationType = true
|
|
|
|
|
+ reqOpts.changeLocationType = changeLocationType
|
|
|
|
|
+ } else if (mode === 'smaller') {
|
|
|
|
|
+ if (getChangeLocationDisabledState().disableSmaller) return
|
|
|
|
|
+ const changeLocationType = resolveChangeLocationType(false)
|
|
|
|
|
+ if (!changeLocationType) {
|
|
|
|
|
+ showToast({ duration: 2000, message: '当前无可用库位类型' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ reqOpts.largerLocationType = false
|
|
|
|
|
+ reqOpts.changeLocationType = changeLocationType
|
|
|
|
|
+ } else if (mode === 'overflow') {
|
|
|
|
|
+ const changeLocationType = resolveOverflowLocationType()
|
|
|
|
|
+ if (!changeLocationType) {
|
|
|
|
|
+ showToast({ duration: 2000, message: '当前无可用库位类型' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ reqOpts.changeLocationType = changeLocationType
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
changeLocationLoading.value = true
|
|
changeLocationLoading.value = true
|
|
|
try {
|
|
try {
|
|
|
|
|
+ //换一换获取推荐库位
|
|
|
const batchItem = barcodeActiveList.value[0]
|
|
const batchItem = barcodeActiveList.value[0]
|
|
|
if (locationList.value?.length) {
|
|
if (locationList.value?.length) {
|
|
|
excludedLocations.value = [...excludedLocations.value, ...locationList.value]
|
|
excludedLocations.value = [...excludedLocations.value, ...locationList.value]
|
|
|
}
|
|
}
|
|
|
- const reqOpts = { fromChangeLocation: true }
|
|
|
|
|
- if (item?.value) reqOpts.changeTypeName = item.value
|
|
|
|
|
|
|
+ if (reqOpts.changeLocationType) {
|
|
|
|
|
+ lastChangeLocationType.value = reqOpts.changeLocationType
|
|
|
|
|
+ }
|
|
|
|
|
+ if (mode === 'larger') lastChangeLocationDirection.value = true
|
|
|
|
|
+ else if (mode === 'smaller') lastChangeLocationDirection.value = false
|
|
|
await _getRecommendedLocation(batchItem, reqOpts)
|
|
await _getRecommendedLocation(batchItem, reqOpts)
|
|
|
} finally {
|
|
} finally {
|
|
|
changeLocationLoading.value = false
|
|
changeLocationLoading.value = false
|
|
@@ -735,10 +834,20 @@ const doChangeLocationWithType = async (item) => {
|
|
|
}
|
|
}
|
|
|
const numberRef = ref(null)
|
|
const numberRef = ref(null)
|
|
|
const locationRef = ref(null)
|
|
const locationRef = ref(null)
|
|
|
|
|
+
|
|
|
|
|
+const focusField = async (fieldRef) => {
|
|
|
|
|
+ await nextTick()
|
|
|
|
|
+ try {
|
|
|
|
|
+ fieldRef.value?.focus?.()
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error(e)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 完成收货校验
|
|
// 完成收货校验
|
|
|
const isCheck = async () => {
|
|
const isCheck = async () => {
|
|
|
if (searchLocation.value == '') {
|
|
if (searchLocation.value == '') {
|
|
|
- locationRef.value?.focus()
|
|
|
|
|
|
|
+ await focusField(locationRef)
|
|
|
scanError()
|
|
scanError()
|
|
|
showToast({ duration: 3000, message: '请先扫描库位编号' })
|
|
showToast({ duration: 3000, message: '请先扫描库位编号' })
|
|
|
return false
|
|
return false
|
|
@@ -750,7 +859,7 @@ const isCheck = async () => {
|
|
|
}
|
|
}
|
|
|
// 扫描库位与提交上架共用同一套强制匹配规则
|
|
// 扫描库位与提交上架共用同一套强制匹配规则
|
|
|
if (!isLocationInRecommendedList(searchLocation.value)) {
|
|
if (!isLocationInRecommendedList(searchLocation.value)) {
|
|
|
- locationRef.value?.focus()
|
|
|
|
|
|
|
+ await focusField(locationRef)
|
|
|
scanError()
|
|
scanError()
|
|
|
showToast({ duration: 3000, message: '库位与推荐库位不一致,无法上架' })
|
|
showToast({ duration: 3000, message: '库位与推荐库位不一致,无法上架' })
|
|
|
return false
|
|
return false
|
|
@@ -761,20 +870,20 @@ const isCheck = async () => {
|
|
|
closeLoading()
|
|
closeLoading()
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
searchLocation.value = ''
|
|
searchLocation.value = ''
|
|
|
- locationRef.value?.focus()
|
|
|
|
|
|
|
+ await focusField(locationRef)
|
|
|
scanError()
|
|
scanError()
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (searchCount.value == '') {
|
|
if (searchCount.value == '') {
|
|
|
- numberRef.value?.focus()
|
|
|
|
|
|
|
+ await focusField(numberRef)
|
|
|
scanError()
|
|
scanError()
|
|
|
showToast({ duration: 3000, message: '请先输入上架数量' })
|
|
showToast({ duration: 3000, message: '请先输入上架数量' })
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
const maxQuantity = barcodeQuantity(barcodeActiveList.value)
|
|
const maxQuantity = barcodeQuantity(barcodeActiveList.value)
|
|
|
if (Number(searchCount.value) > maxQuantity) {
|
|
if (Number(searchCount.value) > maxQuantity) {
|
|
|
- numberRef.value?.focus()
|
|
|
|
|
|
|
+ await focusField(numberRef)
|
|
|
scanError()
|
|
scanError()
|
|
|
showToast({ duration: 3000, message: `上架数量最大为:${maxQuantity}` })
|
|
showToast({ duration: 3000, message: `上架数量最大为:${maxQuantity}` })
|
|
|
return false
|
|
return false
|
|
@@ -936,6 +1045,38 @@ window.onRefresh = loadData
|
|
|
display: flex
|
|
display: flex
|
|
|
align-items: center
|
|
align-items: center
|
|
|
|
|
|
|
|
|
|
+ &--location
|
|
|
|
|
+ background: #fff
|
|
|
|
|
+
|
|
|
|
|
+ .location-row
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ align-items: center
|
|
|
|
|
+ height: 50px
|
|
|
|
|
+
|
|
|
|
|
+ .location-search
|
|
|
|
|
+ flex: 1
|
|
|
|
|
+ min-width: 0
|
|
|
|
|
+
|
|
|
|
|
+ .change-location-btn
|
|
|
|
|
+ display: inline-flex
|
|
|
|
|
+ align-items: center
|
|
|
|
|
+ justify-content: center
|
|
|
|
|
+ flex-shrink: 0
|
|
|
|
|
+ height: 22px
|
|
|
|
|
+ margin-right: 8px
|
|
|
|
|
+ padding: 0 8px
|
|
|
|
|
+ font-size: 12px
|
|
|
|
|
+ color: #1989fa
|
|
|
|
|
+ border: 1px solid #1989fa
|
|
|
|
|
+ border-radius: 999px
|
|
|
|
|
+ white-space: nowrap
|
|
|
|
|
+ cursor: pointer
|
|
|
|
|
+ -webkit-tap-highlight-color: transparent
|
|
|
|
|
+
|
|
|
|
|
+ &--loading
|
|
|
|
|
+ opacity: 0.6
|
|
|
|
|
+ pointer-events: none
|
|
|
|
|
+
|
|
|
::v-deep(.van-search__field)
|
|
::v-deep(.van-search__field)
|
|
|
border-bottom: 2px solid #ffffff
|
|
border-bottom: 2px solid #ffffff
|
|
|
display: flex
|
|
display: flex
|
|
@@ -967,23 +1108,6 @@ window.onRefresh = loadData
|
|
|
font-weight: bold
|
|
font-weight: bold
|
|
|
color: #ee0a25
|
|
color: #ee0a25
|
|
|
|
|
|
|
|
- .change-location-btn
|
|
|
|
|
- display: inline-flex
|
|
|
|
|
- align-items: center
|
|
|
|
|
- justify-content: center
|
|
|
|
|
- height: 22px
|
|
|
|
|
- padding: 0 8px
|
|
|
|
|
- font-size: 12px
|
|
|
|
|
- color: #1989fa
|
|
|
|
|
- border: 1px solid #1989fa
|
|
|
|
|
- border-radius: 999px
|
|
|
|
|
- white-space: nowrap
|
|
|
|
|
- flex-shrink: 0
|
|
|
|
|
-
|
|
|
|
|
- &--loading
|
|
|
|
|
- opacity: 0.6
|
|
|
|
|
- pointer-events: none
|
|
|
|
|
-
|
|
|
|
|
.take-lot
|
|
.take-lot
|
|
|
text-align: left
|
|
text-align: left
|
|
|
margin-top: 5px
|
|
margin-top: 5px
|