计数功能校验输入正整数
其他几个页面扫码出错后,清空已扫描的值
This commit is contained in:
1 parent
c286bf55d7
commit
a869449034
5 files changed
+57
-43
No files matched your search
@@ -88,8 +88,12 @@ var app = new Vue({
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
var qty = _this.form.qty;
|
||||
if (qty == "")
|
||||
qty = parseInt(_this.qtyPlaceholder);
|
||||
|
||||
// 正则表达式 校验qty为正整数
|
||||
if (!/^[1-9]\d*$/.test(qty)) {
|
||||
layer.alert("数量必须为正整数");
|
||||
return;
|
||||
}
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -115,11 +119,11 @@ var app = new Vue({
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 扫描唯一码
|
||||
scanUniqueCode(data) {
|
||||
var _this = this;
|
||||
|
||||
|
||||
//1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量
|
||||
var isExit = this.tableData.findIndex(function (value) {
|
||||
return value.UniqueCode == data;
|
||||
|
||||
Reference in new issue
Block a user