/home/techb158/ileadtechnology.com/SSM/public/js/configuration/academic/idCardTemplate
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/configuration/academic/idCardTemplate/index.js (14785B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{"3RLn":function(t,e,a){"use strict";a.r(e);var i={components:{idCardTemplateForm:a("IS+6").a},data:function(){return{id_card_templates:{total:0,data:[]},filter:{sort_by:"name",order:"asc",name:"",page_length:helper.getConfig("page_length")},orderByOptions:[{value:"name",translation:i18n.academic.id_card_template_name},{value:"type",translation:i18n.academic.id_card_template_type}],showCreatePanel:!1,help_topic:""}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),this.getIdCardTemplates()},methods:{getConfig:function(t){return helper.getConfig(t)},getIdCardTemplates:function(t){var e=this,a=this.$loading.show();"number"!=typeof t&&(t=1);var i=helper.getFilterURL(this.filter);axios.get("/api/academic/id-card/template?page="+t+i).then((function(t){e.id_card_templates=t,a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},editIdCardTemplate:function(t){this.$router.push("/configuration/academic/id-card/template/"+t.id+"/edit")},confirmDelete:function(t){var e=this;return function(a){return e.deleteIdCardTemplate(t)}},deleteIdCardTemplate:function(t){var e=this,a=this.$loading.show();axios.delete("/api/academic/id-card/template/"+t.id).then((function(t){toastr.success(t.message),e.getIdCardTemplates(),a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},print:function(){var t=this.$loading.show();axios.post("/api/academic/id-card/template/print",{filter:this.filter}).then((function(e){var a=window.open("/print");t.hide(),a.document.write(e)})).catch((function(e){t.hide(),helper.showErrorMsg(e)}))},pdf:function(){var t=this,e=this.$loading.show();axios.post("/api/academic/id-card/template/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)}))}},filters:{momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{"filter.sort_by":function(t){this.getIdCardTemplates()},"filter.order":function(t){this.getIdCardTemplates()},"filter.page_length":function(t){this.getIdCardTemplates()}},computed:{authToken:function(){return helper.getAuthToken()}}},r=a("KHd+"),s=Object(r.a)(i,(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("academic.id_card_template"))+" \n "),t.id_card_templates.total?a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.total_result_found",{count:t.id_card_templates.total,from:t.id_card_templates.from,to:t.id_card_templates.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.id_card_templates.total&&!t.showCreatePanel?a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.add_new"),expression:"trans('general.add_new')"}],staticClass:"btn btn-info btn-sm",on:{click:function(e){t.showCreatePanel=!t.showCreatePanel}}},[a("i",{staticClass:"fas fa-plus"}),t._v(" "),a("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("academic.id_card_template")))])]):t._e(),t._v(" "),a("sort-by",{attrs:{"order-by-options":t.orderByOptions,"sort-by":t.filter.sort_by,order:t.filter.order},on:{updateSortBy:function(e){t.filter.sort_by=e},updateOrder:function(e){t.filter.order=e}}}),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("help-button",{on:{clicked:function(e){t.help_topic="configuration.academic.id_card_template"}}})],1)])])]),t._v(" "),a("div",{staticClass:"container-fluid"},[a("transition",{attrs:{name:"fade"}},[t.showCreatePanel?a("div",{staticClass:"card card-form"},[a("div",{staticClass:"card-body"},[a("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("academic.id_card_template")))]),t._v(" "),a("id-card-template-form",{on:{completed:t.getIdCardTemplates,cancel:function(e){t.showCreatePanel=!t.showCreatePanel}}})],1)]):t._e()]),t._v(" "),a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[t.id_card_templates.total?a("div",{staticClass:"table-responsive"},[a("table",{staticClass:"table table-sm"},[a("thead",[a("tr",[a("th",[t._v(t._s(t.trans("academic.id_card_template_name")))]),t._v(" "),a("th",[t._v(t._s(t.trans("academic.id_card_template_type")))]),t._v(" "),a("th",{staticClass:"table-option"},[t._v(t._s(t.trans("general.action")))])])]),t._v(" "),a("tbody",t._l(t.id_card_templates.data,(function(e){return a("tr",[a("td",{domProps:{textContent:t._s(e.name)}}),t._v(" "),a("td",{domProps:{textContent:t._s("student"==e.type?t.trans("student.student"):t.trans("employee.employee"))}}),t._v(" "),a("td",{staticClass:"table-option"},[a("div",{staticClass:"btn-group"},[a("router-link",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("general.view_detail"),expression:"trans('general.view_detail')"}],staticClass:"btn btn-success btn-sm",attrs:{to:"/configuration/academic/id-card/template/"+e.id}},[a("i",{staticClass:"fas fa-arrow-circle-right"})]),t._v(" "),a("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("academic.id_card_template"),expression:"trans('academic.id_card_template')"}],staticClass:"btn btn-info btn-sm",on:{click:function(a){return a.preventDefault(),t.editIdCardTemplate(e)}}},[a("i",{staticClass:"fas fa-edit"})]),t._v(" "),a("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDelete(e)},expression:"{ok: confirmDelete(id_card_template)}"},{name:"tooltip",rawName:"v-tooltip",value:t.trans("academic.id_card_template"),expression:"trans('academic.id_card_template')"}],key:e.id,staticClass:"btn btn-danger btn-sm"},[a("i",{staticClass:"fas fa-trash"})])],1)])])})),0)])]):t._e(),t._v(" "),t.id_card_templates.total?t._e():a("module-info",{attrs:{module:"academic",title:"id_card_template_module_title",description:"id_card_template_module_description",icon:"list"}},[a("div",{attrs:{slot:"btn"},slot:"btn"},[t.showCreatePanel?t._e():a("button",{staticClass:"btn btn-info btn-md",on:{click:function(e){t.showCreatePanel=!t.showCreatePanel}}},[a("i",{staticClass:"fas fa-plus"}),t._v(" "+t._s(t.trans("general.add_new")))])])]),t._v(" "),a("pagination-record",{attrs:{"page-length":t.filter.page_length,records:t.id_card_templates},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.getIdCardTemplates},nativeOn:{change:function(e){return t.getIdCardTemplates(e)}}})],1)])],1),t._v(" "),a("right-panel",{attrs:{topic:t.help_topic}})],1)}),[],!1,null,null,null);e.default=s.exports},"IS+6":function(t,e,a){"use strict";var i={data:function(){return{idCardTemplateForm:new Form({name:"",type:"",per_page_limit:"",height:"",width:""})}},props:["id"],mounted:function(){this.id&&this.get()},methods:{proceed:function(){this.id?this.update():this.store()},store:function(){var t=this,e=this.$loading.show();this.idCardTemplateForm.post("/api/academic/id-card/template").then((function(a){toastr.success(a.message),t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},get:function(){var t=this,e=this.$loading.show();axios.get("/api/academic/id-card/template/"+this.id).then((function(a){t.idCardTemplateForm.name=a.name,t.idCardTemplateForm.type=a.type,t.idCardTemplateForm.height=a.height,t.idCardTemplateForm.width=a.width,t.idCardTemplateForm.per_page_limit=a.options.per_page_limit,e.hide()})).catch((function(a){e.hide(),helper.showErrorMsg(a),t.$router.push("/configuration/academic/id-card/template")}))},update:function(){var t=this,e=this.$loading.show();this.idCardTemplateForm.patch("/api/academic/id-card/template/"+this.id).then((function(a){toastr.success(a.message),e.hide(),t.$router.push("/configuration/academic/id-card/template")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))}}},r=a("KHd+"),s=Object(r.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.idCardTemplateForm.errors.clear(e.target.name)}}},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.id_card_template_name")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.idCardTemplateForm.name,expression:"idCardTemplateForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("academic.id_card_template_name")},domProps:{value:t.idCardTemplateForm.name},on:{input:function(e){e.target.composing||t.$set(t.idCardTemplateForm,"name",e.target.value)}}}),t._v(" "),a("show-error",{attrs:{"form-name":t.idCardTemplateForm,"prop-name":"name"}})],1),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("div",{staticClass:"radio radio-success"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.idCardTemplateForm.type,expression:"idCardTemplateForm.type"}],attrs:{type:"radio",value:"student",id:"student",name:"type"},domProps:{checked:t.idCardTemplateForm.type,checked:t._q(t.idCardTemplateForm.type,"student")},on:{click:function(e){return t.idCardTemplateForm.errors.clear("type")},change:function(e){return t.$set(t.idCardTemplateForm,"type","student")}}}),t._v(" "),a("label",{attrs:{for:"student"}},[t._v(t._s(t.trans("student.student")))])]),t._v(" "),a("div",{staticClass:"radio radio-success"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.idCardTemplateForm.type,expression:"idCardTemplateForm.type"}],attrs:{type:"radio",value:"employee",id:"employee",name:"type"},domProps:{checked:!t.idCardTemplateForm.type,checked:t._q(t.idCardTemplateForm.type,"employee")},on:{click:function(e){return t.idCardTemplateForm.errors.clear("type")},change:function(e){return t.$set(t.idCardTemplateForm,"type","employee")}}}),t._v(" "),a("label",{attrs:{for:"employee"}},[t._v(t._s(t.trans("employee.employee")))])]),t._v(" "),a("show-error",{attrs:{"form-name":t.idCardTemplateForm,"prop-name":"type"}})],1)])])]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.id_card_template_width")))]),t._v(" "),a("div",{staticClass:"input-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.idCardTemplateForm.width,expression:"idCardTemplateForm.width"}],staticClass:"form-control",attrs:{type:"text",name:"width",placeholder:t.trans("academic.id_card_template_width")},domProps:{value:t.idCardTemplateForm.width},on:{input:function(e){e.target.composing||t.$set(t.idCardTemplateForm,"width",e.target.value)}}}),t._v(" "),t._m(0)]),t._v(" "),a("show-error",{attrs:{"form-name":t.idCardTemplateForm,"prop-name":"width"}})],1)]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.id_card_template_height")))]),t._v(" "),a("div",{staticClass:"input-group"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.idCardTemplateForm.height,expression:"idCardTemplateForm.height"}],staticClass:"form-control",attrs:{type:"text",name:"height",placeholder:t.trans("academic.id_card_template_height")},domProps:{value:t.idCardTemplateForm.height},on:{input:function(e){e.target.composing||t.$set(t.idCardTemplateForm,"height",e.target.value)}}}),t._v(" "),t._m(1)]),t._v(" "),a("show-error",{attrs:{"form-name":t.idCardTemplateForm,"prop-name":"height"}})],1)])]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"form-group"},[a("label",{attrs:{for:""}},[t._v(t._s(t.trans("academic.id_card_template_per_page_limit")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.idCardTemplateForm.per_page_limit,expression:"idCardTemplateForm.per_page_limit"}],staticClass:"form-control",attrs:{type:"text",name:"per_page_limit",placeholder:t.trans("academic.id_card_template_per_page_limit")},domProps:{value:t.idCardTemplateForm.per_page_limit},on:{input:function(e){e.target.composing||t.$set(t.idCardTemplateForm,"per_page_limit",e.target.value)}}}),t._v(" "),a("show-error",{attrs:{"form-name":t.idCardTemplateForm,"prop-name":"per_page_limit"}})],1)])])])]),t._v(" "),a("div",{staticClass:"card-footer text-right"},[a("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/academic/id-card/template"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():a("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(e){return t.$emit("cancel")}}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),a("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?a("span",[t._v(t._s(t.trans("general.update")))]):a("span",[t._v(t._s(t.trans("general.save")))])])],1)])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"input-group-append"},[e("span",{staticClass:"input-group-text"},[this._v("mm")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"input-group-append"},[e("span",{staticClass:"input-group-text"},[this._v("mm")])])}],!1,null,null,null);e.a=s.exports}}]);
//# sourceMappingURL=index.js.map?id=0b6b9b32cc51476e9ea8