File manager - Edit - /var/www/payraty/inventory_main/public/js/chunks/531.dbd688787c99cf49.js
Back
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[531],{9531:(t,e,s)=>{s.r(e),s.d(e,{default:()=>a});const r={props:["product","warehouses","old_stocks","shelfs"],data:function(){return{items:[{id:"",warehouse:"",shelf:"",quantity:0,stock:0,adjust_type:"",customer_buying_price:0,price:0}],adjust_type:["Add","Subtract"],stock_alert_quantity:0}},mounted:function(){var t=this;this.old_stocks.length>0&&(this.items=[],this.old_stocks.map((function(e){t.items.filter((function(t){return t.warehouse==e.warehouse_id})).length<1&&t.items.push({id:e.id,warehouse:e.warehouse_id,stock:e.quantity,quantity:0,adjust_type:"",customer_buying_price:e.customer_buying_price,price:e.price})}))),this.stock_alert_quantity=this.product.stock_alert_quantity},computed:{filteredShelves:function(){var t=this;return function(e){return t.shelfs.filter((function(t){return t.warehouse_id===e}))}}},methods:{getPriceValue:function(t,e,s){var r=this.old_stocks.find((function(r){return r.warehouse_id==t&&r.attribute_id==e&&r.attribute_item_id==s&&r}));return r?r.price:this.product.price},getCustomerBuyingPriceValue:function(t,e,s){var r=this.old_stocks.find((function(r){return r.warehouse_id==t&&r.attribute_id==e&&r.attribute_item_id==s&&r}));return r?r.customer_buying_price:this.product.customer_buying_price},getItemValue:function(t,e,s){var r=this.old_stocks.find((function(r){return r.warehouse_id==t&&r.attribute_id==e&&r.attribute_item_id==s&&r}));return r?r.quantity:0},checkDuplicate:function(t,e){var s=e.target.value;this.items.filter((function(t){return t.warehouse==s})).length>1&&(this.$swal.fire({icon:"error",text:"Duplicate warehouse selected!"}),this.items.splice(t,1))},addItem:function(){this.items.push({id:"",warehouse:"",quantity:0,adjust_type:"",customer_buying_price:0,price:0})},deleteItem:function(t){this.items.splice(t,1)}}};const a=(0,s(1900).Z)(r,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"col-sm-12 table-responsive"},[e("table",{staticClass:"table table-bordered"},[e("tr",[e("th",{attrs:{colspan:"5"}},[e("img",{staticClass:"img-100-60",attrs:{src:t.product.thumb_url,alt:t.product.name}}),t._v(" "),e("span",{staticClass:"ml-4"},[e("small",[t._v(t._s(t.__("custom.product_name"))+": ")]),t._v("\n "+t._s(t.product.name)+"\n ")])]),t._v(" "),e("th",{attrs:{colspan:"2"}},[t._v("\n "+t._s(t.__("custom.alert_quantity"))+"\n "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.stock_alert_quantity,expression:"stock_alert_quantity"}],staticClass:"form-control",attrs:{type:"number",name:"alert_quantity",required:"",placeholder:t.__("custom.alert_quantity")},domProps:{value:t.stock_alert_quantity},on:{input:function(e){e.target.composing||(t.stock_alert_quantity=e.target.value)}}})])]),t._v(" "),e("tr",[e("th",[t._v(t._s(t.__("custom.warehouse_name")))]),t._v(" "),e("th",[t._v("Shelf")]),t._v(" "),e("th",{attrs:{width:"20%"}},[t._v(t._s(t.__("custom.current_stock"))+" "),t.product.weight_unit?e("small",[t._v("("+t._s(t.product.weight_unit.name)+")")]):t._e()]),t._v(" "),e("th",{attrs:{width:"20%"}},[t._v(t._s(t.__("custom.qty"))+" "),t.product.weight_unit?e("small",[t._v("("+t._s(t.product.weight_unit.name)+")")]):t._e()]),t._v(" "),e("th",[t._v(t._s(t.__("custom.price")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.customer_buying_price")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.adjust_type"))+" "),e("small",[t._v("("+t._s(t.__("custom.stock"))+")")])]),t._v(" "),e("th")]),t._v(" "),t._l(t.items,(function(s,r){return e("tr",{key:r},[e("td",{attrs:{width:"30%"}},[e("select",{directives:[{name:"model",rawName:"v-model",value:s.warehouse,expression:"item.warehouse"}],staticClass:"form-control",attrs:{name:"warehouse_stock["+r+"][warehouse]"},on:{change:[function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(s,"warehouse",e.target.multiple?r:r[0])},function(e){return t.checkDuplicate(r,e)}]}},[e("option",{attrs:{value:"",selected:""}},[t._v(t._s(t.__("custom.select_warehouse")))]),t._v(" "),t._l(t.warehouses,(function(s,r){return e("option",{key:r,domProps:{value:s.id}},[t._v("\n "+t._s(s.name)+"\n ")])}))],2)]),t._v(" "),e("td",{attrs:{width:"20%"}},[e("select",{directives:[{name:"model",rawName:"v-model",value:s.shelf,expression:"item.shelf"}],staticClass:"form-control",attrs:{name:"warehouse_stock["+r+"][shelf_id]",disabled:!s.warehouse},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(s,"shelf",e.target.multiple?r:r[0])}}},[e("option",{attrs:{value:"",selected:""}},[t._v("Select Shelf")]),t._v(" "),t._l(t.filteredShelves(s.warehouse),(function(s){return e("option",{key:s.id,domProps:{value:s.id}},[t._v("\n "+t._s(s.name)+"\n ")])}))],2)]),t._v(" "),e("td",[e("table",{staticClass:"table table-bordered"},t._l(t.product.attributes,(function(a,i){return e("tr",{key:i},[e("td",[t._v("\n "+t._s(a.attribute.name)+": "+t._s(a.attribute_item.name)+"\n "),e("br"),t._v(" "),e("input",{staticClass:"form-control",attrs:{type:"number",readonly:"",name:"warehouse_stock["+r+"][stock]["+a.attribute_id+"]["+a.attribute_item_id+"]"},domProps:{value:t.getItemValue(s.warehouse,a.attribute_id,a.attribute_item_id)}})])])})),0)]),t._v(" "),e("td",[e("table",{staticClass:"table table-bordered"},t._l(t.product.attributes,(function(s,a){return e("tr",{key:a},[e("td",[t._v("\n "+t._s(s.attribute.name)+": "+t._s(s.attribute_item.name)+"\n "),e("br"),t._v(" "),e("input",{staticClass:"form-control",attrs:{value:"0",type:"number",name:"warehouse_stock["+r+"][quantity]["+s.attribute_id+"]["+s.attribute_item_id+"]"}})])])})),0)]),t._v(" "),e("td",[e("table",{staticClass:"table table-bordered"},t._l(t.product.attributes,(function(a,i){return e("tr",{key:i},[e("td",[t._v("\n "+t._s(a.attribute.name)+": "+t._s(a.attribute_item.name)+"\n "),e("br"),t._v(" "),e("input",{staticClass:"form-control",attrs:{type:"number",name:"warehouse_stock["+r+"][price]["+a.attribute_id+"]["+a.attribute_item_id+"]"},domProps:{value:t.getPriceValue(s.warehouse,a.attribute_id,a.attribute_item_id)}})])])})),0)]),t._v(" "),e("td",[e("table",{staticClass:"table table-bordered"},t._l(t.product.attributes,(function(a,i){return e("tr",{key:i},[e("td",[t._v("\n "+t._s(a.attribute.name)+": "+t._s(a.attribute_item.name)+"\n "),e("br"),t._v(" "),e("input",{staticClass:"form-control",attrs:{type:"number",name:"warehouse_stock["+r+"][customer_buying_price]["+a.attribute_id+"]["+a.attribute_item_id+"]"},domProps:{value:t.getCustomerBuyingPriceValue(s.warehouse,a.attribute_id,a.attribute_item_id)}})])])})),0)]),t._v(" "),t.old_stocks.length>0?e("td",{attrs:{width:"20%"}},[e("select",{directives:[{name:"model",rawName:"v-model",value:s.adjust_type,expression:"item.adjust_type"}],staticClass:"form-control",attrs:{name:"warehouse_stock["+r+"][adjust_type]"},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(s,"adjust_type",e.target.multiple?r:r[0])}}},[e("option",{attrs:{value:"",selected:""}},[t._v(t._s(t.__("custom.select_adjust_type")))]),t._v(" "),t._l(t.adjust_type,(function(s,r){return e("option",{key:r,domProps:{value:s}},[t._v(t._s(s))])}))],2)]):e("td",{attrs:{width:"20%"}},[e("select",{directives:[{name:"model",rawName:"v-model",value:s.adjust_type,expression:"item.adjust_type"}],staticClass:"form-control",attrs:{name:"warehouse_stock["+r+"][adjust_type]"},on:{change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(s,"adjust_type",e.target.multiple?r:r[0])}}},[e("option",{attrs:{value:"",selected:""}},[t._v(t._s(t.__("custom.select_adjust_type")))]),t._v(" "),e("option",{attrs:{value:"Add",selected:""}},[t._v("Add")])])]),t._v(" "),e("td",{attrs:{width:"5%"}},[s.id?e("button",{staticClass:"btn btn-sm btn-outline-danger",attrs:{type:"button",disabled:""},on:{click:function(e){return t.deleteItem(r)}}},[e("i",{staticClass:"fa fa-trash"})]):e("button",{staticClass:"btn btn-sm btn-outline-danger",attrs:{type:"button"},on:{click:function(e){return t.deleteItem(r)}}},[e("i",{staticClass:"fa fa-trash"})])])])})),t._v(" "),e("tfoot",[e("tr",[e("td",{attrs:{colspan:"7"}},[e("button",{staticClass:"btn btn-sm btn-info mb-4 float-right",attrs:{type:"button",title:t.__("custom.add_warehouse")},on:{click:t.addItem}},[e("i",{staticClass:"fa fa-plus"})])])])])],2)])}),[],!1,null,null,null).exports},1900:(t,e,s)=>{function r(t,e,s,r,a,i,n,u){var o,_="function"==typeof t?t.options:t;if(e&&(_.render=e,_.staticRenderFns=s,_._compiled=!0),r&&(_.functional=!0),i&&(_._scopeId="data-v-"+i),n?(o=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),a&&a.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},_._ssrRegister=o):a&&(o=u?function(){a.call(this,(_.functional?this.parent:this).$root.$options.shadowRoot)}:a),o)if(_.functional){_._injectStyles=o;var c=_.render;_.render=function(t,e){return o.call(e),c(t,e)}}else{var l=_.beforeCreate;_.beforeCreate=l?[].concat(l,o):[o]}return{exports:t,options:_}}s.d(e,{Z:()=>r})}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings