소스 검색

盲收-允许扫描未维护产品

zhaohuanhuan 1 년 전
부모
커밋
b3372e8df7
2개의 변경된 파일29개의 추가작업 그리고 8개의 파일을 삭제
  1. 3 0
      src/utils/request.ts
  2. 26 8
      src/views/inbound/blindCollection/task/index.vue

+ 3 - 0
src/utils/request.ts

@@ -49,6 +49,9 @@ service.interceptors.response.use(
         }
         }
         return
         return
       }
       }
+      if(res.code===305 && response.config.url=='api/entryOrder/app/blind/checkBarcodeIgnoreCase'){
+        return res
+      }
       showNotify({
       showNotify({
         message: res.message,
         message: res.message,
         duration: 5000,
         duration: 5000,

+ 26 - 8
src/views/inbound/blindCollection/task/index.vue

@@ -104,7 +104,9 @@
               <tbody>
               <tbody>
               <tr v-if="binList.length>0" v-for="(item,index) in binList" :key="index">
               <tr v-if="binList.length>0" v-for="(item,index) in binList" :key="index">
                 <td>{{ item.latticeCode }}</td>
                 <td>{{ item.latticeCode }}</td>
-                <td>{{ item.barcode }}</td>
+                <td :style="item.commodityName==null?'background:#dcdee0':''">
+                  {{ item.barcode }}
+                </td>
                 <td>{{ item.qty }}</td>
                 <td>{{ item.qty }}</td>
               </tr>
               </tr>
               </tbody>
               </tbody>
@@ -122,7 +124,9 @@
           </thead>
           </thead>
           <tbody>
           <tbody>
           <tr v-for="(item, index) in localData" :key="index" :class="{'odd-row': index % 2 !== 0}">
           <tr v-for="(item, index) in localData" :key="index" :class="{'odd-row': index % 2 !== 0}">
-            <td>{{ item.barcode }}</td>
+            <td :style="item.dataType?'background:#dcdee0':''">
+              {{ item.barcode }}
+            </td>
             <td>{{item.latticeCode}}</td>
             <td>{{item.latticeCode}}</td>
             <td>{{ item.qty }}</td>
             <td>{{ item.qty }}</td>
             <td>
             <td>
@@ -130,7 +134,9 @@
             </td>
             </td>
           </tr>
           </tr>
           <tr v-for="(item, index) in route.query.typeCode==='1'?binList: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 :style="item.commodityName==null?'background:#dcdee0':''">
+              {{ 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>
             <td>
             <td>
@@ -288,18 +294,29 @@ const _checkBarcode = () => {
       barcode:inputBarcode.value
       barcode:inputBarcode.value
     };
     };
     checkBlindBarcode(params).then(res=>{
     checkBlindBarcode(params).then(res=>{
-      if(res.data){
+      if(res.code===305){
+        showConfirmDialog({
+          title: '温馨提示',
+          message:`<div style="font-size: 16px">条码《<span style="color: orangered;font-weight: 500">${inputBarcode.value}</span>》未在系统中维护</div><div>是否确认录入?</div>`,
+          allowHtml:true,
+          keyboardEnabled:false
+        })
+          .then(() => {
+            setBarcode(inputBarcode.value,'new')
+          })
+          .catch(() => {});
+      }else {
         setBarcode(res.data.barCode)
         setBarcode(res.data.barCode)
       }
       }
     }).catch((err)=>{
     }).catch((err)=>{
-      inputBarcode.value=''
       scanError();
       scanError();
+      inputBarcode.value=''
     })
     })
   }
   }
 
 
 };
 };
 // 设置条码的处理
 // 设置条码的处理
-const setBarcode = (curBarcode) => {
+const setBarcode = (curBarcode,dataType) => {
   inputBarcode.value=''
   inputBarcode.value=''
   const { code } = taskInfo.value;
   const { code } = taskInfo.value;
   switch (modeType) {
   switch (modeType) {
@@ -314,7 +331,7 @@ const setBarcode = (curBarcode) => {
       _setBoxCacheData(code, data);  // 添加缓存数据
       _setBoxCacheData(code, data);  // 添加缓存数据
       break;
       break;
     case 0:
     case 0:
-      setLocalData(curBarcode, modeType);  // 设置本地数据
+      setLocalData(curBarcode, modeType,dataType);  // 设置本地数据
       break;
       break;
     default:
     default:
       break;
       break;
@@ -328,10 +345,11 @@ const loadLocalData = (taskCode) => {
   const savedData = localStorage.getItem(`task_${taskCode}`);
   const savedData = localStorage.getItem(`task_${taskCode}`);
   return savedData ? JSON.parse(savedData) : []; // 如果缓存有数据,解析并返回,如果没有,则返回空数组
   return savedData ? JSON.parse(savedData) : []; // 如果缓存有数据,解析并返回,如果没有,则返回空数组
 };
 };
-const setLocalData=(barCode,type)=>{
+const setLocalData=(barCode,type,dataType)=>{
   scanSuccess();
   scanSuccess();
   const data = {
   const data = {
     barcode:barCode,
     barcode:barCode,
+    dataType,
     cartonCode: null,
     cartonCode: null,
     index:localData.value.length,
     index:localData.value.length,
     qty:1
     qty:1