1 |
- webpackJsonp([26],{"1sRj":function(t,e,a){"use strict";var i={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{"append-to-body":!0,"custom-class":"channel_code_group",title:t.propsData.dialogTitle+"分组",visible:t.dialogVisible,width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"dialogBox"},[a("div",{staticClass:"lable"},[t._v("分组名称")]),t._v(" "),a("el-input",{attrs:{size:"small",placeholder:"请输入内容",maxlength:"8","show-word-limit":"",clearable:""},model:{value:t.groupName,callback:function(e){t.groupName=e},expression:"groupName"}})],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(e){return t.save(t.propsData.dialogTitle)}}},[t._v("确 定")])],1)])},staticRenderFns:[]};var n=a("VU/8")({name:"dialogGroup",props:["propsData"],data:function(){return{groupName:"",dialogVisible:!1,loading:!1}},methods:{save:function(t){"修改"==t?this.editGroup():this.addGroup()},addGroup:function(){var t=this;""!=this.groupName?(this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.channel_addGroup,{name:this.groupName}).then(function(e){e=e.data,t.loading=!1,t.$message({message:e.err,type:"warning"}),e&&0==e.errno&&(t.dialogVisible=!1,t.$emit("init"))}).catch(function(e){t.loading=!1})):this.$message({message:"分组名必填",type:"info"})},editGroup:function(){var t=this;""!=this.groupName?(this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.channel_editGroup,{id:this.propsData.groupId,name:this.groupName}).then(function(e){e=e.data,t.loading=!1,t.$message({message:e.err,type:"warning"}),e&&0==e.errno&&(t.dialogVisible=!1,t.$emit("init"))}).catch(function(e){t.loading=!1})):this.$message({message:"分组名必填",type:"info"})}}},i,!1,function(t){a("sBkz")},null,null);e.a=n.exports},"9h5Q":function(t,e){},AHx4:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("McOJ"),n=a("fGUm"),s=a("FVz6"),o=a("lbyi"),r=a("1sRj"),l=a("w/TU"),c=a.n(l),d={name:"groupList",mixins:[o.a],components:{dialogGroup:r.a,draggable:c.a},data:function(){return{dialogTitle:"添加",acIdx:null,tableData:[],loading:!1,page:1,pages:0,total:0,page_size:500,groupId:""}},created:function(){this.init()},methods:{init:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_groupList,{params:{page:this.page,pagesize:this.page_size}}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?(t.tableData=e.rst.data,t.total=e.rst.pageInfo.total,t.pages=e.rst.pageInfo.pages):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})},handleCommand:function(t){var e=t.split("/"),a=e[0],i=e[1],n=e[2];"editName"==a?this.editGroup(n,i):"deleGroup"==a&&this.deleGroup(i)},editGroup:function(t,e){var a=this;this.$nextTick(function(){a.dialogTitle="修改",a.$refs.dialogGroupRef.groupName=t,a.groupId=e,a.$refs.dialogGroupRef.dialogVisible=!0})},deleGroup:function(t){var e=this;this.$confirm("此操作将永久删除该分组, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.loading=!0,e.$axios.post(e.URL.BASEURL+e.URL.channel_deleGroup,{id:t,del_sqs:0}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno?e.init():4002!=t.errno&&e.$message({message:t.err,type:"warning"})})}).catch(function(t){e.$message({message:t,type:"warning"})})},draggableSort:function(t){var e=this,a=(t.to,t.from,t.item,t.clone,t.oldIndex,t.newIndex,[]);this.tableData.forEach(function(t){a.push(t.id)}),this.$axios.post(this.URL.BASEURL+this.URL.channel_sortGroup,{ids:a}).then(function(t){t=t.data;e.loading=!1,t&&0==t.errno||4002!=t.errno&&e.$message({message:t.err,type:"warning"})})},itemClick:function(t){this.acIdx=t,this.$emit("getId",t)}}},p={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"title"},[a("span",{staticClass:"fWeight600 c-000 f14"},[t._v("渠道分组")]),t._v(" "),a("span",{staticClass:"addGroupBox",on:{click:function(e){t.$refs.dialogGroupRef.dialogVisible=!0,t.$refs.dialogGroupRef.groupName=""}}},[a("i",{staticClass:"el-icon-plus f12"}),t._v("\n 添加分组\n ")])]),t._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"listBox"},[a("div",{staticClass:"item_css",class:[null==t.acIdx?"ac_css":""],on:{click:function(e){return t.itemClick(null)}}},[a("i",{staticClass:"el-icon-folder"}),t._v("全部渠道活码")]),t._v(" "),a("draggable",{staticClass:"syllable_ul",attrs:{element:"ul",list:t.tableData,emptyInsertThreshold:0,options:{group:"name",animation:200,ghostClass:"ghostClass",dragClass:"dragClass"}},on:{sort:t.draggableSort}},t._l(t.tableData,function(e,i){return a("div",{key:e.id,staticClass:"item_css",class:[t.acIdx==e.id?"ac_css":""],on:{click:function(a){return t.itemClick(e.id)}}},[a("i",{staticClass:"el-icon-folder",staticStyle:{cursor:"move"}}),t._v(" "),a("span",[t._v(t._s(e.name?e.name:"-"))]),t._v(" "),a("span",{staticClass:"lMarauto"},[a("el-dropdown",{on:{command:t.handleCommand}},[a("span",{staticClass:"el-dropdown-link"},[a("i",{staticClass:"el-icon-more"})]),t._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"editName/"+e.id+"/"+e.name}},[t._v("修改名称")]),t._v(" "),a("el-dropdown-item",{attrs:{command:"deleGroup/"+e.id}},[t._v("删除分组")])],1)],1)],1)])}),0)],1),t._v(" "),a("dialogGroup",{ref:"dialogGroupRef",attrs:{propsData:{dialogTitle:t.dialogTitle,groupId:t.groupId}},on:{init:t.init}})],1)},staticRenderFns:[]};var u=a("VU/8")(d,p,!1,function(t){a("9h5Q")},"data-v-258e2ab9",null).exports,g={name:"codeIndex",components:{publicTable:s.a,selfInput:i.a,groupList:u,selfCustomerservice:n.a},data:function(){return{initFlag:!1,channel_val:"",user_id_list:"",desCol:[{prop:"name",label:"渠道名称"},{prop:"creater",label:"创建人"},{prop:"group_name",label:"分组"},{prop:"user_add_count",label:"扫码总人数"}],group_id:"",reset:!1}},methods:{resetEvent:function(){this.initFlag=!this.initFlag,this.reset=!this.reset,this.channel_val="",this.user_id_list=[]},createdchannel_code:function(){this.$router.push({path:"/createChannelCode"})},onChangeChannelVal:function(t){this.channel_val=t,this.initFlag=!this.initFlag},onChangeUserIdList:function(t){this.user_id_list=t,this.initFlag=!this.initFlag},onChangeGroupId:function(t){this.group_id=t,this.initFlag=!this.initFlag}}},h={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"con"},[a("instructions",{attrs:{doc:"codeIndex"}}),t._v(" "),a("div",{staticClass:"searchBox"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.createdchannel_code}},[t._v("新建渠道活码")]),t._v(" "),a("selfInput",{attrs:{reset:t.reset,label_name:"搜索渠道"},on:{inputChange:t.onChangeChannelVal}}),t._v(" "),a("selfCustomerservice",{attrs:{reset:t.reset},on:{customerDefine:t.onChangeUserIdList}}),t._v(" "),a("div",{staticClass:"reset",on:{click:t.resetEvent}},[t._v("重置")])],1),t._v(" "),a("div",{staticClass:"mainBox"},[a("div",{staticClass:"groupBox"},[a("groupList",{on:{getId:t.onChangeGroupId}})],1),t._v(" "),a("div",{staticClass:"tableBox"},[a("publicTable",{attrs:{propsData:{desCol:t.desCol,source:"codeIndex",initFlag:t.initFlag,channel_val:t.channel_val,userIds:t.user_id_list,group_id:t.group_id}}})],1)])],1)},staticRenderFns:[]};var m=a("VU/8")(g,h,!1,function(t){a("DWtt")},"data-v-8022feb4",null);e.default=m.exports},DWtt:function(t,e){},FVz6:function(t,e,a){"use strict";var i={name:"publicTable",props:["propsData"],data:function(){return{loading:!1,dataLoading:!1,page:1,pages:0,total:0,page_size:20,height:"",tableData:[]}},watch:{"propsData.initFlag":function(){this.source_init()}},created:function(){this.height=document.documentElement.clientHeight-300>400?document.documentElement.clientHeight-300:400,this.source_init()},methods:{source_init:function(t){t=t||1,"codeIndex"==this.propsData.source?(this.init(t),this.height=document.documentElement.clientHeight-220>400?document.documentElement.clientHeight-220:400):"channelAnalyse"==this.propsData.source?this.tableData=this.propsData.tableData:"customerList"==this.propsData.source?this.init_list(t):"customerAnalyse"==this.propsData.source&&this.init_analyse()},editCode:function(t){this.$router.push({path:"/createChannelCode",query:{id:t}})},downloadIamge:function(t,e){var a=new Image,i=e;a.setAttribute("crossOrigin","anonymous"),a.onload=function(){var t=document.createElement("canvas");t.width=a.width,t.height=a.height,t.getContext("2d").drawImage(a,0,0,a.width,a.height);var e=t.toDataURL("image/png"),n=document.createElement("a"),s=new MouseEvent("click");n.download=i||"photo",n.href=e,n.dispatchEvent(s)},a.src=t},forbiddenCode:function(t){var e=this;this.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.channel_code_forbidden,{id:t}).then(function(t){t=t.data;e.loading=!1,e.$message({message:t.err,type:"warning"}),t&&0==t.errno&&e.init(1)}).catch(function(t){e.loading=!1})},copyCode:function(t){this.$router.push({path:"/createChannelCode",query:{id:t,type:"copy"}})},goDataAanlyse:function(t){this.$router.push("/dataAnalyse/"+t)},init:function(t,e){var a=this;if("export"!=e)this.page=t||this.page;else if(0==this.total)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_codeList,{params:{group_id:this.propsData.group_id,user_ids:this.propsData.userIds,name:this.propsData.channel_val,page:"export"==e?1:this.page,page_size:"export"==e?this.$store.state.exportNumber:this.page_size}}).then(function(t){t=t.data;a.loading=!1,t&&0==t.errno?"export"==e?a.exportEvent(t.rst.data):(a.tableData=t.rst.data,a.total=t.rst.pageInfo.total,a.pages=t.rst.pageInfo.pages):4002!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},init_list:function(t,e){var a=this;if("export"!=e)this.page=t||this.page;else if(this.tableData&&0==this.tableData.length)return void this.$message({message:"暂无数据可导出",type:"warning"});this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_trend_customerList,{params:{sq_id:this.$route.params.id,name:this.propsData.name,page:this.page,page_size:this.page_size}}).then(function(t){t=t.data;a.loading=!1,t&&0==t.errno?"export"==e?a.exportEvent(t.rst.data):(a.tableData=t.rst.data,a.total=t.rst.pageInfo.total,a.pages=t.rst.pageInfo.pages):4002!=t.errno&&a.$message({message:t.err,type:"warning"})}).catch(function(t){a.loading=!1})},init_analyse:function(){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.channel_trend_staffList,{params:{sq_id:this.$route.params.id}}).then(function(e){e=e.data;t.loading=!1,e&&0==e.errno?t.tableData=e.rst:4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.loading=!1})},handleCurrentChange:function(t){this.source_init(t)},exportEvent:function(t){var e=t,a=this.propsData.desCol.map(function(t){return t.label}),i=this.propsData.desCol.map(function(t){return t.prop});e.forEach(function(t){t.desCol_list_info=t.name,t.enable=1==t.enable?"正常":0==t.enable?"已流失":"-",t.scan_user_type=1==t.scan_user_type?"存量用户":2==t.scan_user_type?"增量用户":"-"});var n=[{tHeader:a,filterVal:i,tableDatas:e,sheetName:""}];this.$exportOrder({excelDatas:n,name:"渠道活码-数据分析-客户列表(导出时间:"+this.$getDay(0)+")"})}}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%"},attrs:{border:"",height:t.height,data:t.tableData,"tooltip-effect":"dark","header-cell-style":function(){return{backgroundColor:"#f9f9f9 !important"}}}},[t._l(t.propsData.desCol,function(e){return[a("el-table-column",{key:e.prop,attrs:{label:e.label,align:"center","show-overflow-tooltip":e.showOverTooltip,"min-width":e.min_width?e.min_width:120},scopedSlots:t._u([e.tooltip?{key:"header",fn:function(){return[t._v("\n "+t._s(e.label?e.label:"-")+"\n "),a("el-tooltip",{staticClass:"disinblock",attrs:{content:e.tooltip,placement:"top"}},[a("i",{staticClass:"el-icon-question"})])]},proxy:!0}:null,{key:"default",fn:function(i){return["creater"==e.prop?a("div",{staticClass:"customerServiceTagBox"},[a("div",{staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-headset rMar3 f12"}),t._v(t._s(i.row[e.prop]?i.row[e.prop]:"-"))])]):"desCol_list_info"==e.prop?a("div",{staticClass:"flex-align-center"},[a("img",{staticStyle:{width:"30px",height:"30px","border-radius":"50%","margin-right":"4px"},attrs:{src:i.row.avatar,alt:""}}),t._v("\n "+t._s(i.row.name?i.row.name:"-")+"\n ")]):"is_open"==e.prop?a("div",[t._v("\n "+t._s(1==i.row.is_open?"是":0==i.row.is_open?"否":"-")+"\n ")]):"enable"==e.prop?a("div",[t._v("\n "+t._s(1==i.row.enable?"正常":0==i.row.enable?"已流失":"-")+"\n ")]):"scan_user_type"==e.prop?a("div",[t._v("\n "+t._s(1==i.row.scan_user_type?"存量用户":2==i.row.scan_user_type?"增量用户":"-")+"\n ")]):a("div",[t._v(t._s(i.row[e.prop]||0==i.row[e.prop]?i.row[e.prop]:"-"))])]}}],null,!0)})]}),t._v(" "),"codeIndex"==t.propsData.source?[a("el-table-column",{attrs:{label:"操作",align:"center","min-width":"180px"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex"},[a("el-popconfirm",{attrs:{disabled:1!==e.row.status,title:"禁用【"+e.row.name+"】渠道活码后,将无法启用,是否还要继续?"},on:{confirm:function(a){return t.forbiddenCode(e.row.id)}}},[a("div",{class:1==e.row.status?"c-00B38A pointer":"c-999 pointer-drop",attrs:{slot:"reference"},slot:"reference"},[t._v("禁用")])]),t._v(" "),a("div",{staticClass:"lMar8",class:1==e.row.status?"c-00B38A pointer":"c-999 pointer-drop",on:{click:function(a){1==e.row.status&&t.editCode(e.row.id)}}},[t._v("编辑")]),t._v(" "),a("el-popconfirm",{attrs:{title:"确定复制【"+e.row.name+"】渠道活码?"},on:{confirm:function(a){return t.copyCode(e.row.id)}}},[a("div",{staticClass:"c-00B38A pointer lMar8",attrs:{slot:"reference"},slot:"reference"},[t._v("复制")])]),t._v(" "),a("div",{staticClass:"c-00B38A lMar8",class:e.row.qrcode?"pointer":"pointer-drop c-999",on:{click:function(a){e.row.qrcode&&t.downloadIamge(e.row.qrcode,e.row.name)}}},[t._v("下载")]),t._v(" "),a("div",{staticClass:"c-00B38A pointer lMar8",on:{click:function(a){return t.goDataAanlyse(e.row.id)}}},[t._v("分析数据")])],1)]}}],null,!1,2249112343)})]:t._e()],2),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],staticClass:"pagination"},[a("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":Number(t.pages)},on:{"current-change":t.handleCurrentChange}})],1)],1)},staticRenderFns:[]};var s=a("VU/8")(i,n,!1,function(t){a("IbuX")},"data-v-2cb11589",null);e.a=s.exports},IbuX:function(t,e){},sBkz:function(t,e){}});
|