/home/techb158/ileadtechnology.com/SSM/public/js/calendar/celebration
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/calendar/celebration/anniversary.js (7735B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{eTEz:function(t,e,a){"use strict";a.r(e);var n={components:{},data:function(){return{anniversaries:{total:0,data:[]},filter:{sort_by:"date",order:"asc",start_date:"",end_date:"",page_length:helper.getConfig("page_length")},showFilterPanel:!1}},mounted:function(){helper.hasPermission("list-anniversary")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getAnniversaries(),helper.showDemoNotification(["calendar"])},created:function(){this.filter.start_date=helper.today(),this.filter.end_date=moment().add(1,"weeks").format("YYYY-MM-DD")},methods:{getConfig:function(t){return helper.getConfig(t)},hasPermission:function(t){return helper.hasPermission(t)},getEmployeeName:function(t){return helper.getEmployeeName(t)},getEmployeeCode:function(t){return helper.getEmployeeCode(t)},getCount:function(t){return moment().diff(t,"years")},getEmployeeDesignationOnDate:function(t){return helper.getEmployeeDesignationOnDate(t,helper.today())},getAnniversaries:function(t){var e=this,a=this.$loading.show();"number"!=typeof t&&(t=1),this.filter.start_date=helper.toDate(this.filter.start_date),this.filter.end_date=helper.toDate(this.filter.end_date);var n=helper.getFilterURL(this.filter);axios.get("/api/anniversary?page="+t+n).then((function(t){e.anniversaries=t,a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},print:function(){var t=this.$loading.show();axios.post("/api/anniversary/print",{filter:this.filter}).then((function(e){t.hide(),window.open("/print").document.write(e)})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},pdf:function(){var t=this,e=this.$loading.show();axios.post("/api/anniversary/pdf",{filter:this.filter}).then((function(a){e.hide(),window.open("/download/report/"+a+"?token="+t.authToken)})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},showDate:function(t){return helper.formatDate(t)}},filters:{moment:function(t){return helper.formatDate(t)},momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{"filter.sort_by":function(t){this.getAnniversaries()},"filter.order":function(t){this.getAnniversaries()},"filter.page_length":function(t){this.getAnniversaries()}},computed:{authToken:function(){return helper.getAuthToken()}}},s=a("KHd+"),r=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("calendar.anniversary"))+" \n "),t.anniversaries.total?a("span",{staticClass:"card-subtitle"},[a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("general.total_result_found",{count:t.anniversaries.total,from:t.anniversaries.from,to:t.anniversaries.to})))])]):a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.no_result_found")))])])]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[t.showFilterPanel?t._e():a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showFilterPanel=!t.showFilterPanel}}},[a("i",{staticClass:"fas fa-filter"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(" "+t._s(t.trans("general.filter")))])]),t._v(" "),a("div",{staticClass:"btn-group"},[a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.more_option"),expression:"trans('general.more_option')"}],staticClass:"btn btn-info btn-sm dropdown-toggle no-caret ",attrs:{type:"button",role:"menu",id:"moreOption","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[a("i",{staticClass:"fas fa-ellipsis-h"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"})]),t._v(" "),a("div",{class:["dropdown-menu","ltr"==t.getConfig("direction")?"dropdown-menu-right":""],attrs:{"aria-labelledby":"moreOption"}},[a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:t.print}},[a("i",{staticClass:"fas fa-print"}),t._v(" "+t._s(t.trans("general.print")))]),t._v(" "),a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:t.pdf}},[a("i",{staticClass:"fas fa-file-pdf"}),t._v(" "+t._s(t.trans("general.generate_pdf")))]),t._v(" "),a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:function(e){return t.$router.push("/calendar/celebration/birthday")}}},[a("i",{staticClass:"fas fa-birthday-cake"}),t._v(" "+t._s(t.trans("calendar.birthday")))]),t._v(" "),a("button",{staticClass:"dropdown-item custom-dropdown",on:{click:function(e){return t.$router.push("/calendar/celebration/work/anniversary")}}},[a("i",{staticClass:"fas fa-gift"}),t._v(" "+t._s(t.trans("calendar.work_anniversary")))])])])])])])]),t._v(" "),a("div",{staticClass:"container-fluid"},[a("transition",{attrs:{name:"fade"}},[t.showFilterPanel?a("div",{staticClass:"card border-left border-bottom"},[a("div",{staticClass:"card-body p-4"},[a("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("general.filter"))+"\n "),a("button",{staticClass:"btn btn-danger btn-sm pull-right",attrs:{type:"button"},on:{click:function(e){t.showFilterPanel=!1}}},[t._v(t._s(t.trans("general.cancel")))])]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-8"},[a("div",{staticClass:"form-group"},[a("date-range-picker",{attrs:{"start-date":t.filter.start_date,"end-date":t.filter.end_date,label:t.trans("general.date_between")},on:{"update:startDate":function(e){return t.$set(t.filter,"start_date",e)},"update:start-date":function(e){return t.$set(t.filter,"start_date",e)},"update:endDate":function(e){return t.$set(t.filter,"end_date",e)},"update:end-date":function(e){return t.$set(t.filter,"end_date",e)}}})],1)])]),t._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light pull-right",attrs:{type:"button"},on:{click:t.getAnniversaries}},[t._v(t._s(t.trans("general.filter")))])])]):t._e()]),t._v(" "),a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[t.filter.start_date&&t.filter.end_date?a("h6",{staticClass:"p-3"},[t._v(t._s(t.trans("calendar.anniversary_between",{start_date:t.showDate(t.filter.start_date),end_date:t.showDate(t.filter.end_date)})))]):t._e(),t._v(" "),t.anniversaries.total?a("div",{staticClass:"table-responsive"},[a("table",{staticClass:"table table-sm"},[a("thead",[a("tr",[a("th",[t._v(t._s(t.trans("employee.date_of_anniversary")))]),t._v(" "),a("th",[t._v(t._s(t.trans("employee.name")))]),t._v(" "),a("th",[t._v(t._s(t.trans("employee.code")))]),t._v(" "),a("th",[t._v(t._s(t.trans("employee.designation")))]),t._v(" "),a("th",[t._v(t._s(t.trans("employee.contact_number")))])])]),t._v(" "),a("tbody",t._l(t.anniversaries.data,(function(e){return a("tr",[a("td",[t._v(t._s(t._f("moment")(e.date_of_anniversary))+" ("+t._s(t.getCount(e.date_of_anniversary)+" "+t.trans("general.years"))+")")]),t._v(" "),a("td",[t._v(t._s(t.getEmployeeName(e)))]),t._v(" "),a("td",[t._v(t._s(t.getEmployeeCode(e)))]),t._v(" "),a("td",[t._v(t._s(t.getEmployeeDesignationOnDate(e)))]),t._v(" "),a("td",[t._v(t._s(e.contact_number))])])})),0)])]):t._e(),t._v(" "),t.anniversaries.total?t._e():a("module-info",{attrs:{module:"calendar",title:"anniversary_module_title",description:"anniversary_module_description",icon:"list"}}),t._v(" "),a("pagination-record",{attrs:{"page-length":t.filter.page_length,records:t.anniversaries},on:{"update:pageLength":function(e){return t.$set(t.filter,"page_length",e)},"update:page-length":function(e){return t.$set(t.filter,"page_length",e)},updateRecords:t.getAnniversaries}})],1)])],1)])}),[],!1,null,null,null);e.default=r.exports}}]);
//# sourceMappingURL=anniversary.js.map?id=22fc848c770d86eb1700