(window.webpackJsonp=window.webpackJsonp||[]).push([[138],{"4qWz":function(t,e,n){"use strict";var i={data:function(){return{complaintTypeForm:new Form({name:"",description:""})}},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.complaintTypeForm.post("/api/reception/complaint/type").then((function(n){toastr.success(n.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/reception/complaint/type/"+this.id).then((function(n){t.complaintTypeForm.name=n.name,t.complaintTypeForm.description=n.description,e.hide()})).catch((function(n){e.hide(),helper.showErrorMsg(n),t.$router.push("/configuration/reception/complaint/type")}))},update:function(){var t=this,e=this.$loading.show();this.complaintTypeForm.patch("/api/reception/complaint/type/"+this.id).then((function(n){toastr.success(n.message),e.hide(),t.$router.push("/configuration/reception/complaint/type")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))}}},o=n("KHd+"),s=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.complaintTypeForm.errors.clear(e.target.name)}}},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.complaint_type_name")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.complaintTypeForm.name,expression:"complaintTypeForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("reception.complaint_type_name")},domProps:{value:t.complaintTypeForm.name},on:{input:function(e){e.target.composing||t.$set(t.complaintTypeForm,"name",e.target.value)}}}),t._v(" "),n("show-error",{attrs:{"form-name":t.complaintTypeForm,"prop-name":"name"}})],1)]),t._v(" "),n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"form-group"},[n("label",{attrs:{for:""}},[t._v(t._s(t.trans("reception.complaint_type_description")))]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.complaintTypeForm.description,expression:"complaintTypeForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:t.trans("reception.complaint_type_description")},domProps:{value:t.complaintTypeForm.description},on:{input:function(e){e.target.composing||t.$set(t.complaintTypeForm,"description",e.target.value)}}}),t._v(" "),n("show-error",{attrs:{"form-name":t.complaintTypeForm,"prop-name":"description"}})],1)])]),t._v(" "),n("div",{staticClass:"card-footer text-right"},[n("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/reception/complaint/type"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():n("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(" "),n("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?n("span",[t._v(t._s(t.trans("general.update")))]):n("span",[t._v(t._s(t.trans("general.save")))])])],1)])}),[],!1,null,null,null);e.a=s.exports},Wzc9:function(t,e,n){"use strict";n.r(e);var i={components:{complaintTypeForm:n("4qWz").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},o=n("KHd+"),s=Object(o.a)(i,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"page-titles"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-12 col-sm-6"},[n("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("reception.edit_complaint_type")))])]),t._v(" "),n("div",{staticClass:"col-12 col-sm-6"},[n("div",{staticClass:"action-buttons pull-right"},[n("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/configuration/reception/complaint/type")}}},[n("i",{staticClass:"fas fa-list"}),t._v(" "),n("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("reception.complaint_type")))])])])])])]),t._v(" "),n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"card card-form"},[n("div",{staticClass:"card-body p-t-20"},[n("complaint-type-form",{attrs:{id:t.id}})],1)])])])}),[],!1,null,null,null);e.default=s.exports}}]);
//# sourceMappingURL=edit.js.map?id=a3fcb09d9cef96b899d9