Commit c0b01ae20e75a0c20e5bac2cdaa07f64bf9803dd

Authored by Neeraj Sharma
1 parent d45ffc6fa0

solve bugs in progressCardReport

Showing 1 changed file with 129 additions and 124 deletions   Show diff stats
src/pages/Report/progressCardReport.vue
... ... @@ -84,11 +84,10 @@
84 84 </v-flex>
85 85 </v-form>
86 86 </v-card>
87   - <!-- ****** PROFILE MARK ****** -->
88   -
89   - <v-container fluid grid-list-md v-show="showReport">
  87 + <v-container grid-list-md v-show="showReport">
  88 + <!-- {{ filterData }} -->
90 89 <v-layout>
91   - <v-flex xs12 sm12>
  90 + <v-flex xs12 sm12 v-if="filterData != {}">
92 91 <v-btn class="grey" dark @click="print()">
93 92 Print
94 93 <v-icon right dark>print</v-icon>
... ... @@ -97,106 +96,64 @@
97 96 </v-layout>
98 97 <v-flex xs12 sm12 id="printMe">
99 98 <v-layout wrap>
100   - <v-flex xs12 sm12 md3>
101   - <v-card class="fixcolors white--text" flat>
102   - <v-card-actions class="pa-0">
103   - <v-spacer></v-spacer>
104   - <v-card-title class="pa-2">
105   - <h3>Profile</h3>
106   - </v-card-title>
107   - <v-spacer></v-spacer>
108   - </v-card-actions>
109   - </v-card>
110   - <v-card flat>
111   - <v-layout
112   - wrap
113   - v-for="(value, id, index) in filterData"
114   - v-if="index == 0"
115   - :key="index"
116   - >
117   - <v-flex xs12 style="margin:16px;">
118   - <v-layout>
119   - <v-flex xs12>
120   - <v-avatar
121   - size="100px"
122   - class="mx-auto"
123   - style="margin: auto;display:block;margin-bottom:10px !important"
124   - >
125   - <img src="/static/icon/user.png" v-if="!value[0].studentId.profilePicUrl" />
126   - <img
127   - :src="value[0].studentId.profilePicUrl"
128   - v-else-if="value[0].studentId.profilePicUrl"
129   - />
130   - </v-avatar>
131   - </v-flex>
132   - </v-layout>
133   - <v-layout>
134   - <v-flex xs12 style="text-align:center;">
135   - <h3>
136   - <b>{{ value[0].studentId.name }}</b>
137   - </h3>
138   - <p class="grey--text">Student</p>
139   - </v-flex>
140   - </v-layout>
141   - <v-layout
142   - style="border: 1px solid lightgrey;padding: 4px;border-top-right-radius: 4px;
143   - border-top-left-radius: 4px;"
144   - >
145   - <v-flex xs6 sm3 class="py-1">
146   - <h4>
147   - <b>RollNo</b>
148   - </h4>
149   - </v-flex>
150   - <v-flex sm9 xs6 class="py-1">
151   - <h4>: {{ value[0].studentId.rollNo }}</h4>
152   - </v-flex>
153   - </v-layout>
154   - <v-layout style="border: 1px solid lightgrey;padding: 4px;">
155   - <v-flex xs6 sm3 class="py-1">
156   - <h4>
157   - <b>Class</b>
158   - </h4>
159   - </v-flex>
160   - <v-flex sm9 xs6 class="py-1">
161   - <h4>: {{value[0].classId.classNum }}</h4>
162   - </v-flex>
163   - </v-layout>
164   - <v-layout
165   - style="border: 1px solid lightgrey;padding: 4px;border-bottom-right-radius: 4px;
166   - border-bottom-left-radius: 4px;"
167   - >
168   - <v-flex xs6 sm3 class>
169   - <h4>
170   - <b>Section</b>
171   - </h4>
172   - </v-flex>
173   - <v-flex sm9 xs6 class>
174   - <h4>: {{ value[0].sectionId.name}}</h4>
175   - </v-flex>
176   - </v-layout>
177   - </v-flex>
178   - </v-layout>
179   - </v-card>
180   - </v-flex>
181   -
182 99 <!-- ****** TABLE DATA MARK ****** -->
183   -
184   - <v-flex xs12 sm12 md9>
185   - <v-card class="fixcolors white--text" flat>
186   - <v-card-actions class="pa-0">
187   - <v-spacer></v-spacer>
188   - <v-card-title class="pa-2">
189   - <h3>Mark</h3>
190   - </v-card-title>
191   - <v-spacer></v-spacer>
192   - </v-card-actions>
193   - </v-card>
  100 + <v-flex xs12 sm12 md12>
194 101 <v-card
195 102 v-for="(value, id, index) in filterData"
196 103 :key="index"
197 104 flat
198   - style="border: 1px solid lightgrey;margin-bottom:14px;"
  105 + style="border: 1px solid lightgrey;margin-bottom:14px;padding:20px"
