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.
1 line
92 KiB
1 line
92 KiB
4 years ago
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2f67","chunk-fe5f","chunk-c820","chunk-9f2d","chunk-0d43","chunk-4b80","chunk-9f2d2","chunk-9f2d23","chunk-9f2d238","chunk-7d61","chunk-e082","chunk-91b7"],{"/G0b":function(t,e,i){"use strict";var s=i("m1cH"),n=i.n(s),a=i("KTTK"),o=i("6iAj"),l=i("4XAY"),c=i("7Dod"),r=i("7Qib"),u=i("mkuN"),d=i("zMq1"),p=i("ye9D"),h=i("NYF1"),m=i("YIeP"),f=i("ZoMv"),v={name:"LogEditDialog",components:{CrmRelative:u.a,AddImageList:d.a,AddFileList:p.a,AddRelateList:h.a,CommonWords:m.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=f.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 s=t.business_list||[];this.business=s.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(o.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 s="image/*"==t.target.accept?"img":"file",n=0;n<e.length;n++){var a=e[n];this.uploadFileRequest(a,s)}t.target.value=""}},uploadFileRequest:function(t,e,i){var s=this;this.$wkUploadFile.upload({file:t,params:{module_id:this.id,module:"crm_"+this.crmType,type:e,batchId:this.batchId}}).then(function(n){var a=n.res.data||{};a.size=Object(r.h)(t.size),"img"==e?s.imgFiles.push(a):(a.icon=Object(r.o)(t),s.files.push(a)),i&&i()}).catch(function(){})},deleteImage:function(t,e){this.deleteImgOrFile("image",t,e)},deleteFile:function(t,e){this.deleteImgOrFile("file",t,e)},deleteImgOr
|