Просмотр исходного кода

活动单复核-重量增加限制

zhaohuanhuan 7 месяцев назад
Родитель
Сommit
1b0ac51dcd
1 измененных файлов с 22 добавлено и 11 удалено
  1. 22 11
      src/views/outbound/check/activity/index.vue

+ 22 - 11
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">
@@ -311,10 +311,14 @@ const cutBarcode = (itemActive, count) => {
     tips.value = '请继续扫描条码';
     showNotify({ type: 'success', duration: 3000, message: '数量已扣除,请继续扫描条码' });
   } else {
-    // 如果所有商品已扫描完毕,根据总重量判断提示信息
-    // showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请点击结束复核' });
-    // tips.value = '商品扫描完成,请点击结束复核';
-    endCheck()
+    if (!totalWeight.value) {
+      tips.value = '请输入重量';
+      weightRef.value?.focus()
+      showNotify({ type: 'success', duration: 3000, message: '商品扫描完成,请输入重量' });
+    } else {
+      endCheck()
+      tips.value = '商品扫描完成,请点击结束复核';
+    }
   }
   scanSuccess();
 };
@@ -387,12 +391,19 @@ 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
+  }
   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)) {