199 106 >
  107 + <!-- {{ value[index] }} -->
  108 + <v-layout>
  109 + <v-flex xs12 style="border-bottom: 1px solid #707478;padding-bottom:6px !important">
  110 + <img :src="userData.schoolLogoUrl" v-if="userData.schoolLogoUrl" width="100" />
  111 + <img src="/static/icon/user.png" v-else-if="!userData.schoolLogoUrl" width="100" />
  112 + </v-flex>
  113 + </v-layout>
  114 + <v-layout style="padding-top:10px">
  115 + <v-flex xs5>
  116 + <p style="margin:0px;margin-bottom:4px">
  117 + <span style="font-size:20px">{{ userData.name }}</span>
  118 + <br />
  119 + <span style="font-size: 15px;color: #707478;">{{ userData.address }}</span>
  120 + </p>
  121 + <p
  122 + style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;"
  123 + >phone : {{ userData.mobile }}</p>
  124 + <p
  125 + style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;"
  126 + >Email : {{ userData.email }}</p>
  127 + </v-flex>
  128 + <v-flex xs5>
  129 + <p
  130 + style="font-size:20px;margin:0px;margin-bottom:4px;"
  131 + >{{ value[0].studentId.name }}</p>
  132 + <p
  133 + style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;"
  134 + >Class : {{ value[0].classId.classNum }}</p>
  135 + <p
  136 + style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;"
  137 + >Roll NO : {{ value[0].studentId.rollNo }}</p>
  138 + <p
  139 + style="font-size: 15px;color: #707478;margin:0px;margin-bottom:4px;"
  140 + >Section : {{ value[0].sectionId.name }}</p>
  141 + </v-flex>
  142 + <v-flex xs2>
  143 + <v-avatar size="100">
  144 + <img
  145 + :src="value[0].studentId.profilePicUrl"
  146 + v-if="value[0].studentId.profilePicUrl"
  147 + width="100px"
  148 + />
  149 + <img
  150 + src="/static/icon/user.png"
  151 + v-else-if="!value[0].studentId.profilePicUrl"
  152 + width="100px"
  153 + />
  154 + </v-avatar>
  155 + </v-flex>
  156 + </v-layout>
200 157 <v-card-title class="subheading">{{value[0].examId.examName}}</v-card-title>
201 158 <table
202 159 class="mb-5 tableRsponsive feeTypeTable"
... ... @@ -206,19 +163,25 @@
206 163 width: 100% !important;"
207 164 >
208 165 <thead style="border: 1px solid lightgrey !important;">
209   - <tr
210   - class="info white--text"
211   - style="border: 1px solid lightgrey !important;padding:4px;"
212   - >
  166 + <tr style="border: 1px solid lightgrey !important;padding:4px;">
213 167 <td
214 168 rowspan="2"
215 169 style="border: 1px solid lightgrey !important;padding: 10px;"
216 170 >Subject</td>
217   - <td
218   - colspan="2"
219   - v-for="exam in value[index].studentsMarks"
220   - style="border: 1px solid lightgrey !important;padding: 10px;"
221   - >{{exam.markDistributionId.distributionType}}</td>
  171 + <!-- <template v-for="(exam,i) in value[index].studentsMarks">
  172 + <td
  173 + colspan="2"
  174 + style="border: 1px solid lightgrey !important;padding: 10px;"
  175 + >{{ exam.markDistributionId.distributionType }}</td>
  176 + </template>-->
  177 + <template v-for="values in value">
  178 + <td
  179 + colspan="2"
  180 + v-for="studentData in values.studentsMarks"
  181 + >{{ studentData.markDistributionId.distributionType }}</td>
  182 + </template>
  183 + <!-- <td>{{value[0].studentsMarks[1].markDistributionId.distributionType}}</td> -->
  184 +
222 185 <td style="border: 1px solid lightgrey !important;padding: 10px;">Total</td>
223 186 </tr>
224 187 <tr
... ... @@ -227,19 +190,10 @@
227 190 style="border: 1px solid lightgrey !important;"
228 191 >
229 192 <template v-for="(exam, i) in subject.studentsMarks">
230   - <td
231   - class="bg-sky white--text"
232   - style="border: 1px solid lightgrey !important;padding: 10px;"
233   - >Mark</td>
234   - <td
235   - class="bg-sky-light white--text"
236   - style="border: 1px solid lightgrey !important;padding: 10px;"
237   - >Highest Mark</td>
  193 + <td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td>
  194 + <td style="border: 1px solid lightgrey !important;padding: 10px;">Highest Mark</td>
238 195 </template>
239   - <td
240   - class="bg-sky white--text"
241   - style="border: 1px solid lightgrey !important;padding: 10px;"
242   - >Mark</td>
  196 + <td style="border: 1px solid lightgrey !important;padding: 10px;">Mark</td>
