Ver Fonte

上架-支持退货上架

zhaohuanhuan há 5 meses atrás
pai
commit
dcd9a4af6b
3 ficheiros alterados com 105 adições e 12 exclusões
  1. 27 1
      src/api/putaway/index.ts
  2. 17 0
      src/types/putaway.ts
  3. 61 11
      src/views/inbound/putaway/task/index.vue

+ 27 - 1
src/api/putaway/index.ts

@@ -1,7 +1,7 @@
 // @ts-ignore
 // @ts-ignore
 import request from '@/utils/request'
 import request from '@/utils/request'
 // @ts-ignore
 // @ts-ignore
-import { batchPutawayType, getWaitPutawayInfoType } from '@/types/putaway'
+import { batchPutawayNewType, batchPutawayType, getWaitPutawayInfoNewType, getWaitPutawayInfoType} from '@/types/putaway'
 
 
 /**
 /**
  * 批量上架
  * 批量上架
@@ -14,6 +14,19 @@ export function batchPutaway(data:batchPutawayType) {
     data
     data
   })
   })
 }
 }
+/**
+ * 批量上架
+ * @param data
+ */
+export function batchPutawayNew(data:batchPutawayNewType) {
+  return request({
+    url: '/api/wms/app/inbound-self/shelf',
+    method: 'post',
+    data
+  })
+}
+
+
 
 
 /**
 /**
  * 获取待上架信息
  * 获取待上架信息
@@ -26,3 +39,16 @@ export function getWaitPutawayInfo(params:getWaitPutawayInfoType) {
     params
     params
   })
   })
 }
 }
+/**
+ * 获取待上架列表-退货上架
+ * @param params
+ */
+export function getWaitPutawayInfoNew(params:getWaitPutawayInfoNewType) {
+  return request({
+    url: '/api/wms/app/inbound-self/toShelf/list',
+    method: 'get',
+    params
+  })
+}
+
+

+ 17 - 0
src/types/putaway.ts

@@ -12,6 +12,16 @@ export interface batchPutawayType {
   [property: string]: any;
   [property: string]: any;
 }
 }
 
 
+/**
+ * 批量上架
+ */
+export interface batchPutawayNewType {
+  seqId?: string;
+  locationId?: string;
+  qty?: number;
+  [property: string]: any;
+}
+
 /**
 /**
  * 上架任务列表
  * 上架任务列表
  */
  */
@@ -20,3 +30,10 @@ export interface getWaitPutawayInfoType {
   warehouse: string;
   warehouse: string;
 }
 }
 
 
+/**
+ * 上架任务列表
+ */
+export interface getWaitPutawayInfoNewType {
+  containerId: string;
+  warehouseId: string;
+}

+ 61 - 11
src/views/inbound/putaway/task/index.vue

@@ -159,7 +159,7 @@ import { closeLoading, showLoading } from '@/utils/loading'
 import { useStore } from '@/store/modules/user'
 import { useStore } from '@/store/modules/user'
 import { showNotify, showToast } from 'vant'
 import { showNotify, showToast } from 'vant'
 import { getCurrentTime } from '@/utils/date'
 import { getCurrentTime } from '@/utils/date'
-import { batchPutaway, getWaitPutawayInfo } from '@/api/putaway/index'
+import { batchPutaway, batchPutawayNew, getWaitPutawayInfo, getWaitPutawayInfoNew } from '@/api/putaway/index'
 import { barcodeToUpperCase } from '@/utils/dataType.js'
 import { barcodeToUpperCase } from '@/utils/dataType.js'
 import { getRecommendedLocation } from '@/api/haikang/index'
 import { getRecommendedLocation } from '@/api/haikang/index'
 import { getOwnerList } from '@/hooks/basic/index'
 import { getOwnerList } from '@/hooks/basic/index'
@@ -199,7 +199,7 @@ const taskInfo = ref({})
 //开始时间
 //开始时间
 const currentTime = ref('--')
 const currentTime = ref('--')
 const scanType = ref(2)
 const scanType = ref(2)
