Explorar el Código

fix: 扫描枪问题

zhangjie hace 1 semana
padre
commit
77e4428649
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  1. 11 1
      src/modules/print/components/BarCodeCheck.vue

+ 11 - 1
src/modules/print/components/BarCodeCheck.vue

@@ -10,7 +10,7 @@
     append-to-body
     @open="initData"
   >
-    <div @keyup.enter="confirm">
+    <div @keyup.enter="enterHandle">
       <el-form
         ref="modalFormComp"
         :model="modalForm"
@@ -115,6 +115,16 @@ export default {
         this.$refs.CodeEndRef.select();
       }
     },
+    enterHandle() {
+      if (this.modalForm.packageCodeStart && !this.modalForm.packageCodeEnd) {
+        this.$refs.CodeEndRef.select();
+      } else if (
+        this.modalForm.packageCodeStart &&
+        this.modalForm.packageCodeEnd
+      ) {
+        this.confirm();
+      }
+    },
     async confirm() {
       const valid = await this.$refs.modalFormComp.validate().catch(() => {});
       if (!valid) return;