console error fixed
This commit is contained in:
parent
ad0a81a53a
commit
7e83aefa37
13
resources/assets/js/views/common/documents.js
vendored
13
resources/assets/js/views/common/documents.js
vendored
@ -811,15 +811,20 @@ const app = new Vue({
|
||||
|
||||
watch: {
|
||||
'form.discount': function (newVal, oldVal) {
|
||||
if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') !== 0) {
|
||||
if (newVal > 99) {
|
||||
newVal = oldVal;
|
||||
return;
|
||||
}
|
||||
|
||||
if (newVal != '' && newVal.search('^[-+]?([0-9]|[1-9][0-9]|100)*\.?[0-9]+$') !== 0) {
|
||||
this.form.discount = oldVal;
|
||||
this.form.discount = this.form.discount.replace(',', '.');
|
||||
this.form.discount = this.form.discount ? this.form.discount.replace(',', '.') : '';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (let item of this.regex_condition) {
|
||||
if (this.form.discount.includes(item)) {
|
||||
if (this.form.discount && this.form.discount.includes(item)) {
|
||||
const removeLastChar = newVal.length - 1;
|
||||
const inputShown = newVal.slice(0, removeLastChar);
|
||||
|
||||
@ -827,7 +832,7 @@ const app = new Vue({
|
||||
}
|
||||
}
|
||||
|
||||
this.form.discount = this.form.discount.replace(',', '.');
|
||||
this.form.discount = this.form.discount ? this.form.discount.replace(',', '.') : '';
|
||||
},
|
||||
|
||||
'form.loading': function (newVal, oldVal) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user