Changed default value of production from undefined to0, added input validation for plantingArea and production fields in addCropForm, and added input validation for production field in addNoteJobForm.

master
Tuzki 2 years ago
parent 6f9ed657af
commit 2272f89f4c
  1. 13
      sunPages/addCropForm/addCropForm.vue
  2. 8
      sunPages/addNoteJobForm/addNoteJobForm.vue

@ -128,7 +128,7 @@ export default {
plantingTime: undefined,
plantingArea: undefined,
harvestTime: undefined,
production: undefined,
production: 0,
blockArea: undefined,
blockName: undefined,
@ -326,11 +326,16 @@ export default {
}
},
checkArea1(val) {
console.log(this.formData.production)
if (val == 1) {
this.formData.plantingArea = parseFloat(this.formData.plantingArea).toFixed(2);
if(this.formData.plantingArea!=''){
this.formData.plantingArea = parseFloat(this.formData.plantingArea).toFixed(2);
}
}
if (val == 2) {
this.formData.production = parseFloat(this.formData.production).toFixed(2);
if(this.formData.production!=''){
this.formData.production = parseFloat(this.formData.production).toFixed(2);
}
}
},
goSearch() {
@ -353,7 +358,7 @@ export default {
plantingTime: undefined,
plantingArea: undefined,
harvestTime: undefined,
production: undefined,
production: 0,
blockArea: undefined,
blockName: undefined,

@ -374,9 +374,11 @@ export default {
},
handlerInput(event, index) {
this.$nextTick(() => {
const num = parseFloat(event.target.value).toFixed(2);
this.formData.production = num;
this.$forceUpdate();
if(event.target.value!=''){
const num = parseFloat(event.target.value).toFixed(2);
this.formData.production = num;
this.$forceUpdate();
}
});
},
//

Loading…
Cancel
Save