|
@@ -75,7 +75,7 @@
|
|
|
>
|
|
>
|
|
|
<template #right-icon>
|
|
<template #right-icon>
|
|
|
<van-button
|
|
<van-button
|
|
|
- v-if="forcePublishEnabled && barcodeActiveList.length > 0"
|
|
|
|
|
|
|
+ v-if="barcodeActiveList.length > 0"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
plain
|
|
plain
|
|
@@ -133,7 +133,7 @@
|
|
|
<div class="btn" type="primary" size="large" round style="height: 36px" @click="onConfirm">上架</div>
|
|
<div class="btn" type="primary" size="large" round style="height: 36px" @click="onConfirm">上架</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <location-list :locationList="locationList" :legacy="!forcePublishEnabled" />
|
|
|
|
|
|
|
+ <location-list :locationList="locationList" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -157,7 +157,7 @@
|
|
|
<van-action-sheet v-model:show="locationTrueFalseBy" cancel-text="取消" description="推荐库位列表"
|
|
<van-action-sheet v-model:show="locationTrueFalseBy" cancel-text="取消" description="推荐库位列表"
|
|
|
close-on-click-action>
|
|
close-on-click-action>
|
|
|
<div style="max-height: 60vh;overflow: auto;">
|
|
<div style="max-height: 60vh;overflow: auto;">
|
|
|
- <location-list :locationList="locationList" :legacy="!forcePublishEnabled" />
|
|
|
|
|
|
|
+ <location-list :locationList="locationList" />
|
|
|
</div>
|
|
</div>
|
|
|
</van-action-sheet>
|
|
</van-action-sheet>
|
|
|
<!-- 组合商品上架数量-->
|
|
<!-- 组合商品上架数量-->
|
|
@@ -179,8 +179,7 @@ import { getCurrentTime } from '@/utils/date'
|
|
|
import { getWaitPutawayListNew, setPutawayNew } from '@/api/putaway/index'
|
|
import { getWaitPutawayListNew, setPutawayNew } from '@/api/putaway/index'
|
|
|
import { getListCombineSku } from '@/api/picking'
|
|
import { getListCombineSku } from '@/api/picking'
|
|
|
import { barcodeToUpperCase } from '@/utils/dataType.js'
|
|
import { barcodeToUpperCase } from '@/utils/dataType.js'
|
|
|
-import { getRecommendedLocation, getRecommendedLocationNew } from '@/api/haikang/index'
|
|
|
|
|
-import { findSysParamByKey } from '@/api/basic/index'
|
|
|
|
|
|
|
+import { getRecommendedLocationNew } from '@/api/haikang/index'
|
|
|
import { getOwnerList } from '@/hooks/basic/index'
|
|
import { getOwnerList } from '@/hooks/basic/index'
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -191,27 +190,12 @@ try {
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
router.push('/login')
|
|
router.push('/login')
|
|
|
}
|
|
}
|
|
|
-/** 查询参数配置-精准推荐是否开启 */
|
|
|
|
|
-const forcePublishEnabled = ref(true)
|
|
|
|
|
-async function loadForcePublishParam() {
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await findSysParamByKey({ paramKey: 'FORCE_PUBLISH_ENABLED' })
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- if (res?.data && res.data=='true') {
|
|
|
|
|
- forcePublishEnabled.value = true
|
|
|
|
|
- }else{
|
|
|
|
|
- forcePublishEnabled.value = false
|
|
|
|
|
- }
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- console.error(e)
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
|
|
+/** 精准推荐是否开启 */
|
|
|
|
|
+const forcePublishEnabled = ref(false)
|
|
|
// 页面初始化
|
|
// 页面初始化
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
openListener()
|
|
openListener()
|
|
|
scanInit(_handlerScan)
|
|
scanInit(_handlerScan)
|
|
|
- await loadForcePublishParam()
|
|
|
|
|
loadData()
|
|
loadData()
|
|
|
})
|
|
})
|
|
|
const warehouse = store.warehouse
|
|
const warehouse = store.warehouse
|
|
@@ -403,7 +387,7 @@ const matchingBarcodeItem = (data, barcode) => {
|
|
|
const switchTask = () => {
|
|
const switchTask = () => {
|
|
|
inputBarcodeType.value = 'switchTask'
|
|
inputBarcodeType.value = 'switchTask'
|
|
|
back.value = false
|
|
back.value = false
|
|
|
- if (forcePublishEnabled.value) excludedLocations.value = {}
|
|
|
|
|
|
|
+ excludedLocations.value = {}
|
|
|
inputBarcodeRef.value?.show('', `请扫描容器号`, '')
|
|
inputBarcodeRef.value?.show('', `请扫描容器号`, '')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -559,23 +543,14 @@ const _handlerScan = (code) => {
|
|
|
scanSuccess()
|
|
scanSuccess()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-// 获取推荐库位(false:master GET 多行列表;true:精准推荐 POST)
|
|
|
|
|
|
|
+// 获取推荐库位
|
|
|
const _getRecommendedLocation = async (item, options = {}) => {
|
|
const _getRecommendedLocation = async (item, options = {}) => {
|
|
|
const { fromChangeLocation = false } = options
|
|
const { fromChangeLocation = false } = options
|
|
|
const { lotNumber, owner } = item
|
|
const { lotNumber, owner } = item
|
|
|
- if (!forcePublishEnabled.value) {
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await getRecommendedLocation({ warehouse, lotNum: lotNumber, owner })
|
|
|
|
|
- locationList.value = res.data || []
|
|
|
|
|
- } catch (err) {
|
|
|
|
|
- console.error(err)
|
|
|
|
|
- }
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
const { sku, quantity, lotAtt08 } = item
|
|
const { sku, quantity, lotAtt08 } = item
|
|
|
const listByLot = fromChangeLocation ? (excludedLocations.value[lotNumber] || []) : []
|
|
const listByLot = fromChangeLocation ? (excludedLocations.value[lotNumber] || []) : []
|
|
|
const uniqueLocationIds = listByLot.length > 0
|
|
const uniqueLocationIds = listByLot.length > 0
|
|
|
- ? [...new Set(listByLot.map(loc => loc.locationId))]
|
|
|
|
|
|
|
+ ? [...new Set(listByLot.map(loc => loc.locationId).filter(Boolean))]
|
|
|
: undefined
|
|
: undefined
|
|
|
try {
|
|
try {
|
|
|
const params = { warehouse, lotNum: lotNumber, owner, sku, qty: quantity, lotAtt08 }
|
|
const params = { warehouse, lotNum: lotNumber, owner, sku, qty: quantity, lotAtt08 }
|
|
@@ -583,7 +558,8 @@ const _getRecommendedLocation = async (item, options = {}) => {
|
|
|
if (containerNo.value?.includes('TH-')) params.scene = 'RETURN_SHELVE'
|
|
if (containerNo.value?.includes('TH-')) params.scene = 'RETURN_SHELVE'
|
|
|
const res = await getRecommendedLocationNew(params)
|
|
const res = await getRecommendedLocationNew(params)
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
- const loc = res.data.location ?? res.data
|
|
|
|
|
|
|
+ forcePublishEnabled.value = res.data.forbidForcePutaway
|
|
|
|
|
+ const loc = res.data
|
|
|
if (fromChangeLocation) {
|
|
if (fromChangeLocation) {
|
|
|
// 按批次维度存储已推荐库位,用于后续换一换排除
|
|
// 按批次维度存储已推荐库位,用于后续换一换排除
|
|
|
const lotExcluded = excludedLocations.value[lotNumber] || []
|
|
const lotExcluded = excludedLocations.value[lotNumber] || []
|
|
@@ -592,7 +568,7 @@ const _getRecommendedLocation = async (item, options = {}) => {
|
|
|
[lotNumber]: [...lotExcluded, loc]
|
|
[lotNumber]: [...lotExcluded, loc]
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- locationList.value = [res.data]
|
|
|
|
|
|
|
+ locationList.value = [loc]
|
|
|
searchCount.value = 1
|
|
searchCount.value = 1
|
|
|
}
|
|
}
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
@@ -602,7 +578,6 @@ const _getRecommendedLocation = async (item, options = {}) => {
|
|
|
|
|
|
|
|
// 换一换:请求新的推荐库位,排除当前批次已推荐过的
|
|
// 换一换:请求新的推荐库位,排除当前批次已推荐过的
|
|
|
const onChangeLocation = async () => {
|
|
const onChangeLocation = async () => {
|
|
|
- if (!forcePublishEnabled.value) return
|
|
|
|
|
if (barcodeActiveList.value.length > 0) {
|
|
if (barcodeActiveList.value.length > 0) {
|
|
|
changeLocationLoading.value = true
|
|
changeLocationLoading.value = true
|
|
|
try {
|
|
try {
|