Commit 1c69557ac3f458e77fc45d3ca2622783b10cc2dc

Authored by Neeraj Sharma
1 parent 00e4bc4e16

implement design bulkImport

... ... @@ -91,6 +91,8 @@ const adminMenu = [
91 91 { name: 'systemAdmin', title: 'System Admin', component: 'systemAdmin', action: '', },
92 92 { name: 'resetPassword', title: 'Reset Password', component: 'resetPassword', action: '', },
93 93 { name: 'Role', title: 'Role', component: 'Role', action: '', },
  94 + { name: 'bulkImportole', title: 'Bulk Import', component: 'bulkImport', action: '', },
  95 +
94 96 ]
95 97 },
96 98 {
... ... @@ -188,7 +190,7 @@ const schoolMenu = [
188 190 // group: 'apps',
189 191 path: '/school',
190 192 icon: '/static/schoolIcons/Dashboard.png',
191   - },
  193 + }
192 194 ];
193 195  
194 196 // reorder menu
... ...
src/components/pageHeader/AppToolbar.vue
... ... @@ -9,7 +9,7 @@
9 9 xs7
10 10 sm3
11 11 class="userSearch"
12   - v-if="$route.name != 'Dashboard' && $route.name != 'changepassword' && $route.name != 'generalSetting' && $route.name != 'resetPassword'"
  12 + v-if="$route.name != 'Dashboard' && $route.name != 'changepassword' && $route.name != 'generalSetting' && $route.name != 'resetPassword' && $route.name != 'bulkImport'"
