Selaa lähdekoodia

大件、活动复核-增加打印质检

zhaohuanhuan 7 kuukautta sitten
vanhempi
commit
5fe0f1649e

+ 55 - 43
src/views/outbound/check/activity/index.vue

@@ -18,12 +18,12 @@
       <div class="scan-barcode">
         <van-field v-model.lazy="scanBarcode"  label-align="left" placeholder="请扫描商品条码/SKU" label="商品条码:"
                    class="input-barcode" autocomplete="off" @keydown.enter="_handlerScan(scanBarcode)"  />
-        <van-field  v-model.lazy="totalWeight" ref="weightRef" label-align="left" required placeholder="请输入商品重量KG" label="重&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量:"
-                    autocomplete="off" type="number"  >
-          <template #button>
-            <div>KG</div>
-          </template>
-        </van-field>
+<!--        <van-field  v-model.lazy="totalWeight" ref="weightRef" label-align="left" required placeholder="请输入商品重量KG" label="重&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量:"-->
+<!--                    autocomplete="off" type="number"  >-->
+<!--          <template #button>-->
+<!--            <div>KG</div>-->
+<!--          </template>-->
+<!--        </van-field>-->
       </div>
       <div class="order-detail">
         <div class="picking-no">
@@ -42,23 +42,26 @@
             <div  style="text-decoration: underline;color: #0077ff">设置打印机<van-icon name="edit" color="#0077ff"/> </div>
           </div>
           <div class="picking-order-count ">
-            <div>已复核数/总复核数:
+            <div>
+              <span style="font-size: 12px">已复核数/总复核数:</span>
               <span style="color: #333;font-weight: bold;font-size: 18px" v-if="orderMap.dataGroup">{{ successNumber }}/{{Object.keys(orderMap.dataGroup).length ||0}}</span>
               <span v-else>0</span>
             </div>
-            <div>取消单:
+            <div>
+              <span style="font-size: 12px">取消单:</span>
               <span style="color: #333;font-weight: bold;font-size: 18px" v-if="orderMap.cancelGroup">{{Object.keys(orderMap.cancelGroup).length ||0}}</span>
               <span v-else>0</span>
             </div>
-            <div>冻结单:
+            <div>
+              <span style="font-size: 12px">冻结单:</span>
               <span style="color: #333;font-weight: bold;font-size: 18px" v-if="orderMap.freezeGroup">{{Object.keys(orderMap.freezeGroup).length ||0}}</span>
               <span  v-else>0</span>
             </div>
           </div>
         </div>
         <div class="picking-button">
-          <div class="picking-button-item" @click="print('A3012_RF_WIFI_HDQD')">波次清单</div>
-          <div class="picking-button-item" @click="print('PRINT_WAYBILL')">打印面单</div>
+          <div class="picking-button-item" @click="print('A3012_RF_WIFI_HDQD',orderDetail.waveNo)">波次清单</div>
+          <div class="picking-button-item" @click="print('PRINT_WAYBILL',orderDetail.waveNo)">打印面单</div>
           <div class="picking-button-item" @click="endCheck()" >结束复核</div>
           <van-popover :actions="actions" placement="bottom-end" @select="onSelect" theme="dark">
             <template #reference>
@@ -77,7 +80,7 @@
              <th>数量</th>
              <th>剩余</th>
              <th>状态</th>
-             <th v-if="isUniqueCode">标记</th>
+             <th v-if="isUniqueCode || isQualityCheck">标记</th>
            </tr>
            </thead>
            <tbody>
@@ -86,9 +89,10 @@
              <td>{{item.qty}}/{{item.qtyOrdered}}</td>
              <td>{{ item.qty }}</td>
              <td>{{ statusMap[item.status] || '' }}</td>
-             <td v-if="isUniqueCode">
+             <td v-if="isUniqueCode || isQualityCheck">
                <van-tag v-if="item.uniqueRegExp" type="warning" >唯一码</van-tag>
                <van-tag v-if="item.imeiRegExp" type="primary" >IMEI码</van-tag>
+               <van-tag v-if="item.qualityCheck" type="warning" >质检</van-tag>
              </td>
            </tr>
            <tr v-else>
@@ -148,6 +152,7 @@ const warehouse = store.warehouse
 // JH-WH99-990
 const waveNo = ref('')
 const  isUniqueCode=ref(false)
