|
@@ -14,7 +14,9 @@
|
|
|
<div class="take-info">
|
|
<div class="take-info">
|
|
|
<div class="take-info-no">
|
|
<div class="take-info-no">
|
|
|
<div class="info-no-tips">
|
|
<div class="info-no-tips">
|
|
|
- <div>货主:<span style="color: #333;font-weight: bold;">{{ ownerMap[taskInfo.owner] || '--' }}</span></div>
|
|
|
|
|
|
|
+ <div>货主: <span style="color: #333;font-weight: bold;" v-if="barcodeActiveList.length>0">{{ ownerMap[barcodeActiveList[0].owner] || barcodeActiveList[0].owner }}</span>
|
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
|
+ </div>
|
|
|
<div>待上架数:<span style="color: #0077ff;font-weight: bold;">{{ totalQuantity || 0 }}</span></div>
|
|
<div>待上架数:<span style="color: #0077ff;font-weight: bold;">{{ totalQuantity || 0 }}</span></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -159,7 +161,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, batchPutawayNew, getWaitPutawayInfo, getWaitPutawayInfoNew } from '@/api/putaway/index'
|
|
|
|
|
|
|
+import { getWaitPutawayListNew, setPutawayNew } 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'
|
|
@@ -263,8 +265,8 @@ const setBarcode = (code, type) => {
|
|
|
formattedTime.value = '00:00:00'
|
|
formattedTime.value = '00:00:00'
|
|
|
totalSeconds.value = 0
|
|
totalSeconds.value = 0
|
|
|
}
|
|
}
|
|
|
- const params = { warehouse, container: code }
|
|
|
|
|
- getWaitPutawayInfo(params).then(res => {
|
|
|
|
|
|
|
+ const params = { warehouseId:warehouse, containerId: code }
|
|
|
|
|
+ getWaitPutawayListNew(params).then(res => {
|
|
|
reset()
|
|
reset()
|
|
|
scanType.value=2
|
|
scanType.value=2
|
|
|
back.value = true
|
|
back.value = true
|
|
@@ -272,52 +274,33 @@ const setBarcode = (code, type) => {
|
|
|
currentTime.value = getCurrentTime()
|
|
currentTime.value = getCurrentTime()
|
|
|
startTimer()
|
|
startTimer()
|
|
|
}
|
|
}
|
|
|
- if (res.data.length > 0) {
|
|
|
|
|
- taskInfo.value = res.data[0]
|
|
|
|
|
- dataList.value = res.data
|
|
|
|
|
- dataMap.value = groupedData(res.data)
|
|
|
|
|
|
|
+ if (res.data.asnToShelfList.length > 0 || res.data.noAsnToShelfList.length>0 ) {
|
|
|
|
|
+ const asnToShelfList = res.data.asnToShelfList.map(item => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ type:'asn'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ const noAsnToShelfList = res.data.noAsnToShelfList.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,
|
|
|
|
|
+ type:'noAsn'
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ dataList.value = [...asnToShelfList,...noAsnToShelfList]
|
|
|
|
|
+ dataMap.value = groupedData(dataList.value)
|
|
|
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 = {}
|
|
|
|
|
dataMap.value = {}
|
|
dataMap.value = {}
|
|
|
dataList.value = []
|
|
dataList.value = []
|
|
|
inputBarcodeRef.value?.show('', '请扫描容器号', '暂无待上架信息')
|
|
inputBarcodeRef.value?.show('', '请扫描容器号', '暂无待上架信息')
|
|
@@ -325,7 +308,6 @@ const _getWaitPutawayInfoNew=(params)=>{
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
reset()
|
|
reset()
|
|
|
- taskInfo.value = {}
|
|
|
|
|
dataMap.value = {}
|
|
dataMap.value = {}
|
|
|
dataList.value = []
|
|
dataList.value = []
|
|
|
inputBarcodeRef.value?.show('', '请扫描容器号', err.message)
|
|
inputBarcodeRef.value?.show('', '请扫描容器号', err.message)
|
|
@@ -333,7 +315,6 @@ const _getWaitPutawayInfoNew=(params)=>{
|
|
|
}).finally(() => {
|
|
}).finally(() => {
|
|
|
closeLoading()
|
|
closeLoading()
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
//根据条码批次分组数据
|
|
//根据条码批次分组数据
|
|
|
const groupedData = (data) => {
|
|
const groupedData = (data) => {
|
|
@@ -466,14 +447,15 @@ const isCheck = () => {
|
|
|
const onConfirm = () => {
|
|
const onConfirm = () => {
|
|
|
if (isCheck()) {
|
|
if (isCheck()) {
|
|
|
const quantity = searchCount.value
|
|
const quantity = searchCount.value
|
|
|
- const data = []
|
|
|
|
|
|
|
+ const asnDoShelfList = []
|
|
|
|
|
+ const noAsnDoShelfList=[]
|
|
|
const list = structuredClone(barcodeActiveList.value) // 深拷贝,保证原始数据不被修改
|
|
const list = structuredClone(barcodeActiveList.value) // 深拷贝,保证原始数据不被修改
|
|
|
let remainingQuantity = quantity
|
|
let remainingQuantity = quantity
|
|
|
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)
|
|
|
- if(putweayType.value=='def'){
|
|
|
|
|
- data.push({
|
|
|
|
|
|
|
+ if(list[i].type=='asn'){
|
|
|
|
|
+ asnDoShelfList.push({
|
|
|
taskNo,
|
|
taskNo,
|
|
|
taskLineNo,
|
|
taskLineNo,
|
|
|
warehouse,
|
|
warehouse,
|
|
@@ -482,7 +464,7 @@ const onConfirm = () => {
|
|
|
quantity: takeQuantity, // 当前项扣除的数量
|
|
quantity: takeQuantity, // 当前项扣除的数量
|
|
|
})
|
|
})
|
|
|
}else {
|
|
}else {
|
|
|
- data.push({
|
|
|
|
|
|
|
+ noAsnDoShelfList.push({
|
|
|
id:taskLineNo,
|
|
id:taskLineNo,
|
|
|
location:searchLocation.value,
|
|
location:searchLocation.value,
|
|
|
qty:takeQuantity
|
|
qty:takeQuantity
|
|
@@ -491,11 +473,7 @@ const onConfirm = () => {
|
|
|
remainingQuantity -= takeQuantity
|
|
remainingQuantity -= takeQuantity
|
|
|
}
|
|
}
|
|
|
showLoading()
|
|
showLoading()
|
|
|
- let url=batchPutaway
|
|
|
|
|
- if(putweayType.value=='new'){
|
|
|
|
|
- url=batchPutawayNew
|
|
|
|
|
- }
|
|
|
|
|
- url(data).then(res => {
|
|
|
|
|
|
|
+ setPutawayNew({asnDoShelfList,noAsnDoShelfList}).then(res => {
|
|
|
if (totalQuantity.value - Number(searchCount.value) == 0) {
|
|
if (totalQuantity.value - Number(searchCount.value) == 0) {
|
|
|
containerNo.value = ''
|
|
containerNo.value = ''
|
|
|
dataMap.value = {}
|
|
dataMap.value = {}
|