/
home
/
henzagold
/
adminold
/
export
/
js
/
File Upload :
llllll
Current File: //home/henzagold/adminold/export/js/chunk-60f9c914.e54629cd.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60f9c914"],{"2f6f":function(t,e,r){"use strict";r("5c76")},"3cc4":function(t,e,r){"use strict";r.r(e);r("7f7f"),r("ac6a");var n=function(){var t=this,e=t._self._c;return e("div",{attrs:{id:"page-user-list"}},[t.$hasPermission("order.create")?e("ASpin",{attrs:{type:"loading",spinning:t.loading}},[e("vx-card",{ref:"filterCard",staticClass:"vx-card",attrs:{removeCardAction:!1,title:"لیست محصولات"}},[e("div",[e("XTable",{ref:"AddInvoice",attrs:{model:t.cols},scopedSlots:t._u([{key:"image",fn:function(r){r.text;var n=r.record;return[e("img",{staticStyle:{"object-fit":"scale-down"},attrs:{width:"90px",height:"90px",src:n.thumb&&n.thumb.full?n.thumb.full:t.noImage}})]}},{key:"op",fn:function(r){r.text;var n=r.record;return[e("a-dropdown",[e("a-menu",{attrs:{slot:"overlay"},on:{click:t.addToCart},slot:"overlay"},t._l(n.variants_all,(function(r,a){return e("a-menu-item",{key:{vid:r.id,qty:1,pid:n.id,product:n,promotion_id:n.promotion&&n.promotion.id?n.promotion.id:null}},[t._v("\n افزودن تنوع "+t._s(r.title)+"\n ")])})),1),e("a-button",{staticStyle:{"margin-left":"8px"}},[t._v(" افزودن "),e("a-icon",{attrs:{type:"down"}})],1)],1)]}}],null,!1,4184801464)}),e("h6",{staticClass:"mt-2"},[t._v("تعداد "+t._s(t.selects.keys.length)+" محصول انتخاب شده است.")]),t.Items.length>0?e("a-card",{staticClass:"mt-5",attrs:{title:"ثبت سفارش"}},[e("a-table",{attrs:{columns:t.columns,"data-source":t.Items,bordered:"",pagination:!1},scopedSlots:t._u([{key:"delete",fn:function(r,n,a){return[e("a-icon",{attrs:{type:"close"},on:{click:function(e){return t.$store.dispatch("invoiceCart/remove",n)}}})]}},{key:"product",fn:function(r,n,a){return[e("div",{staticClass:"flex items-center"},[e("img",{attrs:{src:t.getImage(r),width:"50px"}}),t._v("\n "+t._s(r.title)+"\n ")])]}},{key:"price",fn:function(e,r,n){return[t._v("\n "+t._s(t._f("priceUnit")(t.getVariant(r).price_with_discount))+"\n ")]}},{key:"qty",fn:function(r,n,a){return[e("a-input-number",{attrs:{min:1,max:t.getVariant(t.Items[a]).qty>0?t.getVariant(t.Items[a]).qty:1/0},on:{change:function(e){return t.$store.dispatch("cart/updateItemQuantity",{index:a,quantity:e})}},model:{value:t.Items[a].qty,callback:function(e){t.$set(t.Items[a],"qty",e)},expression:"Items[index].qty"}})]}},{key:"weight",fn:function(r,n,a){return e("div",{staticClass:"flex"},[t.variant.grams&&t.variant.id===t.getVariant(n).id?[e("a-input-number",{model:{value:t.variant.grams,callback:function(e){t.$set(t.variant,"grams",e)},expression:"variant.grams"}}),e("FeatherIcon",{staticClass:"cursor-pointer ml-2",attrs:{icon:"CheckIcon",svgClasses:"h-6 w-6 text-success"},on:{click:t.editGram}})]:[e("span",{staticStyle:{width:"max-content"}},[t._v("\n "+t._s(t.getVariant(n).title)+"\n ")]),e("FeatherIcon",{staticClass:"cursor-pointer ml-2",attrs:{icon:"EditIcon",svgClasses:"h-6 w-6 text-primary"},on:{click:function(e){return t.toEdit(n)}}})]],2)}},{key:"total",fn:function(e,r,n){return[t._v("\n "+t._s(t._f("priceUnit")(r.qty*t.getVariant(r).price))+"\n ")]}}],null,!1,2670106517)}),e("a-form",{attrs:{form:t.form},on:{submit:t.submitOrder}},[e("div",{staticClass:"grid grid-cols-5 gap-4"},[e("a-form-item",{attrs:{label:"نام شعبه"}},[e("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["branch_id",{rules:[{required:!0,message:"مقدار را وارد نمایید"}]}],expression:"['branch_id', { rules: [{ required: true, message: 'مقدار را وارد نمایید' }] }]"}],attrs:{"show-search":"","option-filter-prop":"children","filter-option":t.filterOption}},t._l(t.list,(function(r,n){return e("a-select-option",{key:r.id},[e("span",[t._v(t._s(r.name))])])})),1)],1)],1),e("a-button",{attrs:{type:"primary",disabled:!t.Items||t.Items.length<1},on:{click:t.submitOrder}},[t._v("\n ثبت تغییرات\n ")])],1)],1):t._e()],1)])],1):t._e()],1)},a=[],i=(r("ac4d"),r("8a81"),r("5df3"),r("1c4c"),r("6b54"),r("7514"),r("96cf"),r("1da1")),o=r("fb4d"),s=r("ff6e"),c=r("bb36"),l=r("529b"),u=r.n(l),d=r("04c5");function f(t,e){var r="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=m(t))||e&&t&&"number"===typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function m(t,e){if(t){if("string"===typeof t)return p(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var h={components:{XTable:s["a"],FeatherIcon:d["a"]},data:function(){return{list:[],noImage:u.a,types:void 0,sts:{1:"ثبت سفارش",2:"تایید مدیر سیستم",3:"در حال تامین",4:"در حال آماده سازی",5:"ارسال",6:"تحویل مشتری"},form:this.$form.createForm(this,{name:"coordinated"}),selects:{rows:[],keys:[]},loading:!1,cols:null,customers:void 0,products:void 0,columns:[{title:"حذف",dataIndex:"delete",width:60,scopedSlots:{customRender:"delete"},align:"center"},{title:"کد محصول",dataIndex:"pid",align:"center",width:90},{title:"محصول",dataIndex:"product",scopedSlots:{customRender:"product"}},{title:"قیمت",dataIndex:"product.variants_all",scopedSlots:{customRender:"price"},align:"center"},{title:"تعداد",dataIndex:"qty",scopedSlots:{customRender:"qty"},align:"center",width:140},{title:"وزن",dataIndex:"product.variants_all",scopedSlots:{customRender:"weight"},align:"center",width:90},{title:"مجموع",dataIndex:"total",scopedSlots:{customRender:"total"},align:"center"}],variant:{}}},methods:{addToCart:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(e){var r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log(e.key.product.branch_id),null!==e.key.product.branch_id){t.next=12;break}return t.next=4,this.$store.dispatch("invoiceCart/add",e.key);case 4:return this.$ntNoTitle("اضافه شد"),t.next=7,c["b"].get("/branch/list");case 7:r=t.sent,n=r.data,this.list=n,t.next=13;break;case 12:this.$message.error("برای این محصول شعبه انتخاب شده است");case 13:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),getVariant:function(t){return t.product.variants_all.find((function(e){return e.id===t.vid}))||{}},filterOption:function(t,e){return e.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0},submitOrder:function(t){var e=this;try{this.loading=!0,this.form.validateFields(function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(r,n){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r){t.next=10;break}return a=e.Items.map((function(t){return t.pid})),n.products=a,t.next=5,c["b"].post("/branch/product",n);case 5:e.$ntSet(),e.$store.dispatch("invoiceCart/clear"),e.form.resetFields(),e.loading=!1,e.$router.push("/invoice/list");case 10:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())}catch(t){this.$ntSetError("خطا در ثبت اطلاعات.")}},toEdit:function(t){try{this.loading=!0;var e=this.getVariant(t),r=e.id,n=e.grams;this.variant={id:r,grams:n}}catch(a){console.log(a),this.$ntSetError("خطا در ثبت اطلاعات.")}finally{this.loading=!1}},editGram:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,t.next=4,c["b"].post("add/variant",Object.assign(this.variant,{title:this.variant.grams+" گرم"}));case 4:return this.variant={},this.$refs.tblProducts.fetch(),t.next=8,this.$store.dispatch("cart/init");case 8:t.next=14;break;case 10:t.prev=10,t.t0=t["catch"](0),console.log(t.t0),this.$ntSetError("خطا در ثبت اطلاعات.");case 14:return t.prev=14,this.loading=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[0,10,14,17]])})));function e(){return t.apply(this,arguments)}return e}(),getImage:function(t){return t.tmobile?t.tmobile.image:t.image?t.image.image:""}},created:function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(){var e,r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,this.cols=o["a"],t.next=5,c["b"].get("/order/type");case 5:return e=t.sent,this.types=e.data,t.next=9,c["b"].post("/single-customer");case 9:return r=t.sent,n=r.data.rows,this.customers=n,t.next=14,this.$store.dispatch("cart/init");case 14:t.next=20;break;case 16:t.prev=16,t.t0=t["catch"](0),console.log(t.t0),this.$vs.notify(t.t0);case 20:return t.prev=20,this.loading=!1,t.finish(20);case 23:case"end":return t.stop()}}),t,this,[[0,16,20,23]])})));function e(){return t.apply(this,arguments)}return e}(),computed:{Items:function(){return this.$store.state.invoiceCart.items},reagent_id:function(){return JSON.parse(localStorage.getItem("user")).id},Total:function(){var t,e=0,r=f(this.Items);try{for(r.s();!(t=r.n()).done;){var n=t.value;e+=this.getVariant(n).price*n.qty}}catch(a){r.e(a)}finally{r.f()}return e},price:function(){var t,e=0,r=f(this.Items);try{for(r.s();!(t=r.n()).done;){var n=t.value;e+=this.getVariant(n).price_with_discount*n.qty}}catch(a){r.e(a)}finally{r.f()}return e},totalWeight:function(){var t,e=0,r=f(this.Items);try{for(r.s();!(t=r.n()).done;){var n=t.value;e+=this.getVariant(n).grams}}catch(a){r.e(a)}finally{r.f()}return e},totalDiscount:function(){var t,e=0,r=f(this.Items);try{for(r.s();!(t=r.n()).done;){var n=t.value;e+=this.getVariant(n).price-this.getVariant(n).price_with_discount}}catch(a){r.e(a)}finally{r.f()}return e}}},g=h,v=(r("2f6f"),r("2877")),y=Object(v["a"])(g,n,a,!1,null,null,null);e["default"]=y.exports},"5c76":function(t,e,r){},fb4d:function(t,e,r){"use strict";var n=r("e0d2"),a=new n["b"]("https://henzagold.com/oapi/admin/products","لیست محصولات");a.add(new n["a"]("id","کد").filterNumber()),a.add(new n["a"]("ProductImage","تصویر محصول").renderSlot("image").noSort()),a.add(new n["a"]("title","نام محصول").filterText()),a.add(new n["a"]("min_gram","وزن").filterNumber()),a.add(new n["a"]("brand.title","برند").filterText()),a.add(new n["a"]("category.collection.title","دسته بندی").filterText()),a.add(new n["a"]("product_code","کد محصول").filterText()),a.add(new n["a"]("max_gram","حداکثر وزن").filterNumber().hidden()),a.add(new n["a"]("op","عملیات").noSort().renderSlot("op")),a._noFilter=!1,a._noDownload=!0,e["a"]=a}}]);
Copyright ©2k19 -
Hexid
|
Tex7ure