/
home
/
henzagold
/
admin_report
/
js
/
File Upload :
llllll
Current File: /home/henzagold/admin_report/js/chunk-44e79192.f0a5e956.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-44e79192","chunk-456e2b03"],{"1552a":function(e,t,r){"use strict";r("78ac")},"2f21":function(e,t,r){"use strict";var i=r("79e5");e.exports=function(e,t){return!!e&&i((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},"529b":function(e,t,r){e.exports=r.p+"img/no-image.8380890f.png"},"55dd":function(e,t,r){"use strict";var i=r("5ca1"),a=r("d8e8"),n=r("4bf8"),s=r("79e5"),o=[].sort,l=[1,2,3];i(i.P+i.F*(s((function(){l.sort(void 0)}))||!s((function(){l.sort(null)}))||!r("2f21")(o)),"Array",{sort:function(e){return void 0===e?o.call(n(this)):o.call(n(this),a(e))}})},"78ac":function(e,t,r){},8275:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var i=r("d4ec"),a=r("bee2"),n=function(e,t){return t.defaultValue=e,t},s=function(e,t){return t.defaultFilter=e,t},o=function(){function e(t,r){Object(i["a"])(this,e),this.key=t,this.title=r,this.dataIndex=t,this.show=!0,this.__sorter=!0,this.defaultValue=void 0,this.defaultFilter=void 0}return Object(a["a"])(e,[{key:"export",value:function(){var e={};return e["key"]=this.key,e["__key"]=this.__fkey,e["dataIndex"]=this.key,e["title"]=this.title,this._slots&&(this._slots.filterIcon||(this._slots.filterIcon="filterIcon"),e["scopedSlots"]=this._slots),this.filter&&(this.filter=this.filterType,this.filtered=!0),e}},{key:"filterKey",value:function(e){return this.__fkey=e,this.master=e,this}},{key:"renderSlot",value:function(e){return this._slots={customRender:e},this.scopedSlots||(this.scopedSlots={}),this.scopedSlots.customRender=e,this}},{key:"__filter",value:function(){this.filtered=!0,this._slots||(this.scopedSlots={}),this.scopedSlots.filterDropdown="".concat(this.key,"_filterDropdown"),this.scopedSlots.filterIcon="".concat(this.key,"_filterIcon")}},{key:"filterText",value:function(){return this.__filter(),this.filterType="default",this}},{key:"filterSwitch",value:function(){return this.__filter(),this.filterType="switch",this}},{key:"filterQuery",value:function(e){return this.__filter(),this.filterType="query",this.filterAction=e,this}},{key:"filterDate",value:function(){return this.__filter(),this.filterType="date",this}},{key:"filterSelect",value:function(e){return this.__filter(),this.filterType="select",this.filterItems=e,this}},{key:"filterNumber",value:function(){return this.__filter(),this.filterType="number",this}},{key:"noSort",value:function(){return this.__sorter=!1,this}},{key:"hidden",value:function(){return this.show=!1,this}},{key:"setDefaultValue",value:function(e){return n(e,this)}},{key:"setDefaultFilter",value:function(e){return s(e,this)}}]),e}()},"8e6e":function(e,t,r){var i=r("5ca1"),a=r("990b"),n=r("6821"),s=r("11e9"),o=r("f1ae");i(i.S,"Object",{getOwnPropertyDescriptors:function(e){var t,r,i=n(e),l=s.f,u=a(i),c={},d=0;while(u.length>d)r=l(i,t=u[d++]),void 0!==r&&o(c,t,r);return c}})},"990b":function(e,t,r){var i=r("9093"),a=r("2621"),n=r("cb7c"),s=r("7726").Reflect;e.exports=s&&s.ownKeys||function(e){var t=i.f(n(e)),r=a.f;return r?t.concat(r(e)):t}},ab6f:function(e,t,r){"use strict";r.r(t);var i=function(){var e=this,t=e._self._c;return t("div",[t("vx-card",[t("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[t("ASpin",{attrs:{type:"loading",spinning:e.loading}},[t("h4",[e._v(e._s(e.id?"ویرایش تخفیف":"افزودن تخفیف"))]),t("div",{staticClass:"grid grid-col-1 md:grid-cols-3 gap-2"},[t("a-form-item",{staticClass:"hidden",attrs:{label:"شناسه"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["id",{rules:[{required:!!e.id,message:"لطفا مقدار را وارد کنید"}]}],expression:"['id', { rules: [{ required: id ? true : false, message: 'لطفا مقدار را وارد کنید' }] }]"}],staticClass:"w-full",attrs:{min:0,autocomplete:"off"}})],1),t("a-form-item",{attrs:{label:"عنوان"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!!e.id,message:"لطفا مقدار را وارد کنید"}]}],expression:"['title', { rules: [{ required: id ? true : false, message: 'لطفا مقدار را وارد کنید' }] }]"}],staticClass:"w-full",attrs:{autocomplete:"off"}})],1),t("a-form-item",{attrs:{label:"نوع","has-feedback":""}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["type",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['type', { rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }]}]"}],staticClass:"w-full",on:{change:e.changeTbl}},e._l(e.types,(function(r){return t("a-select-option",{attrs:{value:r.value}},[e._v("\n "+e._s(r.label)+"\n ")])})),1)],1),e.showBrand?t("a-form-item",{attrs:{label:"برند ها","has-feedback":""}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["items",{rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['items', { rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }]}]"}],staticClass:"w-full",attrs:{mode:"multiple"}},e._l(e.brands,(function(r){return t("a-select-option",{key:r.id,attrs:{value:r.id}},[e._v("\n "+e._s(r.title)+"\n ")])})),1)],1):e._e(),t("a-form-item",{staticClass:"hidden",attrs:{label:"نوع مشتری","has-feedback":""}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["type_customer",{initialValue:2,rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['type_customer', { initialValue: 2, rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }]}]"}],staticClass:"w-full"},e._l([{key:2,value:"مشتری"}],(function(r){return t("a-select-option",{attrs:{value:r.key}},[e._v("\n "+e._s(r.value)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"میزان تخفیف"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount_percent",{rules:[{required:!!e.id,message:"لطفا مقدار را وارد کنید"}]}],expression:"['discount_percent', { rules: [{ required: id ? true : false, message: 'لطفا مقدار را وارد کنید' }] }]"}],staticClass:"w-full",attrs:{min:0,max:100,autocomplete:"off"}})],1),t("a-form-item",{attrs:{label:"تاریخ شروع","has-feedback":""}},[t("custom-date-picker",{attrs:{"auto-submit":!0,value:e.start_at},on:{input:function(t){return e.form.setFieldsValue({start_at:t})}}}),t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["start_at",{initialValue:e.start_at,rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['start_at', {initialValue: start_at, rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }]}]"}],staticClass:"hidden"})],1),t("a-form-item",{attrs:{label:"تاریخ پایان","has-feedback":""}},[t("custom-date-picker",{attrs:{"auto-submit":!0,value:e.end_at},on:{input:function(t){return e.form.setFieldsValue({end_at:t})}}}),t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["end_at",{initialValue:e.end_at,rules:[{required:!0,message:"لطفا مقدار را وارد کنید"}]}],expression:"['end_at', {initialValue: end_at, rules: [{ required: true, message: 'لطفا مقدار را وارد کنید' }]}]"}],staticClass:"hidden"})],1),t("a-form-item",{attrs:{label:"وضعیت"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_active",{initialValue:!1,valuePropName:"checked",rules:[{required:!1}]}],expression:"['is_active',{ initialValue:false,valuePropName:'checked',rules: [{ required: false }] }]"}]},[t("a-icon",{attrs:{slot:"checkedChildren",type:"check"},slot:"checkedChildren"}),t("a-icon",{attrs:{slot:"unCheckedChildren",type:"close"},slot:"unCheckedChildren"})],1)],1),t("a-form-item",{attrs:{label:"یک بار مصرف"}},[t("a-switch",{directives:[{name:"decorator",rawName:"v-decorator",value:["use_only",{initialValue:!1,valuePropName:"checked",rules:[{required:!1}]}],expression:"['use_only',{ initialValue:false,valuePropName:'checked',rules: [{ required: false }] }]"}]},[t("a-icon",{attrs:{slot:"checkedChildren",type:"check"},slot:"checkedChildren"}),t("a-icon",{attrs:{slot:"unCheckedChildren",type:"close"},slot:"unCheckedChildren"})],1)],1),t("a-form-item",{staticClass:"md:col-span-3",attrs:{label:"توضیحات","has-feedback":""}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["description",{rules:[{required:!1,message:"لطفا مقدار را وارد کنید"}]}],expression:"['description', {rules: [{ required: false, message: 'لطفا مقدار را وارد کنید' }]}]"}]})],1)],1),t("a-button",{staticStyle:{"margin-top":"3em"},attrs:{type:"primary","html-type":"submit"}},[e._v("\n "+e._s(e.id?"ویرایش تخفیف":"ثبت تخفیف")+"\n ")])],1)],1)],1),e.cols&&!e.showBrand?t("vx-card",{staticClass:"mt-8"},[t("h4",[e._v(e._s(e.cols.title))]),t("XTable",{attrs:{model:e.cols,hasSelection:!0},scopedSlots:e._u([{key:"image",fn:function(e){var i=e.text;return[t("img",{attrs:{width:"90px",src:i?i.src:r("529b"),alt:"product"}})]}},{key:"is_new",fn:function(t){var r=t.text;return[e._v("\n "+e._s(r?"بله":"خیر")+"\n ")]}}],null,!1,3548916598),model:{value:e.items,callback:function(t){e.items=t},expression:"items"}})],1):e._e()],1)},a=[],n=(r("96cf"),r("1da1")),s=r("bb36"),o=(r("a67b"),r("26ef")),l=r("f9ca"),u=new l["b"]("/admin/product/table","لیست محصولات");u.add(new l["a"]("id","کد").filterNumber()),u.add(new l["a"]("image","تصویر محصول").renderSlot("image").noSort()),u.add(new l["a"]("title","نام محصول").filterText()),u.add(new l["a"]("product_code","کد محصول").filterText()),u.add(new l["a"]("brand_product.title","برند").filterText()),u.add(new l["a"]("count","موجودی").filterText()),u.add(new l["a"]("is_new","محصول جدید").filterText().renderSlot("is_new")),u.add(new l["a"]("omde_price","قیمت").filterText().setDefaultFilter("priceUnit"));var c=u,d=r("e0d2"),f=new d["b"]("/admin/collection/table","لیست دسته بندی ها");f.add(new d["a"]("id","کد دسته")),f.add(new d["a"]("title","نام دسته").filterText()),f.add(new d["a"]("parent","پدر دسته"));var h=f,m={name:"targetForm",components:{XTable:o["a"]},data:function(){return{form:this.$form.createForm(this,{name:"coordinated"}),loading:!1,types:[{label:"محصول",value:1},{label:"دسته بندی",value:2},{label:"برند",value:4}],brands:[],customer_types:[{label:"محصول",value:1},{label:"دسته بندی",value:2},{label:"برند",value:4}],start_at:null,end_at:null,cols:void 0,showBrand:!1,items:[],promotion:void 0}},computed:{id:function(){return this.$route.params.id}},methods:{changeTbl:function(e){var t={1:c,2:h};e&&(this.items=[],4!==e?(this.showBrand=!1,this.cols=t[e]):4===e&&(this.showBrand=!0))},getBrands:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s["b"].get("admin/brand");case 3:t=e.sent,r=t.data,this.brands=r,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.log(e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}(),getData:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s["b"].get("admin/promotion/".concat(this.id));case 3:t=e.sent,r=t.data,this.changeTbl(r.type),this.items=r.items=r.items.map((function(e){return e.item_id})),this.promotion=r,e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](0),console.log(e.t0);case 13:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(){return e.apply(this,arguments)}return t}(),handleSubmit:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.preventDefault(),this.form.validateFields(function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t,i){var a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t){e.next=20;break}if(e.prev=1,r.loading=!0,4!==i.type&&(i.items=r.items),!r.id){e.next=9;break}return e.next=7,s["b"].put("/admin/promotion/".concat(r.id),i);case 7:e.next=11;break;case 9:return e.next=11,s["b"].post("/admin/promotion",i);case 11:r.$ntSet(),e.next=17;break;case 14:if(e.prev=14,e.t0=e["catch"](1),500===e.t0.response.status)r.$ntSetError("خطای سرور");else{for(n in a="",e.t0.response.data)a+=e.t0.response.data[n][0]+"<br/>";r.$ntSetError(a)}case 17:return e.prev=17,r.loading=!1,e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[1,14,17,20]])})));return function(t,r){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},created: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.next=2,this.getBrands();case 2:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),mounted:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.id){e.next=7;break}return e.next=3,this.getData();case 3:this.start_at=this.promotion.start_at,this.end_at=this.promotion.end_at,4===this.promotion.type&&(this.showBrand=!0),this.$nextTick((function(){t.form.setFieldsValue(t.promotion)}));case 7:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},p=m,v=(r("1552a"),r("2877")),b=Object(v["a"])(p,i,a,!1,null,null,null);t["default"]=b.exports},e0d2:function(e,t,r){"use strict";var i=r("8275");r.d(t,"a",(function(){return i["a"]}));var a=r("e6f7");t["b"]=a["a"]},e6f7:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var i=r("d4ec"),a=r("bee2"),n=r("ade3"),s=r("8275"),o=function(){function e(t,r){Object(i["a"])(this,e),Object(n["a"])(this,"title",void 0),Object(n["a"])(this,"url",void 0),Object(n["a"])(this,"cols",void 0),Object(n["a"])(this,"opt",void 0),Object(n["a"])(this,"defaultFilters",void 0),this.url=t,this.title=r}return Object(a["a"])(e,[{key:"add",value:function(e){this.cols||(this.cols=[]),this.cols.push(e)}},{key:"addDefaultFilter",value:function(e){this.defaultFilters||(this.defaultFilters=[]),this.defaultFilters.push(e)}},{key:"addOpt",value:function(e,t,r,i,a){return this.opt=new s["a"]("opt","عملیات").noSort(),this.opt.opt=!0,this.opt.slotEdit=t,this.opt.slotDelete=r,this.cols.push(this.opt),this}},{key:"hidePagination",value:function(){return this._hidePageination=!0,this}},{key:"getSortFields",value:function(){return this.cols.filter((function(e){return e.__sorter}))}},{key:"hideSearch",value:function(){return this._hidePageination=!0,this}},{key:"addExtraBtn",value:function(e){return this._hidePageination=!0,this}},{key:"noSearch",value:function(){return this._noSearch=!0,this}},{key:"noSettings",value:function(){return this._noSettings=!0,this}},{key:"noFilters",value:function(){return this._noFilters=!0,this}}]),e}()},f9ca:function(e,t,r){"use strict";var i=r("281e");r.d(t,"a",(function(){return i["a"]}));var a=r("0d3c");t["b"]=a["a"]}}]); //# sourceMappingURL=chunk-44e79192.f0a5e956.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure