1 |
- webpackJsonp([65],{DRy3:function(e,t){},i4YQ:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("Xxa5"),n=r.n(a),o=r("exGp"),i=r.n(o),s=r("u2KI"),l=r.n(s),p=r("Dd8w"),c=r.n(p),u=r("mvHQ"),d=r.n(u),f=r("//Fk"),g=r.n(f),_=r("M4fF"),h=r.n(_),m=r("erru"),v=r("xcuB"),C={name:"operatorGroupDialog",components:{selfChannel:m.a,customerServiceCorpV2:v.a},props:{dialogVisible:{type:Boolean,default:function(){return!1}},groupId:{type:[String,Number],default:function(){return""}}},data:function(){return{loading:!1,reset:!1,isShowOperatorOptions:!1,form:{group_name:"",operator_id:"",afferent_corp_user_list:[],corp_user_list:[]}}},computed:{isEdit:function(){return!!this.groupId},title:function(){return(this.isEdit?"编辑":"新建")+"运营组"}},watch:{dialogVisible:function(e){e&&this.handleGetFormData()}},methods:{onChangeCorpUserList:function(e){var t=e.res_format_1;t&&t.length?this.form.corp_user_list=t.map(function(e){return{corpid:e.corpid,user_id:e.user_id}}):this.form.corp_user_list=[]},onChangeOperatorId:function(e){this.form.operator_id=e},handleConfirm:function(){var e=this;return i()(n.a.mark(function t(){var r,a,o,i,s;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:return r=""+e.URL.BASEURL+e.URL.operatorGroup_setConfig,a=e.handleGetParams(),e.loading=!0,t.next=8,e.$axios.post(r,a);case 8:o=t.sent,i=o.data,(s=void 0===i?{}:i)&&0==s.errno?(e.$message.success("操作成功"),e.handleClearFormData(),e.$emit("confirm",{isEdit:e.isEdit})):4002!=s.errno&&e.$message.warning(s.err||"操作失败"),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(0),console.log("error => ",t.t0);case 17:return t.prev=17,e.loading=!1,t.finish(17);case 20:case"end":return t.stop()}},t,e,[[0,14,17,20]])}))()},handleCancel:function(){this.handleClearFormData(),this.$emit("cancel")},handleFormValidate:function(){var e=this;return new g.a(function(t,r){var a=e.form,n=a.group_name,o=a.operator_id,i=a.corp_user_list;""===n?(e.$message.warning("请输入名称"),r("表单校验未通过")):o?i&&i.length?t("表单校验通过"):(e.$message.warning("请选择成员"),r("表单校验未通过")):(e.$message.warning("请选择运营"),r("表单校验未通过"))})},handleGetParams:function(){var e={group_name:this.form.group_name,operator_id:this.form.operator_id,corp_user_list:d()(this.form.corp_user_list)};return this.isEdit&&(e.group_id=this.groupId),c()({},e)},handleGetFormData:function(){var e=this;return i()(n.a.mark(function t(){return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e.handleClearFormData(),t.next=3,e.$nextTick();case 3:e.isEdit?e.handleGetGroupDetail():e.handleShowOperatorOpt();case 4:case"end":return t.stop()}},t,e)}))()},handleGetGroupDetail:function(){var e=this;return i()(n.a.mark(function t(){var r,a,o,i,s,l,p;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r=""+e.URL.BASEURL+e.URL.operatorGroup_groupDetail,a={group_id:e.groupId},e.loading=!0,t.next=6,e.$axios.get(r,{params:a});case 6:o=t.sent,i=o.data,(s=void 0===i?{}:i)&&0==s.errno?(l=s.rst,e.form.group_name=l.group_name,e.form.operator_id=l.operator_id,e.handleShowOperatorOpt(),l.corp_user_list&&l.corp_user_list.length&&(p=[],l.corp_user_list.forEach(function(e){e&&e.user_list&&Array.isArray(e.user_list)&&e.user_list.forEach(function(t){p.push({user_id:t,corpid:e.app_id})})}),e.form.afferent_corp_user_list=[].concat(p),e.form.corp_user_list=h.a.cloneDeep(e.form.afferent_corp_user_list))):4002!=s.errno&&e.$message.warning(s.err||"操作失败"),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log("error => ",t.t0);case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:case"end":return t.stop()}},t,e,[[0,12,15,18]])}))()},handleClearFormData:function(){this.form.group_name="",this.form.operator_id="",this.form.afferent_corp_user_list=[],this.form.corp_user_list=[],this.$refs.customerServiceCorpV2&&this.$refs.customerServiceCorpV2.handleCloseAllOpen(),this.reset=!this.reset,this.isShowOperatorOptions=!1},handleShowOperatorOpt:function(){this.isShowOperatorOptions=!0}}},b={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{staticClass:"operatorGroup-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:e.title,width:"590px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t}}},[r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[r("div",{staticClass:"form-item"},[r("span",{staticClass:"lable required"},[e._v("名称:")]),e._v(" "),r("el-input",{attrs:{size:"small",placeholder:"请输入名称",clearable:""},model:{value:e.form.group_name,callback:function(t){e.$set(e.form,"group_name",t)},expression:"form.group_name"}})],1),e._v(" "),r("div",{staticClass:"form-item"},[r("span",{staticClass:"lable required"},[e._v("运营:")]),e._v(" "),e.isShowOperatorOptions?r("selfChannel",{attrs:{title:"",type:"circleCreate",placeholder:"请选择",labelWidth:!0,width:"440px",reset:e.reset,afferent_params:{type:1,operator_id:e.form.operator_id||""},afferent_value:e.form.operator_id},on:{channelDefine:e.onChangeOperatorId}}):e._e()],1),e._v(" "),r("div",{staticClass:"form-item",staticStyle:{"margin-top":"10px"}},[r("span",{staticClass:"lable required"},[e._v("成员:")]),e._v(" "),r("customerServiceCorpV2",{ref:"customerServiceCorpV2",attrs:{title:"",width:"440px",afferent_users:e.form.afferent_corp_user_list},on:{customerDefine:e.onChangeCorpUserList}})],1)]),e._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{size:"mini",disabled:e.loading},on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{size:"mini",type:"primary",disabled:e.loading},on:{click:e.handleConfirm}},[e._v("确 定")])],1)])},staticRenderFns:[]};var w={ENABLE:1,DISABLE:0},x={name:"operatorGroup",components:{operatorGroupDialog:r("VU/8")(C,b,!1,function(e){r("zoEJ")},"data-v-4d1412b2",null).exports,selfChannel:m.a},data:function(){return{enableTypes:l()(w),height:"",loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},filter:{operator_id:""},list:[],operatorGroupDialogVisible:!1,currentOperatorGroupId:""}},created:function(){this.height=document.documentElement.clientHeight-200,this.handleGetList()},methods:{handleGetList:function(){var e=this;return i()(n.a.mark(function t(){var r,a,o,i,s;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,r=""+e.URL.BASEURL+e.URL.operatorGroup_groupList,a={page:e.pagination.page,page_size:e.pagination.page_size,operator_id:e.filter.operator_id},t.next=6,e.$axios.get(r,{params:a});case 6:o=t.sent,i=o.data,(s=void 0===i?{}:i)&&0==s.errno&&Array.isArray(s.rst.data)?(e.list=s.rst.data,e.pagination.total=s.rst.pageInfo.total,e.pagination.pages=s.rst.pageInfo.pages):4002!=s.errno&&(e.$message.warning(s.err),e.list=[],e.pagination.total=0,e.pagination.pages=0),t.next=18;break;case 12:t.prev=12,t.t0=t.catch(0),console.log(t.t0),e.list=[],e.pagination.total=0,e.pagination.pages=0;case 18:return t.prev=18,e.loading=!1,t.finish(18);case 21:case"end":return t.stop()}},t,e,[[0,12,18,21]])}))()},onChangeOperatorId:function(e){this.filter.operator_id=e,this.pagination.page=1,this.handleGetList()},handleCurrentChange:function(e){this.pagination.page=e,this.handleGetList()},onClickSetStatus:function(e){var t=this,r=e.group_id,a=e.enable;return i()(n.a.mark(function e(){return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$confirm("确定"+(a==w.ENABLE?"启用":"禁用")+"当前运营组吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:t.handleSetStatus({group_id:r,enable:a}),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.log("error => ",e.t0);case 9:case"end":return e.stop()}},e,t,[[0,6]])}))()},handleSetStatus:function(e){var t=this,r=e.group_id,a=e.enable;return i()(n.a.mark(function e(){var o,i,s,l,p;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,o=""+t.URL.BASEURL+t.URL.operatorGroup_changeStatus,i={group_id:r,status:a},e.next=6,t.$axios.get(o,{params:i});case 6:s=e.sent,l=s.data,(p=void 0===l?{}:l)&&0==p.errno?(t.$message.success("操作成功"),t.handleGetList()):4002!=p.errno&&t.$message.warning(p.err),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),console.log(e.t0);case 15:return e.prev=15,t.loading=!1,e.finish(15);case 18:case"end":return e.stop()}},e,t,[[0,12,15,18]])}))()},onClickCreateBtn:function(){this.currentOperatorGroupId="",this.operatorGroupDialogVisible=!0},onClickEditBtn:function(e){this.currentOperatorGroupId=e,this.operatorGroupDialogVisible=!0},onConfirmOperatorGroup:function(e){var t=e.isEdit;this.operatorGroupDialogVisible=!1,t||(this.pagination.page=1),this.handleGetList()},onCancelOperator:function(){this.operatorGroupDialogVisible=!1}}},S={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"operatorGroup-wrap"},[r("div",{staticClass:"screenBox"},[r("div",{staticClass:"filter-wrap"},[r("selfChannel",{staticStyle:{"margin-left":"-30px"},attrs:{title:"运营",type:"circleCreate",placeholder:"请选择",labelWidth:!0},on:{channelDefine:e.onChangeOperatorId}})],1),e._v(" "),r("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onClickCreateBtn}},[e._v("新建运营组")])],1),e._v(" "),r("el-table",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:e.height,data:e.list,"tooltip-effect":"dark"}},[r("el-table-column",{attrs:{label:"名称",prop:"group_name","min-width":"200",align:"center",fixed:"left"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[r("div",[e._v(" "+e._s(a.group_name||"-")+" ")])]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"运营",prop:"operator_name","min-width":"200",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[r("div",{staticClass:"customerServiceTagBox"},[r("div",{staticClass:"customerServiceTag"},[r("i",{staticClass:"el-icon-user-solid"}),e._v(" "+e._s(a.operator_name))])])]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"成员",prop:"corp_user_list","min-width":"400",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[r("div",{staticClass:"lableBox_dad"},[a.corp_user_list&&a.corp_user_list?e._l(a.corp_user_list,function(t){return r("div",{key:t.corpid+t.user_id,staticClass:"lableBox"},[e._v("\n "+e._s(t.user_info)+"\n ")])}):[e._v("-")]],2)]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[[a.enable==e.enableTypes.ENABLE?r("span",{staticClass:"btn c-FF604D",on:{click:function(t){return e.onClickSetStatus({group_id:a.group_id,enable:e.enableTypes.DISABLE})}}},[e._v("禁用")]):a.enable==e.enableTypes.DISABLE?r("span",{staticClass:"btn c-007AFF",on:{click:function(t){return e.onClickSetStatus({group_id:a.group_id,enable:e.enableTypes.ENABLE})}}},[e._v("启用")]):e._e()],e._v(" "),r("span",{staticClass:"btn c-00b38a",on:{click:function(t){return e.onClickEditBtn(a.group_id)}}},[e._v("编辑")])]}}])})],1),e._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:e.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[r("el-pagination",{attrs:{background:"","current-page":e.pagination.page,layout:"prev, pager, next","page-count":Number(e.pagination.pages)},on:{"current-change":e.handleCurrentChange}})],1),e._v(" "),r("operatorGroupDialog",{attrs:{dialogVisible:e.operatorGroupDialogVisible,groupId:e.currentOperatorGroupId},on:{confirm:e.onConfirmOperatorGroup,cancel:e.onCancelOperator}})],1)},staticRenderFns:[]};var G=r("VU/8")(x,S,!1,function(e){r("DRy3")},"data-v-7975bff0",null);t.default=G.exports},zoEJ:function(e,t){}});
|