Commit d9bb52b5bc17cb3de00c9c22f78654feb2594560

Authored by Neeraj Sharma
1 parent 99cd791848

implement trello task

src/Services/http.js
... ... @@ -7,7 +7,7 @@ const baseURL = `${baseDomain}`;
7 7  
8 8 export default () => {
9 9 return axios.create({
10   - // baseURL: 'http://192.168.0.108:3002/v1',
  10 + // baseURL: 'http://192.168.0.120:3002/v1',
11 11 baseURL,
12 12 headers: {
13 13 Authorization: `Bearer ${store.state.token}`
... ...
src/pages/Account/editInvoice.vue
... ... @@ -492,6 +492,12 @@ export default {
492 492 feeType.paidAmount =
493 493 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
494 494 this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
  495 +
  496 + // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value.
  497 + if (feeType.paidAmount > feeType.subTotal) {
  498 + this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal;
  499 + this.feeType.paidAmount = feeType.subTotal;
  500 + }
495 501 }
496 502 },
497 503 getPayMethodList() {
... ...
src/pages/Account/feeTypes.vue
... ... @@ -47,7 +47,6 @@
47 47 <v-text-field
48 48 v-model="editedItem.feeType"
49 49 placeholder="fill your Fee Type"
50   - :rules="feetTypeRules"
51 50 required
52 51 ></v-text-field>
53 52 </v-flex>
... ... @@ -61,7 +60,6 @@
61 60 name="input-7-1"
62 61 v-model="editedItem.note"
63 62 placeholder="fill your Note"
64   - :rules="noteRules"
65 63 multi-line
66 64 required
67 65 ></v-textarea>
... ... @@ -230,7 +228,6 @@
230 228 v-model="feeTypeData.note"
231 229 placeholder="fill your Note"
232 230 type="text"
233   - :rules="noteRules"
234 231 multi-line
235 232 required
236 233 ></v-textarea>
... ...
src/pages/Account/invoice.vue
... ... @@ -116,11 +116,16 @@
116 116 class="red lighten-1 pa-2 white--text paymentStatus"
117 117 >{{ props.item.paymentStatus }}</span>
118 118 </td>
119   - <td id="td" class="text-xs-center" v-if="props.item.paymentStatus != 'NOT_PAID'">
  119 + <td id="td" class="text-xs-center" v-if="props.item.paymentStatus === 'FULLY_PAID'">
120 120 <span
121 121 class="green lighten-1 pa-2 white--text paymentStatus"
122 122 >{{ props.item.paymentStatus }}</span>
123 123 </td>
  124 + <td id="td" class="text-xs-center" v-if="props.item.paymentStatus === 'PARTIALLY_PAID'">
  125 + <span
  126 + class="yellow darken-3 pa-2 white--text paymentStatus"
  127 + >{{ props.item.paymentStatus }}</span>
  128 + </td>
124 129 <td id="td" class="text-xs-center">{{ dates(props.item.date) }}</td>
125 130 <td>
126 131 <router-link :to="{ name:'ViewInvoice',params: { viewInvoiceId:props.item._id } }">
... ... @@ -176,7 +181,7 @@
176 181 :right="x === 'right'"
177 182 :vertical="mode === 'vertical'"
178 183 v-model="snackbar"
179   - color="success"
  184 + :color="color"
180 185 >{{ text }}</v-snackbar>
181 186 <v-flex xs12 sm12>
182 187 <v-container fluid>
... ... @@ -423,8 +428,9 @@ export default {
423 428 y: "top",
424 429 x: "right",
425 430 mode: "",
426   - timeout: 3000,
  431 + timeout: 5000,
427 432 text: "",
  433 + color: "",
428 434 showLoader: false,
429 435 loading: false,
430 436 date: null,
... ... @@ -546,9 +552,9 @@ export default {
546 552 }
547 553 )
548 554 .then(response => {
549   - if ((this.snackbar = true)) {
550   - this.text = "Successfully delete Existing Invoice";
551   - }
  555 + this.snackbar = true;
  556 + this.text = "Successfully delete Existing Invoice";
  557 + this.color = "green";
552 558 this.getInvoiceList();
553 559 })
554 560 .catch(error => {
... ... @@ -578,6 +584,23 @@ export default {
578 584 close1() {
579 585 this.dialog1 = false;
580 586 },
  587 + // totalAmount() {
  588 + // // console.log("this.feeType.paidAmount ", this.feeType.paidAmount);
  589 + // // console.log(
  590 + // // "this.feeType.subTotalAAAAAAAAAAAAAAA ",
  591 + // // this.feeType.subTotal
  592 + // // );
  593 +
  594 + // if (this.feeType.paidAmount < this.feeType.subTotal) {
  595 + // console.log("this.feeType.subTotalBBBBBBBBBBB ", this.feeType.subTotal);
  596 +
  597 + // this.feeType.paidAmount = this.feeType.subTotal;
  598 + // console.log(
  599 + // "this.feeType.paidAmount BBBBBBBBBBB",
  600 + // this.feeType.paidAmount
  601 + // );
  602 + // }
  603 + // },
581 604 submit() {
582 605 let feeTypeId = "";
583 606 for (let i = 0; i < this.feeTypes.length; i++) {
... ... @@ -607,6 +630,7 @@ export default {
607 630 this.getInvoiceList();
608 631 this.snackbar = true;
609 632 this.text = "New Invoice added successfully";
  633 + this.color = "green";
610 634 this.clear();
611 635 this.feeTypeData = [];
612 636 if (this.feeTypeData.length == 0) {
... ... @@ -621,9 +645,10 @@ export default {
621 645 this.loading = false;
622 646 })
623 647 .catch(error => {
624   - // console.log(error);
  648 + console.log(error.response.data.errors[0].messages[0]);
625 649 this.snackbar = true;
626   - this.text = error.response.data.message;
  650 + this.text = error.response.data.errors[0].messages[0];
  651 + this.color = "error";
627 652 this.loading = false;
628 653 });
629 654 }
... ... @@ -686,6 +711,7 @@ export default {
686 711 });
687 712 },
688 713 getAllStudents() {
  714 + this.showLoader = true;
689 715 http()
690 716 .get("/getStudentsList", {
691 717 params: {
... ... @@ -696,8 +722,10 @@ export default {
696 722 })
697 723 .then(response => {
698 724 this.studentList = response.data.data;
  725 + this.showLoader = false;
699 726 })
700 727 .catch(err => {
  728 + this.showLoader = false;
701 729 // console.log("err====>", err);
702 730 // this.$router.replace({ path: "/" });
703 731 });
... ... @@ -746,7 +774,6 @@ export default {
746 774 feeType.subParticularTotal =
747 775 this.feeTypeData[i].amount -
748 776 (this.feeTypeData[i].amount * this.feeTypeData[i].discount) / 100;
749   - // console.log("feeType.subTotal", feeType.subTotal);
750 777 this.feeTypeData[i].subTotal = feeType.subParticularTotal.toFixed(2);
751 778 }
752 779  
... ... @@ -761,6 +788,12 @@ export default {
761 788 feeType.paidAmount =
762 789 Number(feeType.paidAmount) + Number(this.feeTypeData[i].paidAmount);
763 790 this.feeType.paidAmount = feeType.paidAmount.toFixed(2);
  791 +
  792 + // if paid Amount fill large of subtotal value so this condition are fixed filled subtotal value.
  793 + if (feeType.paidAmount > feeType.subTotal) {
  794 + this.feeTypeData[i].paidAmount = this.feeTypeData[i].subTotal;
  795 + this.feeType.paidAmount = feeType.subTotal;
  796 + }
764 797 }
765 798 },
766 799 getPayMethodList() {
... ...
src/pages/Account/viewInvoice.vue
... ... @@ -166,10 +166,8 @@ export default {
166 166 (this.feeType.amount = response.data.data.totalAmount),
167 167 (this.feeType.discount = response.data.data.totalDiscount),
168 168 (this.feeType.subTotal = response.data.data.totalSubTotal),
169   - (this.feeType.totalPaidAmount = response.data.data.totalPaidAmount(
170   - // console.log("response.data.data.totalPaidAmount",response.data.data.totalPaidAmount)
171   - (this.showLoader = false)
172   - ));
  169 + (this.feeType.totalPaidAmount = response.data.data.totalPaidAmount);
  170 + this.showLoader = false;
173 171 })
174 172 .catch(error => {
175 173 this.showLoader = false;
... ...
src/pages/Class/addclass.vue
... ... @@ -45,12 +45,11 @@
45 45 <label class="right">Class:</label>
46 46 </v-flex>
47 47 <v-flex xs9 class="ml-2">
48   - <v-autocomplete
  48 + <v-text-field
49 49 v-model="editedItem.classNum"
50   - :label="editedItem.classNum"
51   - :items="classList"
  50 + @keyup.enter="save"
52 51 :rules="nameRules"
53   - ></v-autocomplete>
  52 + ></v-text-field>
54 53 </v-flex>
55 54 </v-layout>
56 55 <v-card-actions>
... ... @@ -109,7 +108,7 @@
109 108 <!-- ****** EXISTING-USERS Classess Table ****** -->
110 109 <v-data-table
111 110 :headers="headers"
112   - :items="desserts"
  111 + :items="classList"
113 112 :pagination.sync="pagination"
114 113 :search="search"
115 114 >
... ... @@ -182,14 +181,13 @@
182 181 <label class="right">Class :</label>
183 182 </v-flex>
184 183 <v-flex xs6 class="ml-3">
185   - <v-autocomplete
  184 + <v-text-field
186 185 v-model="addclasses.classNum"
187 186 placeholder="fill your class Name"
188 187 type="text"
189   - :items="classList"
190 188 :rules="nameRules"
191 189 required
192   - ></v-autocomplete>
  190 + ></v-text-field>
193 191 </v-flex>
194 192 </v-layout>
195 193 <v-layout>
... ... @@ -253,8 +251,7 @@ export default {
253 251  
254 252 { text: "Action", value: "", sortable: false, align: "center" }
255 253 ],
256   - desserts: [],
257   - classList: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
  254 + classList: [],
258 255 editedIndex: -1,
259 256 editedItem: {
260 257 classNum: ""
... ... @@ -270,7 +267,7 @@ export default {
270 267 http()
271 268 .get("/getClassesList")
272 269 .then(response => {
273   - this.desserts = response.data.data;
  270 + this.classList = response.data.data;
274 271 this.showLoader = false;
275 272 })
276 273 .catch(error => {
... ... @@ -283,12 +280,12 @@ export default {
283 280 });
284 281 },
285 282 editItem(item) {
286   - this.editedIndex = this.desserts.indexOf(item);
  283 + this.editedIndex = this.classList.indexOf(item);
287 284 this.editedItem = Object.assign({}, item);
288 285 this.dialog = true;
289 286 },
290 287 profile(item) {
291   - this.editedIndex = this.desserts.indexOf(item);
  288 + this.editedIndex = this.classList.indexOf(item);
292 289 this.editedItem = Object.assign({}, item);
293 290 this.dialog1 = true;
294 291 },
... ...
src/pages/School/school.vue
... ... @@ -470,7 +470,6 @@
470 470 <v-text-field
471 471 v-model="addSchool.societyName"
472 472 placeholder="fill your Society Name"
473   - :rules="cityRules"
474 473 required
475 474 ></v-text-field>
476 475 </v-flex>
... ... @@ -569,7 +568,7 @@
569 568 <v-flex xs8 class="ml-3">
570 569 <v-text-field
571 570 v-model="addSchool.mobile"
572   - placeholder="fill your MobileNo"
  571 + placeholder="fill your Mobile No"
573 572 name="mobileNo"
574 573 type="number"
575 574 :rules="mobileNoRules"
... ... @@ -590,7 +589,6 @@
590 589 <v-text-field
591 590 v-model="addSchool.landLineNo"
592 591 :items="countries"
593   - :rules="landlineNoRule"
594 592 placeholder="fill your LandLine No"
595 593 type="number"
596 594 required
... ... @@ -683,8 +681,7 @@
683 681 <v-text-field
684 682 name="input-4-3"
685 683 v-model="addSchool.websiteUrl"
686   - :rules="presentAddress"
687   - placeholder="fill Your Address"
  684 + placeholder="fill Your WebSite Url"
688 685 required
689 686 ></v-text-field>
690 687 </v-flex>
... ... @@ -770,7 +767,6 @@ export default {
770 767 country: [v => !!v || " Country Name is required"],
771 768 permanentAddress: [v => !!v || " Permanent Address is requiclearred"],
772 769 presentAddress: [v => !!v || " Present Address is required"],
773   - landlineNoRule: [v => !!v || " Present Address is required"],
774 770 mobileNoRules: [v => !!v || "Mobile Number is required"],
775 771 stateRules: [v => !!v || "State Name is required"],
776 772 schoolDetailRule: [v => !!v || "school Detail is required"],
... ...
src/pages/Section/section.vue
... ... @@ -392,15 +392,15 @@ export default {
392 392 classData: {
393 393 classNum: ""
394 394 },
395   - classId: "",
396   - classInchargeId: "",
  395 + // classId: "",
  396 + // classInchargeId: "",
397 397 teacherData: [
398 398 {
399 399 name: ""
400 400 }
401   - ],
402   - name: "",
403   - session: new Date().getFullYear()
  401 + ]
  402 + // name: "",
  403 + // session: new Date().getFullYear()
404 404 },
405 405 sectionData: {
406 406 session: new Date().getFullYear()
... ... @@ -431,7 +431,6 @@ export default {
431 431 editItem(item) {
432 432 this.editedIndex = this.desserts.indexOf(item);
433 433 this.editedItem = Object.assign({}, item);
434   - console.log(this.editedItem);
435 434 this.dialog = true;
436 435 },
437 436 profile(item) {
... ... @@ -451,9 +450,8 @@ export default {
451 450 }
452 451 )
453 452 .then(response => {
454   - if ((this.snackbar = true)) {
455   - this.text = "Successfully delete Existing Section";
456   - }
  453 + this.snackbar = true;
  454 + this.text = "Successfully delete Existing Section";
457 455 this.getSectionList();
458 456 })
459 457 .catch(error => {
... ... @@ -492,26 +490,22 @@ export default {
492 490 name: this.sectionData.name,
493 491 classId: this.sectionData.classNum,
494 492 session: this.sectionData.session,
495   - classInchargeId: this.sectionData._id
  493 + classInchargeId: this.sectionData.sectionId
496 494 };
497 495 this.loading = true;
498 496 http()
499 497 .post("/createSection", addSection)
500 498 .then(response => {
501   - console.log(response);
502 499 this.getSectionList();
503   - if ((this.snackbar = true)) {
504   - this.text = "New Section added successfully";
505   - }
506   -
  500 + this.snackbar = true;
  501 + this.text = "New Section added successfully";
507 502 this.clear();
508 503 this.loading = false;
509 504 })
510 505 .catch(error => {
511 506 // console.log(error);
512   - if ((this.snackbar = true)) {
513   - this.text = error.response.data.message;
514   - }
  507 + this.snackbar = true;
  508 + this.text = error.response.data.message;
515 509 this.loading = false;
516 510 });
517 511 }
... ... @@ -524,16 +518,13 @@ export default {
524 518 http()
525 519 .put("/updateSection", this.editedItem)
526 520 .then(response => {
527   - // console.log("editStudent",editStudent);
528   - if ((this.snackbar = true)) {
529   - this.text = "Successfully Edit Existing Section";
530   - }
  521 + this.snackbar = true;
  522 + this.text = "Successfully Edit Existing Section";
531 523 this.getSectionList();
532 524 this.close();
533 525 })
534 526 .catch(error => {
535 527 this.text = error.response.data.message;
536   - // console.log(error);
537 528 });
538 529 },
539 530 getAllTeacher() {
... ...
src/pages/Students/students.vue
... ... @@ -572,7 +572,7 @@
572 572 </v-flex>
573 573 </v-layout>
574 574 </v-flex>-->
575   - <v-flex xs12 sm6>
  575 + <v-flex xs12 sm6>
576 576 <v-layout>
577 577 <v-flex xs6 sm4>
578 578 <b>
... ... @@ -1730,15 +1730,14 @@
1730 1730 <v-flex xs12 sm6>
1731 1731 <v-layout>
1732 1732 <v-flex xs4 sm4 class="pt-4 subheading">
1733   - <label class="right pr-4">Present Address:</label>
  1733 + <label class="right">Present Address:</label>
1734 1734 </v-flex>
1735 1735 <v-flex xs8 sm8 class="ml-3">
1736 1736 <v-text-field
1737   - name="input-4-3"
1738 1737 v-model="addStudents.presentAddress"
1739 1738 :rules="presentAddress"
1740 1739 placeholder="fill Your present Address"
1741   - required
  1740 + @keyup="copyData"
1742 1741 ></v-text-field>
1743 1742 </v-flex>
1744 1743 </v-layout>
... ... @@ -1749,12 +1748,26 @@
1749 1748 <label class="right">Permanent Address:</label>
1750 1749 </v-flex>
1751 1750 <v-flex xs12 sm8 class="ml-3">
  1751 + <v-switch
  1752 + v-model="addStudents.permanentAddress"
  1753 + label="Select Permanent Address"
  1754 + :value="addStudents.presentAddress"
  1755 + ></v-switch>
  1756 + </v-flex>
  1757 + </v-layout>
  1758 + </v-flex>
  1759 + </v-layout>
  1760 + <v-layout class="hidden-xs-only hidden-sm-only">
  1761 + <v-flex xs12 sm6>
  1762 + <v-layout>
  1763 + <v-flex xs4 sm4 class="pt-4 subheading addressForm">
  1764 + <label class="right">Permanent Address:</label>
  1765 + </v-flex>
  1766 + <v-flex xs12 sm8 class="ml-3">
1752 1767 <v-text-field
1753   - name="input-4-3"
1754 1768 v-model="addStudents.permanentAddress"
1755 1769 :rules="permanentAddress"
1756 1770 placeholder="fill Your Permanent Address"
1757   - required
1758 1771 ></v-text-field>
1759 1772 </v-flex>
1760 1773 </v-layout>
... ... @@ -1764,7 +1777,7 @@
1764 1777 <v-flex xs12 sm12>
1765 1778 <v-layout>
1766 1779 <v-flex xs12 sm12 class="pt-4 subheading text-xs-center">
1767   - <label class>Present Address :</label>
  1780 + <label class>Present Address:</label>
1768 1781 </v-flex>
1769 1782 </v-layout>
1770 1783 <v-layout>
... ... @@ -1786,7 +1799,7 @@
1786 1799 sm12
1787 1800 class="pt-4 pr-4 subheading text-xs-center addressForm"
1788 1801 >
1789   - <label>Permanent addr:</label>
  1802 + <label>Permanent Address:</label>
1790 1803 </v-flex>
1791 1804 </v-layout>
1792 1805 <v-layout>
... ... @@ -2168,6 +2181,9 @@ export default {
2168 2181 close1() {
2169 2182 this.dialog1 = false;
2170 2183 },
  2184 + copyData() {
  2185 + this.addStudents.permanentAddress = this.addStudents.presentAddress;
  2186 + },
2171 2187 submit() {
2172 2188 if (this.$refs.form.validate()) {
2173 2189 let addStudent = {
... ... @@ -2297,6 +2313,7 @@ export default {
2297 2313 },
2298 2314 getParentDetails() {
2299 2315 if (this.parentData.fatherCellNo.length > 9) {
  2316 + this.showLoader = true;
2300 2317 http()
2301 2318 .get("getParticularParent", {
2302 2319 params: { fatherCellNo: this.parentData.fatherCellNo },
... ... @@ -2309,9 +2326,13 @@ export default {
2309 2326 this.showParent = false;
2310 2327 this.parentData = response.data.data;
2311 2328 this.parentId = response.data.data._id;
  2329 + this.showLoader = false;
2312 2330 })
2313 2331 .catch(error => {
2314 2332 console.log("err====>", error.response.data.message);
  2333 + this.text = error.response.data.message;
  2334 + this.snackbar = true;
  2335 + this.showLoader = false;
2315 2336 });
2316 2337 }
2317 2338 }
... ...
src/pages/Teachers/teachers.vue
... ... @@ -825,7 +825,7 @@
825 825 v-model="addTeachers.presentAddress"
826 826 :rules="presentAddress"
827 827 placeholder="fill Your present Address"
828   - required
  828 + @keyup="copyData"
829 829 ></v-text-field>
830 830 </v-flex>
831 831 </v-layout>
... ... @@ -836,6 +836,22 @@
836 836 <label class="right">Permanent Address:</label>
837 837 </v-flex>
838 838 <v-flex xs12 md8 class="ml-3">
  839 + <v-switch
  840 + v-model="addTeachers.permanentAddress"
  841 + label="Select Permanent Address"
  842 + :value="addTeachers.presentAddress"
  843 + ></v-switch>
  844 + </v-flex>
  845 + </v-layout>
  846 + </v-flex>
  847 + </v-layout>
  848 + <v-layout class="hidden-xs-only hidden-sm-only">
  849 + <v-flex xs12 sm6>
  850 + <v-layout>
  851 + <v-flex xs4 md4 class="pt-4 subheading addressForm">
  852 + <label class="right">Permanent Address:</label>
  853 + </v-flex>
  854 + <v-flex xs12 md8 class="ml-3">
839 855 <v-text-field
840 856 name="input-4-3"
841 857 v-model="addTeachers.permanentAddress"
... ... @@ -1158,6 +1174,9 @@ export default {
1158 1174 close1() {
1159 1175 this.dialog1 = false;
1160 1176 },
  1177 + copyData() {
  1178 + this.addTeachers.permanentAddress = this.addTeachers.presentAddress;
  1179 + },
1161 1180 submit() {
1162 1181 if (this.$refs.form.validate()) {
1163 1182 let addTeacher = {
... ...
src/pages/generalSetting/generalSetting.vue
1 1 <template>
2 2 <v-app id="login">
3   - <v-container fill-height>
  3 + <v-container>
4 4 <v-layout>
5 5 <v-flex xs12 sm12 md12 lg12 class="mt-5">
6 6 <v-toolbar class="fixcolors mt-5" dark>
... ... @@ -8,70 +8,107 @@
8 8 <v-toolbar-title>General Setting</v-toolbar-title>
9 9 <v-spacer></v-spacer>
10 10 </v-toolbar>
11   - <v-card class="elevation-1 pa-3" id="form">
  11 + <v-card class="elevation-1" id="form">
12 12 <v-card-text>
13 13 <v-flex xs12>
14 14 <v-form class="mt-3" ref="form" v-model="valid" lazy-validation>
  15 + <v-layout>
  16 + <v-flex
  17 + xs12
  18 + class="text-xs-center text-sm-center text-md-center text-lg-center mb-4"
  19 + >
  20 + <v-avatar size="100px">
  21 + <img src="/static/icon/user.png" v-if="!imageUrl" />
  22 + </v-avatar>
  23 + <input
  24 + type="file"
  25 + style="display: none"
  26 + ref="image"
  27 + accept="image/*"
  28 + @change="onFilePicked"
  29 + />
  30 + <img :src="imageData.imageUrl" height="150" width="200" v-if="imageUrl" />
  31 + </v-flex>
  32 + </v-layout>
15 33 <v-flex xs12>
16 34 <!-- <v-layout> -->
17   - <v-flex xs12>
18   - <v-layout>
19   - <v-flex xs4 sm4>
20   - <label class="subheading right pt-4">Site Title:</label>
21   - </v-flex>
22   - <v-flex xs8 sm5>
23   - <v-text-field
24   - class="ml-3"
25   - placeholder="fill your Site title"
26   - v-model="setting.name"
27   - ></v-text-field>
28   - </v-flex>
29   - </v-layout>
30   - </v-flex>
31   - <v-flex xs12>
32   - <v-layout>
33   - <v-flex xs4 sm4>
34   - <label class="subheading right pt-4">Phone:</label>
35   - </v-flex>
36   - <v-flex xs8 sm5>
37   - <v-text-field
38   - class="ml-3"
39   - placeholder="fill your Phone number"
40   - v-model="setting.mobile"
41   - ></v-text-field>
42   - </v-flex>
43   - </v-layout>
44   - </v-flex>
  35 + <v-flex xs12>
  36 + <v-layout>
  37 + <v-flex xs4 sm4>
  38 + <label class="subheading right pt-4">Site Title:</label>
  39 + </v-flex>
  40 + <v-flex xs8 sm5>
  41 + <v-text-field
  42 + class="ml-3"
  43 + placeholder="fill your Site title"
  44 + v-model="setting.name"
  45 + ></v-text-field>
  46 + </v-flex>
  47 + </v-layout>
  48 + </v-flex>
  49 + <v-flex xs12>
  50 + <v-layout>
  51 + <v-flex xs4 sm4>
  52 + <label class="subheading right pt-4">Phone:</label>
  53 + </v-flex>
  54 + <v-flex xs8 sm5>
  55 + <v-text-field
  56 + class="ml-3"
  57 + placeholder="fill your Phone number"
  58 + v-model="setting.mobile"
  59 + ></v-text-field>
  60 + </v-flex>
  61 + </v-layout>
  62 + </v-flex>
45 63 <!-- </v-layout> -->
46 64 <!-- <v-layout> -->
47   - <v-flex xs12>
48   - <v-layout>
49   - <v-flex xs4 sm4>
50   - <label class="subheading right pt-4">Email:</label>
51   - </v-flex>
52   - <v-flex xs8 sm5>
53   - <v-text-field
54   - class="ml-3"
55   - placeholder="fill your email"
56   - v-model="setting.email"
57   - ></v-text-field>
58   - </v-flex>
59   - </v-layout>
60   - </v-flex>
61   - <v-flex xs12>
62   - <v-layout>
63   - <v-flex xs4 sm4>
64   - <label class="subheading right pt-4">Address:</label>
65   - </v-flex>
66   - <v-flex xs8 sm5>
67   - <v-text-field
68   - class="ml-3"
69   - placeholder="fill your Address"
70   - v-model="setting.address"
71   - ></v-text-field>
72   - </v-flex>
73   - </v-layout>
74   - </v-flex>
  65 + <v-flex xs12>
  66 + <v-layout>
  67 + <v-flex xs4 sm4>
  68 + <label class="subheading right pt-4">Email:</label>
  69 + </v-flex>
  70 + <v-flex xs8 sm5>
  71 + <v-text-field
  72 + class="ml-3"
  73 + placeholder="fill your email"
  74 + v-model="setting.email"
  75 + ></v-text-field>
  76 + </v-flex>
  77 + </v-layout>
  78 + </v-flex>
  79 + <v-flex xs12>
  80 + <v-layout>
  81 + <v-flex xs4 sm4>
  82 + <label class="subheading right pt-4">Address:</label>
  83 + </v-flex>
  84 + <v-flex xs8 sm5>
  85 + <v-text-field
  86 + class="ml-3"
  87 + placeholder="fill your Address"
  88 + v-model="setting.address"
  89 + ></v-text-field>
  90 + </v-flex>
  91 + </v-layout>
  92 + </v-flex>
  93 + <v-flex xs12>
  94 + <v-layout>
  95 + <v-flex xs4 sm4>
  96 + <label class="right hidden-xs-only hidden-sm-only pt-4">Uplaod Image:</label>
  97 + <label
  98 + class="right hidden-lg-only hidden-md-only hidden-xl-only pt-4"
  99 + >Uplaod :</label>
  100 + </v-flex>
  101 + <v-flex xs8 sm5>
  102 + <v-text-field
  103 + class="ml-3"
  104 + label="Select Image"
  105 + @click="pickFile"
  106 + v-model="imageName"
  107 + append-icon="attach_file"
  108 + ></v-text-field>
  109 + </v-flex>
  110 + </v-layout>
  111 + </v-flex>
75 112 <!-- </v-layout> -->
76 113 </v-flex>
77 114 </v-form>
... ... @@ -120,7 +157,11 @@ export default {
120 157 setting: {},
121 158 valid: true,
122 159 loading: false,
123   - text: ""
  160 + text: "",
  161 + imageData: {},
  162 + imageName: "",
  163 + imageUrl: "",
  164 + imageFile: ""
124 165 };
125 166 },
126 167 mounted() {
... ... @@ -128,9 +169,39 @@ export default {
128 169 // this.getRole();
129 170 },
130 171 methods: {
  172 + pickFile() {
  173 + this.$refs.image.click();
  174 + },
  175 + onFilePicked(e) {
  176 + // console.log(e)
  177 + const files = e.target.files;
  178 + this.imageData.upload = e.target.files[0];
  179 + if (files[0] !== undefined) {
  180 + this.imageName = files[0].name;
  181 + if (this.imageName.lastIndexOf(".") <= 0) {
  182 + return;
  183 + }
  184 + const fr = new FileReader();
  185 + fr.readAsDataURL(files[0]);
  186 + fr.addEventListener("load", () => {
  187 + this.imageUrl = fr.result;
  188 + this.imageFile = files[0]; // this is an image file that can be sent to server...
  189 + this.imageData.imageUrl = URL.createObjectURL(this.imageFile);
  190 + });
  191 + } else {
  192 + this.imageName = "";
  193 + this.imageFile = "";
  194 + this.imageUrl = "";
  195 + }
  196 + },
131 197 reset() {
132 198 if (this.$refs.form.validate()) {
133 199 this.loading = true;
  200 + if (this.imageUrl) {
  201 + var str = this.imageUrl;
  202 + const [baseUrl, imageUrl] = str.split(/,/);
  203 + this.setting.upload = imageUrl;
  204 + }
134 205 this.setting.schoolId = this.$store.state.id;
135 206 http()
136 207 .put("/updateSchool", this.setting, {
... ... @@ -141,6 +212,7 @@ export default {
141 212 this.snackbar = true;
142 213 this.text = response.data.message;
143 214 this.color = "green";
  215 + this.imageUrl = "";
144 216 this.clear();
145 217 })
146 218 .catch(error => {
... ... @@ -206,11 +278,6 @@ export default {
206 278 };
207 279 </script>
208 280 <style scoped>
209   -img {
210   - position: absolute;
211   - top: 13px;
212   - left: 50px;
213   -}
214 281 .v-btn--large {
215 282 padding: 0px 74px;
216 283 }
... ...