You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wkcrm/static/js/chunk-ddd6.c7eb1c0f.js

1 line
109 KiB

3 years ago
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-ddd6"],{"+lNB":function(e,t,i){"use strict";var a=i("8GhS"),s=i("7Dod"),n=i("AAeT"),l=i("ERJp"),o=i("d9x6"),c=i("c2Co"),r=i("Y4Le"),d=i("1DpC"),u=i("VcMt"),h={name:"TransferHandle",components:{XhUserCell:a.p},mixins:[],props:{dialogVisible:{type:Boolean,required:!0,default:!1},crmType:{type:String,default:""},selectionList:{type:Array,default:function(){return[]}}},data:function(){return{loading:!1,visible:!1,usersList:[],removeType:1,handleType:1,addsTypes:[]}},computed:{showRemoveType:function(){return"leads"!=this.crmType&&"contacts"!=this.crmType&&"receivables"!=this.crmType&&"product"!=this.crmType&&"invoice"!=this.crmType}},watch:{dialogVisible:{handler:function(e){this.visible=e,e||this.resetData()},deep:!0,immediate:!0}},mounted:function(){this.visible=this.dialogVisible},methods:{resetData:function(){this.usersList=[],this.removeType=1,this.handleType=1,this.addsTypes=[]},handleCancel:function(){this.visible=!1,this.$emit("update:dialogVisible",!1)},userChage:function(e){this.usersList=e.value},handleConfirm:function(){var e=this;0===this.usersList.length?this.$message.error("请选择变更负责人"):(this.loading=!0,this.getRequest()(this.getParams()).then(function(t){e.$message({type:"success",message:"操作成功"}),e.loading=!1,e.handleCancel(),"customer"!=e.crmType&&"contract"!=e.crmType&&"leads"!=e.crmType||e.$store.dispatch("GetMessageNum"),e.$emit("handle",{type:"transfer"})}).catch(function(){e.loading=!1}))},getRequest:function(){return"leads"===this.crmType?c.m:"customer"===this.crmType?s.W:"contacts"===this.crmType?n.n:"business"===this.crmType?l.r:"contract"===this.crmType?o.o:"receivables"===this.crmType?d.k:"product"===this.crmType?r.m:"invoice"===this.crmType?u.l:void 0},getParams:function(){var e=this,t=this.usersList[0].id,i={is_remove:this.removeType};return 2===this.removeType&&(i.type=this.handleType),i.owner_user_id=t,i[this.crmType+"_id"]=this.selectionList.map(function(t){return t[e.crmType+"_id"]}),"customer"===this.crmType&&(i.types=this.addsTypes),i}}},m=(i("OwoT"),i("KHd+")),p=Object(m.a)(h,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{visible:e.visible,"append-to-body":!0,"close-on-click-modal":!1,title:"批量转移",width:"450px"},on:{"update:visible":function(t){e.visible=t},close:e.handleCancel}},[i("div",{staticClass:"handle-box"},[i("flexbox",{staticClass:"handle-item"},[i("div",{staticClass:"handle-item-name"},[e._v("变更负责人为:")]),e._v(" "),i("xh-user-cell",{staticClass:"handle-item-content",attrs:{value:e.usersList},on:{"value-change":e.userChage}})],1),e._v(" "),e.showRemoveType?i("flexbox",{staticClass:"handle-item"},[i("div",{staticClass:"handle-item-name"},[e._v("将原负责人:")]),e._v(" "),i("el-radio-group",{model:{value:e.removeType,callback:function(t){e.removeType=t},expression:"removeType"}},[i("el-radio",{attrs:{label:1}},[e._v("移出")]),e._v(" "),i("el-radio",{attrs:{label:2}},[e._v("转为团队成员")])],1)],1):e._e(),e._v(" "),2==e.removeType?i("flexbox",{staticClass:"handle-item"},[i("div",{staticClass:"handle-item-name"},[e._v("权限:")]),e._v(" "),i("el-radio-group",{model:{value:e.handleType,callback:function(t){e.handleType=t},expression:"handleType"}},[i("el-radio",{attrs:{label:1}},[e._v("只读")]),e._v(" "),i("el-radio",{attrs:{label:2}},[e._v("读写")])],1)],1):e._e(),e._v(" "),"customer"===e.crmType?i("flexbox",{staticClass:"handle-item"},[i("div",{staticClass:"handle-item-name"},[e._v("同时变更负责人至:")]),e._v(" "),i("el-checkbox-group",{model:{value:e.addsTypes,callback:function(t){e.addsTypes=t},expression:"addsTypes"}},[i("el-checkbox",{attrs:{label:"crm_contacts"}},[e._v("联系人")]),e._v(" "),i("el-checkbox",{attrs:{label:"crm_business"}},[e._v("商机")]),e._v(" "),i("el-checkbox",{attrs:{label:"crm_contract"}},[e._v("合同")])],1)],1):e._e()],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},sl