243 197 </tr>
244 198 </thead>
245 199 <tbody style="border: 1px solid lightgrey !important;">
... ... @@ -260,6 +214,26 @@
260 214 >{{subject.totalMarks}}</td>
261 215 </tr>
262 216 </tbody>
  217 + <!-- <tfoot>
  218 + <tr>
  219 + <td colspan="4">
  220 + <span class="right subheding">Total Amount (RS) :</span>
  221 + </td>
  222 + <td>{{ feeType.subTotal }}</td>
  223 + </tr>
  224 + <tr>
  225 + <td colspan="4">
  226 + <span class="right subheding">Paid (RS) :</span>
  227 + </td>
  228 + <td>{{ feeType.totalPaidAmount ? feeType.totalPaidAmount : 0 }}</td>
  229 + </tr>
  230 + <tr>
  231 + <td colspan="4">
  232 + <span class="right subheding">Balance (RS) :</span>
  233 + </td>
  234 + <td>{{ feeType.totalPaidAmount ? feeType.subTotal - feeType.totalPaidAmount : feeType.subTotal }}</td>
  235 + </tr>
  236 + </tfoot>-->
263 237 </table>
264 238 </v-card>
265 239 </v-flex>
... ... @@ -296,11 +270,13 @@ export default {
296 270 studentRules: [v => !!v || "Student is required"],
297 271 getReport: {},
298 272 classList: [],
299   - output: null
  273 + output: null,
  274 + userData: {}
300 275 }),
301 276 mounted() {
302 277 this.token = this.$store.state.token;
303 278 this.getClass();
  279 + this.getUserData();
304 280 },
305 281 methods: {
306 282 clear() {
... ... @@ -316,12 +292,13 @@ export default {
316 292 this.classList = response.data.data;
317 293 this.showLoader = false;
318 294 })
319   - .catch(err => {
  295 + .catch(error => {
320 296 this.showLoader = false;
321 297 // console.log("err====>", err);
322 298 });
323 299 },
324 300 getSections(_id) {
  301 + this.showLoader = true;
325 302 http()
326 303 .get(
327 304 "/getSectionsList",
... ... @@ -332,8 +309,10 @@ export default {
332 309 )
333 310 .then(response => {
334 311 this.addSection = response.data.data;
  312 + this.showLoader = false;
335 313 })
336 314 .catch(err => {
  315 + this.showLoader = false;
337 316 // console.log("err====>", err);
338 317 });
339 318 },
... ... @@ -349,7 +328,7 @@ export default {
349 328 .then(response => {
350 329 this.getStudentsList = response.data.data;
351 330 this.showLoader = false;
352   - console.log("getSectionsList=====>", response.data.data);
  331 + // console.log("getSectionsList=====>", response.data.data);
353 332 })
354 333 .catch(error => {
355 334 console.log("err====>", error);
... ... @@ -357,7 +336,7 @@ export default {
357 336 });
358 337 },
359 338 getMarkReportList() {
360   - this.showLoader = true;
  339 + // this.showLoader = true;
361 340 this.showReport = true;
362 341 http()
363 342 .get("/getParticularMark", {
... ... @@ -365,13 +344,23 @@ export default {
365 344 headers: { Authorization: "Bearer " + this.token }
366 345 })
367 346 .then(response => {
  347 + this.showLoader = false;
368 348 let newData = response.data.data;
  349 + // console.log("response", newData);
369 350 for (var i = 0; i < newData.length; i++) {
370 351 newData[i].examination = newData[i].examId._id;
  352 + // console.log("newData[i].examination", newData[i].examination);
371 353 }
372 354 this.filterData = _.groupBy(newData, ["examination"]);
373 355 for (let data in this.filterData) {
  356 + // console.log("data+++++++++++++++++++++++++++++++++++", data);
  357 +
374 358 for (let item in this.filterData[data]) {
  359 + console.log(
  360 + "filterData[data]==========================>",
  361 + this.filterData[data]
  362 + );
  363 + console.log("filterData[item]==========================>", item);
375 364 var totalMarks = 0;
376 365 for (
377 366 let i = 0;
... ... @@ -382,9 +371,11 @@ export default {
382 371 .marksScored;
383 372 }
384 373 this.filterData[data][item].totalMarks = totalMarks;
  374 + // var total = 0;
  375 + // total += this.filterData[data][item].totalMarks ;
  376 + // console.log("total", total);
385 377 }
386 378 }
387   - this.showLoader = false;
388 379 })
389 380 .catch(error => {
390 381 // console.log("err====>", err);
... ... @@ -401,6 +392,20 @@ export default {
401 392 print() {
402 393 // Pass the element id here
403 394 this.$htmlToPaper("printMe");
  395 + },
  396 + getUserData() {
  397 + http()
  398 + .get("/getParticularUserDetail")
  399 + .then(response => {
  400 + this.userData = response.data.data;
  401 + })
  402 + .catch(error => {
  403 + if (error.response.status === 401) {
  404 + this.$router.replace({ path: "/" });
  405 + this.$store.dispatch("setToken", null);
  406 + this.$store.dispatch("Id", null);
  407 + }
  408 + });
404 409 }
405 410 }
406 411 };
... ...