/home/techb158/ileadtechnology.com/SSM/public/js/configuration/asset/room
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/configuration/asset/room/edit.js (6452B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{CtgS:function(o,t,s){"use strict";s.r(t);var e={components:{roomForm:s("uM5F").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},r=s("KHd+"),i=Object(r.a)(e,(function(){var o=this,t=o.$createElement,s=o._self._c||t;return s("div",[s("div",{staticClass:"page-titles"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-6"},[s("h3",{staticClass:"text-themecolor"},[o._v(o._s(o.trans("asset.edit_room")))])]),o._v(" "),s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"action-buttons pull-right"},[s("button",{staticClass:"btn btn-info btn-sm",on:{click:function(t){return o.$router.push("/configuration/asset/room")}}},[s("i",{staticClass:"fas fa-list"}),o._v(" "),s("span",{staticClass:"d-none d-sm-inline"},[o._v(o._s(o.trans("asset.room")))])])])])])]),o._v(" "),s("div",{staticClass:"container-fluid"},[s("div",{staticClass:"card card-form"},[s("div",{staticClass:"card-body p-t-20"},[s("room-form",{attrs:{id:o.id}})],1)])])])}),[],!1,null,null,null);t.default=i.exports},uM5F:function(o,t,s){"use strict";var e={data:function(){return{roomForm:new Form({name:"",floor_number:"",building_id:"",description:""}),buildings:[],selected_building:null}},props:["id"],mounted:function(){this.id&&this.get(),this.getPreRequisite()},methods:{getPreRequisite:function(){var o=this,t=this.$loading.show();axios.get("/api/asset/room/pre-requisite").then((function(s){o.buildings=s.buildings,t.hide()})).catch((function(o){t.hide(),helper.showErrorMsg(o)}))},proceed:function(){this.id?this.update():this.store()},store:function(){var o=this,t=this.$loading.show();this.roomForm.post("/api/asset/room").then((function(s){toastr.success(s.message),o.selected_building=null,o.$emit("completed"),t.hide()})).catch((function(o){t.hide(),helper.showErrorMsg(o)}))},get:function(){var o=this,t=this.$loading.show();axios.get("/api/asset/room/"+this.id).then((function(s){o.roomForm.name=s.room.name,o.roomForm.floor_number=s.room.floor_number,o.roomForm.building_id=s.room.building_id,o.selected_building=s.selected_building,o.roomForm.description=s.room.description,t.hide()})).catch((function(s){t.hide(),helper.showErrorMsg(s),o.$router.push("/configuration/asset/room")}))},update:function(){var o=this,t=this.$loading.show();this.roomForm.patch("/api/asset/room/"+this.id).then((function(s){toastr.success(s.message),t.hide(),o.$router.push("/configuration/asset/room")})).catch((function(o){t.hide(),helper.showErrorMsg(o)}))},onBuildingSelect:function(o){this.roomForm.building_id=o.id}}},r=s("KHd+"),i=Object(r.a)(e,(function(){var o=this,t=o.$createElement,s=o._self._c||t;return s("form",{on:{submit:function(t){return t.preventDefault(),o.proceed(t)},keydown:function(t){return o.roomForm.errors.clear(t.target.name)}}},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-4"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[o._v(o._s(o.trans("asset.building")))]),o._v(" "),s("v-select",{attrs:{label:"name",name:"building_id",id:"building_id",options:o.buildings,placeholder:o.trans("asset.select_building")},on:{select:o.onBuildingSelect,close:function(t){return o.roomForm.errors.clear("building_id")},remove:function(t){o.roomForm.building_id=""}},model:{value:o.selected_building,callback:function(t){o.selected_building=t},expression:"selected_building"}},[o.buildings.length?o._e():s("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[o._v("\n "+o._s(o.trans("general.no_option_found"))+"\n ")])]),o._v(" "),s("show-error",{attrs:{"form-name":o.roomForm,"prop-name":"building_id"}})],1)]),o._v(" "),s("div",{staticClass:"col-12 col-sm-4"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[o._v(o._s(o.trans("asset.room_name")))]),o._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:o.roomForm.name,expression:"roomForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:o.trans("asset.room_name")},domProps:{value:o.roomForm.name},on:{input:function(t){t.target.composing||o.$set(o.roomForm,"name",t.target.value)}}}),o._v(" "),s("show-error",{attrs:{"form-name":o.roomForm,"prop-name":"name"}})],1)]),o._v(" "),s("div",{staticClass:"col-12 col-sm-4"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[o._v(o._s(o.trans("asset.room_floor_number")))]),o._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:o.roomForm.floor_number,expression:"roomForm.floor_number"}],staticClass:"form-control",attrs:{type:"text",name:"floor_number",placeholder:o.trans("asset.room_floor_number")},domProps:{value:o.roomForm.floor_number},on:{input:function(t){t.target.composing||o.$set(o.roomForm,"floor_number",t.target.value)}}}),o._v(" "),s("show-error",{attrs:{"form-name":o.roomForm,"prop-name":"floor_number"}})],1)]),o._v(" "),s("div",{staticClass:"col-12 col-sm-12"},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[o._v(o._s(o.trans("asset.room_description")))]),o._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:o.roomForm.description,expression:"roomForm.description"}],staticClass:"form-control",attrs:{type:"text",name:"description",placeholder:o.trans("asset.room_description")},domProps:{value:o.roomForm.description},on:{input:function(t){t.target.composing||o.$set(o.roomForm,"description",t.target.value)}}}),o._v(" "),s("show-error",{attrs:{"form-name":o.roomForm,"prop-name":"description"}})],1)])]),o._v(" "),s("div",{staticClass:"card-footer text-right"},[s("router-link",{directives:[{name:"show",rawName:"v-show",value:o.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/configuration/asset/room"}},[o._v(o._s(o.trans("general.cancel")))]),o._v(" "),o.id?o._e():s("button",{staticClass:"btn btn-danger waves-effect waves-light ",attrs:{type:"button"},on:{click:function(t){return o.$emit("cancel")}}},[o._v(o._s(o.trans("general.cancel")))]),o._v(" "),s("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[o.id?s("span",[o._v(o._s(o.trans("general.update")))]):s("span",[o._v(o._s(o.trans("general.save")))])])],1)])}),[],!1,null,null,null);t.a=i.exports}}]);
//# sourceMappingURL=edit.js.map?id=cf8f879f83210a8d3063