+const isQualityCheck=ref(false)
 // 错误提示
 const tips = ref('')
 //强制返回
@@ -202,6 +207,7 @@ const actions = [
   { text: '装箱清单',value:'packing' },
   { text: '取消单列表',value:'cancel' },
   { text: '冻结单列表',value: 'freeze' },
+  // { text: '结束复核',value: 'end' },
 ];
 // 扫描条码监听
 const relatedMateriaRef=ref(null)
@@ -306,14 +312,9 @@ const cutBarcode = (itemActive, count) => {
     showNotify({ type: 'success', duration: 3000, message: '数量已扣除,请继续扫描条码' });
   } else {
     // 如果所有商品已扫描完毕,根据总重量判断提示信息
-    if (!totalWeight.value) {
-      tips.value = '请输入重量';
-      weightRef.value?.focus()
-      showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请输入重量' });
-    } else {
-      showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请点击结束复核' });
-      tips.value = '商品扫描完成,请点击结束复核';
-    }
+    // showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请点击结束复核' });
+    // tips.value = '商品扫描完成,请点击结束复核';
+    endCheck()
   }
   scanSuccess();
 };
@@ -350,13 +351,13 @@ const onPrint=(code)=>{
   printer.value=code
   localStorage.setItem('check-print',JSON.stringify(code))
 }
