Commit f6200ce53760284dcfa816478ebed8882cf6115c
1 parent
748acd1a6e
Exists in
master
and in
3 other branches
send number via authenticatiion in student and parents number
Showing
2 changed files
with
39 additions
and
15 deletions
Show diff stats
src/pages/Parent/parents.vue
... | ... | @@ -501,6 +501,7 @@ |
501 | 501 | placeholder="fill your father Cell Number" |
502 | 502 | type="number" |
503 | 503 | :rules="fatheCellNoRules" |
504 | + counter="10" | |
504 | 505 | required |
505 | 506 | ></v-text-field> |
506 | 507 | </v-flex> |
... | ... | @@ -577,6 +578,8 @@ |
577 | 578 | <v-text-field |
578 | 579 | v-model="parentData.motherCellNo" |
579 | 580 | placeholder="fill your Mother Cell Number" |
581 | + :rules="motherCellNoRules" | |
582 | + counter="10" | |
580 | 583 | type="number" |
581 | 584 | required |
582 | 585 | ></v-text-field> |
... | ... | @@ -629,9 +632,10 @@ |
629 | 632 | <v-flex xs12> |
630 | 633 | <v-text-field |
631 | 634 | v-model="parentData.fatherCellNo" |
635 | + :rules="fatheCellNoRules" | |
636 | + counter="10" | |
632 | 637 | placeholder="fill your father Cell Number" |
633 | 638 | type="number" |
634 | - :rules="fatheCellNoRules" | |
635 | 639 | required |
636 | 640 | ></v-text-field> |
637 | 641 | </v-flex> |
... | ... | @@ -708,6 +712,7 @@ |
708 | 712 | <v-text-field |
709 | 713 | v-model="parentData.motherCellNo" |
710 | 714 | placeholder="fill your Mother Cell Number" |
715 | + :rules="motherCellNoRules" | |
711 | 716 | type="number" |
712 | 717 | required |
713 | 718 | ></v-text-field> |
... | ... | @@ -797,9 +802,15 @@ export default { |
797 | 802 | rowsPerPage: 15 |
798 | 803 | }, |
799 | 804 | fatherNameRules: [v => !!v || " Father Name is required"], |
800 | - fatheCellNoRules: [v => !!v || " father Cell Number is required"], | |
801 | - motherNameRules: [v => !!v || " Mother Name is required"], | |
802 | - motherCellNoRules: [v => !!v || " Mother Cell Number is required"], | |
805 | + fatheCellNoRules: [ | |
806 | + v => !!v || " father Cell Number is required", | |
807 | + v => v <= 10000000000 || "Max 10 characters is required" | |
808 | + ], | |
809 | + // motherNameRules: [v => !!v || " Mother Name is required"], | |
810 | + motherCellNoRules: [ | |
811 | + v => !!v || " Mother Cell Number is required", | |
812 | + v => v <= 10000000000 || "Max 10 characters is required" | |
813 | + ], | |
803 | 814 | errorMessages: "", |
804 | 815 | emailRules: [ |
805 | 816 | v => !!v || "E-mail is required", |
... | ... | @@ -844,6 +855,7 @@ export default { |
844 | 855 | parentsList: [], |
845 | 856 | editedIndex: -1, |
846 | 857 | parentData: {}, |
858 | + max: 10, | |
847 | 859 | editedItem: { |
848 | 860 | fatherName: "", |
849 | 861 | fatherCellNo: "", |
... | ... | @@ -900,6 +912,8 @@ export default { |
900 | 912 | }, |
901 | 913 | save() { |
902 | 914 | this.editedItem.parentId = this.editedItem._id; |
915 | + this.editedItem.fatherCellNo = "+91" + this.editedItem.fatherCellNo; | |
916 | + this.editedItem.motherCellNo = "+91" + this.editedItem.motherCellNo; | |
903 | 917 | http() |
904 | 918 | .put("/updateParent", this.editedItem) |
905 | 919 | .then(response => { |
... | ... | @@ -918,11 +932,13 @@ export default { |
918 | 932 | } |
919 | 933 | }); |
920 | 934 | }, |
921 | - submitParentDetails() { | |
935 | + async submitParentDetails() { | |
922 | 936 | if (this.$refs.parentForm.validate()) { |
923 | 937 | this.parentData.role = "PARENT"; |
938 | + this.parentData.fatherCellNo = "+91" + this.parentData.fatherCellNo; | |
939 | + this.parentData.motherCellNo = "+91" + this.parentData.motherCellNo; | |
924 | 940 | this.loading = true; |
925 | - http() | |
941 | + await http() | |
926 | 942 | .post("/createParent", this.parentData) |
927 | 943 | .then(response => { |
928 | 944 | this.parentId = response.data.data.id; |
... | ... | @@ -933,7 +949,7 @@ export default { |
933 | 949 | this.loading = false; |
934 | 950 | }) |
935 | 951 | .catch(error => { |
936 | - console.log(error.response.data); | |
952 | + // console.log(error.response.data); | |
937 | 953 | this.snackbar = true; |
938 | 954 | this.text = error.response.data.message; |
939 | 955 | if (error.response.data.statusText) { | ... | ... |
src/pages/Students/students.vue
... | ... | @@ -239,7 +239,6 @@ |
239 | 239 | <v-text-field |
240 | 240 | v-model="editedItem.medicalNotes" |
241 | 241 | placeholder="fill your medicalNotes" |
242 | - name="mobileNo" | |
243 | 242 | required |
244 | 243 | ></v-text-field> |
245 | 244 | </v-flex> |
... | ... | @@ -1024,6 +1023,7 @@ |
1024 | 1023 | placeholder="fill your father Cell Number" |
1025 | 1024 | type="number" |
1026 | 1025 | :rules="fatheCellNoRules" |
1026 | + counter="10" | |
1027 | 1027 | v-on:keyup="getParentDetails()" |
1028 | 1028 | required |
1029 | 1029 | ></v-text-field> |
... | ... | @@ -1070,7 +1070,6 @@ |
1070 | 1070 | <v-text-field |
1071 | 1071 | v-model="parentData.motherName" |
1072 | 1072 | placeholder="fill your Mother Name" |
1073 | - name="state" | |
1074 | 1073 | type="text" |
1075 | 1074 | required |
1076 | 1075 | ></v-text-field> |
... | ... | @@ -1088,7 +1087,7 @@ |
1088 | 1087 | <v-text-field |
1089 | 1088 | v-model="parentData.motherCellNo" |
1090 | 1089 | placeholder="fill your Mother Cell Number" |
1091 | - name="state" | |
1090 | + :rules="motherCellNoRules" | |
1092 | 1091 | type="number" |
1093 | 1092 | required |
1094 | 1093 | ></v-text-field> |
... | ... | @@ -1166,6 +1165,7 @@ |
1166 | 1165 | placeholder="fill your father Cell Number" |
1167 | 1166 | type="number" |
1168 | 1167 | :rules="fatheCellNoRules" |
1168 | + counter="10" | |
1169 | 1169 | v-on:keyup="getParentDetails()" |
1170 | 1170 | required |
1171 | 1171 | ></v-text-field> |
... | ... | @@ -1212,7 +1212,6 @@ |
1212 | 1212 | <v-text-field |
1213 | 1213 | v-model="parentData.motherName" |
1214 | 1214 | placeholder="fill your Mother Name" |
1215 | - name="state" | |
1216 | 1215 | type="text" |
1217 | 1216 | required |
1218 | 1217 | ></v-text-field> |
... | ... | @@ -1230,8 +1229,8 @@ |
1230 | 1229 | <v-text-field |
1231 | 1230 | v-model="parentData.motherCellNo" |
1232 | 1231 | placeholder="fill your Mother Cell Number" |
1233 | - name="state" | |
1234 | 1232 | type="number" |
1233 | + :rules="motherCellNoRules" | |
1235 | 1234 | required |
1236 | 1235 | ></v-text-field> |
1237 | 1236 | </v-flex> |
... | ... | @@ -1889,7 +1888,14 @@ export default { |
1889 | 1888 | classRules: [v => !!v || " Class Name is required"], |
1890 | 1889 | sectionRules: [v => !!v || " Section Name is required"], |
1891 | 1890 | genderRules: [v => !!v || " Select Gender is required"], |
1892 | - fatheCellNoRules: [v => !!v || " father Cell Number is required"], | |
1891 | + fatheCellNoRules: [ | |
1892 | + v => !!v || " father Cell Number is required", | |
1893 | + v => v <= 10000000000 || "Max 10 characters is required" | |
1894 | + ], | |
1895 | + motherCellNoRules: [ | |
1896 | + v => !!v || " Mother Cell Number is required", | |
1897 | + v => v <= 10000000000 || "Max 10 characters is required" | |
1898 | + ], | |
1893 | 1899 | establishmentYearRules: [v => !!v || " Academic Year is required"], |
1894 | 1900 | errorMessages: "", |
1895 | 1901 | countries: [], |
... | ... | @@ -2192,7 +2198,7 @@ export default { |
2192 | 2198 | country: this.addStudents.country, |
2193 | 2199 | permanentAddress: this.addStudents.permanentAddress, |
2194 | 2200 | presentAddress: this.addStudents.presentAddress, |
2195 | - mobile: this.addStudents.mobile, | |
2201 | + mobile: "+91" + this.addStudents.mobile, | |
2196 | 2202 | state: this.addStudents.state, |
2197 | 2203 | gender: this.addStudents.gender, |
2198 | 2204 | establishmentYear: this.addStudents.establishmentYear, |
... | ... | @@ -2248,7 +2254,7 @@ export default { |
2248 | 2254 | country: this.editedItem.country, |
2249 | 2255 | permanentAddress: this.editedItem.permanentAddress, |
2250 | 2256 | presentAddress: this.editedItem.presentAddress, |
2251 | - mobile: this.editedItem.mobile, | |
2257 | + mobile: "+91" + this.editedItem.mobile, | |
2252 | 2258 | state: this.editedItem.state, |
2253 | 2259 | gender: this.editedItem.gender, |
2254 | 2260 | establishmentYear: this.editedItem.establishmentYear, |
... | ... | @@ -2285,6 +2291,8 @@ export default { |
2285 | 2291 | }, |
2286 | 2292 | submitParentDetails() { |
2287 | 2293 | if (this.$refs.parentForm.validate()) { |
2294 | + this.parentData.fatherCellNo = "+91" + this.parentData.fatherCellNo; | |
2295 | + this.parentData.motherCellNo = "+91" + this.parentData.motherCellNo; | |
2288 | 2296 | let addparentDetails = { |
2289 | 2297 | email: this.parentData.email, |
2290 | 2298 | fatherName: this.parentData.fatherName, | ... | ... |