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