-const print=(templateCode)=>{
+const print=(templateCode,code)=>{
   if(!printer.value){
     scanError()
     showNotify({ type: 'warning', duration: 3000, message: '请先设置打印机' });
     return
   }
-  const data = {warehouse,code:orderDetail.value.waveNo,printServer: printer.value.server, printName:printer.value.printer,templateCode }
+  const data = {warehouse,code,printServer: printer.value.server, printName:printer.value.printer,templateCode }
   showLoading()
   fluxPrint(data)
     .then(res => {
@@ -374,6 +375,11 @@ const successNumber=ref(0)
 const errorNumber=ref(0)
 //结束复核
 const endCheck=()=>{
+  if(!printer.value){
+    scanError()
+    showNotify({ type: 'warning', duration: 3000, message: '请先设置打印机' });
+    return
+  }
   const allCount = orderList.value.reduce((sum, item) => sum + Math.max(Number(item.qty), 0), 0);
   if(allCount>0){
     scanError()
@@ -381,28 +387,27 @@ const endCheck=()=>{
     showNotify({ type: 'warning', duration: 3000, message: '商品未扫描完成,请先扫描商品' });
     return
   }
-  const lastNumber=Object.keys(orderMap.value.dataGroup).length
-  if (totalWeight.value<=0 && lastNumber>0) {
-    tips.value = '请输入重量';
-    scanError()
-    showNotify({ type: 'warning', duration: 3000, message: '请输入重量' });
-    weightRef.value?.focus()
-    return
-  }
-  if (lastNumber > 0) {
-    const dataGroup = orderMap.value.dataGroup
-    for (const order of Object.values(dataGroup)) {
-      for (const item of order) {
-        if (item.qty !== 0 && item.status=='60') {
-          item.quantity = item.qty
-          item.qty = 0
+  showDialog({
+    title: '温馨提示',
+    message: '是否进行复核操作?',
+    theme: 'round-button',
+  }).then(() => {
+    const lastNumber=Object.keys(orderMap.value.dataGroup).length
+    if (lastNumber > 0) {
+      const dataGroup = orderMap.value.dataGroup
+      for (const order of Object.values(dataGroup)) {
+        for (const item of order) {
+          if (item.qty !== 0 && item.status=='60') {
+            item.quantity = item.qty
+            item.qty = 0
+          }
         }
       }
     }
-  }
-  packingRequests(0,lastNumber)
-  successNumber.value=0
-  errorNumber.value=0
+    packingRequests(0,lastNumber)
+    successNumber.value=0
+    errorNumber.value=0
+  })
 }
 //装箱
 const reversePickingRef=ref(null)
@@ -450,6 +455,9 @@ const packingRequests = async (startIndex = 0, lastNumber) => {
           orderMap.value.freezeGroup[item.orderNo] = item.orderNo
         }else {
           successNumber.value+=1
+          if(isQualityCheck.value && startIndex==0){
+            print('A3014_PACK_CARTON_QC',res.data)
+          }
         }
         await packingRequests(startIndex + 1, lastNumber)
       }
@@ -482,7 +490,10 @@ const onSelect=(item)=>{
   }else if(item.value=='reset'){
     reset()
   }else if(item.value=='packing'){
-    print('A3014_PACK_CARTON_PACKINGLIST')
+    print('A3014_PACK_CARTON_PACKINGLIST',orderDetail.value.waveNo)
+  }
+  else if(item.value=='end'){
+    endCheck()
   }
 }
 
@@ -514,6 +525,7 @@ const setBarcode = (code) => {
       if(orderMap.value.dataGroup && Object.keys(orderMap.value.dataGroup).length>0){
         dataList.value=orderMap.value.dataGroup[Object.keys(orderMap.value.dataGroup)[0]]
         isUniqueCode.value = dataList.value.some(item => item.uniqueRegExp || item.imeiRegExp );
+        isQualityCheck.value = dataList.value.some(item => item.qualityCheck === true);
       }else {
         dataList.value=[]
       }

+ 7 - 0
src/views/outbound/check/components/BatchPacking.vue

@@ -82,6 +82,7 @@ const recursiveRequest = async (index, dataList, item) => {
       groupDetailList: [dataList[index]],
     }
     showLoading()
+
     const res = await packingReview(data)
     if (res.data && res.data != '0000'  && res.data != '1111') {
       showNotify({ type: 'success', duration: 3000, message: res.data + '装箱成功' })
@@ -93,6 +94,12 @@ const recursiveRequest = async (index, dataList, item) => {
       } else {
         emit('print', 'PRINT_WAYBILL', res.data)
       }
+      const curQualityCheck= packingList.value.some(item => item.qualityCheck === true)
+      if(curQualityCheck){
+        setTimeout(()=>{
+          emit('print','A3014_PACK_CARTON_QC',res.data)
+        },300)
+      }
       await recursiveRequest(index + 1, dataList, item)
       closeLoading()
     } else {

+ 6 - 0
src/views/outbound/check/components/CheckPacking.vue

@@ -76,6 +76,12 @@ const setPacking = () => {
       // 冻结
       emit('cancelOrder',orderDetail.value,'release')
     }else {
+      const curQualityCheck= packingList.value.some(item => item.qualityCheck === true)
+      if(curQualityCheck){
+        setTimeout(()=>{
+          emit('print','A3014_PACK_CARTON_QC',res.data)
+        },300)
+      }
       showNotify({ type: 'success', duration: 3000, message: res.data + '装箱成功'})
       scanSuccess()
       emit('resetPackingStatus')

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

@@ -70,7 +70,7 @@
               <th>数量</th>
               <th>剩余</th>
               <th>状态</th>
-              <th v-if="isUniqueCode">标记</th>
+              <th v-if="isUniqueCode || isQualityCheck">标记</th>
             </tr>
             </thead>
             <tbody>
@@ -83,9 +83,10 @@
               </td>
               <td>{{ item.qty }}</td>
               <td>{{ statusMap[item.status] || '' }}</td>
-              <td v-if="isUniqueCode">
+              <td v-if="isUniqueCode || isQualityCheck">
                 <van-tag v-if="item.uniqueRegExp" type="warning">唯一码</van-tag>
                 <van-tag v-if="item.imeiRegExp" type="primary">IMEI码</van-tag>
+                <van-tag v-if="item.qualityCheck" type="warning" >质检</van-tag>
               </td>
             </tr>
             <tr v-else>
@@ -162,6 +163,7 @@ const orderDetail = ref({})
 //装箱明细
 const packingDetailMap=ref({})
 const isUniqueCode = ref(false)
+const isQualityCheck=ref(false)
 const statusMap = {
   '00': '创建',
   '20': '预配',
@@ -517,6 +519,7 @@ const setBarcode = (code) => {
       res.data.details.push(...relatedMaterialList)
       dataList.value = res.data.details
       isUniqueCode.value = dataList.value.some(item => item.uniqueRegExp || item.imeiRegExp)
+      isQualityCheck.value = dataList.value.some(item => item.qualityCheck === true);
       scanBarcode.value = ''
     }
   }).catch(err => {