|
|
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-8b27","chunk-9e99","chunk-1409","chunk-5b3b"],{"+CdH":function(t,e,i){"use strict";var a=i("jc+C");i.n(a).a},"/G0b":function(t,e,i){"use strict";var a=i("m1cH"),s=i.n(a),n=i("KTTK"),l=i("6iAj"),o=i("4XAY"),c=i("7Dod"),r=i("7Qib"),d=i("mkuN"),u=i("zMq1"),m=i("ye9D"),h=i("NYF1"),p=i("YIeP"),v=i("ZoMv"),f={name:"LogEditDialog",components:{CrmRelative:d.a,AddImageList:u.a,AddFileList:m.a,AddRelateList:h.a,CommonWords:p.a},props:{visible:{type:Boolean,required:!0,default:!1},data:Object},data:function(){return{loading:!1,crmType:"",content:"",imgFiles:[],businessAction:{},files:[],showBusinessPopover:!1,business:[],contacts:[],selectContactsId:"",followTypes:[],followType:"",next_time:"",showRelativeType:"",batchId:""}},computed:{autosize:function(){return{minRows:4,maxRows:8}},id:function(){return this.data?this.data.activity_type_id:""},showBusiness:function(){return"customer"==this.crmType},showContacts:function(){return this.showBusiness}},watch:{visible:{handler:function(t){if(t){var e=v.a.convertTypeToKey(this.data.activity_type);this.crmType!=e&&(this.crmType=e),this.handleDetailInfo(Object(r.t)(this.data))}},immediate:!0,deep:!0},id:{handler:function(){this.businessAction={type:"condition",data:{moduleType:this.crmType,customerId:this.id}}},immediate:!0}},created:function(){},beforeDestroy:function(){},methods:{handleDetailInfo:function(t){var e=this;this.showContacts&&this.getContactsList(),0==this.followTypes.length&&this.getLogTypeList(),this.content=t.content,this.imgFiles=t.imgList||[];var i=t.fileList||[];this.files=i.map(function(t){return t.icon=e.getFileTypeIcon(t.name),t});var a=t.business_list||[];this.business=a.map(function(t){return{businessName:t.name,business_id:t.business_id}}),this.selectContactsId=t.contacts_ids&&parseInt(t.contacts_ids),this.followType=t.category,this.next_time=t.next_time,this.batchId=t.batchId},getFileTypeIcon:function(t){if(!t)return"";var e=t?t.split("."):[],i="";return i=e.length>0?e[e.length-1]:"",Object(r.n)(i)},getLogTypeList:function(){var t=this;Object(l.r)().then(function(e){t.followTypes=e.data.map(function(t){return{value:t,label:t}})}).catch(function(){})},getContactsList:function(){var t=this;Object(c.y)({customer_id:this.id}).then(function(e){t.contacts=e.data.list}).catch(function(){})},getDefalutFollowType:function(){this.followTypes&&this.followTypes.length>0?this.followType=this.followTypes[0].value:this.followType=""},resetInfo:function(){this.next_time="",this.content="",this.imgFiles=[],this.files=[],this.business=[],this.selectContactsId=this.contactsId||"",this.showRelativeType="",this.batchId="",this.getDefalutFollowType()},commonWordsSelect:function(t){var e=this;this.content?this.$confirm("您选中的常用语将覆盖当前填写内容?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",customClass:"is-particulars"}).then(function(){e.content=t}).catch(function(){}):this.content=t},checkRelativeInfos:function(t){"business"==this.showRelativeType&&(this.business=t.data)},barClick:function(t){this.showRelativeType=t,"business"==t?this.showBusinessPopover=!0:"file"==t?this.$refs.fileInput.click():"img"==t&&this.$refs.imgInput.click()},uploadFile:function(t){var e=t.target.files;if(e.length){for(var i=0;i<e.length;i++){if(-1==e[i].type.indexOf("image")&&"img"==this.showRelativeType)return void this.$message.error("请上传正确的文件类型")}for(var a="image/*"==t.target.accept?"img":"file",s=0;s<e.length;s++){var n=e[s];this.uploadFileRequest(n,a)}t.target.value=""}},uploadFileRequest:function(t,e,i){var a=this;this.$wkUploadFile.upload({file:t,params:{type:e,batchId:this.batchId}}).then(function(s){var n=s.res.data||{};n.size=Object(r.h)(t.size),"img"==e?a.imgFiles.push(n):(n.icon=Object(r.o)(t),a.files.push(n)),i&&i()}).catch(function(){})},deleteImage:function(t,e){this.deleteImgOrFile("image",t,e)},deleteFile:function(t,e){this.deleteImgOrFile("file",t,e)},deleteImgOrFile:function(t,e,i){var a=this;this.$confirm("确定删除?","提示",{confirmButtonText:"<EFBFBD><EFBFBD>
|