Browse Source

Merge remote-tracking branch 'origin/master'

zh 3 months ago
parent
commit
3391d1918c

+ 3 - 0
src/utils/request.ts

@@ -54,6 +54,9 @@ service.interceptors.response.use(
       if(res.code===305 && response.config.url=='api/entryOrder/app/blind/checkBarcodeIgnoreCase'){
         return res
       }
+      if( response.config.url=='api/wms/fluxPrint/print'){
+          return res
+      }
       if(res.message=='找不到此盲收任务'){
         return res
       }

+ 17 - 3
src/views/outbound/check/activity/index.vue

@@ -38,7 +38,7 @@
           <div>{{ orderDetail.carrierName || '--' }}</div>
         </div>
         <div class="picking-container ">
-          <div class="container-item"><span style="color:#666">拣货容器号:</span><div style="flex:1"> <van-notice-bar :background="'none'" color="#000" :speed="50" :text="orderDetail.pickingContainer||'--'" /></div></div>
+          <div class="container-item"><span style="color:#666">拣货容器/波次号:</span><div style="flex:1"> <van-notice-bar :background="'none'" color="#000" :speed="50" :text="formattedOrderDetails" /></div></div>
           <div class="container-item"><span style="color:#666">返拣容器:</span>{{ reversePickingContainerNo || '--' }}</div>
           <div style="display: flex;padding-top: 5px"  @click="setPrinter()">
             <div>打印机:</div>
@@ -194,6 +194,13 @@ const orderList = computed(() => {
       return 0
     })
 })
+// 计算已格式化的拣货容器和波次号字符串
+const formattedOrderDetails = computed(() => {
+  const pickingContainer = orderDetail.value.pickingContainer || '--'
+  const waveNo = orderDetail.value.waveNo || '--'
+  return `${pickingContainer}/${waveNo}`
+})
+
 const statusMap = {
   '00': '创建',
   '20': '预配',
@@ -369,12 +376,19 @@ const print=(templateCode,code)=>{
   showLoading()
   fluxPrint(data)
     .then(res => {
-      scanSuccess()
-      showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
+      if(res.code==200){
+        scanSuccess()
+        showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
+      }else {
+        scanError()
+        tips.value=res.message || '系统异常,请联系技术支持!'
+        showNotify({ type: 'danger', duration: 3000, message: res.message || '系统异常,请联系技术支持!' });
+      }
     })
     .catch(err => {
       scanError()
       tips.value=err.message || '系统异常,请联系技术支持!'
+      showNotify({ type: 'danger', duration: 3000, message: err.message || '系统异常,请联系技术支持!' });
     }).finally(() => {
       closeLoading()
   })

+ 21 - 5
src/views/outbound/check/large/index.vue

@@ -469,13 +469,20 @@ const print=(templateCode,code)=>{
   showLoading()
   fluxPrint(data)
     .then(res => {
-      scanSuccess()
-      showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
-      printPickingList(code,currPackingList.value)
+      if(res.code==200){
+        scanSuccess()
+        showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
+        printPickingList(code,currPackingList.value)
+      }else {
+        scanError()
+        tips.value=res.message || '系统异常,请联系技术支持!'
+        showNotify({ type: 'danger', duration: 3000, message: res.message || '系统异常,请联系技术支持!' });
+      }
     })
     .catch(err => {
       scanError()
       tips.value=err.message || '系统异常,请联系技术支持!'
+      showNotify({ type: 'danger', duration: 3000, message: err.message || '系统异常,请联系技术支持!' });
     }).finally(() => {
       closeLoading()
   })
@@ -513,7 +520,8 @@ const printPickingList=(deliveryNo,curPackingList)=> {
         code: deliveryNo,
         printServer: printMap[0],
         printName: printMap[1],
-        templateCode: item.templateCode
+        templateCode: item.templateCode,
+        ignoreNoData:item.templateCode
       };
       const printCount = Math.max(item.printNum, 1)
       printData.push(...new Array(printCount).fill(data));
@@ -533,10 +541,18 @@ const printRequests = async(index, dataList)=> {
   try {
     const res = await _printMode(dataList[index]);
     if (res) {
-      this.$message.success('打印成功');
+      if(res.code==200){
+        showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
+      }else {
+        if(dataList[index].ignoreNoData && dataList[index].ignoreNoData==true && (res.message.includes('打印数据为空') ||res.message.includes('ignoreNoData'))){
+          return
+        }
+        showNotify({ type: 'danger', duration: 3000, message:res.message || '未知系统错误,请联系开发人员' });
+      }
     }
   } catch (error) {
     console.error('打印请求发生错误:', error);
+    showNotify({ type: 'danger', duration: 3000, message: error.message || '系统异常,请联系技术支持!' });
   } finally {
     closeLoading();
     await printRequests(index + 1, dataList);

+ 9 - 5
src/views/outbound/picking/components/expressPrint.vue

@@ -23,6 +23,7 @@ import { showNotify, showToast } from 'vant'
 import Printer from '@/components/Printer.vue'
 import { closeLoading, showLoading } from '@/utils/loading'
 import { fluxPrint } from '@/api/picking'
+import {scanError, scanSuccess} from "@/utils/android";
 const props = defineProps({
   warehouse:String
 });
@@ -70,15 +71,18 @@ const printRequests = async (startIndex = 0, printNum) => {
       const wave = waveNo.value[startIndex]
       const res = await _printMode(wave)
       if (res) {
-        showNotify({ message:`波次${wave}打印成功`, duration: 5000, type:'success' })
-        // 递归调用,继续打印下一个
-        await printRequests(startIndex + 1, printNum)
-      } else {
-        showNotify({ message:`波次${wave}打印失败`, duration: 5000, type:'danger' })
+        if(res.code==200){
+          showNotify({ message:`波次${wave}打印成功`, duration: 5000, type:'success' })
+          // 递归调用,继续打印下一个
+          await printRequests(startIndex + 1, printNum)
+        }else {
+          showNotify({ message:`波次${wave}打印失败`, duration: 5000, type:'danger' })
+        }
       }
     }
   } catch (error) {
     console.error('请求过程中发生错误', error)
+    showNotify({ type: 'danger', duration: 3000, message: error.message || '系统异常,请联系技术支持!' });
   } finally {
     closeLoading()
   }