(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["market"],{"052a":function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form-model",{ref:"myForm",staticClass:"my-form",attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-form-model-item",{attrs:{label:"开启商品推荐",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-radio-group",{model:{value:e.record.enabled,callback:function(r){e.$set(e.record,"enabled",r)},expression:"record.enabled"}},[r("a-radio",{attrs:{value:1}},[e._v("开启")]),r("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),r("p",{staticClass:"form-item-help"},[r("small",[e._v("开启后将在用户端购物车页底部、个人中心页底部显示推荐的商品列表")])])],1),r("a-form-model-item",{attrs:{label:"商品来源",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-radio-group",{model:{value:e.record.params.source,callback:function(r){e.$set(e.record.params,"source",r)},expression:"record.params.source"}},[r("a-radio",{attrs:{value:"auto"}},[e._v("自动获取")]),r("a-radio",{attrs:{value:"choice"}},[e._v("手动选择")])],1)],1),r("div",{directives:[{name:"show",rawName:"v-show",value:"auto"===e.record.params.source,expression:"record.params.source === 'auto'"}]},[r("a-form-model-item",{attrs:{label:"商品分类",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("SelectCategory",{model:{value:e.record.params.auto.category,callback:function(r){e.$set(e.record.params.auto,"category",r)},expression:"record.params.auto.category"}})],1),r("a-form-model-item",{attrs:{label:"商品排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-radio-group",{model:{value:e.record.params.auto.goodsSort,callback:function(r){e.$set(e.record.params.auto,"goodsSort",r)},expression:"record.params.auto.goodsSort"}},[r("a-radio",{attrs:{value:"all"}},[e._v("默认")]),r("a-radio",{attrs:{value:"sales"}},[e._v("销量")]),r("a-radio",{attrs:{value:"price"}},[e._v("价格")])],1)],1),r("a-form-model-item",{attrs:{label:"显示数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-input-number",{attrs:{min:0,max:50,autocomplete:"off"},model:{value:e.record.params.auto.showNum,callback:function(r){e.$set(e.record.params.auto,"showNum",r)},expression:"record.params.auto.showNum"}}),r("span",{staticClass:"ml-10"},[e._v("件")])],1)],1),r("div",{directives:[{name:"show",rawName:"v-show",value:"choice"===e.record.params.source,expression:"record.params.source === 'choice'"}]},[r("a-form-model-item",{attrs:{label:"选择的商品",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("SelectGoods",{attrs:{defaultList:e.choiceGoodsList},model:{value:e.record.params.goodsIds,callback:function(r){e.$set(e.record.params,"goodsIds",r)},expression:"record.params.goodsIds"}})],1)],1),r("a-divider",{attrs:{orientation:"left"}},[e._v("样式设置")]),r("a-form-model-item",{attrs:{label:"标题内容",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-input",{model:{value:e.record.style.title,callback:function(r){e.$set(e.record.style,"title",r)},expression:"record.style.title"}}),r("div",{staticClass:"form-item-help"},[r("small",[e._v("例如:商品推荐、精选好物、为你推荐")])])],1),r("a-form-model-item",{attrs:{label:"商品分列",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-radio-group",{model:{value:e.record.style.column,callback:function(r){e.$set(e.record.style,"column",r)},expression:"record.style.column"}},[r("a-radio",{attrs:{value:1}},[e._v("单列")]),r("a-radio",{attrs:{value:2}},[e._v("两列")]),r("a-radio",{attrs:{value:3}},[e._v("三列")])],1)],1),r("a-form-model-item",{attrs:{label:"商品内容",labelCol:e.labelCol,wrapperCol:e.wrapperCol,required:""}},[r("a-checkbox-group",{model:{value:e.record.style.show,callback:function(r){e.$set(e.record.style,"show",r)},expression:"record.style.show"}},[r("a-checkbox",{attrs:{value:"goodsName"}},[e._v("商品名称")]),r("a-checkbox",{attrs:{value:"goodsPrice"}},[e._v("商品价格")]),r("a-checkbox",{attrs:{value:"linePrice"}},[e._v("划线价格")]),r("a-checkbox",{directives:[{name:"show",rawName:"v-show",value:1===e.record.style.column,expression:"record.style.column === 1"}],attrs:{value:"sellingPoint"}},[e._v("商品卖点")]),r("a-checkbox",{directives:[{name:"show",rawName:"v-show",value:1===e.record.style.column,expression:"record.style.column === 1"}],attrs:{value:"goodsSales"}},[e._v("商品销量")])],1)],1),r("a-form-model-item",{attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary",loading:e.confirmLoading},on:{click:e.handleSubmit}},[e._v("保存")])],1)],1)],1)],1)},o=[],i=a("c7eb"),n=a("1da1"),s=(a("d3b7"),a("ddb0"),a("2ef0")),l=a("f585"),u=a("d084"),c=a("2af9"),d=a("35c4"),p={enabled:1,params:{source:"auto",auto:{category:0,goodsSort:"all",showNum:6},goodsIds:[]},style:{title:"",column:2,show:["goodsName","goodsPrice","linePrice","sellingPoint","goodsSales"]}},m={components:{SelectGoods:c["g"],SelectCategory:c["e"]},data:function(){return{key:d["a"].RECOMMENDED.value,labelCol:{span:4},wrapperCol:{span:12},isLoading:!1,confirmLoading:!1,record:Object(s["cloneDeep"])(p),choiceGoodsList:[]}},created:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,e.getDetail();case 2:return r.next=4,e.getChoiceGoodsList();case 4:case"end":return r.stop()}}),r)})))()},methods:{getDetail:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.isLoading=!0,r.next=3,l["a"](e.key).then((function(r){return e.record=r.data.values})).finally((function(){return e.isLoading=!1}));case 3:case"end":return r.stop()}}),r)})))()},getChoiceGoodsList:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){var a;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=e.record.params.goodsIds,!(a.length>0)){r.next=5;break}return e.isLoading=!0,r.next=5,u["g"](a).then((function(r){return e.choiceGoodsList=r.data.list})).finally((function(){return e.isLoading=!1}));case 5:case"end":return r.stop()}}),r)})))()},handleSubmit:function(e){var r=this;this.confirmLoading=!0,l["b"](this.key,{form:this.record}).then((function(e){return r.$message.success(e.message,1.5)})).finally((function(e){return r.confirmLoading=!1}))}}},f=m,v=(a("2e01"),a("2877")),h=Object(v["a"])(f,t,o,!1,null,"58595866",null);r["default"]=h.exports},"07b9":function(e,r,a){},"0b60":function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[r("a-form-item",{attrs:{label:"优惠券名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入优惠券名称"}})],1),r("a-form-item",{attrs:{label:"优惠券类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["coupon_type",{initialValue:10,rules:[{required:!0}]}],expression:"['coupon_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("满减券")]),r("a-radio",{attrs:{value:20}},[e._v("折扣券")])],1)],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("coupon_type")==e.CouponTypeEnum.FULL_DISCOUNT.value,expression:"form.getFieldValue('coupon_type') == CouponTypeEnum.FULL_DISCOUNT.value"}],attrs:{label:"减免金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["reduce_price",{rules:[{required:!0,message:"请输入减免金额"}]}],expression:"['reduce_price', { rules: [{ required: true, message: '请输入减免金额' }] }]"}],attrs:{min:.01,precision:2}}),r("span",{staticClass:"ml-5"},[e._v("元")])],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:e.form.getFieldValue("coupon_type")==e.CouponTypeEnum.DISCOUNT.value,expression:"form.getFieldValue('coupon_type') == CouponTypeEnum.DISCOUNT.value"}],attrs:{label:"折扣率",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount",{initialValue:9.9,rules:[{required:!0,message:"请输入折扣率"}]}],expression:"['discount', { initialValue: 9.9, rules: [{ required: true, message: '请输入折扣率' }] }]"}],attrs:{min:0,max:9.9,precision:1}}),r("span",{staticClass:"ml-5"},[e._v("%")]),r("p",{staticClass:"form-item-help"},[r("small",[e._v("折扣率范围 0-9.9,8代表打8折,0代表不折扣")])])],1),r("a-form-item",{attrs:{label:"优惠券券种",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["coupon_case",{rules:[{required:!0}]}],expression:"['coupon_case', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("商品券")]),r("a-radio",{attrs:{value:20}},[e._v("服务券")])],1)],1),r("a-form-item",{attrs:{label:"最低消费金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["min_price",{rules:[{required:!0,message:"请输入最低消费金额"}]}],expression:"['min_price', { rules: [{ required: true, message: '请输入最低消费金额' }] }]"}],attrs:{min:1,precision:2}}),r("span",{staticClass:"ml-5"},[e._v("元")])],1),r("a-form-item",{attrs:{label:"到期类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["expire_type",{initialValue:10,rules:[{required:!0}]}],expression:"['expire_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("领取后生效")]),r("a-radio",{attrs:{value:20}},[e._v("固定时间")])],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:10==e.form.getFieldValue("expire_type"),expression:"form.getFieldValue('expire_type') == 10"}],staticClass:"expire_type-10"},[r("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["expire_day",{initialValue:7,rules:[{required:!0,message:"请输入有效期天数"}]}],expression:"[\n 'expire_day',\n { initialValue: 7, rules: [{ required: true, message: '请输入有效期天数' }] },\n ]"}],attrs:{addonBefore:"有效期",addonAfter:"天",inputProps:{min:1,precision:0}}})],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:20==e.form.getFieldValue("expire_type"),expression:"form.getFieldValue('expire_type') == 20"}],staticClass:"expire_type-20"},[r("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime",{initialValue:e.defaultDate,rules:[{required:!0,message:"请选择有效期范围"}]}],expression:"[\n 'betweenTime',\n { initialValue: defaultDate, rules: [{ required: true, message: '请选择有效期范围' }] },\n ]"}],attrs:{format:"YYYY-MM-DD"}})],1)],1),20==e.form.getFieldValue("coupon_case")?r("a-form-item",{attrs:{label:"券适用范围",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range",{rules:[{required:!0}]}],expression:"['apply_range', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("全场通用")]),r("a-radio",{attrs:{value:20}},[e._v("指定服务")])],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:20==e.form.getFieldValue("apply_range")&&20==e.form.getFieldValue("coupon_case"),expression:"form.getFieldValue('apply_range') == 20 && form.getFieldValue('coupon_case') == 20"}]},[r("SelectServer",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range_config.applyServerIds",{rules:[{required:!0,message:"请选择指定的服务"}]}],expression:"[\n 'apply_range_config.applyServerIds',\n { rules: [{ required: true, message: '请选择指定的服务' }] },\n ]"}],attrs:{defaultList:e.containServerList}})],1)],1):e._e(),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:10==e.form.getFieldValue("coupon_case"),expression:"form.getFieldValue('coupon_case') == 10"}],attrs:{label:"券适用范围",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range",{rules:[{required:!0}]}],expression:"['apply_range', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("全场通用")]),r("a-radio",{attrs:{value:20}},[e._v("指定商品")])],1),20==e.form.getFieldValue("apply_range")&&10==e.form.getFieldValue("coupon_case")?r("a-form-item",[r("SelectGoods",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range_config.applyGoodsIds",{rules:[{required:!0,message:"请选择指定的商品"}]}],expression:"[\n 'apply_range_config.applyGoodsIds',\n { rules: [{ required: true, message: '请选择指定的商品' }] },\n ]"}],attrs:{defaultList:e.containGoodsList}})],1):e._e()],1),r("a-form-item",{attrs:{label:"发放总数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["total_num",{initialValue:-1,rules:[{required:!0,message:"请输入发放总数量"}]}],expression:"['total_num', { initialValue: -1, rules: [{ required: true, message: '请输入发放总数量' }] }]"}],attrs:{min:-1,precision:0}}),r("span",{staticClass:"ml-5"},[e._v("张")]),r("p",{staticClass:"form-item-help"},[r("small",[e._v("发放的优惠券总数量,-1为不限制")])])],1),r("a-form-item",{attrs:{label:"显示状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("显示")]),r("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1),r("p",{staticClass:"form-item-help"},[r("small",[e._v("如果设为隐藏将不会展示在用户端页面")])])],1),r("a-form-item",{attrs:{label:"优惠券描述",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["describe"],expression:"['describe']"}],attrs:{autoSize:{minRows:4}}})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1),r("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},o=[],i=a("c7eb"),n=a("1da1"),s=(a("d3b7"),a("c1df")),l=a.n(s),u=a("2ef0"),c=a("39ad9"),d=a("d084"),p=a("41ed"),m=a("ca00"),f=a("2af9"),v=a("8fa3"),h={components:{SelectGoods:f["g"],InputNumberGroup:f["c"],SelectServer:f["k"]},data:function(){return{ApplyRangeEnum:v["a"],CouponTypeEnum:v["b"],ExpireTypeEnum:v["c"],isLoading:!1,isBtnLoading:!1,labelCol:{span:3},wrapperCol:{span:10},form:this.$form.createForm(this),defaultDate:[l()(),l()()],couponId:null,record:{},containGoodsList:[],containServerList:[]}},created:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.couponId=e.$route.query.couponId,r.next=3,e.getDetail();case 3:return r.next=5,e.getContainGoodsList();case 5:return r.next=7,e.getContainServerList();case 7:case"end":return r.stop()}}),r)})))()},methods:{getDetail:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){var a;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a=e.couponId,e.isLoading=!0,r.next=4,c["c"]({couponId:a}).then((function(r){e.record=r.data.detail,e.setFieldsValue()})).finally((function(){return e.isLoading=!1}));case 4:case"end":return r.stop()}}),r)})))()},getContainGoodsList:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){var a,t;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=e.record,t=Object(u["get"])(a,"apply_range_config.applyGoodsIds"),void 0===t||!t.length){r.next=6;break}return e.isLoading=!0,r.next=6,d["g"](t).then((function(r){e.containGoodsList=r.data.list})).finally((function(r){e.isLoading=!1}));case 6:case"end":return r.stop()}}),r)})))()},getContainServerList:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){var a,t;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=e.record,t=Object(u["get"])(a,"apply_range_config.applyServerIds"),void 0===t||!t.length){r.next=6;break}return e.isLoading=!0,r.next=6,p["k"](t).then((function(r){e.containServerList=r.data.list})).finally((function(r){e.isLoading=!1}));case 6:case"end":return r.stop()}}),r)})))()},setFieldsValue:function(){var e=this,r=this.record,a=this.form,t=this.$nextTick;!Object(m["f"])(a.getFieldsValue())&&t((function(){var t=Object(u["pick"])(r,["name","coupon_case","coupon_type","reduce_price","discount","min_price","status","expire_type","expire_day","apply_range","total_num","describe","sort"]);t.betweenTime=e.getBetweenTime(r),a.setFieldsValue(t)}))},getBetweenTime:function(e){return e.expire_type===v["c"].FIXED_TIME.value?[l()(new Date(e.start_time)),l()(new Date(e.end_time))]:this.defaultDate},handleSubmit:function(e){e.preventDefault();var r=this.form.validateFields,a=this.onFormSubmit;r((function(e,r){!e&&a(r)}))},onFormSubmit:function(e){var r=this;this.isLoading=!0,this.isBtnLoading=!0,c["d"]({couponId:this.couponId,form:e}).then((function(e){r.$message.success(e.message,1.5),setTimeout((function(){r.$router.push("./index")}),1500)})).catch((function(){r.isBtnLoading=!1})).finally((function(){return r.isLoading=!1}))}}},b=h,g=(a("3aff"),a("2877")),_=Object(g["a"])(b,t,o,!1,null,"17179472",null);r["default"]=_.exports},"0e9c":function(e,r,a){"use strict";a.r(r);a("b0c0");var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[r("a-form-item",{attrs:{label:"是否开启满额包邮",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_open",{rules:[{required:!0}]}],expression:"['is_open', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("开启")]),r("a-radio",{attrs:{value:0}},[e._v("关闭")])],1)],1),r("a-form-item",{attrs:{label:"单笔订单满",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["money",{rules:[{required:!0,message:"请输入包邮的订单额度"}]}],expression:"['money', { rules: [{ required: true, message: '请输入包邮的订单额度' }] }]"}],attrs:{min:0,precision:2}}),r("span",{staticClass:"ml-10"},[e._v("元包邮")]),r("div",{staticClass:"form-item-help"},[r("small",[e._v("如设置0为全场包邮")])])],1),r("a-form-item",{attrs:{label:"不参与包邮的商品",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("SelectGoods",{directives:[{name:"decorator",rawName:"v-decorator",value:["excludedGoodsIds"],expression:"['excludedGoodsIds']"}],attrs:{defaultList:e.excludedGoodsList}})],1),r("a-form-item",{attrs:{label:"不参与包邮的地区",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-button",{on:{click:e.handleAreasModal}},[e._v("选择地区")]),r("p",{staticClass:"content"},e._l(e.excludedRegions.selectedText,(function(a,t){return r("span",{key:t},[r("span",[e._v(e._s(a.name))]),a.citys.length?[r("span",[e._v("[")]),e._l(a.citys,(function(t,o){return r("span",{key:o,staticClass:"city-name"},[e._v(e._s(t.name)+e._s(a.citys.length>o+1?"、":""))])})),r("span",[e._v("]")])]:e._e(),r("span",{staticClass:"mr-5"})],2)})),0)],1),r("a-form-item",{attrs:{label:"满额包邮说明",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["describe",{rules:[{required:!0,message:"请输入满额包邮说明"}]}],expression:"['describe', { rules: [{ required: true, message: '请输入满额包邮说明' }] }]"}],attrs:{autoSize:{minRows:4}}})],1),r("a-form-item",{attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary","html-type":"submit"}},[e._v("提交")])],1)],1),r("AreasModal",{ref:"AreasModal",on:{handleSubmit:e.handleAreaSubmit}})],1)],1)},o=[],i=a("c7eb"),n=a("1da1"),s=(a("d3b7"),a("ddb0"),a("88bc")),l=a.n(s),u=a("f585"),c=a("d084"),d=a("2af9"),p=a("fd0d"),m={components:{SelectGoods:d["g"],AreasModal:p["a"]},data:function(){return{key:"full_free",labelCol:{span:4},wrapperCol:{span:12},isLoading:!1,form:this.$form.createForm(this),record:{},excludedRegions:{cityIds:[],selectedText:[]},excludedGoodsList:[]}},created:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,e.getDetail();case 2:return r.next=4,e.getExcludedGoodsList();case 4:case"end":return r.stop()}}),r)})))()},methods:{getDetail:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return e.isLoading=!0,r.next=3,u["a"](e.key).then((function(r){e.record=r.data.values,e.setFieldsValue()})).finally((function(){return e.isLoading=!1}));case 3:case"end":return r.stop()}}),r)})))()},getExcludedGoodsList:function(){var e=this;return Object(n["a"])(Object(i["a"])().mark((function r(){var a;return Object(i["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(a=e.record.excludedGoodsIds,!(a.length>0)){r.next=5;break}return e.isLoading=!0,r.next=5,c["g"](a).then((function(r){e.excludedGoodsList=r.data.list})).finally((function(r){e.isLoading=!1}));case 5:case"end":return r.stop()}}),r)})))()},setFieldsValue:function(){var e=this,r=this.record,a=this.$nextTick,t=this.form.setFieldsValue;a((function(){e.excludedRegions=r.excludedRegions,t(l()(r,["is_open","money","describe"]))}))},handleAreasModal:function(){this.$refs.AreasModal.handle({},this.excludedRegions.cityIds)},handleAreaSubmit:function(e){this.excludedRegions={cityIds:e.selectedCityIds,selectedText:e.selectedText}},handleSubmit:function(e){var r=this;e.preventDefault();var a=this.form.validateFields,t=this.excludedRegions;a((function(e,a){e||(a.excludedRegions=t,r.onFormSubmit(a))}))},onFormSubmit:function(e){var r=this;this.isLoading=!0,u["b"](this.key,{form:e}).then((function(e){return r.$message.success(e.message,1.5)})).finally((function(){return r.isLoading=!1}))}}},f=m,v=(a("a02d"),a("2877")),h=Object(v["a"])(f,t,o,!1,null,"c094d56a",null);r["default"]=h.exports},"164a":function(e,r,a){"use strict";a.r(r);a("ac1f"),a("841c"),a("b0c0");var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-alert",{attrs:{message:"注:优惠券只能抵扣商品金额,最多优惠到0.01元,不能抵扣运费",banner:""}}),r("div",{staticClass:"table-operator"},[r("a-row",[r("a-col",{attrs:{span:6}},[e.$auth("/market/coupon/create")?r("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")]):e._e()],1),r("a-col",{attrs:{span:8,offset:10}},[r("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px",float:"right"},attrs:{placeholder:"请输入优惠券名称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(r){e.$set(e.queryParam,"search",r)},expression:"queryParam.search"}})],1)],1)],1),r("s-table",{ref:"table",attrs:{rowKey:"coupon_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"coupon_type",fn:function(a){return[r("a-tag",[e._v(e._s(e.CouponTypeEnum[a].name))])]}},{key:"min_price",fn:function(a){return[r("p",{staticClass:"c-p"},[e._v(e._s(a))])]}},{key:"discount",fn:function(a){return[10==a.coupon_type?[r("span",[e._v("立减")]),r("span",{staticClass:"c-p mlr-2"},[e._v(e._s(a.reduce_price))]),r("span",[e._v("元")])]:e._e(),20==a.coupon_type?[r("span",[e._v("打")]),r("span",{staticClass:"c-p mlr-2"},[e._v(e._s(a.discount))]),r("span",[e._v("折")])]:e._e()]}},{key:"duetime",fn:function(a){return[10==a.expire_type?[r("span",[e._v("领取")]),r("span",{staticClass:"c-p mlr-2"},[e._v(e._s(a.expire_day))]),r("span",[e._v("天内有效")])]:e._e(),20==a.expire_type?[r("span",[e._v(e._s(a.start_time)+" ~ "+e._s(a.end_time))])]:e._e()]}},{key:"status",fn:function(a){return[r("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"显示":"隐藏"))])]}},{key:"action",fn:function(a){return r("span",{staticClass:"actions"},[e.$auth("/market/coupon/update")?r("a",{on:{click:function(r){return e.handleEdit(a)}}},[e._v("编辑")]):e._e(),r("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(r){return e.handleDelete(a)}}},[e._v("删除")])])}}])})],1)},o=[],i=a("5530"),n=(a("d3b7"),a("39ad9")),s=a("2af9"),l=a("8fa3"),u={name:"Index",components:{STable:s["d"]},data:function(){var e=this;return{queryParam:{},ApplyRangeEnum:l["a"],CouponTypeEnum:l["b"],ExpireTypeEnum:l["c"],isLoading:!1,columns:[{title:"优惠券ID",dataIndex:"coupon_id"},{title:"优惠券名称",dataIndex:"name"},{title:"优惠券类型",dataIndex:"coupon_type",scopedSlots:{customRender:"coupon_type"}},{title:"优惠券券种",dataIndex:"coupon_case_text"},{title:"最低消费金额 (元)",dataIndex:"min_price",scopedSlots:{customRender:"min_price"}},{title:"优惠方式",scopedSlots:{customRender:"discount"}},{title:"已发放/领取数量",dataIndex:"receive_num"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"添加时间",dataIndex:"create_time"},{title:"操作",width:"180px",scopedSlots:{customRender:"action"}}],loadData:function(r){return n["f"](Object(i["a"])(Object(i["a"])({},r),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleAdd:function(){this.$router.push("./create")},handleEdit:function(e){this.$router.push({path:"./update",query:{couponId:e.coupon_id}})},handleDelete:function(e){var r=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return n["b"]({couponId:e.coupon_id}).then((function(e){r.$message.success(e.message,1.5),r.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},c=u,d=a("2877"),p=Object(d["a"])(c,t,o,!1,null,null,null);r["default"]=p.exports},1903:function(e,r,a){},"1da1":function(e,r,a){"use strict";a.d(r,"a",(function(){return o}));a("d3b7");function t(e,r,a,t,o,i,n){try{var s=e[i](n),l=s.value}catch(u){return void a(u)}s.done?r(l):Promise.resolve(l).then(t,o)}function o(e){return function(){var r=this,a=arguments;return new Promise((function(o,i){var n=e.apply(r,a);function s(e){t(n,o,i,s,l,"next",e)}function l(e){t(n,o,i,s,l,"throw",e)}s(void 0)}))}}},"2e01":function(e,r,a){"use strict";a("07b9")},3095:function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[r("a-form-item",{attrs:{label:"是否开启会员充值",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_entrance",{rules:[{required:!0}]}],expression:"['is_entrance', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("开启")]),r("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),r("div",{staticClass:"form-item-help"},[r("small",[e._v("如设置关闭则用户端不显示充值按钮")])])],1),r("a-form-item",{attrs:{label:"充值自定义金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_custom",{rules:[{required:!0}]}],expression:"['is_custom', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("允许")]),r("a-radio",{attrs:{value:0}},[e._v("不允许")])],1),r("div",{staticClass:"form-item-help"},[r("small",[e._v("是否允许用户填写自定义的充值金额")])])],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:1==e.form.getFieldValue("is_custom"),expression:"form.getFieldValue('is_custom') == 1"}],attrs:{label:"最低充值金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["lowest_money",{rules:[{required:!0,message:"请输入最低充值金额"}]}],expression:"['lowest_money', { rules: [{ required: true, message: '请输入最低充值金额' }] }]"}],attrs:{min:.01,precision:2}}),r("span",{staticClass:"ml-10"},[e._v("元")]),r("div",{staticClass:"form-item-help"},[r("small",[e._v("低于该设定金额时不允许充值")])])],1),r("a-form-item",{attrs:{label:"自动匹配套餐",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_match_plan",{rules:[{required:!0}]}],expression:"['is_match_plan', { rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("开启")]),r("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),r("div",{staticClass:"form-item-help"},[r("small",[e._v("充值自定义金额时 是否自动匹配充值套餐,如不开启则不参与套餐金额赠送")])])],1),r("a-form-item",{attrs:{label:"充值说明",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["describe",{rules:[{required:!0,message:"请输入充值说明"}]}],expression:"['describe', { rules: [{ required: true, message: '请输入充值说明' }] }]"}],attrs:{autoSize:{minRows:4}}})],1),r("a-form-item",{attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary","html-type":"submit"}},[e._v("提交")])],1)],1)],1)],1)},o=[],i=(a("d3b7"),a("ddb0"),a("88bc")),n=a.n(i),s=a("f585"),l={components:{},data:function(){return{key:"recharge",labelCol:{span:4},wrapperCol:{span:10},isLoading:!1,form:this.$form.createForm(this),record:{}}},created:function(){this.getDetail()},methods:{getDetail:function(){var e=this;this.isLoading=!0,s["a"](this.key).then((function(r){e.record=r.data.values,e.setFieldsValue()})).finally((function(){return e.isLoading=!1}))},setFieldsValue:function(){var e=this.record,r=this.$nextTick,a=this.form.setFieldsValue;r((function(){a(n()(e,["is_entrance","is_custom","lowest_money","is_match_plan","describe"]))}))},handleSubmit:function(e){var r=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&r.onFormSubmit(a)}))},onFormSubmit:function(e){var r=this;this.isLoading=!0,s["b"](this.key,{form:e}).then((function(e){return r.$message.success(e.message,1.5)})).finally((function(){return r.isLoading=!1}))}}},u=l,c=(a("828a"),a("2877")),d=Object(c["a"])(u,t,o,!1,null,"6c768cd3",null);r["default"]=d.exports},"35c4":function(e,r,a){"use strict";a.d(r,"a",(function(){return o}));var t=a("5c06"),o=new t["a"]([{key:"DELIVERY",name:"配送设置",value:"delivery"},{key:"TRADE",name:"交易设置",value:"trade"},{key:"STORAGE",name:"上传设置",value:"storage"},{key:"PRINTER",name:"小票打印",value:"printer"},{key:"FULL_FREE",name:"满额包邮设置",value:"full_free"},{key:"RECHARGE",name:"充值设置",value:"recharge"},{key:"POINTS",name:"积分设置",value:"points"},{key:"SUBMSG",name:"订阅消息设置",value:"submsg"},{key:"APP_THEME",name:"店铺页面风格",value:"app_theme"},{key:"PAGE_CATEGORY_TEMPLATE",name:"分类页模板",value:"page_category_template"},{key:"RECOMMENDED",name:"商品推荐设置",value:"recommended"},{key:"CUSTOMER",name:"商城客服设置",value:"customer"}])},"374b":function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("div",{staticClass:"table-operator"},[r("a-row",{staticClass:"row-item-search"},[r("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[r("a-form-item",{attrs:{label:"会员昵称"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["search"],expression:"['search']"}],attrs:{placeholder:"请输入会员昵称"}})],1),r("a-form-item",{attrs:{label:"变动时间"}},[r("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime"],expression:"['betweenTime']"}],attrs:{format:"YYYY-MM-DD"}})],1),r("a-form-item",{staticClass:"search-btn"},[r("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1)],1),r("s-table",{ref:"table",attrs:{rowKey:"log_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"user",fn:function(e){return r("span",{},[r("UserItem",{attrs:{user:e}})],1)}},{key:"value",fn:function(a){return r("span",{},[r("p",{staticClass:"c-p"},[e._v(e._s(a>0?"+":"")+e._s(a))])])}}])})],1)},o=[],i=a("5530"),n=a("b775"),s={log:"/market.points/log"};function l(e){return Object(n["b"])({url:s.log,method:"get",params:e})}var u=a("ab09"),c=a("fe7e"),d={name:"Index",components:{STable:u["b"],UserItem:u["d"]},data:function(){var e=this;return{SceneEnum:c["a"],searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,columns:[{title:"ID",dataIndex:"log_id"},{title:"会员信息",dataIndex:"user",scopedSlots:{customRender:"user"}},{title:"变动数量",dataIndex:"value",scopedSlots:{customRender:"value"}},{title:"描述/说明",dataIndex:"describe"},{title:"管理员备注",dataIndex:"remark"},{title:"变动时间",dataIndex:"create_time"}],loadData:function(r){return l(Object(i["a"])(Object(i["a"])({},r),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},handleSearch:function(e){var r=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(r.queryParam=Object(i["a"])(Object(i["a"])({},r.queryParam),a),r.handleRefresh(!0))}))}}},p=d,m=(a("bc61"),a("2877")),f=Object(m["a"])(p,t,o,!1,null,"0d4db7ff",null);r["default"]=f.exports},"3aff":function(e,r,a){"use strict";a("78b8")},"3d2f":function(e,r,a){"use strict";a.r(r);a("b0c0");var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("div",{staticClass:"table-operator"},[r("a-row",{staticClass:"row-item-search"},[r("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[r("a-form-item",{attrs:{label:"优惠券名称"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["couponName"],expression:"['couponName']"}],attrs:{placeholder:"请输入优惠券名称"}})],1),r("a-form-item",{attrs:{label:"会员昵称"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["nickName"],expression:"['nickName']"}],attrs:{placeholder:"请输入会员昵称"}})],1),r("a-form-item",{attrs:{label:"领取时间"}},[r("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime"],expression:"['betweenTime']"}],attrs:{format:"YYYY-MM-DD"}})],1),r("a-form-item",{staticClass:"search-btn"},[r("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1)],1),r("s-table",{ref:"table",attrs:{rowKey:"user_coupon_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"user",fn:function(e){return[r("UserItem",{attrs:{user:e}})]}},{key:"coupon_type",fn:function(a){return[r("a-tag",[e._v(e._s(e.CouponTypeEnum[a].name))])]}},{key:"min_price",fn:function(a){return[r("p",{staticClass:"c-p"},[e._v(e._s(a))])]}},{key:"discount",fn:function(a){return[a.coupon_type==e.CouponTypeEnum.FULL_DISCOUNT.value?[r("span",[e._v("立减")]),r("span",{staticClass:"c-p mlr-2"},[e._v(e._s(a.reduce_price))]),r("span",[e._v("元")])]:e._e(),a.coupon_type==e.CouponTypeEnum.DISCOUNT.value?[r("span",[e._v("打")]),r("span",{staticClass:"c-p mlr-2"},[e._v(e._s(a.discount))]),r("span",[e._v("折")])]:e._e()]}},{key:"duetime",fn:function(a){return[10==a.expire_type?[r("span",[e._v("领取")]),r("span",{staticClass:"c-p mlr-2"},[e._v(e._s(a.expire_day))]),r("span",[e._v("天内有效")])]:e._e(),20==a.expire_type?[r("span",[e._v(e._s(a.start_time)+" ~ "+e._s(a.end_time))])]:e._e()]}}])})],1)},o=[],i=a("5530"),n=a("39ad9"),s=a("ab09"),l=a("8fa3"),u={name:"Index",components:{STable:s["b"],UserItem:s["d"]},data:function(){var e=this;return{searchForm:this.$form.createForm(this),queryParam:{},CouponTypeEnum:l["b"],isLoading:!1,columns:[{title:"ID",dataIndex:"user_coupon_id"},{title:"会员信息",dataIndex:"user",scopedSlots:{customRender:"user"}},{title:"优惠券名称",dataIndex:"name"},{title:"优惠券类型",dataIndex:"coupon_type",scopedSlots:{customRender:"coupon_type"}},{title:"最低消费金额 (元)",dataIndex:"min_price",scopedSlots:{customRender:"min_price"}},{title:"优惠方式",scopedSlots:{customRender:"discount"}},{title:"有效期",scopedSlots:{customRender:"duetime"}},{title:"领取时间",dataIndex:"create_time"}],loadData:function(r){return n["g"](Object(i["a"])(Object(i["a"])({},r),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},handleSearch:function(e){var r=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(r.queryParam=Object(i["a"])(Object(i["a"])({},r.queryParam),a),r.handleRefresh(!0))}))}}},c=u,d=a("2877"),p=Object(d["a"])(c,t,o,!1,null,null,null);r["default"]=p.exports},"6ad7":function(e,r,a){"use strict";a.r(r);a("ac1f"),a("841c");var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("div",{staticClass:"table-operator"},[r("a-row",[r("a-col",{attrs:{span:6}},[r("a-button",{directives:[{name:"action",rawName:"v-action:add",arg:"add"}],attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),r("a-col",{attrs:{span:8,offset:10}},[r("a-input-search",{staticStyle:{"max-width":"300px","min-width":"150px",float:"right"},attrs:{placeholder:"请输入套餐名称"},on:{search:e.onSearch},model:{value:e.queryParam.search,callback:function(r){e.$set(e.queryParam,"search",r)},expression:"queryParam.search"}})],1)],1)],1),r("s-table",{ref:"table",attrs:{rowKey:"plan_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"money",fn:function(a){return r("span",{},[r("p",{staticClass:"c-p"},[e._v(e._s(a))])])}},{key:"gift_money",fn:function(a){return r("span",{},[r("p",{staticClass:"c-p"},[e._v(e._s(a))])])}},{key:"action",fn:function(a,t){return r("span",{},[r("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(r){return e.handleEdit(t)}}},[e._v("编辑")]),r("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(r){return e.handleDelete(t)}}},[e._v("删除")])])}}])}),r("AddForm",{ref:"AddForm",on:{handleSubmit:e.handleRefresh}}),r("EditForm",{ref:"EditForm",on:{handleSubmit:e.handleRefresh}})],1)},o=[],i=a("5530"),n=(a("d3b7"),a("b775")),s={list:"/market.recharge.plan/list",add:"/market.recharge.plan/add",edit:"/market.recharge.plan/edit",delete:"/market.recharge.plan/delete"};function l(e){return Object(n["b"])({url:s.list,method:"get",params:e})}function u(e){return Object(n["b"])({url:s.add,method:"post",data:e})}function c(e){return Object(n["b"])({url:s.edit,method:"post",data:e})}function d(e){return Object(n["b"])({url:s.delete,method:"post",data:e})}var p=a("2af9"),m=function(){var e=this,r=e._self._c;return r("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"套餐名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"便于后台查找,例如:充100元送10元"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["plan_name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['plan_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),r("a-form-item",{attrs:{label:"充值金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"会员充值并支付的金额"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["money",{rules:[{required:!0,message:"请输入充值的金额"}]}],expression:"['money', { rules: [{ required: true, message: '请输入充值的金额' }] }]"}],attrs:{min:.01}}),r("span",{staticClass:"ml-10"},[e._v("元")])],1),r("a-form-item",{attrs:{label:"赠送金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"充值成功后赠送的金额,不能大于充值金额"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["gift_money",{rules:[{required:!0,message:"请输入赠送的金额"}]}],expression:"['gift_money', { rules: [{ required: true, message: '请输入赠送的金额' }] }]"}],attrs:{min:.01}}),r("span",{staticClass:"ml-10"},[e._v("元")])],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},f=[],v={data:function(){return{title:"新增充值套餐",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this)}},methods:{add:function(){this.visible=!0},handleSubmit:function(e){var r=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&r.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var r=this;this.confirmLoading=!0,u({form:e}).then((function(a){r.$message.success(a.message,1.5),r.handleCancel(),r.$emit("handleSubmit",e)})).finally((function(){return r.confirmLoading=!1}))}}},h=v,b=a("2877"),g=Object(b["a"])(h,m,f,!1,null,null,null),_=g.exports,C=function(){var e=this,r=e._self._c;return r("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"套餐名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"便于后台查找,例如:充100元送10元"}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["plan_name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['plan_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),r("a-form-item",{attrs:{label:"充值金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"会员充值并支付的金额"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["money",{rules:[{required:!0,message:"请输入充值的金额"}]}],expression:"['money', { rules: [{ required: true, message: '请输入充值的金额' }] }]"}],attrs:{min:.01}}),r("span",{staticClass:"ml-10"},[e._v("元")])],1),r("a-form-item",{attrs:{label:"赠送金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"充值成功后赠送的金额,不能大于充值金额"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["gift_money",{rules:[{required:!0,message:"请输入赠送的金额"}]}],expression:"['gift_money', { rules: [{ required: true, message: '请输入赠送的金额' }] }]"}],attrs:{min:.01}}),r("span",{staticClass:"ml-10"},[e._v("元")])],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},w=[],y=a("88bc"),x=a.n(y),L={data:function(){return{title:"编辑充值套餐",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{}}},methods:{edit:function(e){this.visible=!0,this.record=e,this.setFieldsValue()},setFieldsValue:function(){var e=this,r=this.form.setFieldsValue;this.$nextTick((function(){r(x()(e.record,["plan_name","money","gift_money","sort"]))}))},handleSubmit:function(e){var r=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&r.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var r=this;this.confirmLoading=!0,c({planId:this.record.plan_id,form:e}).then((function(a){r.$message.success(a.message,1.5),r.handleCancel(),r.$emit("handleSubmit",e)})).finally((function(){return r.confirmLoading=!1}))}}},S=L,q=Object(b["a"])(S,C,w,!1,null,null,null),k=q.exports,N={name:"Index",components:{STable:p["d"],AddForm:_,EditForm:k},data:function(){var e=this;return{queryParam:{},isLoading:!1,columns:[{title:"套餐ID",dataIndex:"plan_id"},{title:"套餐名称",dataIndex:"plan_name"},{title:"充值金额 (元)",dataIndex:"money",scopedSlots:{customRender:"money"}},{title:"赠送金额 (元)",dataIndex:"gift_money",scopedSlots:{customRender:"gift_money"}},{title:"排序",dataIndex:"sort"},{title:"添加时间",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"180px",scopedSlots:{customRender:"action"}}],loadData:function(r){return l(Object(i["a"])(Object(i["a"])({},r),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var r=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return d({planId:e.plan_id}).then((function(e){r.$message.success(e.message,1.5),r.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},F=N,O=Object(b["a"])(F,t,o,!1,null,null,null);r["default"]=O.exports},"78b8":function(e,r,a){},"7e22":function(e,r,a){"use strict";a("f406")},"828a":function(e,r,a){"use strict";a("1903")},8521:function(e,r,a){},"85d6":function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v("优惠券 - 手动发放")]),r("a-alert",{staticClass:"mb-30",attrs:{message:"注:选择指定的优惠券(仅一张)发放给指定的用户;发放成功后无法撤销,请谨慎操作",banner:""}}),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form-model",{ref:"myForm",staticClass:"my-form",attrs:{model:e.form,labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-form-model-item",{attrs:{label:"选择指定优惠券",labelCol:e.labelCol,wrapperCol:e.wrapperCol,prop:"couponId",rules:{required:!0,message:"请选择优惠券"}}},[r("SelectCoupon",{attrs:{multiple:!1},model:{value:e.form.couponId,callback:function(r){e.$set(e.form,"couponId",r)},expression:"form.couponId"}}),r("div",{staticClass:"form-item-help"},[r("small",[e._v("请先确保优惠券剩余数量充足,否则将会导致发送失败")])])],1),r("a-form-model-item",{attrs:{label:"发送类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol,prop:"type",rules:{required:!0,message:"请选择发送类型"}}},[r("a-radio-group",{model:{value:e.form.type,callback:function(r){e.$set(e.form,"type",r)},expression:"form.type"}},[r("a-radio",{attrs:{value:10}},[e._v("指定的会员")])],1)],1),r("a-form-model-item",{attrs:{label:"选择会员",labelCol:e.labelCol,wrapperCol:e.wrapperCol,prop:"target.userIds",rules:{required:!0,message:"请选择会员"}}},[r("SelectUser",{attrs:{multiple:!0},model:{value:e.form.target.userIds,callback:function(r){e.$set(e.form.target,"userIds",r)},expression:"form.target.userIds"}})],1),r("a-form-model-item",{attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary",loading:e.confirmLoading},on:{click:e.handleSubmit}},[e._v("保存")])],1)],1)],1)],1)},o=[],i=(a("d3b7"),a("2ef0")),n=a("2af9"),s=a("39ad9"),l={couponId:null,type:10,target:{userIds:[]}},u={components:{SelectCoupon:n["f"],SelectUser:n["m"]},data:function(){return{labelCol:{span:4},wrapperCol:{span:12},isLoading:!1,confirmLoading:!1,form:Object(i["cloneDeep"])(l)}},created:function(){},methods:{handleSubmit:function(e){var r=this,a=this;a.$refs.myForm.validate((function(e){e&&(r.confirmLoading=!0,s["e"]({form:a.form}).then((function(e){a.$message.success(e.message,1.5),a.form=Object(i["cloneDeep"])(l),setTimeout((function(){return r.$router.push("./receive/index")}),1200)})).finally((function(e){return a.confirmLoading=!1})))}))}}},c=u,d=(a("d6ae"),a("2877")),p=Object(d["a"])(c,t,o,!1,null,"1f61d62d",null);r["default"]=p.exports},"88bc":function(e,r,a){(function(r){var a=1/0,t=9007199254740991,o="[object Arguments]",i="[object Function]",n="[object GeneratorFunction]",s="[object Symbol]",l="object"==typeof r&&r&&r.Object===Object&&r,u="object"==typeof self&&self&&self.Object===Object&&self,c=l||u||Function("return this")();function d(e,r,a){switch(a.length){case 0:return e.call(r);case 1:return e.call(r,a[0]);case 2:return e.call(r,a[0],a[1]);case 3:return e.call(r,a[0],a[1],a[2])}return e.apply(r,a)}function p(e,r){var a=-1,t=e?e.length:0,o=Array(t);while(++a0&&a(s)?r>1?w(s,r-1,a,t,o):m(o,s):t||(o[o.length]=s)}return o}function y(e,r){return e=Object(e),x(e,r,(function(r,a){return a in e}))}function x(e,r,a){var t=-1,o=r.length,i={};while(++t-1&&e%1==0&&e<=t}function j(e){var r=typeof e;return!!e&&("object"==r||"function"==r)}function E(e){return!!e&&"object"==typeof e}function D(e){return"symbol"==typeof e||E(e)&&h.call(e)==s}var $=L((function(e,r){return null==e?{}:y(e,p(w(r,1),q))}));e.exports=$}).call(this,a("c8ba"))},9510:function(e,r,a){},a02d:function(e,r,a){"use strict";a("8521")},bc61:function(e,r,a){"use strict";a("f4e6")},c24e:function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[r("a-form-item",{attrs:{label:"优惠券名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}],attrs:{placeholder:"请输入优惠券名称"}})],1),r("a-form-item",{attrs:{label:"优惠券类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["coupon_type",{initialValue:10,rules:[{required:!0}]}],expression:"['coupon_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("满减券")]),r("a-radio",{attrs:{value:20}},[e._v("折扣券")])],1)],1),10==e.form.getFieldValue("coupon_type")?r("a-form-item",{attrs:{label:"减免金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["reduce_price",{rules:[{required:!0,message:"请输入减免金额"}]}],expression:"['reduce_price', { rules: [{ required: true, message: '请输入减免金额' }] }]"}],attrs:{min:.01,precision:2}}),r("span",{staticClass:"ml-5"},[e._v("元")])],1):e._e(),20==e.form.getFieldValue("coupon_type")?r("a-form-item",{attrs:{label:"折扣率",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount",{initialValue:9.9,rules:[{required:!0,message:"请输入折扣率"}]}],expression:"['discount', { initialValue: 9.9, rules: [{ required: true, message: '请输入折扣率' }] }]"}],attrs:{min:0,max:9.9,precision:1}}),r("span",{staticClass:"ml-5"},[e._v("%")]),r("p",{staticClass:"form-item-help"},[r("small",[e._v("折扣率范围 0-9.9,8代表打8折,0代表不折扣")])])],1):e._e(),r("a-form-item",{attrs:{label:"优惠券券种",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["coupon_case",{initialValue:10,rules:[{required:!0}]}],expression:"['coupon_case', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("商品券")]),r("a-radio",{attrs:{value:20}},[e._v("服务券")])],1)],1),r("a-form-item",{attrs:{label:"最低消费金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["min_price",{rules:[{required:!0,message:"请输入最低消费金额"}]}],expression:"['min_price', { rules: [{ required: true, message: '请输入最低消费金额' }] }]"}],attrs:{min:1,precision:2}}),r("span",{staticClass:"ml-5"},[e._v("元")])],1),r("a-form-item",{attrs:{label:"到期类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["expire_type",{initialValue:10,rules:[{required:!0}]}],expression:"['expire_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("领取后生效")]),r("a-radio",{attrs:{value:20}},[e._v("固定时间")])],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:10==e.form.getFieldValue("expire_type"),expression:"form.getFieldValue('expire_type') == 10"}],staticClass:"expire_type-10"},[r("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["expire_day",{initialValue:7,rules:[{required:!0,message:"请输入有效期天数"}]}],expression:"[\n 'expire_day',\n { initialValue: 7, rules: [{ required: true, message: '请输入有效期天数' }] },\n ]"}],attrs:{addonBefore:"有效期",addonAfter:"天",inputProps:{min:1,precision:0}}})],1),r("a-form-item",{directives:[{name:"show",rawName:"v-show",value:20==e.form.getFieldValue("expire_type"),expression:"form.getFieldValue('expire_type') == 20"}],staticClass:"expire_type-20"},[r("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime",{initialValue:e.defaultDate,rules:[{required:!0,message:"请选择有效期范围"}]}],expression:"[\n 'betweenTime',\n { initialValue: defaultDate, rules: [{ required: true, message: '请选择有效期范围' }] },\n ]"}],attrs:{format:"YYYY-MM-DD"}})],1)],1),10==e.form.getFieldValue("coupon_case")?r("a-form-item",{attrs:{label:"券适用范围",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range",{initialValue:10,rules:[{required:!0}]}],expression:"['apply_range', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("全场通用")]),r("a-radio",{attrs:{value:20}},[e._v("指定商品")])],1),20==e.form.getFieldValue("apply_range")?r("a-form-item",[r("SelectGoods",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range_config.applyGoodsIds",{initialValue:[],rules:[{required:!0,message:"请选择指定的商品"}]}],expression:"[\n 'apply_range_config.applyGoodsIds',\n { initialValue: [], rules: [{ required: true, message: '请选择指定的商品' }] },\n ]"}],attrs:{defaultList:e.containGoodsList}})],1):e._e()],1):e._e(),20==e.form.getFieldValue("coupon_case")?r("a-form-item",{attrs:{label:"券适用范围",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range",{initialValue:10,rules:[{required:!0}]}],expression:"['apply_range', { initialValue: 10, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:10}},[e._v("全场通用")]),r("a-radio",{attrs:{value:20}},[e._v("指定服务")])],1),20==e.form.getFieldValue("apply_range")?r("a-form-item",[r("SelectServer",{directives:[{name:"decorator",rawName:"v-decorator",value:["apply_range_config.applyServerIds",{initialValue:[],rules:[{required:!0,message:"请选择指定的服务"}]}],expression:"[\n 'apply_range_config.applyServerIds',\n { initialValue: [], rules: [{ required: true, message: '请选择指定的服务' }] },\n ]"}],attrs:{defaultList:e.containServerList}})],1):e._e()],1):e._e(),r("a-form-item",{attrs:{label:"发放总数量",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["total_num",{initialValue:-1,rules:[{required:!0,message:"请输入发放总数量"}]}],expression:"['total_num', { initialValue: -1, rules: [{ required: true, message: '请输入发放总数量' }] }]"}],attrs:{min:-1,precision:0}}),r("span",{staticClass:"ml-5"},[e._v("张")]),r("p",{staticClass:"form-item-help"},[r("small",[e._v("发放的优惠券总数量,-1为不限制")])])],1),r("a-form-item",{attrs:{label:"显示状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("显示")]),r("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1),r("p",{staticClass:"form-item-help"},[r("small",[e._v("如果设为隐藏将不会展示在用户端页面")])])],1),r("a-form-item",{attrs:{label:"优惠券描述",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["describe"],expression:"['describe']"}],attrs:{autoSize:{minRows:4}}})],1),r("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1),r("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},o=[],i=(a("d3b7"),a("c1df")),n=a.n(i),s=a("39ad9"),l=a("2af9"),u=a("8fa3"),c={components:{SelectGoods:l["g"],InputNumberGroup:l["c"],SelectServer:l["k"]},data:function(){return{ApplyRangeEnum:u["a"],CouponTypeEnum:u["b"],ExpireTypeEnum:u["c"],isLoading:!1,isBtnLoading:!1,labelCol:{span:3},wrapperCol:{span:10},form:this.$form.createForm(this),defaultDate:[n()(),n()()],containGoodsList:[],containServerList:[]}},created:function(){var e=this;this.$nextTick((function(){e.$forceUpdate()}))},methods:{handleSubmit:function(e){e.preventDefault();var r=this.form.validateFields,a=this.onFormSubmit;r((function(e,r){!e&&a(r)}))},onFormSubmit:function(e){var r=this;this.isLoading=!0,this.isBtnLoading=!0,s["a"]({form:e}).then((function(e){r.$message.success(e.message,1.5),setTimeout((function(){r.$router.push("./index")}),1500)})).catch((function(){r.isBtnLoading=!1})).finally((function(){return r.isLoading=!1}))}}},d=c,p=(a("f97d"),a("2877")),m=Object(p["a"])(d,t,o,!1,null,"5981802f",null);r["default"]=m.exports},c7eb:function(e,r,a){"use strict";a.d(r,"a",(function(){return o}));a("a4d3"),a("e01a"),a("d3b7"),a("d28b"),a("3ca3"),a("ddb0"),a("b636"),a("944a"),a("0c47"),a("23dc"),a("3410"),a("159b"),a("b0c0"),a("131a"),a("fb6a");var t=a("53ca");function o(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ o=function(){return r};var e,r={},a=Object.prototype,i=a.hasOwnProperty,n=Object.defineProperty||function(e,r,a){e[r]=a.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function d(e,r,a){return Object.defineProperty(e,r,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,a){return e[r]=a}}function p(e,r,a,t){var o=r&&r.prototype instanceof _?r:_,i=Object.create(o.prototype),s=new V(t||[]);return n(i,"_invoke",{value:N(e,a,s)}),i}function m(e,r,a){try{return{type:"normal",arg:e.call(r,a)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var f="suspendedStart",v="suspendedYield",h="executing",b="completed",g={};function _(){}function C(){}function w(){}var y={};d(y,l,(function(){return this}));var x=Object.getPrototypeOf,L=x&&x(x(j([])));L&&L!==a&&i.call(L,l)&&(y=L);var S=w.prototype=_.prototype=Object.create(y);function q(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function k(e,r){function a(o,n,s,l){var u=m(e[o],e,n);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==Object(t["a"])(d)&&i.call(d,"__await")?r.resolve(d.__await).then((function(e){a("next",e,s,l)}),(function(e){a("throw",e,s,l)})):r.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return a("throw",e,s,l)}))}l(u.arg)}var o;n(this,"_invoke",{value:function(e,t){function i(){return new r((function(r,o){a(e,t,r,o)}))}return o=o?o.then(i,i):i()}})}function N(r,a,t){var o=f;return function(i,n){if(o===h)throw new Error("Generator is already running");if(o===b){if("throw"===i)throw n;return{value:e,done:!0}}for(t.method=i,t.arg=n;;){var s=t.delegate;if(s){var l=F(s,t);if(l){if(l===g)continue;return l}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(o===f)throw o=b,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);o=h;var u=m(r,a,t);if("normal"===u.type){if(o=t.done?b:v,u.arg===g)continue;return{value:u.arg,done:t.done}}"throw"===u.type&&(o=b,t.method="throw",t.arg=u.arg)}}}function F(r,a){var t=a.method,o=r.iterator[t];if(o===e)return a.delegate=null,"throw"===t&&r.iterator["return"]&&(a.method="return",a.arg=e,F(r,a),"throw"===a.method)||"return"!==t&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+t+"' method")),g;var i=m(o,r.iterator,a.arg);if("throw"===i.type)return a.method="throw",a.arg=i.arg,a.delegate=null,g;var n=i.arg;return n?n.done?(a[r.resultName]=n.value,a.next=r.nextLoc,"return"!==a.method&&(a.method="next",a.arg=e),a.delegate=null,g):n:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,g)}function O(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function I(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function V(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function j(r){if(r||""===r){var a=r[l];if(a)return a.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,n=function a(){for(;++o=0;--o){var n=this.tryEntries[o],s=n.completion;if("root"===n.tryLoc)return t("end");if(n.tryLoc<=this.prev){var l=i.call(n,"catchLoc"),u=i.call(n,"finallyLoc");if(l&&u){if(this.prev=0;--a){var t=this.tryEntries[a];if(t.tryLoc<=this.prev&&i.call(t,"finallyLoc")&&this.prev=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),I(a),g}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===e){var t=a.completion;if("throw"===t.type){var o=t.arg;I(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(r,a,t){return this.delegate={iterator:j(r),resultName:a,nextLoc:t},"next"===this.method&&(this.arg=e),g}},r}},d6ae:function(e,r,a){"use strict";a("9510")},da13:function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e._self._c;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),r("a-spin",{attrs:{spinning:e.isLoading}},[r("a-form",{attrs:{form:e.form},on:{submit:e.handleSubmit}},[r("a-form-item",{attrs:{label:"积分名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["points_name",{rules:[{required:!0,message:"请输入积分名称"}]}],expression:"['points_name', { rules: [{ required: true, message: '请输入积分名称' }] }]"}]}),r("div",{staticClass:"form-item-help"},[r("small",[e._v("注:商家使用自定义的积分名称来做品牌运营。如京东把积分称为“京豆”,淘宝把积分称为“淘金币”")])])],1),r("a-form-item",{attrs:{label:"积分说明",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["describe",{rules:[{required:!0,message:"请输入积分说明"}]}],expression:"['describe', { rules: [{ required: true, message: '请输入积分说明' }] }]"}],attrs:{autoSize:{minRows:4}}})],1),r("a-divider",{attrs:{orientation:"left"}},[e._v("积分赠送")]),r("a-form-item",{attrs:{label:"购物送积分",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_shopping_gift",{initialValue:1,rules:[{required:!0}]}],expression:"['is_shopping_gift', { initialValue: 1, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("开启")]),r("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),r("div",{staticClass:"form-item-help"},[r("small",[e._v("积分赠送规则:1. 订单确认收货已完成; 2. 已完成订单超出后台设置的申请售后期限")])])],1),r("div",{directives:[{name:"show",rawName:"v-show",value:1==e.form.getFieldValue("is_shopping_gift"),expression:"form.getFieldValue('is_shopping_gift') == 1"}]},[r("a-form-item",{attrs:{label:"积分赠送比例",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["gift_ratio",{rules:[{required:!0,message:"请输入积分赠送比例"}]}],expression:"['gift_ratio', { rules: [{ required: true, message: '请输入积分赠送比例' }] }]"}],attrs:{min:.1,max:100,precision:1}}),r("span",{staticClass:"ml-10"},[e._v("%")]),r("div",{staticClass:"form-item-help"},[r("p",{staticClass:"extra"},[e._v("注:赠送比例请填写数字0~100;订单的运费不参与积分赠送")]),r("p",{staticClass:"extra"},[e._v("例:订单付款金额(100.00元) * 积分赠送比例(100%) = 实际赠送的积分(100积分)")])])],1)],1),r("a-divider",{attrs:{orientation:"left"}},[e._v("积分抵扣")]),r("a-form-item",{attrs:{label:"下单使用积分抵扣",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["is_shopping_discount",{initialValue:1,rules:[{required:!0}]}],expression:"['is_shopping_discount', { initialValue: 1, rules: [{ required: true }] }]"}]},[r("a-radio",{attrs:{value:1}},[e._v("开启")]),r("a-radio",{attrs:{value:0}},[e._v("关闭")])],1),r("div",{staticClass:"form-item-help"},[r("small",[e._v("注:如开启则用户下单时可选择使用积分抵扣订单金额")])])],1),r("div",{directives:[{name:"show",rawName:"v-show",value:1==e.form.getFieldValue("is_shopping_discount"),expression:"form.getFieldValue('is_shopping_discount') == 1"}]},[r("a-form-item",{attrs:{label:"积分抵扣比例",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount.discount_ratio",{rules:[{required:!0,message:"积分抵扣比例不能为空"}]}],expression:"['discount.discount_ratio', { rules: [{ required: true, message: '积分抵扣比例不能为空' }] }]"}],attrs:{addonBefore:"1个积分可抵扣",addonAfter:"元",inputProps:{min:.01,precision:2}}}),r("div",{staticClass:"form-item-help"},[r("small",[e._v("例如:设置1个积分可抵扣0.1元,则10积分可抵扣1元,100积分可抵扣10元")])])],1),r("a-form-item",{attrs:{label:"最高可抵扣金额",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-form-item",[r("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount.full_order_price",{rules:[{required:!0,message:"抵扣条件不能为空"}]}],expression:"['discount.full_order_price', { rules: [{ required: true, message: '抵扣条件不能为空' }] }]"}],attrs:{addonBefore:"订单满",addonAfter:"元",inputProps:{min:.01,precision:2}}})],1),r("a-form-item",[r("InputNumberGroup",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount.max_money_ratio",{rules:[{required:!0,message:"最高可抵扣金额不能为空"}]}],expression:"['discount.max_money_ratio', { rules: [{ required: true, message: '最高可抵扣金额不能为空' }] }]"}],attrs:{addonBefore:"最高可抵扣金额",addonAfter:"%",inputProps:{min:.1,max:90,precision:1}}}),r("div",{staticClass:"form-item-help"},[r("small",[e._v("例如:设置最高可抵扣10%,订单金额100元,此时用户可抵扣10元")])])],1)],1)],1),r("a-form-item",{attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[r("a-button",{attrs:{type:"primary","html-type":"submit"}},[e._v("提交")])],1)],1)],1)],1)},o=[],i=(a("d3b7"),a("ddb0"),a("88bc")),n=a.n(i),s=a("f585"),l=a("2af9"),u={components:{InputNumberGroup:l["c"]},data:function(){return{key:"points",labelCol:{span:4},wrapperCol:{span:10},isLoading:!1,form:this.$form.createForm(this),record:{}}},created:function(){this.getDetail()},methods:{getDetail:function(){var e=this;this.isLoading=!0,s["a"](this.key).then((function(r){e.record=r.data.values,e.setFieldsValue()})).finally((function(){return e.isLoading=!1}))},setFieldsValue:function(){var e=this.record,r=this.$nextTick,a=this.form.setFieldsValue;r((function(){a(n()(e,["points_name","describe","is_shopping_gift","gift_ratio","is_shopping_discount","discount"]))}))},handleSubmit:function(e){var r=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&r.onFormSubmit(a)}))},onFormSubmit:function(e){var r=this;this.isLoading=!0,s["b"](this.key,{form:e}).then((function(e){return r.$message.success(e.message,1.5)})).finally((function(){return r.isLoading=!1}))}}},c=u,d=(a("7e22"),a("2877")),p=Object(d["a"])(c,t,o,!1,null,"41eeb0aa",null);r["default"]=p.exports},f406:function(e,r,a){},f4e6:function(e,r,a){},f585:function(e,r,a){"use strict";a.d(r,"a",(function(){return n})),a.d(r,"b",(function(){return s}));var t=a("5530"),o=a("b775"),i={detail:"/setting/detail",update:"/setting/update"};function n(e){return Object(o["b"])({url:i.detail,method:"get",params:{key:e}})}function s(e,r){return Object(o["b"])({url:i.update,method:"post",data:Object(t["a"])({key:e},r)})}},f97d:function(e,r,a){"use strict";a("fa73")},fa73:function(e,r,a){},fe7e:function(e,r,a){"use strict";var t=a("5c06");r["a"]=new t["a"]([{key:"RECHARGE",name:"用户充值",value:10},{key:"CONSUME",name:"用户消费",value:20},{key:"ADMIN",name:"管理员操作",value:30},{key:"REFUND",name:"订单退款",value:40},{key:"DEALER",name:"开通分销商",value:70},{key:"MEMBER",name:"开通用户",value:80}])}}]);