1 |
- webpackJsonp([51],{"0uMD":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("Gu7T"),a=n.n(i),r=n("Xxa5"),s=n.n(r),o=n("exGp"),l=n.n(o),c=n("FsX6"),u=n("pdUL"),d=n("ifoU"),p=n.n(d),f=n("//Fk"),h=n.n(f),_=n("mvHQ"),v=n.n(_),g={props:{value:{type:Boolean,default:function(){return!1}},rule_id:{type:String|Number,default:function(){return""}}},data:function(){return{loading:!1,corpOptions:[],form:{title:"",account_list:[{corpid:"",userOptions:[],user_id_res:[],user_list:[]}]}}},computed:{title:function(){return this.isDetail?"续期任务详情":"新建续期任务"},visible:{get:function(){return this.value},set:function(e){this.$emit("input",e)}},isDetail:function(){return!!this.rule_id}},watch:{visible:function(e){var t=this;return l()(s.a.mark(function n(){return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!e){n.next=6;break}return n.next=3,t.handleGetAllList();case 3:t.isDetail&&t.handleGetDetail(),n.next=7;break;case 6:t.isDetail&&t.handleClearForm();case 7:case"end":return n.stop()}},n,t)}))()}},methods:{handleCloseDrawer:function(){this.visible=!1},handleGetDetail:function(){var e=this;return l()(s.a.mark(function t(){var n,i,r,o,c,u,d,p,f,h,_;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,n=""+e.URL.BASEURL+e.URL.license_renewalJobDetail,i={rule_id:e.rule_id},t.next=6,e.$axios.get(n,{params:i});case 6:if(r=t.sent,o=r.data,!(c=void 0===o?{}:o)||0!=c.errno){t.next=20;break}return u=c.rst||{},d=u.title,p=void 0===d?"":d,f=u.list,h=void 0===f?[]:f,e.form.title=p,_=[],h.forEach(function(e){var t=_.findIndex(function(t){return t.corpid===e.corpid});-1===t?_.push({corpid:e.corpid,userOptions:[],user_id_res:[e.user_id],user_list:[]}):_[t].user_id_res.push(e.user_id)}),e.form.account_list=[].concat(a()(JSON.parse(v()(_)))),e.form.account_list.forEach(function(){var t=l()(s.a.mark(function t(n,i){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:e.onChangeCorpid(n.corpid,i);case 3:case"end":return t.stop()}},t,e)}));return function(e,n){return t.apply(this,arguments)}}()),t.next=18,e.$nextTick();case 18:e.form.account_list.forEach(function(){var t=l()(s.a.mark(function t(n,i){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$nextTick();case 2:e.onChangeUserIdRes(_[i].user_id_res,n.corpid,i);case 3:case"end":return t.stop()}},t,e)}));return function(e,n){return t.apply(this,arguments)}}()),e.handleGetUserDetailByReslist(h);case 20:t.next=25;break;case 22:t.prev=22,t.t0=t.catch(0),console.log(t.t0);case 25:return t.prev=25,e.loading=!1,t.finish(25);case 28:case"end":return t.stop()}},t,e,[[0,22,25,28]])}))()},handleGetUserDetailByReslist:function(e){var t=this;return l()(s.a.mark(function n(){return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.$nextTick();case 2:t.form.account_list.forEach(function(n){n.user_list.forEach(function(n){var i=e.find(function(e){return e.corpid+"_"+e.user_id==n.corpid+"_"+n.user_id});t.$set(n,"status",i.status)})});case 3:case"end":return n.stop()}},n,t)}))()},handleGetAllList:function(){var e=this;return l()(s.a.mark(function t(){var n,i,r,o,l;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,n=""+e.URL.BASEURL+e.URL.warn_djuserList,i={is_active:e.isDetail?"":1,sys_group_id:1==e.$cookie.getCookie("isSuperManage")?sessionStorage.getItem("company_session_defaultCorp_level_1").toString():""},t.next=6,e.$axios.get(n,{params:i});case 6:return r=t.sent,o=r.data,(l=void 0===o?{}:o)&&0==l.errno&&(e.corpOptions=[].concat(a()(l.rst))),t.abrupt("return",h.a.resolve());case 13:t.prev=13,t.t0=t.catch(0),console.log(t.t0);case 16:return t.prev=16,e.loading=!1,t.finish(16);case 19:case"end":return t.stop()}},t,e,[[0,13,16,19]])}))()},onChangeCorpid:function(e,t){this.form.account_list[t].corpid=e||"",this.form.account_list[t].userOptions=this.handleGetUserOptionsByCorpid(e||""),this.form.account_list[t].user_id_res=[],this.form.account_list[t].user_list=this.handleGetUserListByUseridres([],e||""),this.handleInitCorpOptionsStatus()},handleGetUserOptionsByCorpid:function(e){if(!e)return[];var t=this.corpOptions.find(function(t){return t.corpid===e});return t?[].concat(a()(t.user_list)):[]},handleGetUserListByUseridres:function(e,t){if(!e||!e.length)return[];var n=[],i=this.handleGetUserOptionsByCorpid(t);return e.forEach(function(e){var t=i.find(function(t){return t.user_id===e});t&&n.push(t)}),n},onChangeUserIdRes:function(e,t,n){this.form.account_list[n].user_id_res=e,this.form.account_list[n].user_list=this.handleGetUserListByUseridres(e,t)},handleGetUserTagType:function(e){return new p.a([[-1,{type:"danger",desc:"续期失败"}],[0,{type:"warning",desc:"待支付"}],[1,{type:"",desc:"已支付"}],[2,{type:"info",desc:"已取消"}]]).get(e)||{type:"",desc:""}},onCloseUserTag:function(e,t){this.form.account_list[t].user_list.splice(e,1),this.form.account_list[t].user_id_res=this.form.account_list[t].user_list.map(function(e){return e.user_id})},onClickDeleteCorp:function(e){var t=this;return l()(s.a.mark(function n(){return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!t.form.account_list[e].user_id_res.length){n.next=5;break}return n.next=5,t.$confirm("确定清空当前已选的客服账号吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 5:t.form.account_list.splice(e,1),t.handleInitCorpOptionsStatus(),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(0),console.log(n.t0);case 12:case"end":return n.stop()}},n,t,[[0,9]])}))()},onClickAddCorp:function(){this.form.account_list.push({corpid:"",userOptions:[],user_id_res:[],user_list:[]}),this.handleInitCorpOptionsStatus()},handleInitCorpOptionsStatus:function(){var e=this;this.corpOptions.forEach(function(t){var n=e.form.account_list.find(function(e){return e.corpid===t.corpid});t.disabled=!!n})},onClickSave:function(){var e=this;return l()(s.a.mark(function t(){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.handleFormValidate();case 3:e.handleSubmitForm(),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.log(t.t0);case 9:case"end":return t.stop()}},t,e,[[0,6]])}))()},handleFormValidate:function(){var e=this,t=this.form,n=t.title,i=t.account_list.some(function(e){return!e.corpid||!e.user_id_res||!e.user_id_res.length});return new h.a(function(t,a){n?i?(e.$message.warning("请完善客服账号信息"),a("表单校验未通过")):t("表单校验通过"):(e.$message.warning("请输入任务名称"),a("表单校验未通过"))})},getAccountParams:function(){return this.form.account_list.map(function(e){return{corpid:e.corpid,user_list:e.user_id_res}})},handleSubmitForm:function(){var e=this;return l()(s.a.mark(function t(){var n,i,a,r,o;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,n=""+e.URL.BASEURL+e.URL.license_createRenewalJob,i={sys_group_id:1==e.$cookie.getCookie("isSuperManage")?sessionStorage.getItem("company_session_defaultCorp_level_1").toString():"",title:e.form.title,account_list:e.getAccountParams()},t.next=6,e.$axios.post(n,i);case 6:a=t.sent,r=a.data,(o=void 0===r?{}:r)&&0==o.errno?(e.$message.success("提交成功"),e.handleClearForm(),e.$emit("confirm")):4002!=o.errno&&e.$message.warning(o.err||"提交失败"),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(0),console.log(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]])}))()},handleClearForm:function(){this.form.title="",this.form.account_list=[{corpid:"",userOptions:[],user_id_res:[],user_list:[]}]}}},m={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-drawer",{attrs:{visible:e.visible,"close-on-press-escape":!1,wrapperClosable:!1,withHeader:!1,size:"60%"},on:{"update:visible":function(t){e.visible=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"content-wrap"},[n("div",{staticClass:"self_drawer_title"},[n("div",{staticClass:"flex"},[e._v("\n "+e._s(e.title)+"\n ")]),e._v(" "),n("div",{staticClass:"flex-align-center"},[n("i",{staticClass:"el-icon-close pointer",on:{click:e.handleCloseDrawer}})])]),e._v(" "),n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"form-wrap"},[n("div",{staticClass:"form-item"},[n("span",{staticClass:"lable required"},[e._v("任务名称")]),e._v(" "),n("el-input",{attrs:{placeholder:"请输入任务名称",clearable:"",size:"small",disabled:e.isDetail},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title","string"==typeof t?t.trim():t)},expression:"form.title"}})],1),e._v(" "),n("div",{staticClass:"form-item flex-start"},[n("span",{staticClass:"lable required"},[e._v("客服账号")]),e._v(" "),n("div",{staticClass:"account-wrap"},e._l(e.form.account_list,function(t,i){return n("div",{staticClass:"account-item-wrap"},[n("div",{staticClass:"corp-wrap"},[n("el-select",{attrs:{size:"small",placeholder:"请选择企微主体",filterable:"",disabled:e.isDetail},on:{change:function(t){return e.onChangeCorpid(t,i)}},model:{value:t.corpid,callback:function(n){e.$set(t,"corpid",n)},expression:"account.corpid"}},e._l(e.corpOptions,function(e){return n("el-option",{key:e.corpid,attrs:{label:e.corp_name,value:e.corpid,disabled:e.disabled}})}),1),e._v(" "),n("el-select",{staticClass:"user-select",attrs:{size:"small",placeholder:"请选择客服",multiple:"","collapse-tags":"",filterable:"",disabled:e.isDetail},on:{change:function(n){return e.onChangeUserIdRes(n,t.corpid,i)}},model:{value:t.user_id_res,callback:function(n){e.$set(t,"user_id_res",n)},expression:"account.user_id_res"}},e._l(t.userOptions,function(e){return n("el-option",{key:e.user_id,attrs:{label:e.name,value:e.user_id}})}),1),e._v(" "),e.isDetail?e._e():n("div",[0!==i?n("i",{staticClass:"el-icon-delete icon-btn",on:{click:function(t){return e.onClickDeleteCorp(i)}}}):e._e(),e._v(" "),i===e.form.account_list.length-1&&e.form.account_list.length<e.corpOptions.length?n("i",{staticClass:"el-icon-circle-plus-outline icon-btn",on:{click:e.onClickAddCorp}}):e._e()])],1),e._v(" "),t.user_list&&t.user_list.length?n("div",{staticClass:"user-wrap"},e._l(t.user_list,function(t,a){return n("span",{staticClass:"user-item-wrap"},[n("el-tag",{key:t.user_id,attrs:{type:e.isDetail&&e.handleGetUserTagType(t.status).type||"",closable:!e.isDetail,"disable-transitions":""},on:{close:function(t){return e.onCloseUserTag(a,i)}}},[e._v("\n "+e._s(t.name)+"\n "),e.isDetail?n("span",[e._v("("+e._s(e.handleGetUserTagType(t.status).desc)+")")]):e._e()])],1)}),0):e._e()])}),0)])]),e._v(" "),e.isDetail?e._e():n("div",{staticClass:"button_box"},[n("button",{staticClass:"button",on:{click:e.onClickSave}},[e._v("提交续期任务")])])])])},staticRenderFns:[]};var C=n("VU/8")(g,m,!1,function(e){n("f/PY")},"data-v-6552fccb",null).exports,b={props:{dialogVisible:{type:Boolean,default:function(){return!1}},list:{type:Array,default:function(){return[]}}},data:function(){return{loading:!1}},computed:{title:function(){return""}},watch:{dialogVisible:function(e){}},methods:{handleCancel:function(){this.$emit("close")},handleClearFormData:function(){}}},w={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{staticClass:"errlist-dialog",attrs:{visible:e.dialogVisible,"before-close":e.handleCancel,title:e.title,width:"550px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"content-wrap"},[n("el-table",{staticStyle:{width:"100%"},attrs:{"max-height":"300",data:e.list,"tooltip-effect":"dark"}},[n("el-table-column",{attrs:{label:"企微主体",prop:"corp_name","min-width":"150",align:"center","show-overflow-tooltip":"",fixed:"left"}}),e._v(" "),n("el-table-column",{attrs:{label:"关闭失败原因",prop:"errmsg","min-width":"300",align:"center","show-overflow-tooltip":""}})],1)],1),e._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"mini",type:"primary"},on:{click:e.handleCancel}},[e._v("关 闭")])],1)])},staticRenderFns:[]};var k=n("VU/8")(b,w,!1,function(e){n("0y0z")},"data-v-cc611d02",null).exports,x=n("la//"),y={name:"license",components:{selfChannelV2:c.a,selfInputV2:u.a,createTaskDrawer:C,errListDialog:k},data:function(){return{licenseTaskStatusMap:x.w,licenseTaskStatusCode:x.v,height:"",loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},filter:{title:"",status:""},list:[],createTaskDrawerVisible:!1,currentTaskId:"",errListDialogVisible:!1,currentErrList:[]}},created:function(){this.height=document.documentElement.clientHeight-200,this.handleGetList()},methods:{handleGetList:function(){var e=this;return l()(s.a.mark(function t(){var n,i,a,r,o;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,n=""+e.URL.BASEURL+e.URL.license_renewalJobList,i={page:e.pagination.page,page_size:e.pagination.page_size,title:e.filter.title,status:e.filter.status},t.next=6,e.$axios.get(n,{params:i});case 6:a=t.sent,r=a.data,(o=void 0===r?{}:r)&&0==o.errno&&Array.isArray(o.rst.data)?(e.list=o.rst.data,e.pagination.total=o.rst.pageInfo.total,e.pagination.pages=o.rst.pageInfo.pages):4002!=o.errno&&(e.$message.warning(o.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]])}))()},onChangeTitle:function(e){this.filter.title=e,this.pagination.page=1,this.handleGetList()},onChangeStatus:function(e){this.filter.status=e||0===e?e:"",this.pagination.page=1,this.handleGetList()},handleCurrentChange:function(e){this.pagination.page=e,this.handleGetList()},onClickCancelTask:function(e){var t=this,n=e.title,i=e.rule_id;return l()(s.a.mark(function e(){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$confirm("确定关闭【"+n+"】任务吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:t.handleCancelTask(i),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),console.log(e.t0);case 9:case"end":return e.stop()}},e,t,[[0,6]])}))()},handleCancelTask:function(e){var t=this;return l()(s.a.mark(function n(){var i,a,r,o,l;return s.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t.loading=!0,i=""+t.URL.BASEURL+t.URL.license_cancelRenewalJob,a={rule_id:e},n.next=6,t.$axios.post(i,a);case 6:r=n.sent,o=r.data,(l=void 0===o?{}:o)&&0==l.errno?t.$message.success("操作成功"):2708==l.errno&&Array.isArray(l.rst)&&l.rst.length?t.handleShowErrList(l.rst):4002!=l.errno&&t.$message.warning(l.err),t.handleGetList(),n.next=16;break;case 13:n.prev=13,n.t0=n.catch(0),console.log(n.t0);case 16:return n.prev=16,t.loading=!1,n.finish(16);case 19:case"end":return n.stop()}},n,t,[[0,13,16,19]])}))()},isShowCancelTaskBtn:function(e){return[x.v.NOT_EXECUTED,x.v.EXECUTED].includes(e)},onClickUserNum:function(e){this.currentTaskId=e.rule_id,this.createTaskDrawerVisible=!0},onClickCreateBtn:function(){this.currentTaskId="",this.createTaskDrawerVisible=!0},onConfirmCreateTask:function(){this.createTaskDrawerVisible=!1,this.pagination.page=1,this.handleGetList()},onCancelCreateTask:function(){this.createTaskDrawerVisible=!1},handleShowErrList:function(e){this.currentErrList=[].concat(a()(e)),this.errListDialogVisible=!0},onCloseErrList:function(){this.errListDialogVisible=!1,this.currentErrList=[]}}},T={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"license-wrap"},[e._m(0),e._v(" "),n("div",{staticClass:"screenBox"},[n("div",{staticClass:"filter-wrap"},[n("selfInputV2",{attrs:{labelWidth:!0,label_name:"任务名称",placeholder:"请输入"},on:{change:e.onChangeTitle},model:{value:e.filter.title,callback:function(t){e.$set(e.filter,"title",t)},expression:"filter.title"}}),e._v(" "),n("selfChannelV2",{staticStyle:{"margin-right":"10px"},attrs:{type:"licenseTaskStatus",title:"任务状态",labelWidth:!0},on:{change:e.onChangeStatus},model:{value:e.filter.status,callback:function(t){e.$set(e.filter,"status",t)},expression:"filter.status"}})],1),e._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.onClickCreateBtn}},[e._v("新建续期任务")])],1),e._v(" "),n("el-table",{staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:e.height,data:e.list,"tooltip-effect":"dark"}},[n("el-table-column",{attrs:{label:"任务名称",prop:"title","min-width":"200",align:"center",fixed:"left"}}),e._v(" "),n("el-table-column",{attrs:{label:"客服数量",prop:"user_num","min-width":"100",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",{staticClass:"btn c-00b38a",on:{click:function(t){return e.onClickUserNum(i)}}},[e._v(e._s(i.user_num))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"创建时间",prop:"create_time","min-width":"160","show-overflow-tooltip":"",align:"center"}}),e._v(" "),n("el-table-column",{attrs:{label:"任务状态",prop:"status","min-width":"120",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[n("span",{class:{"c-F03F5C":i.status==e.licenseTaskStatusCode.FAILED,"c-00B38A":i.status==e.licenseTaskStatusCode.COMPLETED}},[e._v(e._s(e.licenseTaskStatusMap.get(i.status)||"-"))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"异常信息",prop:"err_msg","min-width":"240","show-overflow-tooltip":"",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[i.err_msg&&i.err_msg.length?n("div",e._l(i.err_msg,function(t,i){return n("div",{key:i},[e._v(e._s(t))])}),0):n("div",[e._v(" - ")])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作","min-width":"160",align:"center",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[e.isShowCancelTaskBtn(i.status)?n("span",{staticClass:"btn c-00b38a",on:{click:function(t){return e.onClickCancelTask(i)}}},[e._v("关闭任务")]):n("span",[e._v(" - ")])]}}])})],1),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[n("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(" "),n("createTaskDrawer",{attrs:{rule_id:e.currentTaskId},on:{confirm:e.onConfirmCreateTask,cancel:e.onCancelCreateTask},model:{value:e.createTaskDrawerVisible,callback:function(t){e.createTaskDrawerVisible=t},expression:"createTaskDrawerVisible"}}),e._v(" "),n("errListDialog",{attrs:{dialogVisible:e.errListDialogVisible,list:e.currentErrList},on:{close:e.onCloseErrList}})],1)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"self-hint"},[t("i",{staticClass:"el-icon-message-solid"}),this._v(" "),t("div",[t("p",[this._v("许可续期仅可为购买过许可的客服续期")]),this._v(" "),t("p",[this._v("在系统提交续期任务后,仍然需要通过购买许可流程发送申请邮件以及付款")]),this._v(" "),t("p",[this._v("取消任务仅可取消还未支付的订单,已经支付的不可以取消,只能走退款流程")])])])}]};var L=n("VU/8")(y,T,!1,function(e){n("mQ37")},"data-v-7365ad39",null);t.default=L.exports},"0y0z":function(e,t){},"f/PY":function(e,t){},mQ37:function(e,t){}});
|