1 |
- webpackJsonp([33],{"ney+":function(e,t){},tL0R:function(e,t){},uJ72:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("Xxa5"),n=i.n(a),s=i("exGp"),o=i.n(s),l=i("//Fk"),r=i.n(l),c={name:"custAcqLink",components:{selfCustomerservice:i("fGUm").a},data:function(){return{loading:!1,tableData:[],page:1,pages:0,total:0,page_size:20,desCol:[{prop:"link_id",label:"链接ID"},{prop:"link_name",label:"名称"},{prop:"url",label:"获客链接"},{prop:"user_names",label:"关联客服"},{prop:"created_at",label:"创建时间"},{prop:"operate",label:"操作",min_width:"160px"}],dialogLoading:!1,dialogTableVisible:!1,link_id:"",link_name:"",user_list:[],isShowUserList:!1}},computed:{dialogTitleName:function(){return this.link_id?"编辑获客链接":"创建获客链接"}},mounted:function(){this.init(1)},methods:{onClickDel:function(e){var t=this;this.$confirm("确定要删除【"+e.link_name+"】吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$loading(t.$loadingConfig),t.$axios.post(t.URL.BASEURL+t.URL.custAcqLink_del,{link_id:e.link_id}).then(function(e){e=e.data;t.$loading(t.$loadingConfig).close(),e&&0==e.errno?(t.init(),t.$message.success("删除成功")):t.$message.warning(e.err||"操作失败")}).catch(function(){t.$loading(t.$loadingConfig).close()})}).catch(function(){})},handleCurrentChange:function(e){this.init(e)},init:function(e){var t=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.custAcqLink_list,{params:{page:e||this.page,page_size:this.page_size}}).then(function(e){(e=e.data)&&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"}),t.loading=!1}).catch(function(){t.loading=!1})},handleCheck:function(){var e=this;return new r.a(function(t,i){""==e.link_name?(e.$message({message:"请输入链接名称",type:"warning"}),i("表单校验未通过")):e.user_list&&e.user_list.length?t("表单校验通过"):(e.$message({message:"请选择关联客服",type:"warning"}),i("表单校验未通过"))})},addEditManager:function(){var e=this;return o()(n.a.mark(function t(){var i,a;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleCheck();case 3:i=e.URL.custAcqLink_create,a={link_name:e.link_name,user_list:e.user_list},e.link_id&&(i=e.URL.custAcqLink_edit,a.link_id=e.link_id),e.dialogLoading=!0,e.$axios.post(""+e.URL.BASEURL+i,a).then(function(t){t=t.data;e.dialogLoading=!1,t&&0==t.errno?(e.dialogTableVisible=!1,e.$message.success("操作成功"),e.init(e.link_id?"":1)):e.$message({message:t.err||"操作失败",type:"warning"})}).catch(function(){e.dialogLoading=!1}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),console.log(t.t0);case 13:case"end":return t.stop()}},t,e,[[0,10]])}))()},openDialog:function(e,t){var i=this;return o()(n.a.mark(function a(){return n.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return"edit"==e?(i.link_id=t.link_id,i.link_name=t.link_name,i.user_list=t.user_list):(i.link_id="",i.link_name="",i.user_list=[]),i.isShowUserList=!1,a.next=4,i.$nextTick();case 4:i.isShowUserList=!0,i.dialogTableVisible=!0;case 6:case"end":return a.stop()}},a,i)}))()},onClickCopyLink:function(e){var t=this;return o()(n.a.mark(function i(){return n.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,t.$copyText(e.url);case 3:t.$message.success("复制成功"),i.next=9;break;case 6:i.prev=6,i.t0=i.catch(0),t.$message.error("复制失败,请重试");case 9:case"end":return i.stop()}},i,t,[[0,6]])}))()},onChangeUserList:function(e){this.user_list=e||[]}}},d={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"con"},[i("div",{staticClass:"tableInfo"},[i("el-button",{staticClass:"lMarauto",attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.openDialog("add")}}},[e._v("创建获客链接")])],1),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"tableCon",staticStyle:{width:"100%"},attrs:{data:e.tableData,"tooltip-effect":"dark",height:"calc(100vh - 200px)"}},[e._l(e.desCol,function(t){return[i("el-table-column",{key:t.prop,attrs:{label:t.label,align:"center","show-overflow-tooltip":t.showOverTooltip,"min-width":t.min_width?t.min_width:110},scopedSlots:e._u([t.tooltip?{key:"header",fn:function(){return[e._v("\n "+e._s(t.label?t.label:"-")+"\n "),i("el-tooltip",{staticClass:"disinblock",attrs:{content:t.tooltip,placement:"top"}},[i("i",{staticClass:"el-icon-question"})])]},proxy:!0}:null,{key:"default",fn:function(a){var n=a.row;return["user_names"==t.prop?i("div",[n.user_names&&n.user_names.length?e._l(n.user_names,function(t,a){return i("div",{key:a,staticClass:"customerServiceTagBox"},[i("div",{staticClass:"customerServiceTag-v2"},[e._v(e._s(t))])])}):i("div",[e._v(" - ")])],2):"operate"==t.prop?i("div",[i("div",{staticClass:"flex f13",staticStyle:{padding:"0 10px","font-size":"13px","justify-content":"center"}},[i("div",{staticClass:"lMar14 pointer c-theme",on:{click:function(t){return e.openDialog("edit",n)}}},[e._v("编辑")]),e._v(" "),i("div",{staticClass:"lMar14 pointer c-theme",on:{click:function(t){return e.onClickCopyLink(n)}}},[e._v("复制链接")]),e._v(" "),i("div",{staticClass:"lMar14 pointer",on:{click:function(t){return e.onClickDel(n)}}},[e._v("删除")])])]):i("div",[e._v(e._s(n[t.prop]||0==n[t.prop]?n[t.prop]:"-"))])]}}],null,!0)})]})],2),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],staticClass:"paginationBox"},[i("el-pagination",{attrs:{background:"","current-page":e.page,layout:"prev, pager, next","page-count":Number(e.pages)},on:{"current-change":e.handleCurrentChange}})],1),e._v(" "),i("el-dialog",{staticClass:"dialogCon_permission",attrs:{title:e.dialogTitleName,visible:e.dialogTableVisible,"append-to-body":!0,width:"500px"},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogLoading,expression:"dialogLoading"}],staticClass:"dialogCon"},[i("div",{staticClass:"itemBox",staticStyle:{"margin-top":"0"}},[i("div",{staticClass:"name"},[i("span",{staticClass:"starLabel"},[e._v("*")]),e._v("链接名称:")]),e._v(" "),i("div",{staticClass:"ipt"},[i("el-input",{staticStyle:{width:"350px"},attrs:{size:"small",placeholder:"请输入获客链接名称"},model:{value:e.link_name,callback:function(t){e.link_name=t},expression:"link_name"}})],1)]),e._v(" "),i("div",{staticClass:"itemBox",staticStyle:{"margin-top":"20px"}},[i("div",{staticClass:"name"},[i("span",{staticClass:"starLabel"},[e._v("*")]),e._v("关联客服:")]),e._v(" "),i("div",{staticClass:"ipt"},[e.isShowUserList?i("selfCustomerservice",{attrs:{title:"",width:"350px",afferent_users:e.user_list},on:{customerDefine:e.onChangeUserList}}):e._e()],1)])]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:function(t){e.dialogTableVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.addEditManager}},[e._v("确 定")])],1)])],1)},staticRenderFns:[]};var u=i("VU/8")(c,d,!1,function(e){i("tL0R"),i("ney+")},"data-v-5a0cd746",null);t.default=u.exports}});
|