-
+const putweayType=ref('def')
 const lotAttributes = {
 const lotAttributes = {
   lotAtt01: { title: '生产日期' },
   lotAtt01: { title: '生产日期' },
   lotAtt02: { title: '失效日期' },
   lotAtt02: { title: '失效日期' },
@@ -278,6 +278,43 @@ const setBarcode = (code, type) => {
       dataMap.value = groupedData(res.data)
       dataMap.value = groupedData(res.data)
       containerNo.value = code
       containerNo.value = code
       scanSuccess()
       scanSuccess()
+      putweayType.value='def'
+    } else {
+      _getWaitPutawayInfoNew({ warehouseId:warehouse, containerId: code })
+    }
+  }).catch(err => {
+    reset()
+    taskInfo.value = {}
+    dataMap.value = {}
+    dataList.value = []
+    inputBarcodeRef.value?.show('', '请扫描容器号', err.message)
+    scanError()
+  }).finally(() => {
+    closeLoading()
+  })
+}
+const _getWaitPutawayInfoNew=(params)=>{
+  getWaitPutawayInfoNew(params).then(res => {
+    const list = res.data.map(item => {
+      return {
+        ...item,
+        lotNumber: item.lotNum,
+        lotAtt01: item.productDate,
+        lotAtt02: item.expireDate,
+        lotAtt04: item.productNum,
+        lotAtt08: item.quality,
+        quantity: item.remainShelfQty,
+        taskLineNo: item.id,
+        owner:item.customer
+      }
+    })
+    if (list.length > 0) {
+      putweayType.value='new'
+      taskInfo.value = list[0]
+      dataList.value = list
+      dataMap.value = groupedData(list)
+      containerNo.value = params.containerId
+      scanSuccess()
     } else {
     } else {
       reset()
       reset()
       taskInfo.value = {}
       taskInfo.value = {}
@@ -296,6 +333,7 @@ const setBarcode = (code, type) => {
   }).finally(() => {
   }).finally(() => {
     closeLoading()
     closeLoading()
   })
   })
+
 }
 }
 //根据条码批次分组数据
 //根据条码批次分组数据
 const groupedData = (data) => {
 const groupedData = (data) => {
@@ -434,18 +472,30 @@ const onConfirm = () => {
     for (let i = 0; i < list.length && remainingQuantity > 0; i++) {
     for (let i = 0; i < list.length && remainingQuantity > 0; i++) {
       const { taskNo, taskLineNo, warehouse, quantity } = list[i]
       const { taskNo, taskLineNo, warehouse, quantity } = list[i]
       const takeQuantity = Math.min(quantity, remainingQuantity)
       const takeQuantity = Math.min(quantity, remainingQuantity)
-      data.push({
-        taskNo,
-        taskLineNo,
-        warehouse,
-        container: '*',
-        targetCode: searchLocation.value,
-        quantity: takeQuantity, // 当前项扣除的数量
-      })
+      if(putweayType.value=='def'){
+        data.push({
+          taskNo,
+          taskLineNo,
+          warehouse,
+          container: '*',
+          targetCode: searchLocation.value,
+          quantity: takeQuantity, // 当前项扣除的数量
+        })
+      }else {
+        data.push({
+          id:taskLineNo,
+          location:searchLocation.value,
+          qty:takeQuantity
+        })
+      }
       remainingQuantity -= takeQuantity
       remainingQuantity -= takeQuantity
     }
     }
     showLoading()
     showLoading()
-    batchPutaway(data).then(res => {
+    let url=batchPutaway
+    if(putweayType.value=='new'){
+      url=batchPutawayNew
+    }
+    url(data).then(res => {
       if (totalQuantity.value - Number(searchCount.value) == 0) {
       if (totalQuantity.value - Number(searchCount.value) == 0) {
         containerNo.value = ''
         containerNo.value = ''
         dataMap.value = {}
         dataMap.value = {}