#
whycq
2024-09-26 a84ed18ebca6d113fa9c52a36fc71e3a106fd729
pages/pakin/pakin.vue
@@ -223,11 +223,14 @@
            }, 200)
         },
         asBarcodeInput() {
            this.asBarcode = this.asBarcode.replace(/\s+/g, '')
            setTimeout(() => {
               var len = this.asBarcode.length
               if (len != 12) {
               if (this.checkCode(this.asBarcode)) {
                  // && this.asBarcode.length != 8
                  uni.showToast({
                     title: '托盘码有误请重试',
                     title: 'AS400有误请重试',
                     icon: "none",
                     position: 'top'
                  });
@@ -236,6 +239,24 @@
               }
               this.focuss()
            }, 200)
         },
         checkCode(code) {
            // console.log(this.isNum(code.substring(0, 1)))
            // console.log(!this.isNum(code.substring(1, 2)))
            // console.log(code.length == 8,code.length)
            let flag = true
            if (code.substring(0, 2) == 'PM' ) {
               flag = false
            } else if (
               this.isNum(code.substring(0, 1))
               && !this.isNum(code.substring(1, 2))
               && code.length == 8 ) {
               flag = false
            }
            return flag
         },
         isNum(value) {
            return typeof value === 'string' ? /^\d+$/.test(value) : typeof value === 'number' && !isNaN(value);
         },
         // 托盘码有误重置
         barcodeFocuss() {
@@ -257,11 +278,11 @@
         },
         // 商品光标清空重置
         focuss() {
            this.focus = false;
            this.matFocus = false;
            setTimeout(() => {
               this.matnr = '';
               this.matFocus = true;
            }, 100);
            }, 200);
         },
         codeInput(code) {
            switch (code) {
@@ -285,9 +306,6 @@
                  break;
               case "barcode4":
                  this.barcode4Focus = false;
                  setTimeout(() => {
                     this.barcode4Focus = true;
                  }, 100);
                  break;
            }
         },
@@ -307,7 +325,6 @@
                  if (result.code === 200 && result.data) {
                     that.matData = result.data
                     that.matnr = ''
                     that.matData['model'] = ''
                     uni.navigateTo({
                        url: "../mat/matSelected",
                        // 通过eventChannel向被打开页面传送数据
@@ -464,7 +481,7 @@
               return;
            }
            if (that.asBarcode === '') {
               this.messageText = "请扫描托盘条码"
               this.messageText = "请扫描AS400条码"
               this.messageToggle('error')
               return;
            }
@@ -484,7 +501,12 @@
               url: that.baseUrl + '/mobile/comb/auth',
               data: JSON.stringify({
                  barcode: that.barcode,
                  combMats: that.dataList
                  asBarcode: that.asBarcode,
                  combMats: that.dataList,
                  code1: that.barcode1,
                  code2: that.barcode2,
                  code3: that.barcode3,
                  code4: that.barcode4
               }),
               method: 'POST',
               header: {
@@ -523,7 +545,13 @@
         // 确认重置
         resetConfirm() {
            this.dataList = []
            this.asBarcode = ''
            this.barcode1 = ''
            this.barcode2 = ''
            this.barcode3 = ''
            this.barcode4 = ''
            this.messageText = "重置完成"
            this.barcodeFocuss()
            this.messageToggle('success')
         },
         // 取消重置
@@ -534,6 +562,11 @@
         resst() {
            this.dataList = []
            this.barcode = ''
            this.asBarcode = ''
            this.barcode1 = ''
            this.barcode2 = ''
            this.barcode3 = ''
            this.barcode4 = ''
            this.barcodeFocuss()
         },
      }
@@ -575,7 +608,7 @@
   }
   .code-decs {
      width: 20vw;
      /* width: 20vw; */
      font-size: 14px;
      color: #303133;
   }