diff --git a/src/pages/Parent/parents.vue b/src/pages/Parent/parents.vue index 6f6debf..a245818 100644 --- a/src/pages/Parent/parents.vue +++ b/src/pages/Parent/parents.vue @@ -501,6 +501,7 @@ placeholder="fill your father Cell Number" type="number" :rules="fatheCellNoRules" + counter="10" required > @@ -577,6 +578,8 @@ @@ -629,9 +632,10 @@ @@ -708,6 +712,7 @@ @@ -797,9 +802,15 @@ export default { rowsPerPage: 15 }, fatherNameRules: [v => !!v || " Father Name is required"], - fatheCellNoRules: [v => !!v || " father Cell Number is required"], - motherNameRules: [v => !!v || " Mother Name is required"], - motherCellNoRules: [v => !!v || " Mother Cell Number is required"], + fatheCellNoRules: [ + v => !!v || " father Cell Number is required", + v => v <= 10000000000 || "Max 10 characters is required" + ], + // motherNameRules: [v => !!v || " Mother Name is required"], + motherCellNoRules: [ + v => !!v || " Mother Cell Number is required", + v => v <= 10000000000 || "Max 10 characters is required" + ], errorMessages: "", emailRules: [ v => !!v || "E-mail is required", @@ -844,6 +855,7 @@ export default { parentsList: [], editedIndex: -1, parentData: {}, + max: 10, editedItem: { fatherName: "", fatherCellNo: "", @@ -900,6 +912,8 @@ export default { }, save() { this.editedItem.parentId = this.editedItem._id; + this.editedItem.fatherCellNo = "+91" + this.editedItem.fatherCellNo; + this.editedItem.motherCellNo = "+91" + this.editedItem.motherCellNo; http() .put("/updateParent", this.editedItem) .then(response => { @@ -918,11 +932,13 @@ export default { } }); }, - submitParentDetails() { + async submitParentDetails() { if (this.$refs.parentForm.validate()) { this.parentData.role = "PARENT"; + this.parentData.fatherCellNo = "+91" + this.parentData.fatherCellNo; + this.parentData.motherCellNo = "+91" + this.parentData.motherCellNo; this.loading = true; - http() + await http() .post("/createParent", this.parentData) .then(response => { this.parentId = response.data.data.id; @@ -933,7 +949,7 @@ export default { this.loading = false; }) .catch(error => { - console.log(error.response.data); + // console.log(error.response.data); this.snackbar = true; this.text = error.response.data.message; if (error.response.data.statusText) { diff --git a/src/pages/Students/students.vue b/src/pages/Students/students.vue index 063e90b..eec4af7 100644 --- a/src/pages/Students/students.vue +++ b/src/pages/Students/students.vue @@ -239,7 +239,6 @@ @@ -1024,6 +1023,7 @@ placeholder="fill your father Cell Number" type="number" :rules="fatheCellNoRules" + counter="10" v-on:keyup="getParentDetails()" required > @@ -1070,7 +1070,6 @@ @@ -1088,7 +1087,7 @@ @@ -1166,6 +1165,7 @@ placeholder="fill your father Cell Number" type="number" :rules="fatheCellNoRules" + counter="10" v-on:keyup="getParentDetails()" required > @@ -1212,7 +1212,6 @@ @@ -1230,8 +1229,8 @@ @@ -1889,7 +1888,14 @@ export default { classRules: [v => !!v || " Class Name is required"], sectionRules: [v => !!v || " Section Name is required"], genderRules: [v => !!v || " Select Gender is required"], - fatheCellNoRules: [v => !!v || " father Cell Number is required"], + fatheCellNoRules: [ + v => !!v || " father Cell Number is required", + v => v <= 10000000000 || "Max 10 characters is required" + ], + motherCellNoRules: [ + v => !!v || " Mother Cell Number is required", + v => v <= 10000000000 || "Max 10 characters is required" + ], establishmentYearRules: [v => !!v || " Academic Year is required"], errorMessages: "", countries: [], @@ -2192,7 +2198,7 @@ export default { country: this.addStudents.country, permanentAddress: this.addStudents.permanentAddress, presentAddress: this.addStudents.presentAddress, - mobile: this.addStudents.mobile, + mobile: "+91" + this.addStudents.mobile, state: this.addStudents.state, gender: this.addStudents.gender, establishmentYear: this.addStudents.establishmentYear, @@ -2248,7 +2254,7 @@ export default { country: this.editedItem.country, permanentAddress: this.editedItem.permanentAddress, presentAddress: this.editedItem.presentAddress, - mobile: this.editedItem.mobile, + mobile: "+91" + this.editedItem.mobile, state: this.editedItem.state, gender: this.editedItem.gender, establishmentYear: this.editedItem.establishmentYear, @@ -2285,6 +2291,8 @@ export default { }, submitParentDetails() { if (this.$refs.parentForm.validate()) { + this.parentData.fatherCellNo = "+91" + this.parentData.fatherCellNo; + this.parentData.motherCellNo = "+91" + this.parentData.motherCellNo; let addparentDetails = { email: this.parentData.email, fatherName: this.parentData.fatherName,