File manager - Edit - /var/www/payraty/inventory_main/public/js/chunks/133.9c22afa1fa4247f4.js
Back
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[133],{1264:(t,e,a)=>{a.d(e,{Z:()=>n});var s=a(1519),r=a.n(s)()((function(t){return t[1]}));r.push([t.id,".set_poniter[data-v-476d5742]{cursor:pointer}",""]);const n=r},6133:(t,e,a)=>{a.r(e),a.d(e,{default:()=>d});var s=window.localStorage.getItem("app-languages"),r=function(t){return JSON.parse(s)[t]};const n={name:"PurchaseAdd",props:["currency_symbol"],data:function(){return{trans:r,query:"",searched_product:[],formData:{items:[],status:"",notes:"",tax:0,discount:0,discount_type:"percentage",total:""}}},mounted:function(){},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,attribute_item:e.attribute_item.name,name:e.product.name,price:e.price_for_sale,quantity:1,is_variant:e.product.is_variant,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,is_blank:!1}),this.searched_product=[],this.query=""},deleteItem:function(t){this.formData.items.splice(t,1)},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),o=a.n(i),u=a(1264),c={insert:"head",singleton:!1};o()(u.Z,c);u.Z.locals;const d=(0,a(1900).Z)(n,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"row"},[e("div",{staticClass:"col-sm-12 mb-5"},[e("label",[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:"Search product by Name and 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,s){return e("li",{key:s,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",[t._v(t._s(t.__("custom.product"))+" "),e("span",{staticClass:"error"},[t._v("*")])]),t._v(" "),e("table",{staticClass:"table"},[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",[e("a",{staticClass:"text-danger",attrs:{href:"#"},on:{click:t.deleteAllItem}},[e("i",{staticClass:"fa fa-trash"})])])])]),t._v(" "),e("tbody",[t._l(t.formData.items,(function(a,s){return e("tr",{key:s},[e("td",[t._v(t._s(s+1))]),t._v(" "),e("td",[a.is_blank?e("span",[e("input",{directives:[{name:"model",rawName:"v-model",value:a.sku,expression:"item.sku"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:a.sku},on:{input:function(e){e.target.composing||t.$set(a,"sku",e.target.value)}}})]):e("span",[t._v(t._s(a.sku))]),t._v(" "),e("input",{attrs:{type:"hidden",name:"product_stock_id[]"},domProps:{value:a.id}}),t._v(" "),e("input",{attrs:{type:"hidden",name:"product_id[]"},domProps:{value:a.product_id}})]),t._v(" "),e("td",[a.is_blank?e("span",[e("input",{directives:[{name:"model",rawName:"v-model",value:a.name,expression:"item.name"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:a.name},on:{input:function(e){e.target.composing||t.$set(a,"name",e.target.value)}}})]):e("span",[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(" "),t._m(0,!0),t._v(" "),e("td",[e("input",{staticClass:"form-control",attrs:{readonly:"",type:"number",name:"sub_total[]"},domProps:{value:t.calculateSubTotal(s)}})]),t._v(" "),e("td",[e("a",{staticClass:"text-danger",attrs:{href:"#"},on:{click:function(e){return t.deleteItem(s)}}},[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)])])])}),[function(){var t=this._self._c;return t("td",[t("input",{staticClass:"form-control",attrs:{type:"text",name:"product_note[]"}})])}],!1,null,"476d5742",null).exports},1900:(t,e,a)=>{function s(t,e,a,s,r,n,i,o){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=a,c._compiled=!0),s&&(c.functional=!0),n&&(c._scopeId="data-v-"+n),i?(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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},c._ssrRegister=u):r&&(u=o?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),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 l=c.beforeCreate;c.beforeCreate=l?[].concat(l,u):[u]}return{exports:t,options:c}}a.d(e,{Z:()=>s})}}]);
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 0 |
proxy
|
phpinfo
|
Settings