(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b4c47f6a"],{"1de2":function(e,t,i){"use strict";i("b22c")},b22c:function(e,t,i){},e6c1:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"app-form margin-top"},[i("el-form",{ref:"dataForm",attrs:{rules:e.rules,model:e.form,"label-position":"right","label-width":"200px"}},[i("div",{staticClass:"app-form-group margin-top"},[i("div",{staticClass:"app-form-ti"},[e._v("基础配置")]),i("div",{staticClass:"padding-top-lg"},[i("el-form-item",{attrs:{label:"状态",prop:"is_directpush_achievement"}},[i("el-radio-group",{model:{value:e.form.is_directpush_achievement,callback:function(t){e.$set(e.form,"is_directpush_achievement",t)},expression:"form.is_directpush_achievement"}},[i("el-radio",{attrs:{label:1}},[e._v("开启")]),i("el-radio",{attrs:{label:0}},[e._v("关闭")])],1),i("el-alert",{attrs:{title:"开启后，用户直推业绩达到条件后，可获得达到条件的业绩的百分比奖励，如：设置达到直推业绩1000元，奖励10%，当直推业绩大于等于1000元时，可获得奖1000x10%=100元，每个奖励仅可获得1次",type:"error"}})],1),i("el-form-item",{attrs:{label:"奖励等级",prop:"directpush_achievement_level"}},[i("el-select",{staticClass:"form-input",attrs:{multiple:"",filterable:"",placeholder:"请选择奖励等级"},model:{value:e.form.directpush_achievement_level,callback:function(t){e.$set(e.form,"directpush_achievement_level",t)},expression:"form.directpush_achievement_level"}},e._l(e.levels,(function(e,t){return i("el-option",{key:t,attrs:{label:e.title,value:e.id}})})),1)],1),1==e.form.is_directpush_achievement?i("el-form-item",{attrs:{label:"规则设置"}},[e._l(e.form.directpush_achievement,(function(t,a){return i("div",{staticClass:"flex align-center padding-bottom"},[i("el-input",{staticClass:"form-input margin-left",model:{value:t.achievement,callback:function(i){e.$set(t,"achievement",e._n(i))},expression:"item.achievement"}},[i("template",{slot:"prepend"},[e._v("直推业绩")]),i("template",{slot:"append"},[e._v("元")])],2),i("el-input",{staticClass:"form-input margin-left",attrs:{type:"number"},model:{value:t.reward,callback:function(i){e.$set(t,"reward",i)},expression:"item.reward"}},[i("template",{slot:"prepend"},[e._v("奖励")]),i("template",{slot:"append"},[e._v("元")])],2),i("el-button",{staticClass:"margin-left",attrs:{type:"danger",icon:"el-icon-delete"},on:{click:function(t){return e.delRule(a)}}})],1)})),i("div",{},[i("el-button",{attrs:{type:"success",size:"mini",icon:"el-icon-plus"},on:{click:e.addRule}},[e._v("添加")])],1)],2):e._e()],1)]),i("div",{staticClass:"padding-lg flex justify-center"},[i("el-button",{on:{click:e.onBack}},[e._v("返回")]),i("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("提交")])],1)])],1),i("copyright")],1)},n=[],s=i("7f70"),l=(i("e8d6"),i("baf6"),i("8327")),c={name:"Management",components:{},data:function(){return{activeIndex:"1",rules:{},levels:[],form:{is_directpush_achievement:0,directpush_achievement:[],directpush_achievement_level:[]}}},computed:Object(s["a"])({},Object(l["b"])(["config"])),watch:{config:function(e){this.init()}},mounted:function(){this.init()},methods:{onBack:function(){this.$router.go(-1)},addRule:function(){this.form.directpush_achievement.push({achievement:"",reward:""})},delRule:function(e){this.form.directpush_achievement.splice(e,1)},handleSelect:function(e,t){this.activeIndex=e},submit:function(){var e=this;this.$refs["dataForm"].validate((function(t){t&&e.api.post("directpush_achievement/config/set",e.form).then((function(t){1==t.code?(e.$util.success(t.message),e.$store.dispatch("settings/getSetting")):e.$util.error(t.message)}))}))},init:function(){var e=this,t=this.config;if(t&&t.fenxiao){var i=this.$util.restJson(t.fenxiao);this.form={is_directpush_achievement:i.is_directpush_achievement,directpush_achievement:i.directpush_achievement,directpush_achievement_level:i.directpush_achievement_level}}this.api.get("fenxiao/level/all").then((function(t){1==t.code&&(e.levels=t.data.list)}))}}},r=c,o=(i("1de2"),i("3d7a")),u=Object(o["a"])(r,a,n,!1,null,null,null);t["default"]=u.exports}}]);