13 13 >
14 14 <v-text-field
15 15 flat
... ...
src/pages/Administrator/bulkImport.vue
... ... @@ -0,0 +1,271 @@
  1 +<template>
  2 + <v-container fluid grid-list-md>
  3 + <v-card flat>
  4 + <v-toolbar class="fixcolors" dark flat>
  5 + <v-spacer></v-spacer>
  6 + <v-toolbar-title>Import</v-toolbar-title>
  7 + <v-spacer></v-spacer>
  8 + </v-toolbar>
  9 + <v-container fluid>
  10 + <v-layout>
  11 + <v-flex xs12>
  12 + <v-layout wrap>
  13 + <v-flex xs6 sm5 lg2 class="pt-4">
  14 + <label class="title right">Add Teacher:</label>
  15 + </v-flex>
  16 + <v-flex xs12 sm6 lg3>
  17 + <v-text-field v-model="teacherFileName" placeholder="Choose file" :disabled="true"></v-text-field>
  18 + <input
  19 + type="file"
  20 + style="display: none"
  21 + ref="file"
  22 + @change="picFileTeacher($event)"
  23 + />
  24 + </v-flex>
  25 + <v-flex xs6 sm4 lg2 class="mt-1">
  26 + <v-btn class="grey" dark block @click="pickFile">
  27 + <v-icon small class="pr-1">refresh</v-icon>Upload
  28 + </v-btn>
  29 + </v-flex>
  30 + <v-flex xs6 sm4 lg2 class="mt-1">
  31 + <v-btn class="grey" dark block>import</v-btn>
  32 + </v-flex>
  33 + <v-flex xs12 sm4 lg2 class="mt-1">
  34 + <download-csv :data="teacherData">
  35 + <v-btn class="blue lighten-2" dark block>
  36 + <v-icon small class="pr-1">archive</v-icon>sample download
  37 + </v-btn>
  38 + </download-csv>
  39 + </v-flex>
  40 + </v-layout>
  41 + </v-flex>
  42 + </v-layout>
  43 + <v-layout>
  44 + <v-flex xs12>
  45 + <v-layout wrap>
  46 + <v-flex xs6 sm5 lg2 class="pt-4">
  47 + <label class="title right">Add Parent:</label>
  48 + </v-flex>
  49 + <v-flex xs12 sm6 lg3>
  50 + <v-text-field v-model="parentFileName" placeholder="Choose file" :disabled="true"></v-text-field>
  51 + </v-flex>
  52 + <v-flex xs6 sm4 lg2 class="mt-1">
  53 + <v-btn class="grey" dark block @click="pickFile">
  54 + <v-icon small class="pr-1">refresh</v-icon>Upload
  55 + </v-btn>
  56 + </v-flex>
  57 + <v-flex xs6 sm4 lg2 class="mt-1">
  58 + <v-btn class="grey" dark block>import</v-btn>
  59 + </v-flex>
  60 + <v-flex xs12 sm4 lg2 class="mt-1">
  61 + <download-csv :data="parentData">
  62 + <v-btn class="blue lighten-2" dark block>
  63 + <v-icon small class="pr-1">archive</v-icon>sample download
  64 + </v-btn>
  65 + </download-csv>
  66 + </v-flex>
  67 + </v-layout>
  68 + </v-flex>
  69 + </v-layout>
  70 + <v-layout>
  71 + <v-flex xs12>
  72 + <v-layout wrap>
  73 + <v-flex xs6 sm5 lg2 class="pt-4">
  74 + <label class="title right">Add User:</label>
  75 + </v-flex>
  76 + <v-flex xs12 sm6 lg3>
  77 + <v-text-field placeholder="Choose file" :disabled="true"></v-text-field>
  78 + </v-flex>
  79 + <v-flex xs6 sm4 lg2 class="mt-1">
  80 + <v-btn class="grey" dark block>
  81 + <v-icon small class="pr-1">refresh</v-icon>Upload
  82 + </v-btn>
  83 + </v-flex>
  84 + <v-flex xs6 sm4 lg2 class="mt-1">
  85 + <v-btn class="grey" dark block>import</v-btn>
  86 + </v-flex>
  87 + <v-flex xs12 sm4 lg2 class="mt-1">
  88 + <download-csv :data="userData">
  89 + <v-btn class="blue lighten-2" dark block>
  90 + <v-icon small class="pr-1">archive</v-icon>sample download
  91 + </v-btn>
  92 + </download-csv>
  93 + </v-flex>
  94 + </v-layout>
  95 + </v-flex>
  96 + </v-layout>
  97 + <v-layout>
  98 + <v-flex xs12>
  99 + <v-layout wrap>
  100 + <v-flex xs6 sm5 lg2 class="pt-4">
  101 + <label class="title right">Add Book:</label>
  102 + </v-flex>
  103 + <v-flex xs12 sm6 lg3>
  104 + <v-text-field placeholder="Choose file" :disabled="true"></v-text-field>
  105 + </v-flex>
  106 + <v-flex xs6 sm4 lg2 class="mt-1">
  107 + <v-btn class="grey" dark block>
  108 + <v-icon small class="pr-1">refresh</v-icon>Upload
  109 + </v-btn>
  110 + </v-flex>
  111 + <v-flex xs6 sm4 lg2 class="mt-1">
  112 + <v-btn class="grey" dark block>import</v-btn>
  113 + </v-flex>
  114 + <v-flex xs12 sm4 lg2 class="mt-1">
  115 + <download-csv :data="bookData">
  116 + <v-btn class="blue lighten-2" dark block>
  117 + <v-icon small class="pr-1">archive</v-icon>sample download
  118 + </v-btn>
  119 + </download-csv>
  120 + </v-flex>
  121 + </v-layout>
  122 + </v-flex>
  123 + </v-layout>
  124 + <v-layout>
  125 + <v-flex xs12>
  126 + <v-layout wrap>
  127 + <v-flex xs6 sm5 lg2 class="pt-4">
  128 + <label class="title right">Add Student:</label>
  129 + </v-flex>
  130 + <v-flex xs12 sm6 lg3>
  131 + <v-text-field placeholder="Choose file" :disabled="true"></v-text-field>
  132 + </v-flex>
  133 + <v-flex xs6 sm4 lg2 class="mt-1">
  134 + <v-btn class="grey" dark block>
  135 + <v-icon small class="pr-1">refresh</v-icon>Upload
  136 + </v-btn>
  137 + </v-flex>
  138 + <v-flex xs6 sm4 lg2 class="mt-1">
  139 + <v-btn class="grey" dark block>import</v-btn>
  140 + </v-flex>
  141 + <v-flex xs12 sm4 lg2 class="mt-1">
  142 + <download-csv :data="studentData">
  143 + <v-btn class="blue lighten-2" dark block>
  144 + <v-icon small class="pr-1">archive</v-icon>sample download
  145 + </v-btn>
  146 + </download-csv>
  147 + </v-flex>
  148 + </v-layout>
  149 + </v-flex>
  150 + </v-layout>
  151 + <v-layout>
  152 + <v-flex xs12>
  153 + <v-layout wrap>
  154 + <v-flex xs9 sm5 lg2 class="pt-4">
  155 + <label class="title right">Students & Parents:</label>
  156 + </v-flex>
  157 + <v-flex xs12 sm6 lg3>
  158 + <v-text-field placeholder="Choose file" :disabled="true"></v-text-field>
  159 + </v-flex>
  160 + <v-flex xs6 sm4 lg2 class="mt-1">
  161 + <v-btn class="grey" dark block>
  162 + <v-icon small class="pr-1">refresh</v-icon>Upload
  163 + </v-btn>
  164 + </v-flex>
  165 + <v-flex xs6 sm4 lg2 class="mt-1">
  166 + <v-btn class="grey" dark block>import</v-btn>
  167 + </v-flex>
  168 + <v-flex xs12 sm4 lg2 class="mt-1">
  169 + <v-btn class="blue lighten-2" dark block>
  170 + <v-icon small class="pr-1">archive</v-icon>sample download
  171 + </v-btn>
  172 + </v-flex>
  173 + </v-layout>
  174 + </v-flex>
  175 + </v-layout>
  176 + </v-container>
  177 + </v-card>
  178 + </v-container>
  179 +</template>
  180 +
  181 +
  182 +<script>
  183 +import http from "@/Services/http.js";
  184 +import moment from "moment";
  185 +import teacherData from "@/script/teachers.js";
  186 +import studentData from "@/script/students.js";
  187 +import parentData from "@/script/parents.js";
  188 +import userData from "@/script/users.js";
  189 +import bookData from "@/script/books.js";
  190 +
  191 +export default {
  192 + data: () => ({
  193 + teacherData: [],
  194 + studentData: [],
  195 + parentData: [],
  196 + userData: [],
  197 + bookData: [],
  198 + teacher: "TEACHER",
  199 + teacherFileName: "",
  200 + teacherFileUrl: "",
  201 + parent: "PARENT",
  202 + parentFileName: "",
  203 + parentFileUrl: ""
  204 + }),
  205 + methods: {
  206 + pickFile() {
  207 + this.$refs.file.click();
  208 + },
  209 + picFileTeacher(e) {
  210 + console.log(this.parent);
  211 + if (this.teacher === "TEACHER") {
  212 + var vm = this;
  213 + if (window.FileReader) {
  214 + var reader = new FileReader();
  215 + this.teacherFileName = e.target.files[0].name;
  216 + this.teacherFileUrl = e.target.files[0];
  217 + console.log("this.teacherFileUrl", this.teacherFileUrl);
  218 + }
  219 + }
  220 + // if (this.parent === "PARENT") {
  221 + // var vm = this;
  222 + // if (window.FileReader) {
  223 + // var reader = new FileReader();
  224 + // this.parentFileName = e.target.files[0].name;
  225 + // this.parentFileUrl = e.target.files[0];
  226 + // console.log("this.teacherFileUrl", this.parentFileUrl);
  227 + // }
  228 + // }
  229 + // if (this.teacher === "TEACHER") {
  230 + // const files = e.target.files;
  231 + // if (files[0] !== undefined) {
  232 + // this.teacherFileName = files[0].name;
  233 + // if (this.teacherFileName.lastIndexOf(".") <= 0) {
  234 + // return;
  235 + // }
  236 + // const fr = new FileReader();
  237 + // fr.readAsDataURL(files[0]);
  238 + // fr.addEventListener("load", () => {
  239 + // this.teacherFileUrl = fr.result;
  240 + // // this.imageFile = files[0]; // this is an image file that can be sent to server...
  241 + // });
  242 + // } else {
  243 + // this.teacherFileName = "";
  244 + // this.teacherFileUrl = "";
  245 + // }
  246 + // }
  247 + }
  248 + },
  249 + mounted() {
  250 + /** TEACHERS SAMPLE CSV */
  251 + const getTeacherData = teacherData();
  252 + this.teacherData = getTeacherData;
  253 +
  254 + /** STUDENTS SAMPLE CSV */
  255 + const getstudentData = studentData();
  256 + this.studentData = getstudentData;
  257 +
  258 + /** PARENTS SAMPLE CSV */
  259 + const getparentData = parentData();
  260 + this.parentData = getparentData;
  261 +
  262 + /** USERS SAMPLE CSV */
  263 + const getUserData = userData();
  264 + this.userData = getUserData;
  265 +
  266 + /** BOOKS SAMPLE CSV */
  267 + const getBookData = bookData();
  268 + this.bookData = getBookData;
  269 + }
  270 +};
  271 +</script>
