1 |
- webpackJsonp([33],{"+Agz":function(t,e){},"5Fm7":function(t,e){},"7bg4":function(t,e){},FphS:function(t,e){},Gdbv:function(t,e){},ZLh3:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("Xxa5"),s=i.n(a),n=i("exGp"),l=i.n(n),o={props:{title:{type:String,default:"付费情况"},clearable:{type:Boolean,default:!0},reset:{type:Boolean,default:!1},width:{type:String},afferent_obj:{type:Object,default:function(){}}},watch:{reset:{handler:function(){this.initVal()},immediate:!0}},data:function(){return{visible:!1,radio:null,valueObj:{custom_radio:"number",radio:null,minValue:"",maxValue:""}}},methods:{initVal:function(){this.afferent_obj&&this.afferent_obj.payType?(this.valueObj.custom_radio=this.afferent_obj&&this.afferent_obj.payType,this.valueObj.radio=this.afferent_obj&&this.afferent_obj.payStatus,this.valueObj.minValue=this.afferent_obj&&this.afferent_obj.payMin,this.valueObj.maxValue=this.afferent_obj&&this.afferent_obj.payMax,this.radio=this.afferent_obj&&this.afferent_obj.payStatus):(this.valueObj.custom_radio="number",this.valueObj.radio=null,this.valueObj.minValue="",this.valueObj.maxValue="",this.radio=null)},visibleHide:function(){if("has"==this.radio){if(!this.valueObj.minValue||!this.valueObj.maxValue||Number(this.valueObj.maxValue)<Number(this.valueObj.minValue))return;this.valueObj.radio="has",this.$emit("payChange",this.valueObj),this.visible=!1}},clear:function(){null!=this.valueObj.radio?(this.radio=null,this.valueObj.radio=null,this.valueObj.custom_radio="number",this.valueObj.minValue="",this.valueObj.maxValue="",this.$emit("payChange",this.valueObj)):this.visible=!this.visible},payChange:function(t){this.radio=t,"not"==t&&(this.valueObj={custom_radio:"number",radio:t,minValue:"",maxValue:""},this.visible=!1,this.$emit("payChange",this.valueObj))},customPay:function(){this.valueObj.maxValue&&this.valueObj.minValue?this.valueObj.maxValue&&this.valueObj.minValue&&Number(this.valueObj.maxValue)<Number(this.valueObj.minValue)?this.$message({message:"请正确填写数值",type:"warning"}):(this.valueObj.radio="has",this.$emit("payChange",this.valueObj),this.visible=!1):this.$message({message:"请填写数值",type:"warning"})}}},r={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"common-screen-item pay"},[t.title&&""!=t.title?i("label",{staticClass:"common-screen-label"},[t._v(t._s(t.title))]):t._e(),t._v(" "),i("el-popover",{attrs:{placement:"bottom",size:"mini",trigger:"click"},on:{hide:t.visibleHide},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[i("div",{class:["common-screen-self-box","common-input-select",null!=t.valueObj.radio&&t.clearable?"common-input-select-hover":""],style:t.width?"width:"+t.width:"",attrs:{slot:"reference"},slot:"reference"},[i("div",{class:["common-screen-self-con","not"!=t.valueObj.radio&&null==t.valueObj.radio?"common-screen-self-placeholder":""],style:t.width?"text-align: left;padding-left: 15px !important;":""},[i("div",{staticClass:"common-screen-self-con-div"},[i("span",[t._v(t._s("not"==t.valueObj.radio?"未付费":"has"==t.valueObj.radio?"已付费 - "+("number"==t.valueObj.custom_radio?"次数":"金额")+" "+t.valueObj.minValue+" ~ "+t.valueObj.maxValue:"请选择"))])]),t._v(" "),i("i",{staticClass:"el-icon-circle-close other-icon",on:{click:function(e){return e.stopPropagation(),t.clear.apply(null,arguments)}}})]),t._v(" "),i("div",{staticClass:"common-screen-self-icon"},[i("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),i("div",{staticClass:"popover_con"},[i("div",{class:["item","not"==t.radio?"active":""],on:{click:function(e){return t.payChange("not")}}},[t._v("未付费")]),t._v(" "),i("div",{class:["item","has"==t.radio?"active":""],on:{click:function(e){return t.payChange("has")}}},[t._v("已付费")]),t._v(" "),"has"==t.radio?i("div",{staticClass:"customBox"},[i("div",{staticClass:"flex-row"},[i("el-radio",{attrs:{label:"number"},model:{value:t.valueObj.custom_radio,callback:function(e){t.$set(t.valueObj,"custom_radio",e)},expression:"valueObj.custom_radio"}},[t._v("充值次数")]),t._v(" "),i("el-radio",{attrs:{label:"money"},model:{value:t.valueObj.custom_radio,callback:function(e){t.$set(t.valueObj,"custom_radio",e)},expression:"valueObj.custom_radio"}},[t._v("充值金额")])],1),t._v(" "),i("div",{staticClass:"inputBox flex-row"},[i("el-input",{attrs:{type:"number",size:"mini",placeholder:"最小值"},model:{value:t.valueObj.minValue,callback:function(e){t.$set(t.valueObj,"minValue",e)},expression:"valueObj.minValue"}}),t._v(" "),i("span",[t._v(" - ")]),t._v(" "),i("el-input",{attrs:{type:"number",size:"mini",placeholder:"最大值"},model:{value:t.valueObj.maxValue,callback:function(e){t.$set(t.valueObj,"maxValue",e)},expression:"valueObj.maxValue"}})],1),t._v(" "),i("div",{staticClass:"buttons"},[i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.customPay}},[t._v("确定")])],1)]):t._e()])])],1)},staticRenderFns:[]};var c=i("VU/8")(o,r,!1,function(t){i("5Fm7")},"data-v-4f86a060",null).exports,u={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"timeLineBox ",staticStyle:{margin:"15px 0"}},[i("div",{staticClass:"flex-row tMar10"},[i("el-input",{staticStyle:{width:"100px"},attrs:{size:"mini",type:"number",placeholder:"最小值"},model:{value:t.minVal,callback:function(e){t.minVal=e},expression:"minVal"}}),t._v(" "),i("span",{staticClass:"lMar5"},[t._v("天")]),t._v(" "),i("span",{staticClass:"lMar5 rMar5"},[t._v("-")]),t._v(" "),i("el-input",{staticStyle:{width:"100px"},attrs:{size:"mini",type:"number",placeholder:"最大值"},model:{value:t.maxVal,callback:function(e){t.maxVal=e},expression:"maxVal"}}),t._v(" "),i("span",{staticClass:"lMar5"},[t._v("天")])],1)])},staticRenderFns:[]};var d=i("VU/8")({name:"addTime",components:{},props:["propVal","reset","afferent_obj"],data:function(){return{minVal:"1",maxVal:""}},watch:{minVal:function(){this.handleVal()},maxVal:function(){this.handleVal()},reset:{handler:function(){this.initVal()},immediate:!0}},methods:{handleVal:function(){this.$emit("getVal",{minVal:this.minVal,maxVal:this.maxVal})},initVal:function(){this.afferent_obj?(this.minVal=this.afferent_obj.min,this.maxVal=this.afferent_obj.max):(this.minVal="1",this.maxVal="")}}},u,!1,function(t){i("7bg4")},null,null).exports,h=i("mvHQ"),_=i.n(h),p={components:{noData:i("YLOf").a},props:{clearable:{type:Boolean,default:!0},resetNew:{type:Boolean,default:!1},title:{type:String,default:"企业标签"},excludeFlag:{type:Boolean,default:!1},width:{type:String},afferent_obj:{type:Object},disabled:{type:Boolean,default:!1}},watch:{resetNew:{handler:function(){this.initVal()},immediate:!0}},data:function(){return{visible:!1,radio:1,keyword:"",tagList:[],loading:!1,tag_id_list:[],old_tag_list:[],tag_name_list:[],oldObj:{tag_name_list:[],tag_id_list:[],tag:1}}},created:function(){0==this.tagList.length&&this.init()},methods:{initVal:function(){this.afferent_obj?(this.radio=this.afferent_obj&&this.afferent_obj.tag?this.afferent_obj.tag:1,this.tag_id_list=this.afferent_obj&&this.afferent_obj.tag_id_list?this.afferent_obj.tag_id_list:[],this.tag_name_list=this.afferent_obj&&this.afferent_obj.tag_name_list?this.afferent_obj.tag_name_list:[],this.oldObj.tag=this.radio,this.oldObj.tag_id_list=this.tag_id_list,this.oldObj.tag_name_list=this.tag_name_list):(this.radio=1,this.tag_id_list=[],this.tag_name_list=[],this.oldObj={tag_name_list:[],tag_id_list:[],tag:1})},screenClick:function(){var t=this;if(!this.disabled){this.visible=!0,this.radio=this.oldObj.tag,this.tag_id_list=JSON.parse(_()(this.oldObj.tag_id_list));var e=[];this.tagList.forEach(function(i){i.tag_list.forEach(function(i){-1!=t.tag_id_list.indexOf(i.tag_id)&&e.push(i.tag_name)})}),this.tag_name_list=e,this.oldObj.tag_name_list=e}},clear:function(){this.disabled||(3==this.radio||this.tag_id_list&&0!=this.tag_id_list.length?(this.radio=1,this.tag_id_list=[],this.tag_name_list=[],this.oldObj={tag:this.radio,tag_id_list:[],tag_name_list:[]},this.$emit("tagDefine",this.oldObj)):this.visible=!this.visible)},defineEvent:function(){this.oldObj={tag:this.radio,tag_id_list:JSON.parse(_()(this.tag_id_list)),tag_name_list:JSON.parse(_()(this.tag_name_list))},this.$emit("tagDefine",this.oldObj),this.visible=!1},keyInput:function(){var t=this,e=[];this.old_tag_list.forEach(function(i){var a=JSON.parse(_()(i));a.tag_list=[],i.tag_list.forEach(function(e){-1!=e.tag_name.indexOf(t.keyword)&&a.tag_list.push(e)}),0!=a.tag_list.length&&e.push(a)}),this.tagList=e},groupEvent:function(t){-1==this.tag_id_list.indexOf(t.tag_id)?(this.tag_name_list.push(t.tag_name),this.tag_id_list.push(t.tag_id)):(this.tag_id_list=this.tag_id_list.filter(function(e){return e!=t.tag_id}),this.tag_name_list=this.tag_name_list.filter(function(e){return e!=t.tag_name}))},init:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.tagList,{}).then(function(e){e=e.data;if(t.loading=!1,e&&0==e.errno){t.old_tag_list=e.rst,t.tagList=e.rst;var i=[];t.tagList.forEach(function(e){e.tag_list.forEach(function(e){-1!=t.tag_id_list.indexOf(e.tag_id)&&i.push(e.tag_name)})}),t.tag_name_list=i,t.oldObj.tag_name_list=i}else 4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})}}},m={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"common-screen-item"},[t.title&&""!=t.title?i("label",{staticClass:"common-screen-label"},[t._v(t._s(t.title))]):t._e(),t._v(" "),i("div",{class:["common-screen-self-box","common-input-select",(3==t.oldObj.tag||t.oldObj.tag_name_list&&0!=t.oldObj.tag_name_list.length)&&t.clearable&&!t.disabled?"common-input-select-hover":"",t.disabled?"pointer-drop":""],style:t.width?"width:"+t.width:"",on:{click:t.screenClick}},[i("div",{class:["common-screen-self-con",3!=t.oldObj.tag&&t.oldObj.tag_name_list&&0==t.oldObj.tag_name_list.length?"common-screen-self-placeholder":""]},[i("div",{staticClass:"common-screen-self-con-div"},[i("span",[t._v(t._s(3==t.oldObj.tag?"无任何标签":t.oldObj.tag_name_list&&0!=t.oldObj.tag_name_list.length?t.oldObj.tag_name_list.join(","):"请选择标签"))])]),t._v(" "),i("i",{staticClass:"el-icon-circle-close other-icon",on:{click:function(e){return e.stopPropagation(),t.clear.apply(null,arguments)}}})]),t._v(" "),t._m(0)]),t._v(" "),i("el-dialog",{attrs:{title:"选择标签","append-to-body":"",visible:t.visible,width:"600px",center:"",top:"15vh"},on:{"update:visible":function(e){t.visible=e}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"popover_con"},[t.excludeFlag?i("div",{staticClass:"self-hint",staticStyle:{border:"none"}},[i("i",{staticClass:"el-icon-message-solid"}),t._v(" "),i("span",[t._v("可根据标签选择客户,群发时将不会发送给该标签内的客户。若选择了排除的客户,需要较长时间创建本条群发消息哦~")])]):i("div",{staticClass:"condition"},[i("label",[t._v("筛选条件")]),t._v(" "),i("el-radio-group",{model:{value:t.radio,callback:function(e){t.radio=e},expression:"radio"}},[i("el-radio",{attrs:{label:1}},[t._v("以下标签满足其中之一")]),t._v(" "),i("el-radio",{attrs:{label:2}},[t._v("以下标签同时满足")]),t._v(" "),i("el-radio",{attrs:{label:3}},[t._v("无任何标签")])],1)],1),t._v(" "),3!=t.radio?[i("div",{staticClass:"self-input"},[i("input",{directives:[{name:"model",rawName:"v-model",value:t.keyword,expression:"keyword"}],attrs:{type:"text",placeholder:"请输入要查找的标签"},domProps:{value:t.keyword},on:{input:[function(e){e.target.composing||(t.keyword=e.target.value)},t.keyInput]}}),t._v(" "),i("i",{staticClass:"el-icon-search"})]),t._v(" "),i("div",{staticClass:"tagGroup self-scrollbar-3"},[t._l(t.tagList,function(e){return i("div",{key:e.group_id,staticClass:"groupItem"},[i("div",{staticClass:"groupTitle"},[t._v(t._s(e.group_name)+":")]),t._v(" "),i("div",{staticClass:"groupBox"},t._l(e.tag_list,function(e,a){return i("div",{key:a,class:["group",t.tag_id_list&&-1!=t.tag_id_list.indexOf(e.tag_id)?"group_active":""],on:{click:function(i){return t.groupEvent(e)}}},[t._v(t._s(e.tag_name))])}),0)])}),t._v(" "),!t.loading&&t.tagList&&0==t.tagList.length?i("no-data",{attrs:{hint:"没有搜索到相关标签哦~"}}):t._e()],2)]:i("p",{staticClass:"hint"},[t._v("选择无任何标签后,将筛选出没有被打上过任何标签的客户~")]),t._v(" "),i("div",{staticClass:"buttons"},[i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(e){t.visible=!1}}},[t._v("取消")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.defineEvent}},[t._v("确定")])],1)],2)])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"common-screen-self-icon"},[e("i",{staticClass:"el-icon-arrow-down"})])}]};var v={name:"addEditDialog",components:{screenPay:c,addTime:d,enterpriseTag:i("VU/8")(p,m,!1,function(t){i("FphS")},"data-v-658aa71a",null).exports},props:["dialogVisible","echoObj"],data:function(){return{dialogTitle:"阶段配置",iptName:"",iptDesc:"",resetFlagNew:!1,phaseList:[{label:"客户添加时间",value:"time"},{label:"付费情况",value:"pay"},{label:"标签",value:"label"}],ruleList:[{type:"time",condition:{},disabled:!1,phaseList:[{label:"客户添加时间",value:"time"},{label:"付费情况",value:"pay"},{label:"标签",value:"label"}]}],flag:!0}},created:function(){},watch:{dialogVisible:function(t){t&&(this.resetFlagNew=!this.resetFlagNew,this.echoObj.rule_id?(this.iptName=this.echoObj.stage_title,this.iptDesc=this.echoObj.stage_desc,this.ruleList=this.echoObj.stage_rule&&JSON.parse(this.echoObj.stage_rule)):(this.iptName="",this.iptDesc="",this.ruleList=[{type:"time",condition:{},disabled:!1,phaseList:[{label:"客户添加时间",value:"time"},{label:"付费情况",value:"pay"},{label:"标签",value:"label"}]}]))}},methods:{duplicateRemoval:function(t,e){var i=[];return t.forEach(function(t){-1==i.findIndex(function(i){return i[e]==t[e]})&&i.push(t)}),i},filterphaseList:function(t){var e=[];return this.phaseList.forEach(function(i){-1==t.findIndex(function(t){return t==i.value})&&e.push(i)}),e},fromTypeGetLabel:function(t){var e="";return"time"==t?e="客户添加时间":"pay"==t?e="付费情况":"label"==t&&(e="标签"),e},delePhaseEvent:function(t){var e=this;if(this.ruleList&&1==this.ruleList.length)this.$message({message:"最少需要一个规则",type:"warning"});else{var i=this.ruleList.findIndex(function(e){return e.type==t.type});this.ruleList.splice(i,1),this.ruleList[this.ruleList.length-1].disabled=!1;var a=this.ruleList[this.ruleList.length-1];t.phaseList.forEach(function(t,i){a.phaseList.push({value:t.value,label:e.fromTypeGetLabel(t.value)})}),a.phaseList.push({value:t.type,label:this.fromTypeGetLabel(t.type)}),a.phaseList=this.duplicateRemoval(a.phaseList,"value"),this.ruleList.forEach(function(t,i){i<e.ruleList.length-1&&(a.phaseList=a.phaseList.filter(function(e){return e.value!==t.type}))})}},addPhaseEvent:function(){if(this.ruleList&&3==this.ruleList.length)this.$message({message:"每个规则仅可添加一次",type:"warning"});else{var t=[];this.ruleList.forEach(function(e){e.disabled=!0,t.push(e.type)}),this.ruleList.push({type:this.filterphaseList(t)[0].value,condition:{},disabled:!1,phaseList:this.filterphaseList(t)})}},closeEvent:function(){this.$emit("close")},handleAssignment:function(){var t=this;this.flag=!0,this.ruleList.forEach(function(e){if("time"==e.type){var i=e.condition,a=i.min,s=i.max;if(!a||!s)return t.$message({message:"客户添加时间不可以为空",type:"warning"}),void(t.flag=!1);if(Number(a)>Number(s))return t.$message({message:"请正确填写时间",type:"warning"}),void(t.flag=!1)}else if("pay"==e.type){var n=e.condition,l=n.payStatus,o=n.payMin,r=n.payMax;n.payType;if(!l)return t.$message({message:"付费状态不可以为空",type:"warning"}),void(t.flag=!1);if("has"==l&&!o&&!r)return t.$message({message:"已付费时,最大或最小值不可以为空",type:"warning"}),void(t.flag=!1)}else if("label"==e.type){if(!e.condition.tag_id_list)return t.$message({message:"标签不可以为空",type:"warning"}),void(t.flag=!1)}})},confirmEvent:function(){var t=this;return l()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=t.iptName){e.next=3;break}return t.$message({message:"规则标题必填",type:"warning"}),e.abrupt("return");case 3:return e.next=5,t.handleAssignment();case 5:if(t.flag){e.next=7;break}return e.abrupt("return");case 7:t.$axios.post(t.URL.BASEURL+t.URL.phaseSet,{rule_id:t.echoObj?t.echoObj.rule_id:"",stage_title:t.iptName,stage_desc:t.iptDesc,stage_rule:t.ruleList}).then(function(e){(e=e.data)&&0==e.errno?(t.$message({message:"添加成功",type:"success"}),t.$emit("close",!0)):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(t){});case 8:case"end":return e.stop()}},e,t)}))()}}},f={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-dialog",{staticClass:"dialogCon_permission",attrs:{title:t.dialogTitle,visible:t.dialogVisible,"append-to-body":!0,width:"660px"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.closeEvent}},[i("div",{staticClass:"dialogCon"},[i("div",{staticClass:"itemBox",staticStyle:{"margin-top":"0"}},[i("div",{staticClass:"name"},[i("em",[t._v("*")]),t._v("阶段名称:")]),t._v(" "),i("div",{staticClass:"ipt"},[i("el-input",{staticStyle:{width:"100%"},attrs:{size:"small",placeholder:"请输入阶段名称"},model:{value:t.iptName,callback:function(e){t.iptName=e},expression:"iptName"}})],1)]),t._v(" "),i("div",{staticClass:"itemBox"},[i("div",{staticClass:"name"},[t._v("阶段描述:")]),t._v(" "),i("div",{staticClass:"ipt"},[i("el-input",{staticStyle:{width:"100%"},attrs:{size:"small",placeholder:"请输入阶段描述"},model:{value:t.iptDesc,callback:function(e){t.iptDesc=e},expression:"iptDesc"}})],1)]),t._v(" "),i("div",{staticClass:"itemBox",staticStyle:{"align-items":"baseline"}},[i("div",{staticClass:"name"},[i("em",[t._v("*")]),t._v("阶段规则:")]),t._v(" "),i("div",{staticClass:"ipt phaseBox"},[t._l(t.ruleList,function(e,a){return i("div",{key:a,staticClass:"flex-base"},[i("span",{staticClass:"f13 flexShrink0"},[t._v("规则:")]),t._v(" "),i("el-select",{staticStyle:{width:"120px"},attrs:{disabled:e.disabled,size:"mini",placeholder:"请选择"},model:{value:e.type,callback:function(i){t.$set(e,"type",i)},expression:"rItem.type"}},t._l(e.phaseList,function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})}),1),t._v(" "),i("span",{staticClass:"lMar14 f13 flexShrink0"},[t._v("满足:")]),t._v(" "),i("div",["time"==e.type?i("addTime",{attrs:{reset:t.resetFlagNew,afferent_obj:e.condition},on:{getVal:function(t){e.condition.min=t.minVal,e.condition.max=t.maxVal}}}):t._e(),t._v(" "),"pay"==e.type?i("screen-pay",{attrs:{reset:t.resetFlagNew,title:"",afferent_obj:e.condition},on:{payChange:function(t){e.condition.payStatus=t.radio,e.condition.payMin=t.minValue,e.condition.payMax=t.maxValue,e.condition.payType=t.custom_radio}}}):t._e(),t._v(" "),"label"==e.type?i("enterprise-tag",{attrs:{resetNew:t.resetFlagNew,title:"",afferent_obj:e.condition},on:{tagDefine:function(t){e.condition=t}}}):t._e()],1),t._v(" "),t.ruleList&&t.ruleList.length>1?i("i",{staticClass:"el-icon-delete",on:{click:function(i){return t.delePhaseEvent(e)}}}):t._e()],1)}),t._v(" "),i("div",{staticClass:"addPhase",on:{click:t.addPhaseEvent}},[i("i",{staticClass:"el-icon-circle-plus "}),t._v(" 添加规则\n ")])],2)])]),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:t.closeEvent}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){return t.confirmEvent()}}},[t._v("确 定")])],1)])],1)},staticRenderFns:[]};var g=i("VU/8")(v,f,!1,function(t){i("+Agz")},null,null).exports,b=i("/dO2"),y={name:"phaseConfig",components:{addEditDialog:g},data:function(){return{desCol:[{prop:"stage_title",label:"客户阶段",min_width:180,algin:"center"},{prop:"stage_desc",label:"阶段描述",min_width:180,algin:"center"}],height:"",tableData:[],dialogVisible:!1,total:0,page:1,pages:0,page_size:20,loading:!1,echoObj:{},operate_rule_id:"",front_rule_id:"",behind_rule_id:""}},created:function(){this.height=document.documentElement.clientHeight-280>400?document.documentElement.clientHeight-280:400,this.init()},mounted:function(){this.handleRowDrop()},methods:{fromTypeGetLabel:function(t){var e="";return"time"==t?e="客户添加时间":"pay"==t?e="付费情况":"label"==t&&(e="标签"),e},handleRowDrop:function(){var t=document.querySelector(".el-table__body-wrapper tbody"),e=this;b.a.create(t,{handle:".drag-handler",onEnd:function(t){var i=this,a=t.newIndex,n=t.oldIndex;if(a!=n){e.tableData.splice(a,0,e.tableData.splice(n,1)[0]);var o=e.tableData.slice(0);e.tableData=[],e.$nextTick(l()(s.a.mark(function t(){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.tableData=o,t.next=3,e.getRuleId(a);case 3:return t.next=5,e.sortEvent();case 5:case"end":return t.stop()}},t,i)})))}}})},getRuleId:function(t){this.operate_rule_id=this.tableData[t].rule_id,0==t?(this.front_rule_id="",this.behind_rule_id=this.tableData[t+1].rule_id):t==this.tableData.length-1?(this.front_rule_id=this.tableData[t-1].rule_id,this.behind_rule_id=""):(this.front_rule_id=this.tableData[t-1].rule_id,this.behind_rule_id=this.tableData[t+1].rule_id)},sortEvent:function(){var t=this;this.$axios.post(this.URL.BASEURL+this.URL.phaseSort,{operate_rule_id:this.operate_rule_id,front_rule_id:this.front_rule_id,behind_rule_id:this.behind_rule_id}).then(function(e){e=e.data;t.$message({message:e.err,type:"info"}),"0"!==e.errno&&t.init()})},confirmEvent:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.phaseSetConfirm).then(function(e){(e=e.data)&&0==e.errno?t.init(1):t.$message({message:e.err,type:"warning"})})},addEditEvent:function(t){this.dialogVisible=!0,this.echoObj=t},deleEvent:function(t){var e=this;this.$axios.post(this.URL.BASEURL+this.URL.phaseDel,{rule_id:t}).then(function(t){(t=t.data)&&0==t.errno?e.init(1):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){})},handleCurrentChange:function(){},closeEvent:function(t){this.dialogVisible=!1,t&&this.init(1)},init:function(t){var e=this;this.page=t||this.page,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.phaseList,{params:{page:this.page,page_size:this.page_size}}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?(e.tableData=t.rst.data,e.total=t.rst.pageInfo.total,e.pages=t.rst.pageInfo.pages):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})}}},j={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"screenBox"},[i("div",[i("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.addEditEvent}},[t._v("阶段配置")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"small",plain:""},on:{click:t.confirmEvent}},[t._v("确认阶段配置")])],1),t._v(" "),i("instructions",{attrs:{doc:"phaseConfig"}})],1),t._v(" "),i("div",{staticClass:"tableBox"},[i("div",{staticClass:"f12 bMar15 pad015 c-00B38A"},[t._v("*上下拖动列表可以调整排序,请确保阶段排序为初级到高级的顺序,规则设置完成后点击【确认阶段配置】后开始同步数据")]),t._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"phaseTable",staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:t.height,data:t.tableData,"tooltip-effect":"dark"}},[i("el-table-column",{attrs:{label:"拖拽排序",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return t.row,[i("div",{staticClass:"drag-handler"},[i("i",{staticClass:"el-icon-rank"})])]}}])}),t._v(" "),t._l(t.desCol,function(e,a){return i("el-table-column",{key:a+"des",attrs:{"min-width":e.min_width?e.min_width:"160",prop:e.prop,label:e.label,"show-overflow-tooltip":"",align:e.algin?e.algin:"left",fixed:"date"==e.prop&&"left"},scopedSlots:t._u([{key:"default",fn:function(a){return["enable"==e.prop?[1==a.row.enable?i("span",{staticClass:"c-448AFF"},[t._v("启用")]):i("span",{staticClass:"c-F03F5C"},[t._v("禁用")])]:i("span",[t._v(t._s(a.row[e.prop]))])]}}],null,!0)})}),t._v(" "),i("el-table-column",{attrs:{label:"阶段规则","min-width":"260",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(JSON.parse(e.row.stage_rule),function(e){return i("div",{staticClass:"bMar10"},[t._v("\n "+t._s(t.fromTypeGetLabel(e.type))+" :\n "),"time"==e.type?i("span",[t._v("\n "+t._s(e.condition.min)+" - "+t._s(e.condition.max)+" 天\n ")]):t._e(),t._v(" "),"pay"==e.type?i("span",["not"==e.condition.payStatus?i("span",[t._v("未付费")]):t._e(),t._v(" "),"has"==e.condition.payStatus?i("span",[t._v("\n "+t._s("number"==e.condition.payType?"充值次数":"充值金额")+" :\n "+t._s(e.condition.payMin)+" - "+t._s(e.condition.payMax)+"\n "+t._s("number"==e.condition.payType?"次":"元")+"\n ")]):t._e()]):t._e(),t._v(" "),"label"==e.type?i("span",[t._v("\n "+t._s(e.condition.tag_name_list)+"\n ")]):t._e()])})}}])}),t._v(" "),i("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(i){return t.addEditEvent(e.row)}}},[t._v("编辑")]),t._v(" "),i("el-popconfirm",{attrs:{title:"确定删除吗?"},on:{confirm:function(i){return t.deleEvent(e.row.rule_id)}}},[i("el-button",{attrs:{slot:"reference",type:"danger",size:"mini"},slot:"reference"},[t._v("删除")])],1)]}}])})],2),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"pagination"},[i("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1)],1),t._v(" "),i("addEditDialog",{attrs:{dialogVisible:t.dialogVisible,echoObj:t.echoObj},on:{close:t.closeEvent}})],1)},staticRenderFns:[]};var x=i("VU/8")(y,j,!1,function(t){i("Gdbv")},"data-v-46ed6b86",null);e.default=x.exports}});
|