|
|
@@ -159,7 +159,7 @@ import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
import { useStore } from '@/store/modules/user'
|
|
|
import { showNotify, showToast } from 'vant'
|
|
|
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 { getRecommendedLocation } from '@/api/haikang/index'
|
|
|
import { getOwnerList } from '@/hooks/basic/index'
|
|
|
@@ -199,7 +199,7 @@ const taskInfo = ref({})
|
|
|
//开始时间
|
|
|
const currentTime = ref('--')
|
|
|
const scanType = ref(2)
|
|
|
-
|
|
|
+const putweayType=ref('def')
|
|
|
const lotAttributes = {
|
|
|
lotAtt01: { title: '生产日期' },
|
|
|
lotAtt02: { title: '失效日期' },
|
|
|
@@ -278,6 +278,43 @@ const setBarcode = (code, type) => {
|
|
|
dataMap.value = groupedData(res.data)
|
|
|
containerNo.value = code
|
|
|
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 {
|
|
|
reset()
|
|
|
taskInfo.value = {}
|
|
|
@@ -296,6 +333,7 @@ const setBarcode = (code, type) => {
|
|
|
}).finally(() => {
|
|
|
closeLoading()
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
//根据条码批次分组数据
|
|
|
const groupedData = (data) => {
|
|
|
@@ -434,18 +472,30 @@ const onConfirm = () => {
|
|
|
for (let i = 0; i < list.length && remainingQuantity > 0; i++) {
|
|
|
const { taskNo, taskLineNo, warehouse, quantity } = list[i]
|
|
|
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
|
|
|
}
|
|
|
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) {
|
|
|
containerNo.value = ''
|
|
|
dataMap.value = {}
|