baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
Executable
+82
@@ -0,0 +1,82 @@
|
||||
module.exports = {
|
||||
removeLetter:function(str){
|
||||
let result;
|
||||
let reg = /[a-zA-Z]+/; //[a-zA-Z]表示匹配字母,g表示全局匹配
|
||||
|
||||
while (result = str.match(reg)) { //判断str.match(reg)是否没有字母了
|
||||
str = str.replace(result[0], ''); //替换掉字母 result[0] 是 str.match(reg)匹配到的字母
|
||||
}
|
||||
|
||||
return str;
|
||||
},
|
||||
|
||||
judgeFloat:function(qty){
|
||||
let checkQtyErrorFlag = true;
|
||||
let reg = /\D/;
|
||||
checkQtyErrorFlag = reg.test(qty);
|
||||
if(checkQtyErrorFlag) {
|
||||
let firstQty = qty.toString().substr(0,1);
|
||||
checkQtyErrorFlag = reg.test(firstQty);
|
||||
|
||||
//防止非数字开头
|
||||
if(!checkQtyErrorFlag) {
|
||||
let replaceQty = qty.toString().replace(".", "");
|
||||
checkQtyErrorFlag = reg.test(replaceQty);
|
||||
}
|
||||
}
|
||||
|
||||
//排除0000.1
|
||||
if(!checkQtyErrorFlag) {
|
||||
if (qty.toString().substr(0,1) == "0" && qty.toString().substr(1,1) != "."){
|
||||
checkQtyErrorFlag = true;
|
||||
}
|
||||
}
|
||||
|
||||
//排除0...1
|
||||
if(!checkQtyErrorFlag) {
|
||||
if ((qty.toString().split('.')).length > 2){
|
||||
checkQtyErrorFlag = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(checkQtyErrorFlag) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "请输入正确的数量值",
|
||||
duration: 3500,
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
//排除0...1
|
||||
if(!checkQtyErrorFlag) {
|
||||
if ((qty.toString().split('.')).length > 1){
|
||||
if (qty.toString().split('.')[1].length > 6){
|
||||
checkQtyErrorFlag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(checkQtyErrorFlag) {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "小数位最多只能输入6位",
|
||||
duration: 3500,
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
judgeInt:function(qty){
|
||||
let checkQtyErrorFlag = true;
|
||||
let reg = /\./;
|
||||
checkQtyErrorFlag = reg.test(qty);
|
||||
if(checkQtyErrorFlag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user