0 272 \ No newline at end of file
... ...
src/pages/Attendence/viewStudentsAttendence.vue
... ... @@ -404,7 +404,6 @@ export default {
404 404 type: 'dataURL'
405 405 }
406 406 this.output = await this.$html2canvas(el, options);
407   - console.log(this.output);
408 407 if(this.output) {
409 408 this.loadingPdf = false
410 409 }
... ...
src/router/paths.js
... ... @@ -586,6 +586,18 @@ export default [{
586 586 )
587 587 },
588 588 {
  589 + path: '/bulkImport',
  590 + meta: {},
  591 + name: 'bulkImport',
  592 + props: (route) => ({ type: route.query.type }),
  593 + component: () =>
  594 + import (
  595 + /* webpackChunkName: "routes" */
  596 + /* webpackMode: "lazy-once" */
  597 + `@/pages/Administrator/bulkImport.vue`
  598 + )
  599 + },
  600 + {
589 601 path: '/studentReport',
590 602 meta: {},
591 603 name: 'studentReport',
... ... @@ -622,6 +634,8 @@ export default [{
622 634 )
623 635 },
624 636  
  637 + //////SCHOOL
  638 +
625 639 {
626 640 path: '/school',
627 641 meta: {},
... ...
src/script/books.js
... ... @@ -0,0 +1,22 @@
  1 +export default () => {
  2 +
  3 + const books = [{
  4 + "Book": "Math",
  5 + "Subject": "002015",
  6 + "Author": "R D Sharma",
  7 + "Price": "600",
  8 + "Quantity": "15",
  9 + "Rack": "110",
  10 + },
  11 + {
  12 + "Book": "Hindi",
  13 + "Subject": "059090",
  14 + "Author": "V Kumar",
  15 + "Price": "400",
  16 + "Quantity": "5",
  17 + "Rack": "10",
  18 + },
  19 + ]
  20 + return books;
  21 +
  22 +}
0 23 \ No newline at end of file
... ...
src/script/parents.js
... ... @@ -0,0 +1,20 @@
  1 +export default () => {
  2 +
  3 + const parents = [{
  4 + "email": "digital@theideazfactory.com",
  5 + "fatherName": "Abhishek",
  6 + "fatherCellNo": "9898981234",
  7 + "motherName": "Rita",
  8 + "motherCellNo": "8989786789",
  9 + },
  10 + {
  11 + "email": "Rampal@viithiisys.com",
  12 + "fatherName": "suresh",
  13 + "fatherCellNo": "9898987867",
  14 + "motherName": "rita kumari",
  15 + "motherCellNo": "9768576536",
  16 + }
  17 + ]
  18 + return parents;
  19 +
  20 +}
0 21 \ No newline at end of file
... ...
src/script/students.js
... ... @@ -0,0 +1,31 @@
  1 +export default () => {
  2 +
  3 + const students = [{
  4 + "name": "Rishav Singla",
  5 + "email": "rsingla.rishu@gmail.com",
  6 + "rollNo": "1",
  7 + "dob": "1993-10-08",
  8 + "gender": "Male",
  9 + "bloodGroup": "A+",
  10 + "mobile": "9914092452",
  11 + "city": "Chandigarh",
  12 + "country": "India",
  13 + "presentAddress": "Mohali Sector ",
  14 + "state": "Punjab",
  15 + },
  16 + {
  17 + "name": "Shubham Chugh",
  18 + "email": "shubham@theideazfactory.com",
  19 + "rollNo": "2",
  20 + "dob": "1994-05-29",
  21 + "gender": "Male",
  22 + "bloodGroup": "A+",
  23 + "mobile": "8077362128",
  24 + "city": "Chandigarh",
  25 + "country": "India",
  26 + "presentAddress": "#1571, ground floor, sector 7C",
  27 + "state": "Chandigarh",
  28 + },
  29 + ]
  30 + return students;
  31 +}
0 32 \ No newline at end of file
... ...
src/script/teachers.js
... ... @@ -0,0 +1,27 @@
  1 +export default () => {
  2 +
  3 + const teachers = [{
  4 + "name": "Test Teacher",
  5 + "email": "shubhamchugh1992@gmail.com",
  6 + "dob": "1994-05-01",
  7 + "city": "Chandigarh",
  8 + "country": "India",
  9 + "presentAddress": "SCO 34, second floor",
  10 + "mobileNo": "08558875847",
  11 + "state": "Chandigarh",
  12 + "joinDate": "2019-11-18",
  13 + },
  14 + {
  15 + "name": "Neeraj Sharma",
  16 + "email": "neeraj.sharma@viithiisys.com",
  17 + "dob": "1995-01-14",
  18 + "city": "Mohali",
  19 + "country": "India",
  20 + "presentAddress": "sector 71 ,Mohali",
  21 + "mobileNo": "7009191451",
  22 + "state": "Punjab",
  23 + "joinDate": "2018-04-23",
  24 + }
  25 + ]
  26 + return teachers;
  27 +}
0 28 \ No newline at end of file
... ...
src/script/users.js
... ... @@ -0,0 +1,26 @@
  1 +export default () => {
  2 +
  3 + const users = [{
  4 + "name": "Neeraj",
  5 + "email": "neeraj.sharma@viithiisys.com",
  6 + "dob": "1995-01-14",
  7 + "gender": "Male",
  8 + "religion": "Hindu",
  9 + "address": "Mohali",
  10 + "phone": "1234567890",
  11 + "joiningDate": "2016-08-17",
  12 + },
  13 + {
  14 + "name": "Rishav",
  15 + "email": "rishav.singla@viithiisys.com",
  16 + "dob": "1995-01-14",
  17 + "gender": "Male",
  18 + "religion": "Hindu",
  19 + "address": "Punjab",
  20 + "phone": "9878768790",
  21 + "joiningDate": "2016-08-17",
  22 + }
  23 + ]
  24 + return users;
  25 +
  26 +}
0 27 \ No newline at end of file
... ...