Commit e56d46b1335b1f3019c029df24d2687ba75ceef3

Authored by Shikha Mishra
1 parent 65d5475b66

admit card option added

src/Services/http.js
... ... @@ -15,7 +15,7 @@ const baseURL = `${baseDomain}`;
15 15 // console.log("token",`${store.state.schoolToken}`);
16 16 export default () => {
17 17 return axios.create({
18   - // baseURL: 'http://192.168.0.127:3002/v1',
  18 + // baseURL: 'http://192.168.2.221:3002/v1',
19 19 baseURL,
20 20 headers: {
21 21 Authorization: `Bearer ${store.state.token}`
... ...
... ... @@ -135,7 +135,9 @@ const adminMenu = [
135 135 icon: '/static/icon/reports.png',
136 136 items: [
137 137 { name: 'studentReport', title: 'Student Report', component: 'Student Report', action: '', },
138   - { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', }
  138 + { name: 'ProgressCardReport', title: 'Progress Card Report', component: 'Progress Card Report', action: '', },
  139 + { name: 'idCard', title: 'Id Card Report', component: 'Id Card Report', action: '', },
  140 + { name: 'admitCard', title: 'Admit Card Report', component: 'Admit Card Report', action: '',}
139 141 ]
140 142 },
141 143 {
... ...
src/pages/Report/admitCard.vue
... ... @@ -0,0 +1,616 @@
  1 +<template>
  2 + <v-container fluid class="body-color">
  3 + <!-- **** Admit Card Table **** -->
  4 + <v-card flat class="elevation-0 transparent">
  5 + <v-form ref="form" v-model="valid" lazy-validation>
  6 + <v-flex xs12 sm12 lg12>
  7 + <v-layout wrap>
  8 + <v-flex xs12 sm12 lg3>
  9 + <v-layout>
  10 + <v-flex xs3 sm6 lg4 class="subheading mt-4">
  11 + <label class="right">Exam :</label>
  12 + </v-flex>
  13 + <v-flex xs7 sm6 lg8 class="ml-2">
  14 + <v-autocomplete
  15 + v-model="getReport.examId"
  16 + label="Please Select"
  17 + :items="examData"
  18 + item-text="examName"
  19 + item-value="_id"
  20 + :rules="examRules"
  21 + @change="getExamList"
  22 + required
  23 + ></v-autocomplete>
  24 + </v-flex>
  25 + </v-layout>
  26 + </v-flex>
  27 +
  28 + <v-flex xs12 sm12 lg3>
  29 + <v-layout>
  30 + <v-flex xs3 sm6 lg2 class="subheading mt-4">
  31 + <label class="right">Class:</label>
  32 + </v-flex>
  33 + <v-flex xs9 sm6 lg8 class="ml-2">
  34 + <v-select
  35 + v-model="getReport.classId"
  36 + label="Select your class"
  37 + type="text"
  38 + :items="classList"
  39 + item-text="classNum"
  40 + item-value="_id"
  41 + :rules="classRules"
  42 + @change="getSections(getReport.classId)"
  43 + required
  44 + ></v-select>
  45 + </v-flex>
  46 + </v-layout>
  47 + </v-flex>
  48 + <v-flex xs12 sm12 lg3>
  49 + <v-layout>
  50 + <v-flex xs3 sm6 lg2 class="subheading mt-4">
  51 + <label class="right">Section:</label>
  52 + </v-flex>
  53 + <v-flex xs9 sm6 lg8 class="ml-2">
  54 + <v-select
  55 + :items="addSection"
  56 + label="Select your Section"
  57 + v-model="getReport.sectionId"
  58 + item-text="name"
  59 + item-value="_id"
  60 + name="Select Section"
  61 + @change="getStudents"
  62 + :rules="sectionRules"
  63 + required
  64 + ></v-select>
  65 + </v-flex>
  66 + </v-layout>
  67 + </v-flex>
  68 + <v-flex xs12 sm12 lg3>
  69 + <v-layout>
  70 + <v-flex xs3 sm6 lg2 class="subheading mt-4">
  71 + <label class="right">Student:</label>
  72 + </v-flex>
  73 + <v-flex xs9 sm6 lg8 class="ml-2">
  74 + <v-select
  75 + :items="getStudentsList"
  76 + label="Select your student"
  77 + v-model="getReport.studentId"
  78 + item-text="name"
  79 + item-value="_id"
  80 + :rules="studentRules"
  81 + required
  82 + ></v-select>
  83 + </v-flex>
  84 + </v-layout>
  85 + </v-flex>
  86 +
  87 + <v-flex xs12 sm12 lg4>
  88 + <v-layout>
  89 + <v-flex xs4 sm4 lg3 class="subheading mt-4">
  90 + <label class="right">Type:</label>
  91 + </v-flex>
  92 + <v-flex xs7 sm6 lg8 class="ml-2">
  93 + <v-autocomplete
  94 + label="Please Select"
  95 + type="text"
  96 + :rules="typeRules"
  97 + :items="typeList"
  98 + v-model="getReport.form"
  99 + item-text="name"
  100 + item-value="value"
  101 + @change="getReport(getReport.form)"
  102 + required
  103 + ></v-autocomplete>
  104 + </v-flex>
  105 + </v-layout>
  106 + </v-flex>
  107 + <!-- <v-flex xs12 sm12 lg4>
  108 + <v-layout>
  109 + <v-flex xs4 sm4 lg3 class="subheading mt-4">
  110 + <label class="right">Background:</label>
  111 + </v-flex>
  112 + <v-flex xs7 sm6 lg8 class="ml-2">
  113 + <v-autocomplete
  114 + label="Please Select"
  115 + type="text"
  116 + :rules="backgroundRules"
  117 + :items="backgroundList"
  118 + required
  119 + ></v-autocomplete>
  120 + </v-flex>
  121 + </v-layout>
  122 + </v-flex>-->
  123 + <v-flex xs12 sm12 lg4 class="hidden-xs-only hidden-sm-only pl-5">
  124 + <v-btn
  125 + @click="getSchedule"
  126 + round
  127 + dark
  128 + :loading="loading"
  129 + class="open-dialog-button mt-3 ml-5"
  130 + >Get Report</v-btn>
  131 + </v-flex>
  132 + </v-layout>
  133 + </v-flex>
  134 + </v-form>
  135 + </v-card>
  136 + <div v-if="frontPart">
  137 + <v-layout v-show="showTable">
  138 + <v-flex xs12>
  139 + <v-layout>
  140 + <v-flex xs12>
  141 + <v-btn class="open-dialog-button right" round dark @click="printAdmitReport()">
  142 + Print
  143 + <v-icon right dark>print</v-icon>
  144 + </v-btn>
  145 + </v-flex>
  146 + </v-layout>
  147 + <div class="admincardreport" id="printMe">
  148 + <v-card class="transparent elevation-0">
  149 + <v-layout>
  150 + <v-flex xs12 sm12 md12 class="text-xs-center">
  151 + <div class="line">
  152 + <div class="school-logo">
  153 + <img :src="userData.schoolLogoUrl" width="140" alt="logo" v-if="userData.profilePicUrl"/>
  154 + <img src="/static/icon/dashboard icons-18.png" width="140" v-else-if="!userData.profilePicUrl" />
  155 + </div>
  156 + <div class="school-name">
  157 + <h2>{{ userData.name }}</h2>
  158 + <v-flex class="school-address">
  159 + <p>{{ userData.address }}, {{ userData.pinCode }}</p>
  160 + <h4>First Terminal Exam Admit Card - (2019-2020)</h4>
  161 + </v-flex>
  162 + </div>
  163 + <!-- <div class="student-logo">
  164 + <v-avatar>
  165 + <img :src="studentData.profilePicUrl" width="140" v-if="studentData.profilePicUrl" />
  166 + <img src="/static/icon/user.png" width="140" v-else-if="!studentData.profilePicUrl" />
  167 + </v-avatar>
  168 + </div> -->
  169 + </div>
  170 + <div class="school-info">
  171 + <v-flex xs12 sm12 md12 >
  172 + <div class="student-info" v-if="getScheduleList.studentData">
  173 + <p
  174 + style="font-size:18px;margin:0px;margin-bottom:4px;"
  175 + >Name : {{ getScheduleList.studentData.name }}</p>
  176 + <p
  177 + style="font-size: 18px;margin:0px;margin-bottom:4px;"
  178 + >Class : {{ getScheduleList.studentData.classId.classNum}}</p>
  179 + <p
  180 + style="font-size: 18px;margin:0px;margin-bottom:4px;"
  181 + >Section : {{ getScheduleList.studentData.sectionId.name }}</p>
  182 + <p
  183 + style="font-size: 18px;margin:0px;margin-bottom:4px;"
  184 + >Roll NO : {{ getScheduleList.studentData.rollNo }}</p>
  185 + <p
  186 + style="font-size: 18px;margin:0px;margin-bottom:4px;"
  187 + >Blood Group : {{ getScheduleList.studentData.bloodGroup }}</p>
  188 + <p style="font-size: 18px;color: #707478;">Subject in which Appearing</p>
  189 + </div>
  190 + </v-flex>
  191 + </div>
  192 + </v-flex>
  193 + </v-layout>
  194 + <v-data-table
  195 + :headers="headers"
  196 + :items="getScheduleListArray"
  197 + :pagination.sync="pagination"
  198 + :search="search"
  199 + >
  200 + <template slot="items" slot-scope="props">
  201 + <td class="td td-row">{{ props.index + 1}}</td>
  202 + <td class="td td-row text-xs-center">{{ props.item.date }}</td>
  203 + <td class="td td-row text-xs-center">{{ props.item.timeFrom }}</td>
  204 + <td class="td td-row text-xs-center">{{ props.item.timeTo }}</td>
  205 + <td class="td td-row text-xs-center">{{ props.item.subjectName }}</td>
  206 + </template>
  207 + <v-alert
  208 + slot="no-results"
  209 + :value="true"
  210 + color="error"
  211 + icon="warning"
  212 + >Your search for "{{ search }}" found no results.</v-alert>
  213 + </v-data-table>
  214 + <!-- <v-flex xs12 id="printMe" v-show="hideprintAdmitReport">
  215 + <v-layout>
  216 + <v-flex xs12 style="text-align:center;margin-bottom:10px">
  217 + <img :src="userData.schoolLogoUrl" width="140" alt="logo" v-if="userData.profilePicUrl"/>
  218 + <img src="/static/icon/dashboard icons-18.png" width="140" v-else-if="!userData.profilePicUrl" />
  219 + <p class="title">{{ userData.name }}</p>
  220 + <p>{{ userData.address }}, {{ userData.pinCode }}</p>
  221 + <h4>First Terminal Exam Admit Card - (2019-2020)</h4>
  222 + </v-flex>
  223 + </v-layout>
  224 + <table
  225 + class="mb-5 tableRsponsive feeTypeTable"
  226 + style="border: 1px solid lightgrey;
  227 + border-collapse: collapse;!important
  228 + table-layout: auto !important;
  229 + width: 100% !important;"
  230 + >
  231 + <thead style="border: 1px solid lightgrey !important;">
  232 + <tr style="border: 1px solid lightgrey !important;padding:4px;">
  233 + <td style="border: 1px solid lightgrey !important;padding: 6px;">No</td>
  234 + <td style="border: 1px solid lightgrey !important;padding: 6px;">Exam Date</td>
  235 + <td style="border: 1px solid lightgrey !important;padding: 6px;">Start Time</td>
  236 + <td style="border: 1px solid lightgrey !important;padding: 6px;">End Time</td>
  237 + <td style="border: 1px solid lightgrey !important;padding: 6px;">Subject Name</td>
  238 + </tr>
  239 + </thead>
  240 + <tbody
  241 + style="border: 1px solid lightgrey !important;">
  242 + <tr
  243 + :items="getScheduleListArray"
  244 + slot="items" slot-scope="props" >
  245 + <td
  246 + style="border: 1px soild lightgrey !importand;padding:6px;"
  247 + >{{ props.index + 1 }}</td>
  248 + <td
  249 + style="border: 1px solid lightgrey !important;padding: 6px;"
  250 + >{{ props.item.date }}</td>
  251 + <td
  252 + style="border: 1px solid lightgrey !important;padding: 6px;"
  253 + >{{ props.item.timeFrom }}</td>
  254 + <td
  255 + style="border: 1px solid lightgrey !important;padding: 6px;"
  256 + >{{ props.item.timeTo }}</td>
  257 + <td
  258 + style="border: 1px solid lightgrey !important;padding: 6px;"
  259 + >{{ props.item.subjectName }}</td>
  260 + </tr>
  261 + </tbody>
  262 + </table>
  263 + </v-flex> -->
  264 + </v-card>
  265 + </div>
  266 + </v-flex>
  267 + </v-layout>
  268 + </div>
  269 + <div v-if="backPart">
  270 + <v-layout v-show="showData">
  271 + <v-flex xs12>
  272 + <v-layout>
  273 + <v-flex xs12>
  274 + <v-btn class="open-dialog-button right" round dark @click="printAdmitReport()">
  275 + Print
  276 + <v-icon right dark>print</v-icon>
  277 + </v-btn>
  278 + </v-flex>
  279 + </v-layout>
  280 + <v-flex xs12 sm12 md12 class="text-xs-center">
  281 + <div class="admitcardreportbackend" id="printMe">
  282 + <ol>
  283 + <p>
  284 + <b>1. Do not Carry these Electronic Gadgets:</b>
  285 + Electronic gadgets(Bluetooth devices,head phones,pen/buttonhole cameras,scanner,calculator,storage devices etc)
  286 + in the examination lab. These items are strictly prohibited from examination lab.
  287 + </p>
  288 + <p>
  289 + <b>2. Do not Carry these Ornaments:</b>
  290 + Candidates should also not wear charms,veil,items containing such as rings,bracelet,earings,nose-pin,chains,
  291 + necklace,pendants,badge,broach,hair-pin,hair-band.
  292 + </p>
  293 + <p>
  294 + <b>3. What Candidates wear to Examination hall:</b>
  295 + Candidates should not wear clothes with full sleeves or big button,etc. Candidates are adviced to wear open footwear
  296 + like slippers,sandals instead of shoes as the candidates could be asked to remove shoes by the frisking staff.
  297 + </p>
  298 + <p>
  299 + <b>4. Do not carry Stationary:</b>
  300 + Pen/pencil and paper for rough work would be provided in examination lab. Electronic watch (timer)will be available
  301 + on the computer screen alloted to the candidates.
  302 + </p>
  303 + <p>
  304 + <b>5. Do not Carry Bags:</b>
  305 + Don not Carry back pack, College bag or any other bag like hand bag. If candidates brings any bag, they must make a
  306 + arrangement for safe custody of these items.The Commission shall not make any arrangement nor be responsible for the
  307 + safe custody of such items.
  308 + </p>
  309 + <p>
  310 + <b>6. What will Happen if you carry Prohibited items to Exam Hall:</b>
  311 + If any such prohibited item is found in the possession of a candidate in examination lab, his/her candidature is liable
  312 + to be canceled and legal/criminal proceedings could be initiated against him/her. He/she would also liable to be debarred
  313 + from appearing in future examinations of the Commission for a period of 3 years.
  314 + </p>
  315 + <p>
  316 + <b>7. Candidate should not create Disturbance in Exam Hall:</b>
  317 + If any candidate is found obstructing the conduct of examination or creating disturbances at the examination venue,
  318 + his/her candidature shall be summarily canceled.
  319 + </p>
  320 + </ol>
  321 + </div>
  322 + </v-flex>
  323 + </v-flex>
  324 + </v-layout>
  325 + </div>
  326 + </v-container>
  327 +</template>
  328 +<script>
  329 +import http from "@/Services/http.js";
  330 +import moment from "moment";
  331 +import _ from "underscore";
  332 +
  333 +export default {
  334 + data: () => ({
  335 + valid: true,
  336 + userData: {},
  337 + frontPart: false,
  338 + backPart: false,
  339 + loading: false,
  340 + showTable: false,
  341 + showData: false,
  342 + hideprintAdmitReport: false,
  343 +
  344 + examRules: [v => !!v || "Exam Field is required"],
  345 + classRules: [v => !!v || "Class Field Required"],
  346 + sectionRules: [v => !!v || "Section Field is required"],
  347 + studentRules: [v => !!v || "Student Field is required"],
  348 + typeRules: [v => !!v || "Type Field is required"],
  349 + backgroundRules: [v => !!v || "Background Field is required"],
  350 +
  351 + pagination: {
  352 + rowsPerPage: 10
  353 + },
  354 + search: "",
  355 +
  356 + classList: [],
  357 + studentData: {},
  358 + scheduleData: {},
  359 + examData: [],
  360 + addSection: [],
  361 + getStudentsList: [],
  362 + getScheduleList: [],
  363 + getScheduleListArray: [],
  364 + typeList: [
  365 + {
  366 + name: "Front Part",
  367 + value: "frontPart"
  368 + },
  369 + {
  370 + name: "Back Part",
  371 + value: "backPart"
  372 + }
  373 + ],
  374 + backgroundList: ["Yes", "No"],
  375 +
  376 + headers: [
  377 + {
  378 + text: "No",
  379 + align: "",
  380 + sortable: false,
  381 + value: "No"
  382 + },
  383 + {
  384 + text: "Exam Date",
  385 + align: "center",
  386 + sortable: false,
  387 + value: "date"
  388 + },
  389 + {
  390 + text: "Start Time",
  391 + align: "center",
  392 + sortable: false,
  393 + value: "timeFrom"
  394 + },
  395 + {
  396 + text: "End Time",
  397 + align: "center",
  398 + sortable: false,
  399 + value: "timeTo"
  400 + },
  401 + {
  402 + text: "Subject Name",
  403 + align: "center",
  404 + sortable: false,
  405 + value: "subjectName"
  406 + }
  407 + ]
  408 + }),
  409 +
  410 + mounted() {
  411 + this.token = this.$store.state.token;
  412 + this.getClass();
  413 + this.getExamList();
  414 + this.getUserData();
  415 + },
  416 +
  417 + methods: {
  418 + getReport() {
  419 + if (this.getReport.form === "frontPart") {
  420 + this.frontPart = true;
  421 + this.backPart = false;
  422 + }
  423 + if (this.getReport.form === "backPart") {
  424 + this.frontPart = false;
  425 + this.backPart = true;
  426 + }
  427 + },
  428 + getExamList() {
  429 + this.showLoader = true;
  430 + this.loadingSearch = true;
  431 + http()
  432 + .get("/getExamsList", {
  433 + headers: { Authorization: "Bearer " + this.token }
  434 + })
  435 + .then(response => {
  436 + this.examData = response.data.data;
  437 + this.showLoader = false;
  438 + this.loadingSearch = false;
  439 + })
  440 + .catch(error => {
  441 + this.showLoader = false;
  442 + this.loadingSearch = false;
  443 + this.snackbar = true;
  444 + this.text = error.response.data.message;
  445 + if (error.response.status === 401) {
  446 + this.$router.replace({ path: "/" });
  447 + this.$store.dispatch("setToken", null);
  448 + this.$store.dispatch("Id", null);
  449 + }
  450 + });
  451 + },
  452 + getClass() {
  453 + this.showLoader = true;
  454 + http()
  455 + .get("/getClassesList", {
  456 + headers: { Authorization: "Bearer " + this.token }
  457 + })
  458 + .then(response => {
  459 + this.classList = response.data.data;
  460 + this.showLoader = false;
  461 + })
  462 + .catch(error => {
  463 + this.showLoader = false;
  464 + // console.log("err====>", err);
  465 + });
  466 + },
  467 + getSections(_id) {
  468 + this.showLoader = true;
  469 + http()
  470 + .get(
  471 + "/getSectionsList",
  472 + { params: { classId: _id } },
  473 + {
  474 + headers: { Authorization: "Bearer " + this.token }
  475 + }
  476 + )
  477 + .then(response => {
  478 + this.addSection = response.data.data;
  479 + this.showLoader = false;
  480 + })
  481 + .catch(err => {
  482 + this.showLoader = false;
  483 + // console.log("err====>", err);
  484 + });
  485 + },
  486 + getStudents() {
  487 + this.showLoader = true;
  488 + http()
  489 + .get("/getStudentWithClass", {
  490 + params: {
  491 + classId: this.getReport.classId,
  492 + sectionId: this.getReport.sectionId
  493 + }
  494 + })
  495 + .then(response => {
  496 + this.getStudentsList = response.data.data;
  497 + this.showLoader = false;
  498 + })
  499 + .catch(error => {
  500 + console.log("err====>", error);
  501 + this.showLoader = false;
  502 + });
  503 + },
  504 + getSchedule() {
  505 + this.showLoader = true;
  506 + http()
  507 + .get("/getScheduleForParticularStudent", {
  508 + params: {
  509 + examId: this.getReport.examId,
  510 + classId: this.getReport.classId,
  511 + sectionId: this.getReport.sectionId,
  512 + studentId: this.getReport.studentId
  513 + }
  514 + })
  515 + .then(response => {
  516 + this.getScheduleList = response.data.data;
  517 + this.getScheduleListArray = response.data.data.scheduleData;
  518 + this.showTable = true;
  519 + this.showData = true;
  520 + this.showLoader = false;
  521 + })
  522 + .catch(error => {
  523 + this.showLoader = false;
  524 + });
  525 + },
  526 +
  527 + printAdmitReport() {
  528 + // Pass the element id here
  529 + this.$htmlToPaper("printMe");
  530 + },
  531 + getUserData() {
  532 + http()
  533 + .get("/getParticularUserDetail")
  534 + .then(response => {
  535 + this.userData = response.data.data;
  536 + })
  537 + .catch(error => {
  538 + // if (error.response.status === 401) {
  539 + // this.$router.replace({ path: "/" });
  540 + // this.$store.dispatch("setToken", null);
  541 + // this.$store.dispatch("Id", null);
  542 + // }
  543 + });
  544 + },
  545 + // created() {
  546 + // this.$root.$on("app:search", search => {
  547 + // this.search = search;
  548 + // });
  549 + // },
  550 + // beforeDestroy() {
  551 + // // dont forget to remove the listener
  552 + // this.$root.$off("app:search");
  553 + // }
  554 + }
  555 +};
  556 +</script>
  557 +<style scoped>
  558 +.admincardreport {
  559 + border: 1px solid #ddd;
  560 + overflow: hidden;
  561 + padding: 20px 50px;
  562 + /* margin-bottom: 10px;
  563 + min-height: 443px; */
  564 +}
  565 +.line {
  566 + border-bottom: 1px solid #ddd;
  567 + overflow: hidden;
  568 + padding-bottom: 10px;
  569 + vertical-align: middle;
  570 + /* margin-bottom: 4px; */
  571 +}
  572 +.school-logo {
  573 + float: left;
  574 +}
  575 +.student-logo {
  576 + position: absolute;
  577 + top: 221px;
  578 + right: 221px;
  579 +}
  580 +.school-name {
  581 + box-sizing: border-box;
  582 + align-items: center;
  583 +}
  584 +/* .student-info {
  585 + float: left;
  586 + width: max-content;
  587 + text-align: initial;
  588 +} */
  589 +.student-info {
  590 + width: 50%;
  591 + float: left;
  592 + text-align: initial;
  593 +}
  594 +.student-info p {
  595 + width: 50%;
  596 + float: left;
  597 + margin-bottom: 1px;
  598 + padding: 0 0px;
  599 + font-size: 12px;
  600 +}
  601 +.admitcardreportbackend {
  602 + border: 1px solid #ddd;
  603 + overflow: hidden;
  604 + padding: 5% 25%;
  605 + /* margin-bottom: 10px;
  606 + color: black; */
  607 +}
  608 +.admitcardreportbackend ol {
  609 + margin: 0;
  610 + margin-bottom: 10px;
  611 +}
  612 +.admitcardreportbackend p {
  613 + line-height: 20px;
  614 + text-align: left;
  615 +}
  616 +</style>
0 617 \ No newline at end of file
... ...
src/router/paths.js
... ... @@ -658,6 +658,26 @@ export default [{
658 658 )
659 659 },
660 660 {
  661 + path: '/idCard',
  662 + meta: {},
  663 + name: 'Id Card Report',
  664 + props: (route) => ({ type: route.query.type }),
  665 + component: () =>
  666 + import (
  667 + `@/pages/Report/idCard.vue`
  668 + )
  669 + },
  670 + {
  671 + path: '/admitCard',
  672 + meta: {},
  673 + name: 'Admit Card Report',
  674 + props: (route) => ({ type: route.query.type }),
  675 + component: () =>
  676 + import (
  677 + `@/pages/Report/admitCard.vue`
  678 + )
  679 + },
  680 + {
661 681 path: '/generalSetting',
662 682 meta: {},
663 683 name: 'General Setting',
... ...