several fixes

This commit is contained in:
Denis Duliçi
2021-05-14 18:29:24 +03:00
parent 7ac53681ff
commit b8057a7a12
19 changed files with 165 additions and 75 deletions

View File

@ -30,5 +30,19 @@ const app = new Vue({
form: new Form('item'),
bulk_action: new BulkAction('items'),
}
}
},
watch: {
'form.sale_price': function (newVal, oldVal) {
if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') == -1) {
this.form.sale_price = oldVal;
}
},
'form.purchase_price': function (newVal, oldVal) {
if (newVal != '' && newVal.search('^(?=.*?[0-9])[0-9.,]+$') == -1) {
this.form.purchase_price = oldVal;
}
}
},
});