/home/techb158/ileadtechnology.com/SSM/public/js/employee/leave/request
NameSizeModeActions
create~js/-0755rm
create.js116750644editdlrm
create.js.map1770644editdlrm
edit.js117010644editdlrm
edit.js.map1730644editdlrm
index.js120460644editdlrm
index.js.map1660644editdlrm
show.js95410644editdlrm
show.js.map1730644editdlrm
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/employee/leave/request/edit.js (11701B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[176],{"3Ozy":function(e,t,a){"use strict";a.r(t);var s={components:{leaveRequestForm:a("X48w").a},data:function(){return{uuid:this.$route.params.uuid}},mounted:function(){helper.hasPermission("request-leave")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},l=a("KHd+"),o=Object(l.a)(s,(function(){var e=this,t=e.$createElement,a=e._self._c||t;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"},[e._v(e._s(e.trans("employee.edit_leave_request")))])]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){return e.$router.push("/employee/leave/request")}}},[a("i",{staticClass:"fas fa-list"}),e._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[e._v(e._s(e.trans("employee.leave_request")))])])])])])]),e._v(" "),a("div",{staticClass:"container-fluid"},[a("leave-request-form",{attrs:{uuid:e.uuid}})],1)])}),[],!1,null,null,null);t.default=o.exports},X48w:function(e,t,a){"use strict";var s={components:{},props:["uuid"],data:function(){return{leaveRequestForm:new Form({employee_id:"",employee_leave_type_id:"",start_date:"",end_date:"",reason:"",upload_token:""}),employee:{},apply_leave_for_other:0,leave_allocations:[],clearAttachment:!0,employees:[],leave_types:[],selected_employee:null,selected_leave_type:null,module_id:""}},mounted:function(){this.getPreRequisite(),this.uuid?this.get():this.leaveRequestForm.upload_token=this.$uuid.v4(),this.uuid||this.getLeaveAllocation()},methods:{hasPermission:function(e){return helper.hasPermission(e)},getEmployeeNameWithCode:function(e){return helper.getEmployeeNameWithCode(e)},getEmployeeDesignationOnDate:function(e,t){return helper.getEmployeeDesignationOnDate(e,t)},getPreRequisite:function(){var e=this,t=this.$loading.show();axios.get("/api/employee/leave/request/pre-requisite").then((function(a){t.hide(),e.employees=a.employees,e.leave_types=a.leave_types})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},getLeaveAllocation:function(){var e=this,t=this.$loading.show();axios.post("/api/employee/leave/allocation/fetch",{id:this.leaveRequestForm.employee_id}).then((function(a){t.hide(),e.leave_allocations=a.leave_allocations})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},proceed:function(){this.uuid?this.update():this.store()},store:function(){var e=this,t=this.$loading.show();this.leaveRequestForm.post("/api/employee/leave/request").then((function(a){toastr.success(a.message),t.hide(),e.clearAttachment=!e.clearAttachment,e.selected_employee=null,e.selected_leave_type=null,e.leaveRequestForm.upload_token=e.$uuid.v4(),e.apply_leave_for_other=0,e.$emit("completed")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},get:function(){var e=this,t=this.$loading.show();axios.get("/api/employee/leave/request/"+this.uuid).then((function(a){var s=a.leave_request;"pending"!=s.status&&(t.hide(),toastr.error(i18n.user.permission_denied),e.$router.push("/employee/leave/request")),e.leaveRequestForm.employee_id=s.employee_id,e.getLeaveAllocation(),e.employee=s.employee,e.leaveRequestForm.employee_leave_type_id=s.employee_leave_type_id,e.selected_leave_type=s.employee_leave_type_id?{id:s.employee_leave_type_id,name:s.leave_type.name}:null,e.leaveRequestForm.reason=s.reason,e.leaveRequestForm.start_date=s.start_date,e.leaveRequestForm.end_date=s.end_date,e.leaveRequestForm.upload_token=s.upload_token,e.module_id=s.id,t.hide()})).catch((function(a){t.hide(),helper.showErrorMsg(a),e.$router.push("/employee/leave/request")}))},update:function(){var e=this,t=this.$loading.show();this.leaveRequestForm.patch("/api/employee/leave/request/"+this.uuid).then((function(a){toastr.success(a.message),t.hide(),e.$router.push("/employee/leave/request")})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},onEmployeeSelect:function(e){this.leaveRequestForm.employee_id=e.id,this.getLeaveAllocation()},onLeaveTypeSelect:function(e){this.leaveRequestForm.employee_leave_type_id=e.id}},filters:{moment:function(e){return helper.formatDate(e)},momentDateTime:function(e){return helper.formatDateTime(e)}}},l=a("KHd+"),o=Object(l.a)(s,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-body border-right p-4"},[a("form",{on:{submit:function(t){return t.preventDefault(),e.proceed(t)},keydown:function(t){return e.leaveRequestForm.errors.clear(t.target.name)}}},[a("div",{staticClass:"row"},[e.hasPermission("request-leave-for-other-employee")?[e.uuid?e._e():a("div",{staticClass:"col-12"},[a("div",{staticClass:"form-group"},[a("label",{staticClass:"custom-control custom-checkbox m-t-20"},[a("input",{directives:[{name:"model",rawName:"v-model",value:e.apply_leave_for_other,expression:"apply_leave_for_other"}],staticClass:"custom-control-input",attrs:{type:"checkbox",value:"1"},domProps:{checked:Array.isArray(e.apply_leave_for_other)?e._i(e.apply_leave_for_other,"1")>-1:e.apply_leave_for_other},on:{change:function(t){var a=e.apply_leave_for_other,s=t.target,l=!!s.checked;if(Array.isArray(a)){var o=e._i(a,"1");s.checked?o<0&&(e.apply_leave_for_other=a.concat(["1"])):o>-1&&(e.apply_leave_for_other=a.slice(0,o).concat(a.slice(o+1)))}else e.apply_leave_for_other=l}}}),e._v(" "),a("span",{staticClass:"custom-control-label"},[e._v(e._s(e.trans("employee.apply_leave_for_other")))])])])]),e._v(" "),e.apply_leave_for_other?a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("employee.employee")))]),e._v(" "),a("v-select",{attrs:{label:"name",name:"employee_id",id:"employee_id",options:e.employees,placeholder:e.trans("employee.select_employee")},on:{select:e.onEmployeeSelect,close:function(t){return e.leaveRequestForm.errors.clear("employee_id")},remove:function(t){e.leaveRequestForm.employee_id=""}},model:{value:e.selected_employee,callback:function(t){e.selected_employee=t},expression:"selected_employee"}},[e.employees.length?e._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),a("show-error",{attrs:{"form-name":e.leaveRequestForm,"prop-name":"employee_id"}})],1)]):e._e(),e._v(" "),e.uuid?a("div",{staticClass:"col-12 col-sm-6"},[a("p",{staticClass:"m-t-20"},[e._v("\n "+e._s(e.getEmployeeNameWithCode(e.employee))+" "),a("br"),e._v("\n "+e._s(e.getEmployeeDesignationOnDate(e.employee,e.leaveRequestForm.end_date))+" "),a("br")])]):e._e()]:e._e(),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("employee.leave_type")))]),e._v(" "),a("v-select",{attrs:{label:"name",name:"employee_leave_type_id",id:"employee_leave_type_id",options:e.leave_types,placeholder:e.trans("employee.select_leave_type")},on:{select:e.onLeaveTypeSelect,close:function(t){return e.leaveRequestForm.errors.clear("employee_leave_type_id")},remove:function(t){e.leaveRequestForm.employee_leave_type_id=""}},model:{value:e.selected_leave_type,callback:function(t){e.selected_leave_type=t},expression:"selected_leave_type"}},[e.leave_types.length?e._e():a("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[e._v("\n "+e._s(e.trans("general.no_option_found"))+"\n ")])]),e._v(" "),a("show-error",{attrs:{"form-name":e.leaveRequestForm,"prop-name":"employee_leave_type_id"}})],1)])],2),e._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("employee.leave_request_start_date")))]),e._v(" "),a("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("employee.leave_request_start_date")},on:{selected:function(t){return e.leaveRequestForm.errors.clear("start_date")}},model:{value:e.leaveRequestForm.start_date,callback:function(t){e.$set(e.leaveRequestForm,"start_date",t)},expression:"leaveRequestForm.start_date"}}),e._v(" "),a("show-error",{attrs:{"form-name":e.leaveRequestForm,"prop-name":"start_date"}})],1)]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("employee.leave_request_end_date")))]),e._v(" "),a("datepicker",{attrs:{bootstrapStyling:!0,placeholder:e.trans("employee.leave_request_end_date")},on:{selected:function(t){return e.leaveRequestForm.errors.clear("end_date")}},model:{value:e.leaveRequestForm.end_date,callback:function(t){e.$set(e.leaveRequestForm,"end_date",t)},expression:"leaveRequestForm.end_date"}}),e._v(" "),a("show-error",{attrs:{"form-name":e.leaveRequestForm,"prop-name":"end_date"}})],1)])]),e._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[e._v(e._s(e.trans("employee.leave_request_reason")))]),e._v(" "),a("autosize-textarea",{attrs:{rows:"1",name:"reason",placeholder:e.trans("employee.leave_request_reason")},model:{value:e.leaveRequestForm.reason,callback:function(t){e.$set(e.leaveRequestForm,"reason",t)},expression:"leaveRequestForm.reason"}}),e._v(" "),a("show-error",{attrs:{"form-name":e.leaveRequestForm,"prop-name":"reason"}})],1)]),e._v(" "),a("div",{staticClass:"col-12"},[a("div",{staticClass:"form-group"},[a("file-upload-input",{attrs:{"button-text":e.trans("general.upload_document"),token:e.leaveRequestForm.upload_token,module:"leave_request","clear-file":e.clearAttachment,"module-id":e.module_id}})],1)])]),e._v(" "),a("div",{staticClass:"text-right"},[a("router-link",{directives:[{name:"show",rawName:"v-show",value:e.uuid,expression:"uuid"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/employee/leave/request"}},[e._v(e._s(e.trans("general.cancel")))]),e._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[e._v(e._s(e.trans("general.save")))])],1)])])])]),e._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[a("h4",{staticClass:"card-title m-3"},[e._v(e._s(e.trans("employee.leave_allocation")))]),e._v(" "),e.leave_allocations.length?a("div",{staticClass:"table-responsive"},[a("table",{staticClass:"table table-sm"},[a("thead",[a("tr",[a("th",[e._v(e._s(e.trans("employee.name")))]),e._v(" "),a("th",[e._v(e._s(e.trans("employee.leave_allocation_period")))]),e._v(" "),a("th",[e._v(e._s(e.trans("employee.leave_allotted")))])])]),e._v(" "),a("tbody",e._l(e.leave_allocations,(function(t){return a("tr",[a("td",{domProps:{textContent:e._s(e.getEmployeeNameWithCode(t.employee))}}),e._v(" "),a("td",[e._v(e._s(e._f("moment")(t.start_date))+" "+e._s(e.trans("general.to"))+" "+e._s(e._f("moment")(t.end_date)))]),e._v(" "),a("td",[a("ul",{staticStyle:{"list-style":"none",padding:"0",margin:"0"}},e._l(t.leave_allocation_details,(function(t){return a("li",[e._v(e._s(t.leave_type.name+": "+t.used+"/"+t.allotted))])})),0)])])})),0)])]):a("div",[a("p",{staticClass:"alert alert-danger m-2"},[e._v(e._s(e.trans("employee.leave_not_allocated")))])])])])])])}),[],!1,null,null,null);t.a=o.exports}}]); //# sourceMappingURL=edit.js.map?id=c84066ec9dc3c833d80a