|
|
@@ -51,7 +51,7 @@
|
|
|
<div class="content">
|
|
|
<div class="c-left">
|
|
|
<div class="c-left-count">{{ item.expectedQuantity }}</div>
|
|
|
- <div class="c-left-tips">数量</div>
|
|
|
+<!-- <div class="c-left-tips">数量</div>-->
|
|
|
</div>
|
|
|
<div class="c-right">
|
|
|
<div style="font-weight: bold;">{{ item.barcode }}</div>
|
|
|
@@ -96,12 +96,13 @@
|
|
|
<container-no-input ref="containerNoInputRef" @setContainer="setContainer" :selectTask="selectTask" />
|
|
|
<!-- 拣货任务号-->
|
|
|
<picking-no-input ref="pickingNoInputRef" @loadData="loadData" />
|
|
|
+ <input-barcode ref="inputBarcodeRef" @setBarcode="_handlerScan" />
|
|
|
<van-floating-bubble v-if="locationList.length>0" :gap="50" axis="xy" magnetic="x" @click="onContainerNo(containerNo===''?2:scanType)">容器</van-floating-bubble>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
-import { showDialog, showToast } from 'vant'
|
|
|
+import { showDialog, showFailToast, showToast } from 'vant'
|
|
|
import { fetchPickingData, getPickingTask } from '@/views/outbound/picking/list/hooks/list'
|
|
|
import { getOwnerList } from '@/hooks/basic'
|
|
|
import { useRouter,useRoute } from 'vue-router'
|
|
|
@@ -121,6 +122,7 @@ import { barcodeToUpperCase } from '@/utils/dataType'
|
|
|
import { containerDef } from '@/views/outbound/picking/list/hooks/containerDef'
|
|
|
import { getCarrierList } from '@/hooks/basic/carrier'
|
|
|
import { basicStore } from '@/store/modules/basic'
|
|
|
+import InputBarcode from '@/views/outbound/components/InputBarcode.vue'
|
|
|
onUnmounted(() => {
|
|
|
closeListener()
|
|
|
})
|
|
|
@@ -205,7 +207,8 @@ const loadData = async (pickingCode) => {
|
|
|
lotNum:item.lotNum,
|
|
|
line:item.line,
|
|
|
operationTime: item.operationTime,
|
|
|
- container: item.container
|
|
|
+ container: item.container,
|
|
|
+ quantity:item.quantity
|
|
|
};
|
|
|
});
|
|
|
if(selectTask.value.length>0){
|
|
|
@@ -224,6 +227,12 @@ const setContainer=(code,type)=>{
|
|
|
onScan(type)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 设置扫码
|
|
|
+const setBarcode=(code)=>{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
// 获取拣货任务号
|
|
|
const getPickingCode= async()=>{
|
|
|
const { pickingCode } = await fetchPickingData(warehouse)
|
|
|
@@ -245,7 +254,7 @@ if(Object.keys(basic.carrierMap).length == 0){
|
|
|
getOwnerData()
|
|
|
// 计算已成功数量
|
|
|
const quantity = computed(() => {
|
|
|
- return taskItem.value.reduce((sum, item) => {
|
|
|
+ return selectTask.value.reduce((sum, item) => {
|
|
|
return Number(sum) + (Number(item.quantity) ?? 0)
|
|
|
}, 0)
|
|
|
})
|
|
|
@@ -264,7 +273,7 @@ const tips = () => {
|
|
|
return '请扫描下一拣货库位'
|
|
|
}else if(scanType.value==3){
|
|
|
return '请扫描商品条码'
|
|
|
- }else {
|
|
|
+ }else if(scanType.value==4){
|
|
|
return messageTips.value
|
|
|
}
|
|
|
}
|
|
|
@@ -297,11 +306,20 @@ const onScan = (type) => {
|
|
|
}
|
|
|
//扫描条码监听
|
|
|
const _handlerScan=(code)=> {
|
|
|
+ if(scanType.value===1){
|
|
|
+ if(code.split('-')[0]!=='JH'){
|
|
|
+ showToast({duration:5000,message:'请使用标准拣货容器'})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ containerNo.value=code
|
|
|
+ onScan(2)
|
|
|
+ return
|
|
|
+ }
|
|
|
scanBarcode.value=code
|
|
|
const modelLocative=locationList.value[activeIndex.value]
|
|
|
if(scanType.value===2){
|
|
|
if(containerNo.value == '') {
|
|
|
- showToast('请先扫描容器号')
|
|
|
+ showToast({duration:5000,message:'请先扫描容器号'})
|
|
|
return
|
|
|
}
|
|
|
if(taskMap.value[code.toUpperCase()]){
|
|
|
@@ -310,10 +328,10 @@ const _handlerScan=(code)=> {
|
|
|
scanSuccess()
|
|
|
}else{
|
|
|
scanError()
|
|
|
- showToast('无效库位!请检查扫描库位')
|
|
|
+ showToast({duration:5000,message:'无效库位!请检查扫描库位'})
|
|
|
}
|
|
|
}
|
|
|
- if(scanType.value===3){
|
|
|
+ if(scanType.value===3 || scanType.value===4 ){
|
|
|
// 将当前库位下的商品条码拿出对比
|
|
|
const barcode = [...new Set(
|
|
|
modelLocative.list
|
|
|
@@ -338,37 +356,39 @@ const _handlerScan=(code)=> {
|
|
|
},200)
|
|
|
}else{
|
|
|
scanError()
|
|
|
- showToast('无效条码!请检查扫描条码')
|
|
|
+ showToast({duration:5000,message:'无效条码!请检查扫描条码'})
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// 进行条件验证
|
|
|
const validate = (data) => {
|
|
|
if (containerNo.value === '') {
|
|
|
- showToast('请先扫描拣货容器');
|
|
|
+ showToast({duration:5000,message:'请先扫描拣货容器'})
|
|
|
return false;
|
|
|
}
|
|
|
if (scanType.value === 2) {
|
|
|
- showToast('请先扫描库位');
|
|
|
+ showToast({duration:5000,message:'请先扫描库位'})
|
|
|
return false;
|
|
|
}
|
|
|
if (scanType.value === 3) {
|
|
|
- showToast('请先扫描条码');
|
|
|
+ showToast({duration:5000,message:'请先扫描条码'})
|
|
|
return false;
|
|
|
}
|
|
|
if (data.count < 0) {
|
|
|
messageTips.value='拣货数量无效'
|
|
|
- showToast('拣货数量无效');
|
|
|
+ showToast({duration:5000,message:'拣货数量无效'})
|
|
|
return false;
|
|
|
}
|
|
|
if (data.count > data.expectedQuantity) {
|
|
|
- showToast('拣货数量不能大于所需数量');
|
|
|
+ showToast({duration:5000,message:'拣货数量不能大于所需数量'})
|
|
|
messageTips.value='拣货数量不能大于所需数量'
|
|
|
return false;
|
|
|
}
|
|
|
if (isLot(selectTask.value, [data])) {
|
|
|
messageTips.value='当前容器下已有其他批次产品,请更换容器号'
|
|
|
- showToast('当前容器下已有其他批次产品,请更换容器号');
|
|
|
+ scanBarcode.value=''
|
|
|
+ showToast({duration:5000,message:'当前容器下已有其他批次产品,请更换容器号'})
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
@@ -393,7 +413,7 @@ const onCount=(item,type)=>{
|
|
|
//扣减库存
|
|
|
setPickingDetail(params).then((res)=>{
|
|
|
jumpLoading.value=false
|
|
|
- if(!res.data){
|
|
|
+ if(res.data==false){
|
|
|
showDialog({
|
|
|
title:'温馨提示',
|
|
|
message:'该库位条码存在取消单,任务已被刷新,请将当前货品归还原库位'
|
|
|
@@ -410,7 +430,8 @@ const onCount=(item,type)=>{
|
|
|
lotNum: data.lotNum,
|
|
|
line:data.line,
|
|
|
operationTime: data.operationTime,
|
|
|
- container:data.container
|
|
|
+ container:data.container,
|
|
|
+ quantity:data.quantity
|
|
|
}
|
|
|
selectTask.value.push(task)
|
|
|
locationList.value[activeIndex.value].list[0].operationTime=params[0].operationTime
|
|
|
@@ -434,6 +455,8 @@ const onCount=(item,type)=>{
|
|
|
})
|
|
|
}
|
|
|
}).catch((err)=>{
|
|
|
+ scanBarcode.value=''
|
|
|
+ onScan(4)
|
|
|
messageTips.value=err.message
|
|
|
scanError()
|
|
|
jumpLoading.value=false
|
|
|
@@ -449,16 +472,20 @@ const jump=(item)=>{
|
|
|
const actions = [
|
|
|
{ name: '任务获取',key:'task' },
|
|
|
{ name: '任务号作业' ,key:'picking'},
|
|
|
+ { name: '检索条码' ,key:'inputBarcode'},
|
|
|
];
|
|
|
const onClickRight = () => {
|
|
|
modeTrueFalseBy.value=true
|
|
|
}
|
|
|
const pickingNoInputRef=ref(null)
|
|
|
+const inputBarcodeRef=ref(null)
|
|
|
const onSelectMode=(value) => {
|
|
|
if(value.key=='task'){
|
|
|
router.push('/picking-task')
|
|
|
}else if(value.key=='picking'){
|
|
|
pickingNoInputRef.value?.show()
|
|
|
+ }else if(value.key=='inputBarcode'){
|
|
|
+ inputBarcodeRef.value?.show()
|
|
|
}
|
|
|
}
|
|
|
//库位商品拣货完成高亮 allActive
|
|
|
@@ -587,7 +614,7 @@ const onRefresh = () => {
|
|
|
font-size: 24px
|
|
|
.c-left-count
|
|
|
font-weight: bold
|
|
|
- font-size: 24px
|
|
|
+ font-size: 30px
|
|
|
.c-right
|
|
|
flex: 0 0 75%
|
|
|
max-width: 75%
|