瀏覽代碼

宝时快上-库位验证增加参数

zhaohuanhuan 2 天之前
父節點
當前提交
e0ed42e01d
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 2 1
      src/api/basic/index.ts
  2. 6 1
      src/views/inbound/putaway/task/index.vue

+ 2 - 1
src/api/basic/index.ts

@@ -59,7 +59,8 @@ export function existsLocationTypeMaxQty(data: {
   warehouse: string
   warehouse: string
   owner: string
   owner: string
   sku: string
   sku: string
-  location: string
+  location: string,
+  locationUse: string
 }) {
 }) {
   return request({
   return request({
     url: '/api/basic/location/resource/existsLocationTypeMaxQty',
     url: '/api/basic/location/resource/existsLocationTypeMaxQty',

+ 6 - 1
src/views/inbound/putaway/task/index.vue

@@ -225,12 +225,14 @@ const validateCustomPutawayLocation = async (locationCode) => {
   if (isScannedLocationInRecommendedList(locationCode)) return true
   if (isScannedLocationInRecommendedList(locationCode)) return true
   const batchItem = barcodeActiveList.value[0]
   const batchItem = barcodeActiveList.value[0]
   if (!batchItem) return false
   if (!batchItem) return false
+  if(!searchLocation.value) return false
   try {
   try {
     const res = await existsLocationTypeMaxQty({
     const res = await existsLocationTypeMaxQty({
       warehouse,
       warehouse,
       owner: batchItem.owner,
       owner: batchItem.owner,
       sku: batchItem.sku,
       sku: batchItem.sku,
       location: locationCode,
       location: locationCode,
+      locationUse:locationType.value
     })
     })
     if (res?.data === true) {
     if (res?.data === true) {
       showNotify({ type: 'warning', duration: 3000, message: '请按系统推荐库位上架' })
       showNotify({ type: 'warning', duration: 3000, message: '请按系统推荐库位上架' })
@@ -303,7 +305,7 @@ const syncLastChangeLocationTypeFromList = () => {
 const resolveChangeLocationType = (larger) => {
 const resolveChangeLocationType = (larger) => {
   const fromList = pickLocationTypeFromList(larger)
   const fromList = pickLocationTypeFromList(larger)
   if (fromList) return fromList
   if (fromList) return fromList
-  if (larger && lastChangeLocationType.value) return lastChangeLocationType.value
+  if (lastChangeLocationType.value) return lastChangeLocationType.value
   return ''
   return ''
 }
 }
 //换一换使用的库位类型(换大的或换小的)
 //换一换使用的库位类型(换大的或换小的)
@@ -776,6 +778,9 @@ const changeLocationPickerRef = ref(null)
 const getChangeLocationDisabledState = () => {
 const getChangeLocationDisabledState = () => {
   const noLargerType = !pickLocationTypeFromList(true)
   const noLargerType = !pickLocationTypeFromList(true)
   const noSmallerType = !pickLocationTypeFromList(false)
   const noSmallerType = !pickLocationTypeFromList(false)
+  if (noLargerType && noSmallerType && !lastChangeLocationType.value) {
+    return { disableLarger: true, disableSmaller: true }
+  }
   return {
   return {
     disableLarger: noLargerType && lastChangeLocationDirection.value === true,
     disableLarger: noLargerType && lastChangeLocationDirection.value === true,
     disableSmaller: noSmallerType && lastChangeLocationDirection.value === false,
     disableSmaller: noSmallerType && lastChangeLocationDirection.value === false,