/
home
/
techb158
/
ileadtechnology.com
/
SSM
/
public
/
js
/
student
/
attendance
/
/home/techb158/ileadtechnology.com/SSM/public/js/student/attendance
mkdir
upload
Name
Size
Mode
Actions
absentee.js
17115
0644
edit
dl
rm
absentee.js.map
173
0644
edit
dl
rm
index.js
17327
0644
edit
dl
rm
index.js.map
158
0644
edit
dl
rm
Edit:
/home/techb158/ileadtechnology.com/SSM/public/js/student/attendance/index.js
(17327B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[329],{EDXn:function(t,e,a){var n=a("cZuY");"string"==typeof n&&(n=[[t.i,n,""]]);var s={hmr:!0,transform:void 0,insertInto:void 0};a("aET+")(n,s);n.locals&&(t.exports=n.locals)},bfnd:function(t,e,a){"use strict";a.r(e);var n={components:{},data:function(){return{attendanceForm:new Form({batch_id:"",attendance_method:"",subject_id:"",session:"",date_of_attendance:"",students:[]},!1),disable_filter:!1,previous_date:"",holidays:[],all_holidays:[],attendance:{},attendances:[],disabled:{dates:[]},all_disabled:{dates:[]},header:[],student_data:[],days:0,subjects:[],batches:[],selected_batch:null,selected_batch_detail:{},student_records:[],batch_with_subjects:[],attendance_methods:[],attendance_method_more_than_once_types:[],isEditable:!1,isDeletable:!1}},mounted:function(){helper.hasPermission("list-student-attendance")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.attendanceForm.date_of_attendance=helper.getConfig("current_date"),this.previous_date=this.attendanceForm.date_of_attendance,this.getPreRequisite()},methods:{hasPermission:function(t){return helper.hasPermission(t)},resetFilter:function(){this.student_data=[],this.disable_filter=!1},getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/student/attendance/pre-requisite").then((function(a){t.attendance_methods=a.attendance_methods,t.attendance_method_more_than_once_types=a.attendance_method_more_than_once_types,t.batches=a.batches,t.batch_with_subjects=a.batch_with_subjects,t.holidays=a.holidays,t.all_holidays=a.holidays,a.holidays.forEach((function(e){t.disabled.dates.push(new Date(e.date)),t.all_disabled.dates.push(new Date(e.date))})),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},dateSelected:function(){},getStudent:function(){var t=this;this.disable_filter=!0;var e=this.$loading.show();axios.post("/api/student/attendance/fetch",{batch_id:this.attendanceForm.batch_id,date_of_attendance:this.attendanceForm.date_of_attendance,subject_id:this.attendanceForm.subject_id,session:this.attendanceForm.session,attendance_method:this.attendanceForm.attendance_method}).then((function(a){t.student_records=a.student_records,t.selected_batch_detail=a.batch,t.attendance=a.attendance,t.attendances=a.attendances,t.header=a.header,t.student_data=a.student_data,t.isEditable=a.is_editable,t.isDeletable=a.is_deletable,t.attendanceForm.students=a.current_date_attendance,e.hide()})).catch((function(a){t.disable_filter=!1,e.hide(),helper.showErrorMsg(a)}))},onBatchSelect:function(t){var e=this,a=this.$loading.show();this.attendanceForm.batch_id=t.id;var n=this.batch_with_subjects.find((function(t){return t.id==e.attendanceForm.batch_id}));void 0!==n&&(this.holidays=this.all_holidays,this.disabled.dates=this.all_disabled.dates,(n.holidays_except&&Array.isArray(n.holidays_except)?n.holidays_except:[]).forEach((function(t){e.disabled.dates=e.disabled.dates.filter((function(e){return helper.toDate(e)!=helper.toDate(t)})),e.holidays=e.holidays.filter((function(e){return helper.toDate(e.date)!=helper.toDate(t)}))})),this.attendanceForm.attendance_method=n.options&&n.options.default_attendance_method?n.options.default_attendance_method:"once",this.attendanceForm.subject_id="",this.subjects=[],n.subjects.forEach((function(t){e.subjects.push({id:t.id,name:t.name+" ("+t.code+")"})})),a.hide())},onBatchRemove:function(t){this.attendanceForm.batch_id="",this.student_data=[],this.student_records=[]},currentDate:function(t){return t==moment(this.attendanceForm.date_of_attendance).format("D")},toggleAttendance:function(t,e){if(this.isEditable){var a=["late"];"once"==this.attendanceForm.attendance_method&&a.push("half_day"),a.push("present"),a.push("absent");var n=this.student_data.find((function(e){return e.id==t.id})).attendances[e],s=a.indexOf(n.label);s=++s%a.length,n.label=a[s],this.attendanceForm.students.find((function(e){return e.id==t.id})).attendance=a[s]}},markAllPresent:function(){var t=this,e=moment(this.attendanceForm.date_of_attendance).format("D");this.student_data.forEach((function(a){if(a.sno){var n=a.attendances[e];if("unavailable"!=n.label)n.label="present",t.attendanceForm.students.find((function(t){return t.id==a.id})).attendance="present"}}))},markAllAbsent:function(){var t=this,e=moment(this.attendanceForm.date_of_attendance).format("D");this.student_data.forEach((function(a){if(a.sno){var n=a.attendances[e];if("unavailable"!=n.label)n.label="absent",t.attendanceForm.students.find((function(t){return t.id==a.id})).attendance="absent"}}))},submit:function(){var t=this,e=this.$loading.show();this.attendanceForm.post("/api/student/attendance").then((function(a){t.getStudent(),toastr.success(a.message),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},confirmDelete:function(){var t=this;return function(e){return t.deleteAttendance()}},deleteAttendance:function(){var t=this,e=this.$loading.show();axios.post("/api/student/attendance/delete",{batch_id:this.attendanceForm.batch_id,date_of_attendance:this.attendanceForm.date_of_attendance,subject_id:this.attendanceForm.subject_id,session:this.attendanceForm.session}).then((function(a){toastr.success(a.message),t.getStudent(),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},confirmDefault:function(){var t=this;return function(e){return t.defaultAttendance()}},defaultAttendance:function(){var t=this,e=this.$loading.show();axios.post("/api/student/attendance/default",{batch_id:this.attendanceForm.batch_id,date_of_attendance:this.attendanceForm.date_of_attendance,subject_id:this.attendanceForm.subject_id,session:this.attendanceForm.session}).then((function(a){toastr.success(a.message),t.getStudent(),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))}},computed:{},filters:{moment:function(t){return helper.formatDate(t)},momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{"attendanceForm.date_of_attendance":function(t){this.days=moment(t,"YYYY-MM").daysInMonth(),this.previous_date=helper.toDate(t)}}},s=(a("fydv"),a("KHd+")),i=Object(s.a)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"page-titles"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("student.attendance")))])]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[t.attendanceForm.date_of_attendance?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("student.absentee"),expression:"trans('student.absentee')"}],staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/student/attendance/absentee")}}},[a("i",{staticClass:"fas fa-user-minus"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("student.absentee")))])]):t._e()])])])]),t._v(" "),a("div",{staticClass:"container-fluid"},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-body p-4"},[a("form",{on:{submit:function(e){return e.preventDefault(),t.submit(e)},keydown:function(e){return t.attendanceForm.errors.clear(e.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.batch")))]),t._v(" "),a("v-select",{attrs:{disabled:t.disable_filter,label:"name","group-values":"batches","group-label":"course_group","group-select":!1,name:"batch_id",id:"batch_id",options:t.batches,placeholder:t.trans("academic.select_batch")},on:{select:t.onBatchSelect,close:function(e){return t.attendanceForm.errors.clear("batch_id")},remove:t.onBatchRemove},model:{value:t.selected_batch,callback:function(e){t.selected_batch=e},expression:"selected_batch"}},[t.batches.length?t._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[t._v("\n\t\t\t\t "+t._s(t.trans("general.no_option_found"))+"\n\t\t\t\t ")])]),t._v(" "),a("show-error",{attrs:{"form-name":t.attendanceForm,"prop-name":"batch_id"}})],1)]),t._v(" "),a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("student.attendance_method")))]),t._v(" "),a("select",{directives:[{name:"model",rawName:"v-model",value:t.attendanceForm.attendance_method,expression:"attendanceForm.attendance_method"}],staticClass:"custom-select col-12",attrs:{disabled:t.disable_filter,name:"attendance_method"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.attendanceForm,"attendance_method",e.target.multiple?a:a[0])}}},[a("option",{attrs:{value:"",selected:""}},[t._v(t._s(t.trans("general.select_one")))]),t._v(" "),t._l(t.attendance_methods,(function(e){return a("option",{domProps:{value:e.value}},[t._v("\n\t "+t._s(e.text)+"\n\t ")])}))],2),t._v(" "),a("show-error",{attrs:{"form-name":t.attendanceForm,"prop-name":"attendance_method"}})],1)]),t._v(" "),"more_than_once"==t.attendanceForm.attendance_method?a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("student.attendance_session")))]),t._v(" "),a("select",{directives:[{name:"model",rawName:"v-model",value:t.attendanceForm.session,expression:"attendanceForm.session"}],staticClass:"custom-select col-12",attrs:{disabled:t.disable_filter,name:"session"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.attendanceForm,"session",e.target.multiple?a:a[0])}}},[a("option",{attrs:{value:"",selected:""}},[t._v(t._s(t.trans("general.select_one")))]),t._v(" "),t._l(t.attendance_method_more_than_once_types,(function(e){return a("option",{domProps:{value:e.value}},[t._v("\n\t "+t._s(e.text)+"\n\t ")])}))],2),t._v(" "),a("show-error",{attrs:{"form-name":t.attendanceForm,"prop-name":"session"}})],1)]):t._e(),t._v(" "),"subject_wise"==t.attendanceForm.attendance_method?a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.subject"))+" ")]),t._v(" "),a("select",{directives:[{name:"model",rawName:"v-model",value:t.attendanceForm.subject_id,expression:"attendanceForm.subject_id"}],staticClass:"custom-select col-12",attrs:{disabled:t.disable_filter,name:"subject_id"},on:{change:function(e){var a=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.attendanceForm,"subject_id",e.target.multiple?a:a[0])}}},[a("option",{attrs:{value:"",selected:""}},[t._v(t._s(t.trans("general.select_one")))]),t._v(" "),t._l(t.subjects,(function(e){return a("option",{domProps:{value:e.id}},[t._v("\n\t "+t._s(e.name)+"\n\t ")])}))],2),t._v(" "),a("show-error",{attrs:{"form-name":t.attendanceForm,"prop-name":"subject_id"}})],1)]):t._e(),t._v(" "),t.attendanceForm.batch_id?a("div",{staticClass:"col-12 col-sm-3"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("student.date_of_attendance")))]),t._v(" "),a("datepicker",{attrs:{disabled:t.disable_filter,bootstrapStyling:!0,disabledDates:t.disabled,placeholder:t.trans("student.date_of_attendance")},on:{selected:t.dateSelected},model:{value:t.attendanceForm.date_of_attendance,callback:function(e){t.$set(t.attendanceForm,"date_of_attendance",e)},expression:"attendanceForm.date_of_attendance"}}),t._v(" "),a("show-error",{attrs:{"form-name":t.attendanceForm,"prop-name":"date_of_attendance"}})],1)]):t._e()]),t._v(" "),a("div",{staticClass:"text-right"},[t.disable_filter?a("button",{staticClass:"btn btn-danger m-r-10",attrs:{type:"button"},on:{click:t.resetFilter}},[t._v(t._s(t.trans("general.reset")))]):a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"button"},on:{click:t.getStudent}},[t._v(t._s(t.trans("general.proceed")))])]),t._v(" "),t.student_data.length?a("div",{staticClass:"row"},[a("div",{staticClass:"col-12"},[a("div",{staticClass:"table-responsive font-90pc p-2"},[a("table",{staticClass:"table table-sm table-bordered attendance-table"},[a("thead",[a("tr",[a("th",[t._v("#")]),t._v(" "),a("th",[t._v(t._s(t.trans("student.name")))]),t._v(" "),t._l(t.header,(function(e){return a("th",{class:["date-cell"]},[t._v(t._s(e))])})),t._v(" "),a("th")],2)]),t._v(" "),a("tbody",t._l(t.student_data,(function(e){return e.sno?a("tr",[a("td",[t._v(t._s(e.sno))]),t._v(" "),a("td",{staticStyle:{"font-size":"120%"}},[t._v(t._s(e.name))]),t._v(" "),t._l(e.attendances,(function(n,s){return a("td",{class:["holiday"==n.label||"unavailable"==n.label?"disabled":""]},[a("span",{staticClass:"marking-cell"},["unavailable"==n.label?a("span"):"holiday"==n.label?a("span",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.description,expression:"attendance_record.description"}]},[a("i",{staticClass:"fas fa-hospital-symbol"})]):t.currentDate(s)?a("span",{class:["marking-cell",t.isEditable?"pointer":""],on:{click:function(a){return t.toggleAttendance(e,s)}}},["present"==n.label?a("i",{staticClass:"fas fa-check text-success"}):t._e(),t._v(" "),"late"==n.label?a("i",{staticClass:"fas fa-history text-info"}):t._e(),t._v(" "),"half_day"==n.label?a("i",{staticClass:"fas fa-coffee text-warning"}):t._e(),t._v(" "),"unmarked"==n.label||"absent"==n.label?a("i",{staticClass:"fas fa-times text-danger"}):t._e()]):a("span",{staticClass:"marking-cell"},["present"==n.label?a("i",{staticClass:"fas fa-check text-success"}):t._e(),t._v(" "),"late"==n.label?a("i",{staticClass:"fas fa-history text-info"}):t._e(),t._v(" "),"half_day"==n.label?a("i",{staticClass:"fas fa-coffee text-warning"}):t._e(),t._v(" "),"absent"==n.label?a("i",{staticClass:"fas fa-times text-danger"}):t._e()])])])})),t._v(" "),a("td",[t._v(t._s(e.monthly_count))])],2):a("tr",[a("th"),t._v(" "),a("th",{staticStyle:{"font-size":"120%"}},[t._v(t._s(e.name))]),t._v(" "),t._l(e.attendances,(function(e){return a("th",{class:["date-cell"]},[t._v(t._s(e.count))])})),t._v(" "),a("th")],2)})),0)])])])]):t._e(),t._v(" "),!t.student_data.length&&t.disable_filter?a("div",{staticClass:"row mt-2"},[a("div",{staticClass:"col-12"},[a("p",{staticClass:"alert alert-danger"},[t._v(t._s(t.trans("general.no_data_found",{data:t.trans("student.student")})))])])]):t._e(),t._v(" "),t.student_data.length&&t.isEditable?a("div",{staticClass:"form-group"},[a("button",{staticClass:"btn btn-success pull-right",attrs:{type:"submit"}},[t._v(t._s(t.trans("general.save")))]),t._v(" "),t.isEditable&&t.attendance&&!t.attendance.is_default?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("student.attendance_default_description"),expression:"trans('student.attendance_default_description')"},{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDefault()},expression:"{ok: confirmDefault()}"}],key:"make-attendance-default",staticClass:"btn btn-info pull-right m-r-10",attrs:{type:"button"}},[t._v(t._s(t.trans("student.attendance_default")))]):t._e(),t._v(" "),t.isEditable&&t.isDeletable?a("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDelete()},expression:"{ok: confirmDelete()}"}],key:"delete-attendance",staticClass:"btn btn-danger pull-right m-r-10",attrs:{type:"button"}},[t._v(t._s(t.trans("general.delete")))]):t._e(),t._v(" "),a("button",{staticClass:"btn btn-info btn-sm",attrs:{type:"button"},on:{click:t.markAllPresent}},[t._v(t._s(t.trans("student.attendance_mark_all_present")))]),t._v(" "),a("button",{staticClass:"btn btn-info btn-sm",attrs:{type:"button"},on:{click:t.markAllAbsent}},[t._v(t._s(t.trans("student.attendance_mark_all_absent")))])]):t._e(),t._v(" "),t.student_data.length?a("div",{staticClass:"row mt-2"},[a("div",{staticClass:"col-12"},[a("span",{staticClass:"mr-2"},[a("i",{staticClass:"fas fa-check text-success"}),t._v(" "+t._s(t.trans("student.attendance_present")))]),t._v(" "),a("span",{staticClass:"mr-2"},[a("i",{staticClass:"fas fa-history text-info"}),t._v(" "+t._s(t.trans("student.attendance_late")))]),t._v(" "),a("span",{staticClass:"mr-2"},[a("i",{staticClass:"fas fa-coffee text-warning"}),t._v(" "+t._s(t.trans("student.attendance_half_day")))]),t._v(" "),a("span",{},[a("i",{staticClass:"fas fa-times text-danger"}),t._v(" "+t._s(t.trans("student.attendance_absent")))])])]):t._e()])])])])])}),[],!1,null,null,null);e.default=i.exports},cZuY:function(t,e,a){(t.exports=a("I1BE")(!1)).push([t.i,"\n.disabled{\n\tbackground-color:#f1f2f3;\n}\n.current {\n\tfont-weight: 500;\n\tfont-size: 120%;\n}\n.attendance-table tr th.date-cell{\n\ttext-align: center;\n\tmin-width: 20px;\n\tmax-width: 20px;\n}\n.attendance-table tr td span.marking-cell {\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: center;\n}\n",""])},fydv:function(t,e,a){"use strict";var n=a("EDXn");a.n(n).a}}]); //# sourceMappingURL=index.js.map?id=97abb0c44bd0bd11576d
Save
cmd:
run