webpackJsonp([78],{"65aa":function(t,e){},xaWc:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=a("Xxa5"),s=a.n(n),i=a("exGp"),o=a.n(i),l=a("3uEH"),r=a("FsX6"),c={components:{serviceSingle:l.a,selfChannelV2:r.a},data:function(){return{loading:!1,page:1,pages:0,total:0,page_size:20,tableData:[],height:"",user_id:"",status:""}},created:function(){this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.init(1)},methods:{onClickStatus:function(t){var e=this;return o()(s.a.mark(function a(){return s.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,e.$confirm("确定"+(0==t.enable?"启用":"禁用")+"【"+t.name+"】?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:e.handleSetStatus(t),a.next=9;break;case 6:a.prev=6,a.t0=a.catch(0),console.log(a.t0);case 9:case"end":return a.stop()}},a,e,[[0,6]])}))()},handleSetStatus:function(t){var e=this;this.$loading(this.$loadingConfig),this.$axios.get(this.URL.BASEURL+this.URL.welcomeMsg_updateStatus,{params:{rule_id:t.rule_id,status:1==t.enable?0:1}}).then(function(t){t=t.data;e.$loading(e.$loadingConfig).close(),t&&0==t.errno?(e.$message({message:"操作成功!",type:"success"}),e.init(1)):e.$message({message:t.err,type:"warning"})}).catch(function(){e.$loading(e.$loadingConfig).close()})},copyDetail:function(t){this.$router.push({path:"/welcom_message_copy/"+t.rule_id})},goDetail:function(t){this.$router.push({path:"/welcom_message_edit/"+t})},createWelcom:function(){this.$router.push({path:"/welcom_message_create"})},init:function(t){var e=this;this.page=t||this.page,this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.welcomeMsg_lists,{params:{user_id:this.user_id,status:this.status,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})},handleCurrentChange:function(t){this.init(t)},onChangeUserId:function(t){this.user_id=t?t.user_id:"",this.init(1)},onChangeStatus:function(t){this.status=t,this.init(1)},onClickDelete:function(t){var e=this;this.$confirm("确定要删除【"+t.name+"】吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$loading(e.$loadingConfig),e.$axios.get(e.URL.BASEURL+e.URL.welcomeMsg_ruleDel,{params:{rule_id:t.rule_id,corpid:t.corpid}}).then(function(t){t=t.data;e.$loading(e.$loadingConfig).close(),t&&0==t.errno?(e.init(),e.$message({type:"success",message:"删除成功!"})):4002!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(){e.$loading(e.$loadingConfig).close()})}).catch(function(){})}}},u={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"screenBox"},[a("serviceSingle",{staticStyle:{width:"auto"},attrs:{title:"使用成员",placeholder:"请选择"},on:{customerDefine:t.onChangeUserId}}),t._v(" "),a("selfChannelV2",{attrs:{type:"enableStatus",title:"状态",labelWidth:!0},on:{change:t.onChangeStatus},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}})],1),t._v(" "),a("div",{staticClass:"tableInfo"},[a("div",[a("div",{staticClass:"flex"},[a("div",{staticClass:"totalCustom"},[t._v("共有"),a("span",[t._v(t._s(t.total))]),t._v("条欢迎语")])])]),t._v(" "),a("div",{staticClass:"flex"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.createWelcom}},[t._v("新建欢迎语")]),t._v(" "),a("instructions",{staticStyle:{"margin-left":"20px"},attrs:{doc:"welcomeMsg"}})],1)]),t._v(" "),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{height:t.height,data:t.tableData,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{prop:"name",label:"欢迎语标题","show-overflow-tooltip":"",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"创建人",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"customerServiceTagBox"},[a("div",{staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-user-solid"}),t._v(" "+t._s(e.row.creator))])])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"使用成员",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[1==e.row.is_for_all?a("div",[t._v("全部员工")]):[a("div",{staticClass:"customerServiceTagBox biaoqian"},t._l(e.row.user_list,function(e){return a("div",{key:e,staticClass:"customerServiceTag"},[a("i",{staticClass:"el-icon-s-custom"}),t._v("\n "+t._s(e)+"\n ")])}),0)]]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"updated_at",label:"更新时间","show-overflow-tooltip":"",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"created_at",label:"创建时间","show-overflow-tooltip":"",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[""!==n.enable?a("el-switch",{attrs:{"active-value":1,"inactive-value":0,disabled:""},nativeOn:{click:function(e){return t.onClickStatus(n)}},model:{value:n.enable,callback:function(e){t.$set(n,"enable",e)},expression:"row.enable"}}):a("div",[t._v(" - ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex",staticStyle:{"justify-content":"center"}},[a("div",{staticClass:"c-00B38A pointer",on:{click:function(a){return t.goDetail(e.row.rule_id)}}},[t._v("编辑")]),t._v(" "),a("el-popconfirm",{attrs:{title:"确定复制【"+e.row.name+"】欢迎语吗?"},on:{confirm:function(a){return t.copyDetail(e.row)}}},[a("div",{staticClass:"c-00B38A pointer table_button",staticStyle:{margin:"0 6px"},attrs:{slot:"reference"},slot:"reference"},[t._v("复制")])]),t._v(" "),a("div",{staticClass:"c-FF604D pointer",on:{click:function(a){return t.onClickDelete(e.row)}}},[t._v("删除")])],1)]}}])})],1),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 g=a("VU/8")(c,u,!1,function(t){a("65aa")},"data-v-ea929208",null);e.default=g.exports}});