|
@@ -16,7 +16,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
</van-nav-bar>
|
|
</van-nav-bar>
|
|
|
<div class="blind-task-list">
|
|
<div class="blind-task-list">
|
|
|
- <van-cell-group inset>
|
|
|
|
|
<van-field label-width="70" center class="select" v-model="taskInfo.ownerName" readonly >
|
|
<van-field label-width="70" center class="select" v-model="taskInfo.ownerName" readonly >
|
|
|
<template #label>
|
|
<template #label>
|
|
|
<van-button size="small" plain type="danger" @click="_resetData" >重新清点</van-button>
|
|
<van-button size="small" plain type="danger" @click="_resetData" >重新清点</van-button>
|
|
@@ -26,8 +25,8 @@
|
|
|
<tbody>
|
|
<tbody>
|
|
|
<tr style="border-bottom: 1px solid #ebedf0">
|
|
<tr style="border-bottom: 1px solid #ebedf0">
|
|
|
<td width="70px" style="border-right: 1px solid #ebedf0" >箱号</td>
|
|
<td width="70px" style="border-right: 1px solid #ebedf0" >箱号</td>
|
|
|
- <td width="120px" style="border-right: 1px solid #ebedf0;word-break: break-all" >{{ preBoxNo || '--'}}
|
|
|
|
|
-<!-- <van-icon v-if="preBoxNo" name="edit" color="#0077aa" />-->
|
|
|
|
|
|
|
+ <td width="120px" style="border-right: 1px solid #ebedf0;word-break: break-all" @click="setBoxBarcode">{{ preBoxNo || '--'}}
|
|
|
|
|
+ <van-icon v-if="preBoxNo" name="edit" color="#0077aa" />
|
|
|
</td>
|
|
</td>
|
|
|
<td>
|
|
<td>
|
|
|
<van-field label-width="70" :class="focusType===5?'box-input':'select'" ref="boxNoRef" v-model="boxNo"
|
|
<van-field label-width="70" :class="focusType===5?'box-input':'select'" ref="boxNoRef" v-model="boxNo"
|
|
@@ -40,16 +39,15 @@
|
|
|
<td width="70px" style="border-right: 1px solid #ebedf0" >条码</td>
|
|
<td width="70px" style="border-right: 1px solid #ebedf0" >条码</td>
|
|
|
<td width="120px" style="border-right: 1px solid #ebedf0;word-break: break-all" >{{ preBarcode || '--' }}</td>
|
|
<td width="120px" style="border-right: 1px solid #ebedf0;word-break: break-all" >{{ preBarcode || '--' }}</td>
|
|
|
<td>
|
|
<td>
|
|
|
- <van-field label-width="70" :class="focusType===1?'box-input':'select'" ref="barcodeRef" v-model="barcode"
|
|
|
|
|
- @focus="onFocus(1)" @blur="onFocus(0)" placeholder="请扫描条码" clearable
|
|
|
|
|
- @keydown.enter="_checkBarcode" autocomplete="off" />
|
|
|
|
|
|
|
+ <van-field label-width="70" :class="focusType===1?'box-input':'select'" readonly v-model="boxBarcode"
|
|
|
|
|
+ @focus="onFocus(1)" @blur="onFocus(0)" placeholder="请直接扫描条码" clearable
|
|
|
|
|
+ @click="setBarcodeInput" />
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
- <van-field v-if="modeType!==5" label-width="70" :class="focusType===1?'input':'select'" ref="barcodeRef" v-model="barcode"
|
|
|
|
|
- label="条码" @focus="onFocus(1)" @blur="onFocus(0)" placeholder="请扫描条码" clearable
|
|
|
|
|
- @keydown.enter="_checkBarcode" autocomplete="off" />
|
|
|
|
|
|
|
+ <van-field v-if="modeType!==5" label-width="70" :class="focusType===1?'input':'select'" ref="barcodeRef" readonly v-model="inputBarcode"
|
|
|
|
|
+ label="条码" placeholder="请直接扫描条码" @click="setBarcodeInput" />
|
|
|
<van-grid clickable :column-num="2" v-if="modeType!==3">
|
|
<van-grid clickable :column-num="2" v-if="modeType!==3">
|
|
|
<van-grid-item icon="home-o" text="数量">
|
|
<van-grid-item icon="home-o" text="数量">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
@@ -58,7 +56,7 @@
|
|
|
</van-grid-item>
|
|
</van-grid-item>
|
|
|
<van-grid-item v-if="modeType===0 ">
|
|
<van-grid-item v-if="modeType===0 ">
|
|
|
<template #default>
|
|
<template #default>
|
|
|
- <van-button type="primary" @click="_setBoxBarcode" >装 箱</van-button>
|
|
|
|
|
|
|
+ <van-button type="primary" @click="_setPacking" >装 箱</van-button>
|
|
|
</template>
|
|
</template>
|
|
|
</van-grid-item>
|
|
</van-grid-item>
|
|
|
<van-grid-item text="格口" v-else>
|
|
<van-grid-item text="格口" v-else>
|
|
@@ -72,12 +70,9 @@
|
|
|
<van-button size="mini" type="danger" plain @click="resetNewBin" >取 消</van-button>
|
|
<van-button size="mini" type="danger" plain @click="resetNewBin" >取 消</van-button>
|
|
|
</template>
|
|
</template>
|
|
|
</van-field>
|
|
</van-field>
|
|
|
-
|
|
|
|
|
- </van-cell-group>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<div class="blind-task-table" >
|
|
<div class="blind-task-table" >
|
|
|
- <van-cell-group inset v-if="modeType===5">
|
|
|
|
|
- <div style="display: flex">
|
|
|
|
|
|
|
+ <div style="display: flex" v-if="modeType===5">
|
|
|
<div style="flex: 1">
|
|
<div style="flex: 1">
|
|
|
<table class="task-table-box" >
|
|
<table class="task-table-box" >
|
|
|
<thead>
|
|
<thead>
|
|
@@ -115,9 +110,7 @@
|
|
|
</table>
|
|
</table>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </van-cell-group>
|
|
|
|
|
- <van-cell-group inset v-else>
|
|
|
|
|
- <table class="task-table">
|
|
|
|
|
|
|
+ <table class="task-table" v-else>
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
<th width="120px" >商品条码</th>
|
|
<th width="120px" >商品条码</th>
|
|
@@ -135,7 +128,7 @@
|
|
|
<van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)">修改数量</van-button>
|
|
<van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)">修改数量</van-button>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
- <tr v-for="(item, index) in dataList" :key="index" :class="{'odd-row': Number(index+localData.length) % 2 !== 0}">
|
|
|
|
|
|
|
+ <tr v-for="(item, index) in route.query.typeCode==='1'?binList:dataList" :key="index" :class="{'odd-row': Number(index+localData.length) % 2 !== 0}">
|
|
|
<td>{{ item.barcode }}</td>
|
|
<td>{{ item.barcode }}</td>
|
|
|
<td>{{ modeType === 0 ? item.cartonCode : item.latticeCode }}</td>
|
|
<td>{{ modeType === 0 ? item.cartonCode : item.latticeCode }}</td>
|
|
|
<td>{{ item.qty }}</td>
|
|
<td>{{ item.qty }}</td>
|
|
@@ -145,11 +138,11 @@
|
|
|
</tr>
|
|
</tr>
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
- </van-cell-group>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
<barcode-count ref="barcodeCountRef" @setBarcodeCount="setBarcodeCount" />
|
|
<barcode-count ref="barcodeCountRef" @setBarcodeCount="setBarcodeCount" />
|
|
|
<van-back-top right="15vw" bottom="10vh" />
|
|
<van-back-top right="15vw" bottom="10vh" />
|
|
|
<reset-data ref="resetDataRef" :modeTypeName="modeTypeName" :binData="dataList" @resetData="onResetData" />
|
|
<reset-data ref="resetDataRef" :modeTypeName="modeTypeName" :binData="dataList" @resetData="onResetData" />
|
|
|
|
|
+ <input-barcode ref="inputBarcodeRef" @setBarcode="_handlerScan" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -161,21 +154,25 @@ import {
|
|
|
setBoxBarcodeCount,
|
|
setBoxBarcodeCount,
|
|
|
setBoxCacheData, submitBoxCacheData,
|
|
setBoxCacheData, submitBoxCacheData,
|
|
|
} from '@/api/blind/index.ts'
|
|
} from '@/api/blind/index.ts'
|
|
|
-import { computed, onMounted, ref } from 'vue'
|
|
|
|
|
|
|
+import { computed, nextTick, onMounted, onUnmounted, ref } from 'vue'
|
|
|
import { playVoiceBin, scanError, scanSuccess } from '@/utils/android'
|
|
import { playVoiceBin, scanError, scanSuccess } from '@/utils/android'
|
|
|
import BarcodeCount from '@/views/inbound/blindCollection/components/BarcodeCount.vue'
|
|
import BarcodeCount from '@/views/inbound/blindCollection/components/BarcodeCount.vue'
|
|
|
|
|
+import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
|
|
|
import ResetData from '@/views/inbound/blindCollection/components/ResetData.vue'
|
|
import ResetData from '@/views/inbound/blindCollection/components/ResetData.vue'
|
|
|
import { closeDialog, showConfirmDialog, showDialog, showToast } from 'vant'
|
|
import { closeDialog, showConfirmDialog, showDialog, showToast } from 'vant'
|
|
|
import { barcodeIsData } from '@/views/inbound/blindCollection/task/hooks/barcodeIsData'
|
|
import { barcodeIsData } from '@/views/inbound/blindCollection/task/hooks/barcodeIsData'
|
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
import { binData } from '@/views/inbound/blindCollection/task/hooks/binData'
|
|
import { binData } from '@/views/inbound/blindCollection/task/hooks/binData'
|
|
|
|
|
+import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
//箱号
|
|
//箱号
|
|
|
const boxNo = ref('')
|
|
const boxNo = ref('')
|
|
|
//上一个箱号
|
|
//上一个箱号
|
|
|
const preBoxNo = ref('')
|
|
const preBoxNo = ref('')
|
|
|
//条码
|
|
//条码
|
|
|
-const barcode = ref('')
|
|
|
|
|
|
|
+const inputBarcode = ref('')
|
|
|
|
|
+//条码
|
|
|
|
|
+const boxBarcode = ref('')
|
|
|
//上一个条码
|
|
//上一个条码
|
|
|
const preBarcode=ref('')
|
|
const preBarcode=ref('')
|
|
|
const focusType = ref(0)
|
|
const focusType = ref(0)
|
|
@@ -187,6 +184,7 @@ const modeMap={
|
|
|
const modeType = Number(route.query.typeCode)
|
|
const modeType = Number(route.query.typeCode)
|
|
|
const modeTypeName=modeType===0?'箱号':'格口'
|
|
const modeTypeName=modeType===0?'箱号':'格口'
|
|
|
const barcodeRef = ref(null)
|
|
const barcodeRef = ref(null)
|
|
|
|
|
+const inputBarcodeRef=ref(null)
|
|
|
const boxNoRef = ref(null)
|
|
const boxNoRef = ref(null)
|
|
|
//按箱清点+分货数据
|
|
//按箱清点+分货数据
|
|
|
const dataList=ref([])
|
|
const dataList=ref([])
|
|
@@ -230,44 +228,70 @@ const getTaskInfo = async (taskNo) => {
|
|
|
dataList.value = boxResponse.data;
|
|
dataList.value = boxResponse.data;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ closeListener()
|
|
|
|
|
+})
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ openListener()
|
|
|
getTaskInfo(route.query.code)
|
|
getTaskInfo(route.query.code)
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ scanInit(_handlerScan)
|
|
|
|
|
+ },300)
|
|
|
if(modeType===5){
|
|
if(modeType===5){
|
|
|
focusType.value=5
|
|
focusType.value=5
|
|
|
boxNoRef.value?.focus()
|
|
boxNoRef.value?.focus()
|
|
|
- }else {
|
|
|
|
|
- barcodeRef.value?.focus()
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+const setBoxCode=ref(false)
|
|
|
|
|
+const setBoxBarcode=()=>{
|
|
|
|
|
+ setBoxCode.value=true
|
|
|
|
|
+ inputBarcodeRef.value?.show(boxNo.value,'请扫描箱号')
|
|
|
|
|
+}
|
|
|
|
|
+const _setBoxBarcode=(code)=>{
|
|
|
|
|
+ preBoxNo.value=code
|
|
|
|
|
+ setBoxCode.value=false
|
|
|
|
|
+}
|
|
|
// 验证箱号
|
|
// 验证箱号
|
|
|
const scanBox=()=>{
|
|
const scanBox=()=>{
|
|
|
if (boxNo.value === '') return;
|
|
if (boxNo.value === '') return;
|
|
|
preBoxNo.value=boxNo.value
|
|
preBoxNo.value=boxNo.value
|
|
|
boxNo.value=''
|
|
boxNo.value=''
|
|
|
- barcodeRef.value?.focus()
|
|
|
|
|
|
|
+ boxNoRef.value?.blur()
|
|
|
|
|
+}
|
|
|
|
|
+//设置条码
|
|
|
|
|
+const setBarcodeInput=()=>{
|
|
|
|
|
+ inputBarcodeRef.value?.show(undefined,'扫描商品条码')
|
|
|
|
|
+}
|
|
|
|
|
+const _handlerScan=(code)=>{
|
|
|
|
|
+ if(setBoxCode.value){
|
|
|
|
|
+ _setBoxBarcode(code)
|
|
|
|
|
+ }else {
|
|
|
|
|
+ inputBarcode.value=code.trim()
|
|
|
|
|
+ _checkBarcode()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
// 验证条码
|
|
// 验证条码
|
|
|
const _checkBarcode = () => {
|
|
const _checkBarcode = () => {
|
|
|
const { warehouseCode, ownerCode } = taskInfo.value;
|
|
const { warehouseCode, ownerCode } = taskInfo.value;
|
|
|
- preBarcode.value = barcode.value;
|
|
|
|
|
- barcode.value=''
|
|
|
|
|
- if (preBarcode.value === '') return
|
|
|
|
|
- // 检查条码是否存在列表里
|
|
|
|
|
- const isBarcodeEmpty = barcodeIsData(preBarcode.value, localData.value, dataList.value);
|
|
|
|
|
|
|
+ preBarcode.value=inputBarcode.value
|
|
|
|
|
+ if(inputBarcode.value==='') return
|
|
|
|
|
+ const isBarcodeEmpty = barcodeIsData(inputBarcode.value, localData.value, dataList.value);
|
|
|
// 条码存在列表里设置数据
|
|
// 条码存在列表里设置数据
|
|
|
if (isBarcodeEmpty) {
|
|
if (isBarcodeEmpty) {
|
|
|
- setBarcode(preBarcode.value);
|
|
|
|
|
|
|
+ setBarcode(isBarcodeEmpty.barcode);
|
|
|
} else {
|
|
} else {
|
|
|
const params = {
|
|
const params = {
|
|
|
warehouse: warehouseCode,
|
|
warehouse: warehouseCode,
|
|
|
ownerCode,
|
|
ownerCode,
|
|
|
- barcode:preBarcode.value
|
|
|
|
|
|
|
+ barcode:inputBarcode.value
|
|
|
};
|
|
};
|
|
|
checkBlindBarcode(params).then(res=>{
|
|
checkBlindBarcode(params).then(res=>{
|
|
|
if(res.data){
|
|
if(res.data){
|
|
|
- setBarcode(preBarcode.value)
|
|
|
|
|
|
|
+ setBarcode(res.data.barCode)
|
|
|
}
|
|
}
|
|
|
}).catch((err)=>{
|
|
}).catch((err)=>{
|
|
|
|
|
+ inputBarcode.value=''
|
|
|
scanError();
|
|
scanError();
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -275,7 +299,7 @@ const _checkBarcode = () => {
|
|
|
};
|
|
};
|
|
|
// 设置条码的处理
|
|
// 设置条码的处理
|
|
|
const setBarcode = (curBarcode) => {
|
|
const setBarcode = (curBarcode) => {
|
|
|
- barcode.value = '';
|
|
|
|
|
|
|
+ inputBarcode.value=''
|
|
|
const { code } = taskInfo.value;
|
|
const { code } = taskInfo.value;
|
|
|
switch (modeType) {
|
|
switch (modeType) {
|
|
|
case 5:
|
|
case 5:
|
|
@@ -327,7 +351,7 @@ const setLocalData=(barCode,type)=>{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//装箱
|
|
//装箱
|
|
|
-const _setBoxBarcode=()=>{
|
|
|
|
|
|
|
+const _setPacking=()=>{
|
|
|
const data=loadLocalData(taskInfo.value.code)
|
|
const data=loadLocalData(taskInfo.value.code)
|
|
|
if(data.length===0) {
|
|
if(data.length===0) {
|
|
|
showToast({duration:5000,message:'当前无需要装箱数据'})
|
|
showToast({duration:5000,message:'当前无需要装箱数据'})
|
|
@@ -391,7 +415,6 @@ const setBarcodeCount=(count)=>{
|
|
|
setBoxBarcodeCount(data).then(res=>{
|
|
setBoxBarcodeCount(data).then(res=>{
|
|
|
dataList.value = res.data
|
|
dataList.value = res.data
|
|
|
scanSuccess()
|
|
scanSuccess()
|
|
|
- barcodeRef.value?.focus();
|
|
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
scanError()
|
|
scanError()
|
|
|
})
|
|
})
|
|
@@ -428,7 +451,6 @@ const onResetData = (bin, type) => {
|
|
|
if(modeType===5){
|
|
if(modeType===5){
|
|
|
boxNoRef.value?.focus()
|
|
boxNoRef.value?.focus()
|
|
|
}else {
|
|
}else {
|
|
|
- barcodeRef.value?.focus();
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
})
|
|
})
|
|
@@ -463,7 +485,6 @@ const resetNewBin = () => {
|
|
|
}else {
|
|
}else {
|
|
|
localStorage.removeItem(`task_${taskInfo.value.code}`);
|
|
localStorage.removeItem(`task_${taskInfo.value.code}`);
|
|
|
}
|
|
}
|
|
|
- barcodeRef.value?.focus()
|
|
|
|
|
} else {
|
|
} else {
|
|
|
const bin = modeType === 0 ? cartonCode : latticeCode;
|
|
const bin = modeType === 0 ? cartonCode : latticeCode;
|
|
|
onResetData(bin, 'bin');
|
|
onResetData(bin, 'bin');
|
|
@@ -498,8 +519,10 @@ const onClickRight = () => {
|
|
|
</script>
|
|
</script>
|
|
|
<style scoped lang="sass">
|
|
<style scoped lang="sass">
|
|
|
.blind-task-list
|
|
.blind-task-list
|
|
|
- padding: 10px 0
|
|
|
|
|
|
|
+ padding-bottom: 10px
|
|
|
font-size: 14px
|
|
font-size: 14px
|
|
|
|
|
+ ::v-deep(.van-button)
|
|
|
|
|
+ border-radius: 0
|
|
|
.select
|
|
.select
|
|
|
padding: 10px 15px
|
|
padding: 10px 15px
|
|
|
.box-input
|
|
.box-input
|
|
@@ -556,4 +579,6 @@ const onClickRight = () => {
|
|
|
background: #ffe9d8
|
|
background: #ffe9d8
|
|
|
.task-table tbody tr.odd-row
|
|
.task-table tbody tr.odd-row
|
|
|
background-color: #e4f2ff
|
|
background-color: #e4f2ff
|
|
|
|
|
+ .task-table ::v-deep(.van-button)
|
|
|
|
|
+ border-radius: 0
|
|
|
</style>
|
|
</style>
|