whycq
2022-08-24 36fc4fa64ba5a7fd9f23b33c94c918d4b3ca70e3
pages/basics/outPakin.vue
@@ -298,7 +298,6 @@
                  if(res.code === 200) {
                     // uni.showToast({title: "添加成功", icon: "none",position: 'center'})
                  }
               }
            })
            
@@ -312,6 +311,12 @@
            that.addLog(matCode,userName)
            // that.foucss();
            // return;
            if(that.matList.length > 15) {
               that.messageToggle('warn');
               that.messageText = '组托商品数量已超过16件,请完成当前组托';
               that.foucss();
               return;
            }
            if (that.matnrId.length > 25){
               that.messageToggle('warn');
               that.messageText = '商品编码超长,请重试';
@@ -322,6 +327,31 @@
            let matnr = str[0] + '-' + str[1]
            // 检查条码中非数字
            that.checkNum(str[2])
            // 检查序列码长度
            if (str[2].length != 11) {
               that.messageToggle('warn');
               that.messageText = '商品序列码长度有误,请重试!';
               that.foucss();
               return;
            }
            // 检查年份
            var dt = new Date();
            var year = (dt.getFullYear() + '').substring(2,4)
            var month = (dt.getMonth()+1) < 10 ? '0'+ (dt.getMonth()+1) : (dt.getMonth()+1);
            if (str[2].substring(0,2) > year) {
               that.messageToggle('warn');
               that.messageText = '商品序列码年份有误,请重试!';
               that.foucss();
               return;
            }
            // 检查月份
            if (str[2].substring(2,4) > 12) {
               that.messageToggle('warn');
               that.messageText = '商品序列码月份有误,请重试!';
               that.foucss();
               return;
            }
            if (str)
            if (that.isNum == false) {
               that.messageToggle('warn');
               that.messageText = '商品编码有误,请重试!';
@@ -340,15 +370,14 @@
            // return;
            // uni.showLoading();
            uni.request({
                url: that.commonUrl + '/mat/auth',
                url: that.commonUrl + '/barcode/check/auth',
                data: {
                  matnr:matnr
                  barcode:that.matnrId
                },
                header: {
                  'token':uni.getStorageSync('token')
                },
               success(result) {
                  console.log(result)
                  uni.hideLoading();
                  // uni.vibrateShort();
                  let res = result.data