File manager - Edit - /var/www/payraty/inventory_main/public/js/chunks/768.15ea3bfa74340fb7.js
Back
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[768],{7497:(t,e,a)=>{a.d(e,{Z:()=>s});var r=a(1519),i=a.n(r)()((function(t){return t[1]}));i.push([t.id,".set_poniter[data-v-1ec36a74]{cursor:pointer}",""]);const s=i},4768:(t,e,a)=>{a.r(e),a.d(e,{default:()=>u});const r={props:["products","currency_symbol"],name:"PurchaseAdd",data:function(){return{query:"",searched_product:[],formData:{items:[],status:"",notes:"",discount:0,discount_type:"percentage",total:""}}},mounted:function(){var t=this;this.products.map((function(e){t.formData.items.push({purchase_item_id:e.id,sku:e.product.sku,id:e.product_stock_id,product_id:e.product.id,name:e.product.name,quantity:e.quantity,sub_total:e.sub_total,price:e.price,is_variant:e.product.is_variant,attribute:null!=e.product_stock.attribute_id?e.product_stock.attribute.name:null,attribute_item:null!=e.product_stock.attribute_id?e.product_stock.attribute_item.name:null,note:e.note})}))},methods:{calculateSubTotal:function(t){var e=this.formData.items[t],a=Number(e.quantity)*Number(e.price);return Number(a).toFixed(2)},searchSelectSku:function(t){var e=this,a=t.target.value;a.length>1?axios.get("/admin/api/product-stock/search/name-sku/".concat(a)).then((function(t){e.searched_product=t.data})).catch((function(t){})):this.searched_product=[]},selectProduct:function(t){var e=this.searched_product.find((function(e){return e.id==t}));this.formData.items.find((function(t){return t.id==e.id}))?this.$swal.fire({icon:"error",text:"Product already added."}):1==e.product.is_variant?this.formData.items.push({id:e.id,product_id:e.product_id,sku:e.product.sku,attribute:e.attribute.name,attributeItem:e.attribute_item.name,name:e.product.name,price:e.price_for_sale,quantity:1,is_variant:e.product.is_variant,purchase_item_id:null,is_blank:!1}):this.formData.items.push({id:e.id,product_id:e.product.id,sku:e.product.sku,attribute:null,attributeItem:null,name:e.product.name,price:e.price_for_sale,quantity:1,is_variant:e.product.is_variant,purchase_item_id:null,is_blank:!1}),this.searched_product=[],this.query=""},deleteItem:function(t,e){var a=this;e&&axios.get("/admin/api/purchase_item/delete/".concat(e)).then((function(e){e&&a.formData.items.splice(t,1)})).catch((function(t){}))},deleteAllItem:function(){this.formData.items=[]}},computed:{calculateTotal:function(){var t=0;return this.formData.items.map((function(e){t+=Number(e.price)*Number(e.quantity)})),Number(t).toFixed(2)}}};var i=a(3379),s=a.n(i),n=a(7497),o={insert:"head",singleton:!1};s()(n.Z,o);n.Z.locals;const u=(0,a(1900).Z)(r,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-12 mb-5"},[e("label",{attrs:{for:""}},[t._v(t._s(t.__("custom.search_product")))]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],staticClass:"form-control",attrs:{placeholder:t.__("custom.search_product_by_name_sku"),type:"text"},domProps:{value:t.query},on:{keyup:function(e){return t.searchSelectSku(e)},input:function(e){e.target.composing||(t.query=e.target.value)}}}),t._v(" "),e("div",[e("ul",{staticClass:"list-group"},t._l(t.searched_product,(function(a,r){return e("li",{key:r,staticClass:"list-group-item set_poniter",on:{click:function(e){return t.selectProduct(a.id)}}},[1==a.product.is_variant?e("a",{attrs:{href:"javascript:void(0)"}},[t._v("("+t._s(a.product.sku)+") "+t._s(a.product.name)+" ("+t._s(a.attribute.name)+" : "+t._s(a.attribute_item.name)+")")]):e("a",{attrs:{href:"javascript:void(0)"}},[t._v("("+t._s(a.product.sku)+") "+t._s(a.product.name))])])})),0)])]),t._v(" "),e("div",{staticClass:"col-12"},[e("label",{attrs:{for:""}},[t._v(t._s(t.__("custom.product")))]),t._v(" "),e("div",{staticClass:"table-responsive"},[e("table",{staticClass:"table ic-table-return"},[e("thead",[e("tr",[e("th",[t._v("#")]),t._v(" "),e("th",[t._v(t._s(t.__("custom.sku")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.name")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.quantity")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.price")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.note")))]),t._v(" "),e("th",[t._v(t._s(t.__("custom.sub_total")))]),t._v(" "),e("th")])]),t._v(" "),e("tbody",[t._l(t.formData.items,(function(a,r){return e("tr",{key:r},[e("td",[t._v(t._s(r+1))]),t._v(" "),e("td",[e("span",[t._v(t._s(a.sku))]),t._v(" "),e("input",{attrs:{type:"hidden",name:"purchase_item_id[]"},domProps:{value:a.purchase_item_id}}),t._v(" "),e("input",{attrs:{type:"hidden",name:"product_id[]"},domProps:{value:a.product_id}}),t._v(" "),e("input",{attrs:{type:"hidden",name:"product_stock_id[]"},domProps:{value:a.id}})]),t._v(" "),e("td",[1==a.is_variant?e("span",[t._v("\n "+t._s(a.name)+" "+t._s(a.attribute+":"+a.attribute_item)+"\n ")]):e("span",[t._v("\n "+t._s(a.name)+"\n ")])]),t._v(" "),e("td",[e("input",{directives:[{name:"model",rawName:"v-model",value:a.quantity,expression:"item.quantity"}],staticClass:"form-control",attrs:{type:"number",min:"1",name:"quantity[]"},domProps:{value:a.quantity},on:{input:function(e){e.target.composing||t.$set(a,"quantity",e.target.value)}}})]),t._v(" "),e("td",[e("input",{directives:[{name:"model",rawName:"v-model",value:a.price,expression:"item.price"}],staticClass:"form-control",attrs:{type:"text",min:"1",name:"price[]"},domProps:{value:a.price},on:{input:function(e){e.target.composing||t.$set(a,"price",e.target.value)}}})]),t._v(" "),e("td",[e("input",{staticClass:"form-control",attrs:{type:"text",name:"product_note[]"},domProps:{value:a.note}})]),t._v(" "),e("td",[e("input",{staticClass:"form-control",attrs:{readonly:"",type:"number",name:"sub_total[]"},domProps:{value:t.calculateSubTotal(r)}})]),t._v(" "),e("td",[e("a",{staticClass:"text-danger",attrs:{href:"ic-javascriptVoid"},on:{click:function(e){return t.deleteItem(r,a.purchase_item_id)}}},[e("i",{staticClass:"fa fa-trash"})])])])})),t._v(" "),e("tr",[e("td",{attrs:{colspan:"5"}}),t._v(" "),e("td",[t._v(t._s(t.__("custom.total")))]),t._v(" "),e("td",[e("b",[t._v(t._s(t.currency_symbol)+t._s(t.calculateTotal))]),t._v(" "),e("input",{attrs:{type:"hidden",name:"total"},domProps:{value:t.calculateTotal}})])])],2)])])])])}),[],!1,null,"1ec36a74",null).exports},1900:(t,e,a)=>{function r(t,e,a,r,i,s,n,o){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=a,c._compiled=!0),r&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),n?(u=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__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},c._ssrRegister=u):i&&(u=o?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(c.functional){c._injectStyles=u;var d=c.render;c.render=function(t,e){return u.call(e),d(t,e)}}else{var _=c.beforeCreate;c.beforeCreate=_?[].concat(_,u):[u]}return{exports:t,options:c}}a.d(e,{Z:()=>r})}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings