| | |
| | | if(res.code === 200) { |
| | | // uni.showToast({title: "添加成功", icon: "none",position: 'center'}) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | |
| | |
| | | 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 = '商品编码有误,请重试!'; |