zhaohuanhuan 1 рік тому
батько
коміт
e6b858f487

+ 2 - 2
src/router/index.ts

@@ -22,8 +22,8 @@ const routes: RouteRecordRaw[] = [
     component: () => import('@/views/outbound/picking/task/index.vue')
   },
   {
-    path: '/mode',
-    name: 'BlindMode',
+    path: '/blind-receiving',
+    name: 'BlindReceiving',
     component: () => import('@/views/inbound/blindCollection/mode/index.vue')
   },
   {

+ 1 - 0
src/style.css

@@ -73,6 +73,7 @@ table{
 .container{
   height: 100vh;
   width: 100%;
+  overflow: auto;
 }
 
 @media (prefers-color-scheme: light) {

+ 1 - 5
src/views/inbound/blindCollection/components/ResetData.vue

@@ -41,13 +41,9 @@ const show = async () => {
     new Promise(async (resolve) => {
       if (action === 'confirm') {
         if (bin.value == '') {
-          showToast('请输入格口号')
+          showToast(`请输入${props.value.modeTypeName}!!!`)
           return resolve(false)
         }
-        // if (bin.value>props.binData?.length) {
-        //   showToast({duration:6000,message:`输入格口号${bin.value}不存在,请输入${props.binData?.length}以内格口号`})
-        //   return resolve(false)
-        // }
         emit('resetData', bin.value,'bin')
       }
       resolve(true)

+ 9 - 2
src/views/inbound/blindCollection/mode/index.vue

@@ -6,6 +6,7 @@
       fixed
       placeholder
       @click-left="goBack"
+      z-index="100"
     >
       <template #left>
         <van-icon name="arrow-left" size="25"/>
@@ -22,7 +23,7 @@
         <van-field class="mode-input" ref="taskNoRef"
                    :style="taskNo!==''?'border: 2px solid #07c160':''" clearable v-model="taskNo"
                    placeholder="请扫描盲收任务号"
-                   @keydown.enter="_getBlindTask()"
+                   @keydown.enter="scanTask"
         />
       </div>
       <div class="mode-select">
@@ -97,6 +98,11 @@ const _handlerScan=(code)=>{
   taskNo.value=code
   _getBlindTask()
 }
+const scanTask=()=>{
+  setTimeout(()=>{
+    _getBlindTask()
+  },200)
+}
 const onClickLeft = () => {
   if(route.query.type==='picking'){
     history.back();
@@ -131,8 +137,9 @@ const _getBlindTask=()=>{
     taskModel.value=res.data
     //盲收任务
     if(type===0){
-      if(res.data && res.data.typeCode){
+      if(res.data && res.data.type){
         link(res.data.code,res.data.typeCode)
+        closeLoading()
       }else {
         showToast({duration:5000,message:'该任务未绑定模式,请选择模式!'})
       }

+ 17 - 5
src/views/inbound/blindCollection/task/index.vue

@@ -135,7 +135,7 @@
               <van-button plain size="mini" type="primary" @click="_setBarcodeCount(item)">修改数量</van-button>
             </td>
           </tr>
-          <tr v-for="(item, index) in dataList" :key="index" :class="{'odd-row': index+localData.length % 2 !== 0}">
+          <tr v-for="(item, index) in dataList" :key="index" :class="{'odd-row': Number(index+localData.length) % 2 !== 0}">
             <td>{{ item.barcode }}</td>
             <td>{{ modeType === 0 ? item.cartonCode : item.latticeCode }}</td>
             <td>{{ item.qty }}</td>
@@ -165,7 +165,7 @@ import { computed, onMounted, ref } from 'vue'
 import { playVoiceBin, scanError, scanSuccess } from '@/utils/android'
 import BarcodeCount from '@/views/inbound/blindCollection/components/BarcodeCount.vue'
 import ResetData from '@/views/inbound/blindCollection/components/ResetData.vue'
-import { showConfirmDialog, showToast } from 'vant'
+import { showConfirmDialog, showDialog, showToast } from 'vant'
 import { barcodeIsData } from '@/views/inbound/blindCollection/task/hooks/barcodeIsData'
 import { closeLoading, showLoading } from '@/utils/loading'
 import { binData } from '@/views/inbound/blindCollection/task/hooks/binData'
@@ -277,7 +277,6 @@ const _checkBarcode = () => {
 const setBarcode = (curBarcode) => {
   barcode.value = '';
   const { code } = taskInfo.value;
-  console.log(modeType,"modeType")
   switch (modeType) {
     case 5:
     case 1:
@@ -287,7 +286,6 @@ const setBarcode = (curBarcode) => {
         barcode: curBarcode,
         qty: 1,
       }];
-      console.log(data)
       _setBoxCacheData(code, data);  // 添加缓存数据
       break;
     case 0:
@@ -341,11 +339,21 @@ const _setBoxBarcode=()=>{
 const _setBoxCacheData = (code,data) => {
   showLoading()
   setBoxCacheData(code,taskInfo.value.typeCode,data).then(res=>{
+    const oldData=JSON.parse(JSON.stringify(binList.value))
     dataList.value = res.data
     localData.value=[]
     localStorage.removeItem(`task_${taskInfo.value.code}`);
     if(res.data && modeType!==0){
       playVoiceBin(Number(res.data[0].latticeCode))
+      const found = oldData.find(item => item.barcode === res.data[0].barcode);
+      if(found === undefined && oldData.length>1 ){
+        showDialog({
+          title: '温馨提示',
+          message: `扫到全新商品,请放入格口:${res.data[0].latticeCode}`,
+        }).then(() => {
+          barcodeRef.value?.focus()
+        });
+      }
     }else {
       scanSuccess()
     }
@@ -434,6 +442,10 @@ const showConfirmation = (message) => {
   });
 };
 const resetNewBin = () => {
+  if(localData.value.length===0 && dataList.value.length===0){
+    showToast('暂无数据,不支持清除!')
+    return
+  }
   const { barcode, index, latticeCode, cartonCode } = newOneData.value;
   const confirmMessage = index >= 0
     ? `您正在清除条码:${barcode}数据,是否继续?`
@@ -528,7 +540,7 @@ const onClickRight = () => {
     background-color: #3f8dff
     position: sticky
     top: 0
-    z-index: 1
+    //z-index: 1
     color: white
     font-size: 15px
   .task-table-bin thead

+ 1 - 1
src/views/index.vue

@@ -3,7 +3,7 @@
     <van-image class="image" :src="imageUrl" ></van-image>
     <div class="name" >{{userInfo.username}}</div>
     <div class="home" @click="onRouter('picking')">进入拣货</div>
-    <div class="home" @click="onRouter('mode')">进入盲收</div>
+    <div class="home" @click="onRouter('blind-receiving')">进入盲收</div>
   </div>
 </template>
 <script setup>