diff --git a/mycomponents/qty/CountQtyEdit.vue b/mycomponents/qty/CountQtyEdit.vue
index efaf99f3..32e5e5dd 100644
--- a/mycomponents/qty/CountQtyEdit.vue
+++ b/mycomponents/qty/CountQtyEdit.vue
@@ -38,7 +38,9 @@
数量 :
+ @mousedown="mousedown"
+ @input="checkNum"
+ :maxlength="maxlength" />
@@ -107,7 +109,8 @@
seconds: 0,
timer: {},
showConfirmCountdown: false,
- detaiList: []
+ detaiList: [],
+ maxlength: 10
}
},
watch: {
@@ -140,6 +143,20 @@
},
},
methods: {
+ checkNum(e) {
+ let value = e.detail.value;
+ let dot = value.indexOf('.'); //包含小数点
+ let reg = /^[0-9]+$/; //正整数
+ if (dot > -1) {
+ this.maxlength = dot + 7; //长度是小数点后两位
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //如果是正整数不包含小数点
+ this.maxlength = 10;
+ }
+ },
openEditPopup(item, detaiList) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus;
diff --git a/mycomponents/qty/balanceQtyEdit.vue b/mycomponents/qty/balanceQtyEdit.vue
index 726c2d80..632b1eb0 100644
--- a/mycomponents/qty/balanceQtyEdit.vue
+++ b/mycomponents/qty/balanceQtyEdit.vue
@@ -36,7 +36,7 @@
数量 :
+ @confirm="confirm()" @input="checkNum" :maxlength="maxlength" />
@@ -94,7 +94,8 @@
inventoryStatus: "",
originalInventoryStatus: "",
dataContent: {},
- handleQty: 0
+ handleQty: 0,
+ maxlength: 10
}
},
watch: {
@@ -123,6 +124,20 @@
}
},
methods: {
+ checkNum(e) {
+ let value = e.detail.value;
+ let dot = value.indexOf('.'); //包含小数点
+ let reg = /^[0-9]+$/; //正整数
+ if (dot > -1) {
+ this.maxlength = dot + 7; //长度是小数点后两位
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //如果是正整数不包含小数点
+ this.maxlength = 10;
+ }
+ },
openEditPopup(item, handleQty) {
this.dataContent = item
this.inventoryStatus = this.dataContent.inventoryStatus
diff --git a/mycomponents/qty/recommendQtyEdit.vue b/mycomponents/qty/recommendQtyEdit.vue
index 6f021fd1..72e0ca14 100644
--- a/mycomponents/qty/recommendQtyEdit.vue
+++ b/mycomponents/qty/recommendQtyEdit.vue
@@ -31,12 +31,13 @@
+
总数量 :
+ @input="checkNum" @confirm="confirm()" :maxlength="maxlength" />
@@ -69,7 +70,8 @@
allQty: 0,
stdCount: 0,
labelQty: 0,
- recommendQty: 0
+ recommendQty: 0,
+ maxlength: 10
}
},
watch: {
@@ -104,6 +106,20 @@
},
},
methods: {
+ checkNum(e) {
+ let value = e.detail.value;
+ let dot = value.indexOf('.'); //包含小数点
+ let reg = /^[0-9]+$/; //正整数
+ if (dot > -1) {
+ this.maxlength = dot + 7; //长度是小数点后两位
+ if (value.length > dot + 7) {
+
+ }
+ }
+ if (reg.test(value)) { //如果是正整数不包含小数点
+ this.maxlength = 10;
+ }
+ },
openEditPopup() {
this.$refs.popup.open('bottom')
},
@@ -148,7 +164,8 @@
} else {
if (this.recommendQty != 0) {
if (this.allQty > this.recommendQty) {
- if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty == "TRUE") {
+ if (this.settingParam.allowBiggerQty != null && this.settingParam.allowBiggerQty ==
+ "TRUE") {
this.callback();
} else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许大于推荐数量[' +
@@ -159,7 +176,8 @@
})
}
} else if (this.allQty < this.recommendQty) {
- if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty == "TRUE") {
+ if (this.settingParam.allowSmallerQty != null && this.settingParam.allowSmallerQty ==
+ "TRUE") {
this.callback();
} else {
this.$refs.comMessage.showErrorMessage('数量[' + this.allQty + ']不允许小于推荐数量[' +