/home/techb158/ileadtechnology.com/SSM/public/js/inventory/stock-item
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/inventory/stock-item/edit.js (7495B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[255],{"A+7Q":function(t,e,o){"use strict";o.r(e);var s={components:{stockItemForm:o("PCWq").a},data:function(){return{id:this.$route.params.id}},mounted:function(){helper.hasPermission("edit-stock-item")||(helper.notAccessibleMsg(),this.$router.push("/dashboard"))}},i=o("KHd+"),n=Object(i.a)(s,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"page-titles"},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-6"},[o("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("inventory.edit_stock_item")))])]),t._v(" "),o("div",{staticClass:"col-12 col-sm-6"},[o("div",{staticClass:"action-buttons pull-right"},[o("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/inventory/stock/item")}}},[o("i",{staticClass:"fas fa-list"}),t._v(" "),o("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("inventory.stock_item")))])])])])])]),t._v(" "),o("div",{staticClass:"container-fluid"},[o("div",{staticClass:"card card-form"},[o("div",{staticClass:"card-body p-t-20"},[o("stock-item-form",{attrs:{id:t.id}})],1)])])])}),[],!1,null,null,null);e.default=n.exports},PCWq:function(t,e,o){"use strict";var s={components:{},props:["id"],data:function(){return{stockItemForm:new Form({name:"",code:"",opening_quantity:"",stock_category_id:"",description:""}),stock_categories:[],selected_stock_category:null}},mounted:function(){this.getPreRequisite(),this.id&&this.getStockItem()},methods:{proceed:function(){this.id?this.updateStockItem():this.storeStockItem()},getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/stock/item/pre-requisite").then((function(o){t.stock_categories=o.stock_categories,e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},storeStockItem:function(){var t=this,e=this.$loading.show();this.stockItemForm.post("/api/stock/item").then((function(o){toastr.success(o.message),t.selected_stock_category=null,t.$emit("completed"),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},getStockItem:function(){var t=this,e=this.$loading.show();axios.get("/api/stock/item/"+this.id).then((function(o){t.stockItemForm.name=o.stock_item.name,t.stockItemForm.code=o.stock_item.code,t.stockItemForm.opening_quantity=o.stock_item.opening_quantity,t.stockItemForm.description=o.stock_item.description,t.stockItemForm.stock_category_id=o.stock_item.stock_category_id,t.selected_stock_category=o.selected_stock_category,e.hide()})).catch((function(o){e.hide(),t.$router.push("/inventory/stock/item")}))},updateStockItem:function(){var t=this,e=this.$loading.show();this.stockItemForm.patch("/api/stock/item/"+this.id).then((function(o){toastr.success(o.message),t.$emit("completed"),e.hide(),t.$router.push("/inventory/stock/item")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},onStockCategorySelect:function(t){this.stockItemForm.stock_category_id=t.id}}},i=o("KHd+"),n=Object(i.a)(s,(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("form",{on:{submit:function(e){return e.preventDefault(),t.proceed(e)},keydown:function(e){return t.stockItemForm.errors.clear(e.target.name)}}},[o("div",{staticClass:"row"},[o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("inventory.stock_category")))]),t._v(" "),o("v-select",{attrs:{label:"name",name:"stock_category_id",id:"stock_category_id",options:t.stock_categories,placeholder:t.trans("general.select_one")},on:{select:t.onStockCategorySelect,close:function(e){return t.stockItemForm.errors.clear("stock_category_id")},remove:function(e){t.stockItemForm.stock_category_id=""}},model:{value:t.selected_stock_category,callback:function(e){t.selected_stock_category=e},expression:"selected_stock_category"}},[t.stock_categories.length?t._e():o("div",{staticClass:"multiselect__option",attrs:{slot:"afterList"},slot:"afterList"},[t._v("\n "+t._s(t.trans("general.no_option_found"))+"\n ")])]),t._v(" "),o("show-error",{attrs:{"form-name":t.stockItemForm,"prop-name":"stock_category_id"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("inventory.stock_item_name")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.stockItemForm.name,expression:"stockItemForm.name"}],staticClass:"form-control",attrs:{type:"text",name:"name",placeholder:t.trans("inventory.stock_item_name")},domProps:{value:t.stockItemForm.name},on:{input:function(e){e.target.composing||t.$set(t.stockItemForm,"name",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.stockItemForm,"prop-name":"name"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("inventory.stock_item_code")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.stockItemForm.code,expression:"stockItemForm.code"}],staticClass:"form-control",attrs:{type:"text",name:"code",placeholder:t.trans("inventory.stock_item_code")},domProps:{value:t.stockItemForm.code},on:{input:function(e){e.target.composing||t.$set(t.stockItemForm,"code",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.stockItemForm,"prop-name":"code"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-4"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("inventory.stock_item_opening_quantity")))]),t._v(" "),o("input",{directives:[{name:"model",rawName:"v-model",value:t.stockItemForm.opening_quantity,expression:"stockItemForm.opening_quantity"}],staticClass:"form-control",attrs:{type:"text",name:"opening_quantity",placeholder:t.trans("inventory.stock_item_opening_quantity")},domProps:{value:t.stockItemForm.opening_quantity},on:{input:function(e){e.target.composing||t.$set(t.stockItemForm,"opening_quantity",e.target.value)}}}),t._v(" "),o("show-error",{attrs:{"form-name":t.stockItemForm,"prop-name":"opening_quantity"}})],1)]),t._v(" "),o("div",{staticClass:"col-12 col-sm-12"},[o("div",{staticClass:"form-group"},[o("label",{attrs:{for:""}},[t._v(t._s(t.trans("inventory.stock_item_description")))]),t._v(" "),o("autosize-textarea",{attrs:{rows:"2",name:"description",placeholder:t.trans("stock.stock_item_description")},model:{value:t.stockItemForm.description,callback:function(e){t.$set(t.stockItemForm,"description",e)},expression:"stockItemForm.description"}}),t._v(" "),o("show-error",{attrs:{"form-name":t.stockItemForm,"prop-name":"description"}})],1)])]),t._v(" "),o("div",{staticClass:"card-footer text-right"},[o("router-link",{directives:[{name:"show",rawName:"v-show",value:t.id,expression:"id"}],staticClass:"btn btn-danger waves-effect waves-light ",attrs:{to:"/inventory/stock/item"}},[t._v(t._s(t.trans("general.cancel")))]),t._v(" "),t.id?t._e():o("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(" "),o("button",{staticClass:"btn btn-info waves-effect waves-light",attrs:{type:"submit"}},[t.id?o("span",[t._v(t._s(t.trans("general.update")))]):o("span",[t._v(t._s(t.trans("general.save")))])])],1)])])}),[],!1,null,null,null);e.a=n.exports}}]);
//# sourceMappingURL=edit.js.map?id=a79c8a26c2c4e7abda00