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-3a2c.7da21873.js

1 line
159 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-3a2c","chunk-5b3b","chunk-41ed"],{"/G0b":function(e,t,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"),h=i("ye9D"),p=i("NYF1"),m=i("YIeP"),f=i("ZoMv"),v={name:"LogEditDialog",components:{CrmRelative:u.a,AddImageList:d.a,AddFileList:h.a,AddRelateList:p.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(e){if(e){var t=f.a.convertTypeToKey(this.data.activity_type);this.crmType!=t&&(this.crmType=t),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(e){var t=this;this.showContacts&&this.getContactsList(),0==this.followTypes.length&&this.getLogTypeList(),this.content=e.content,this.imgFiles=e.imgList||[];var i=e.fileList||[];this.files=i.map(function(e){return e.icon=t.getFileTypeIcon(e.name),e});var s=e.business_list||[];this.business=s.map(function(e){return{businessName:e.name,business_id:e.business_id}}),this.selectContactsId=e.contacts_ids&&parseInt(e.contacts_ids),this.followType=e.category,this.next_time=e.next_time,this.batchId=e.batchId},getFileTypeIcon:function(e){if(!e)return"";var t=e?e.split("."):[],i="";return i=t.length>0?t[t.length-1]:"",Object(r.n)(i)},getLogTypeList:function(){var e=this;Object(o.r)().then(function(t){e.followTypes=t.data.map(function(e){return{value:e,label:e}})}).catch(function(){})},getContactsList:function(){var e=this;Object(c.y)({customer_id:this.id}).then(function(t){e.contacts=t.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(e){var t=this;this.content?this.$confirm("您选中的常用语将覆盖当前填写内容?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",customClass:"is-particulars"}).then(function(){t.content=e}).catch(function(){}):this.content=e},checkRelativeInfos:function(e){"business"==this.showRelativeType&&(this.business=e.data)},barClick:function(e){this.showRelativeType=e,"business"==e?this.showBusinessPopover=!0:"file"==e?this.$refs.fileInput.click():"img"==e&&this.$refs.imgInput.click()},uploadFile:function(e){var t=e.target.files;if(t.length){for(var i=0;i<t.length;i++){if(-1==t[i].type.indexOf("image")&&"img"==this.showRelativeType)return void this.$message.error("请上传正确的文件类型")}for(var s="image/*"==e.target.accept?"img":"file",n=0;n<t.length;n++){var a=t[n];this.uploadFileRequest(a,s)}e.target.value=""}},uploadFileRequest:function(e,t,i){var s=this;this.$wkUploadFile.upload({file:e,params:{type:t,batchId:this.batchId}}).then(function(n){var a=n.res.data||{};a.size=Object(r.h)(e.size),"img"==t?s.imgFiles.push(a):(a.icon=Object(r.o)(e),s.files.push(a)),i&&i()}).catch(function(){})},deleteImage:function(e,t){this.deleteImgOrFile("image",e,t)},deleteFile:function(e,t){this.deleteImgOrFile("file",e,t)},deleteImgOrFile:function(e,t,i){var s=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(a.c)({module:"crm_"+s.crmType,module_id:t.file_id,save_name:t.save_name}).then(function(t){"image"==e?s.imgFiles.splice(i,1):s.files.splice(i,1),s.$message.success("操作成功")}).catch(function(){})}).catch(function(){})},deleteAllFile:function(e){var t=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(a.e)({module:"crm_"+t.crmType,module_id:t.id,file_id:[].concat(n()(t.imgFiles.map(function(e){return e.file_id})),n()(t.files.map(function(e){return e.file_id}))),batchId:t.batchId,type:e}).then(function(i){2==e?t.imgFiles=[]:t.files=[],t.$message.success("操作成功")}).catch(function(){})}).catch(function(){})},deleteRelate:function(e,t){this.business.splice(t,1)},inputFocus:function(){var e=this;this.$nextTick(function(){e.$refs.textarea.focus(),e.$emit("focus")})},handleConfirm:function(){var e=this;if(this.content){var t={};t.activity_id=this.data.activity_id,t.activity_type=this.data.activity_type,t.activity_type_id=this.id,t.content=this.content,t.category=this.followType,t.file_id=[].concat(n()(this.imgFiles.map(function(e){return e.file_id})),n()(this.files.map(function(e){return e.file_id})));var i=this.business.map(function(e){return e.business_id||e.id});t.batchId=this.batchId,t.business_ids=i,t.contacts_ids=this.contacts_id,t.next_time=this.next_time||"",t.is_event=0,this.loading=!0,Object(l.e)(t).then(function(t){e.loading=!1,e.$message.success("编辑成功"),e.$emit("save",t.data),e.handleCancel()}).catch(function(){e.loading=!1})}else this.$message.error("请输入跟进内容")},handleCancel:function(){this.$emit("update:visible",!1)}}},y=(i("uX/8"),i("KHd+")),_=Object(y.a)(v,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:"700px","custom-class":"no-padding-dialog"},on:{close:e.handleCancel}},[i("div",{staticClass:"mix-content"},[i("div",{staticClass:"mix-content__body"},[i("div",{staticClass:"mix-content-select"},[e.showContacts?i("el-select",{attrs:{clearable:"",placeholder:"选择联系人"},model:{value:e.selectContactsId,callback:function(t){e.selectContactsId=t},expression:"selectContactsId"}},e._l(e.contacts,function(e){return i("el-option",{key:e.contacts_id,attrs:{label:e.name,value:e.contacts_id}})})):e._e(),e._v(" "),i("el-select",{attrs:{clearable:"",placeholder:"选择跟进方式"},model:{value:e.followType,callback:function(t){e.followType=t},expression:"followType"}},e._l(e.followTypes,function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),e._v(" "),i("el-date-picker",{attrs:{editable:!1,type:"datetime",placeholder:"选择下次联系时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.next_time,callback:function(t){e.next_time=t},expression:"next_time"}}),e._v(" "),i("common-words",{on:{select:e.commonWordsSelect}})],1),e._v(" "),i("div",{staticClass:"i-cont"},[i("el-input",{ref:"textarea",attrs:{autosize:e.autosize,maxlength:800,type:"textarea",clearable:"",resize:"none",placeholder:"请输入内容"},on:{focus:e.inputFocus},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}})],1),e._v(" "),e.imgFiles.length>0?i("add-image-list",{attrs:{data:e.imgFiles},on:{delete:e.deleteImage,"delete-all":function(t){e.deleteAllFile(2)},upload:e.uploadFile}}):e._e(),e._v(" "),e.files.length>0?i("add-file-list",{attrs:{data:e.files},on:{delete:e.deleteFile,"delete-all":function(t){e.deleteAllFile(1)}}}):e._e(),e._v(" "),e.business.length>0?i("add-relate-list",{attrs:{data:e.business,type:"business"},on:{delete:e.deleteRelate}}):e._e()],1),e._v(" "),i("div",{staticClass:"bar-cont"},[i("el-button",{staticClass:"handle-button",attrs:{type:"text",icon:"wk wk-picture"},on:{click:function(t){e.barClick("img")}}},[e._v("图片")]),e._v(" "),i("el-button",{staticClass:"handle-button",attrs:{type:"text",icon:"wk wk-file"},on:{click:function(t){e.barClick("file")}}},[e._v("附件")]),e._v(" "),e.showBusiness?i("el-popover",{attrs:{placement:"bottom",width:"700","popper-class":"no-padding-popover",trigger:"click"},model:{value:e.showBusinessPopover,callback:function(t){e.showBusinessPopover=t},expression:"showBusinessPopover"}},[i("crm-relative",{ref:"crmrelative",attrs:{show:e.showBusinessPopover,radio:!1,action:e.businessAction,"selected-data":{business:e.business},"crm-type":"business"},on:{close:function(t){e.showBusinessPopover=!1},changeCheckout:e.checkRelativeInfos}}),e._v(" "),i("el-button",{staticClass:"handle-button",staticStyle:{"margin-left":"10px"},attrs:{slot:"reference",type:"text",icon:"wk wk-associate"},on:{click:function(t){e.barClick("business")}},slot:"reference"},[e._v("关联商机")])],1):e._e()],1),e._v(" "),i("input",{ref:"fileInput",staticClass:"file-input",attrs:{accept:"*.*",type:"file",multiple:""},on:{change:e.uploadFile}}),e._v(" "),i("input",{ref:"imgInput",staticClass:"file-input",attrs:{accept:"image/*",type:"file",multiple:""},on:{change:e.uploadFile}})]),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{nativeOn:{click:function(t){return e.handleCancel(t)}}},[e._v("取消")]),e._v(" "),i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:e.handleConfirm,expression:"handleConfirm"}],attrs:{type:"primary"}},[e._v("确定")])],1)])},[],!1,null,"6939bfe3",null);_.options.__file="LogEditDialog.vue";t.a=_.exports},"0IZ6":function(e,t,i){"use strict";var s=i("bmyS");i.n(s).a},"1r1B":function(e,t,i){},"1w5D":function(e,t,i){"use strict";var s=i("Nx4I");i.n(s).a},"3Byl":function(e,t,i){"use strict";var s=i("J8i2");i.n(s).a},"577y":function(e,t,i){"use strict";var s=i("Jz0M");i.n(s).a},"5QVi":function(e,t,i){"use strict";var s=i("QbLZ"),n=i.n(s),a=i("L2JU"),o=i("ZoMv"),l=i("8OTK"),c=i("7Dod"),r=i("WGjG"),u={name:"DuplicateCheck",components:{AllocHandle:r.a,CRMFullScreenDetail:function(){return Promise.all([i.e("chunk-114a"),i.e("chunk-7122"),i.e("chunk-9e99"),i.e("chunk-7a7a"),i.e("chunk-8911")]).then(i.bind(null,"3z7q"))}},props:{visible:{type:Boolean,default:!1}},data:function(){return{loading:!1,typeSelect:"name",searchContent:"",tableData:null,showFullDetail:!1,relationId:"",relationData:{},poolId:"",relationCrmType:"",allocDialogShow:!1}},computed:{showTable:function(){return this.tableData},isCustomerFilter:function(){return"name"==this.typeSelect},fieldList:function(){return this.isCustomerFilter?[{prop:"name",label:"客户名称",width:200},{prop:"create_time",label:"创建时间",width:160},{prop:"owner_user_name",label:"负责人",width:100},{prop:"last_time",label:"最后跟进时间",width:160},{prop:"module",label:"模块",width:100}]:[{prop:"mobile",label:"手机号/电话",width:160},{prop:"contacts_name",label:"联系人",width:160},{prop:"name",label:"客户名称",width:200},{prop:"owner_user_name",label:"负责人",width:100},{prop:"module",label:"模块",width:100}]}},watch:{typeSelect:function(){this.searchContent="",this.tableData=null}},mounted:function(){},methods:{handleClose:function(){this.$emit("update:visible",!1),this.resetData()},resetData:function(){this.typeSelect="name",this.searchContent="",this.tableData=null},getList:function(){var e=this;if(this.searchContent){var t={type:this.typeSelect,content:this.searchContent};this.loading=!0,Object(c.a)(t).then(function(t){e.loading=!1;var i=t.data||[];e.tableData=i.map(function(t){return t.poolName&&(t.module=t.module+""+t.poolName+""),e.isCustomerFilter||(t.mobile=e.searchContent,t.type==o.a.contacts&&(t.contactsName=t.name,t.contactsId=t.id,t.name=t.customerName,t.id=t.customerId,t.type=o.a.customer)),t})}).catch(function(){e.loading=!1})}},handleRowClick:function(e,t,i){if("name"==t.property&&e.id){this.relationId=e.id,e.poolAuthList?this.poolId=e.poolAuthList.poolId:this.poolId="";var s=o.a.convertTypeToKey(e.type);this.relationCrmType="pool"==s?"customer":s,this.showFullDetail=!0}else"contacts_name"==t.property&&e.contacts_id&&(this.relationId=e.contacts_id,this.relationCrmType="contacts",this.showFullDetail=!0)},cellClassName:function(e){e.row;var t=e.column;e.rowIndex,e.columnIndex;return"name"===t.property||"contacts_name"===t.property?"can-visit--underline":""},handleClick:function(e,t){var i=this;"receive"===e?this.$confirm("确定要领取该客户吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(c.E)({ids:[t.id],poolId:t.poolAuthList.poolId}).then(function(e){i.$message.success("操作成功"),i.getList()}).catch(function(){})}).catch(function(){}):(t.customerId=t.id,this.relationData=t,this.allocDialogShow=!0)}}},d=(i("cjSm"),i("KHd+")),h=Object(d.a)(u,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{visible:e.visible,"append-to-body":!0,"close-on-click-modal":!1,"before-close":e.handleClose,title:"客户查重","custom-class":"no-padding-dialog",width:"800px"},on:{"update:visible":function(t){e.visible=t}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"duplicate-check",class:{"show-table":e.showTable}},[i("div",[i("el-input",{staticClass:"search-input",nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.getList(t):null}},model:{value:e.searchContent,callback:function(t){e.searchContent=t},expression:"searchContent"}},[i("el-select",{attrs:{slot:"prepend"},slot:"prepend",model:{value:e.typeSelect,callback:function(t){e.typeSelect=t},expression:"typeSelect"}},[i("el-option",{attrs:{label:"按客户名称",value:"name"}}),e._v(" "),i("el-option",{attrs:{label:"按手机号/电话",value:"phone"}})],1),e._v(" "),i("el-button",{attrs:{slot:"append",type:"primary",icon:"wk wk-search"},nativeOn:{click:function(t){return e.getList(t)}},slot:"append"},[e._v("查重")])],1)],1),e._v(" "),e.showTable?i("el-table",{staticClass:"duplicate-check__content",staticStyle:{width:"100%"},attrs:{data:e.tableData,"cell-class-name":e.cellClassName,border:"",height:"380"},on:{"row-click":e.handleRowClick}},[e._l(e.fieldList,function(e,t){return i("el-table-column",{key:t,attrs:{prop:e.prop,label:e.label,"min-width":e.width,"show-overflow-tooltip":""}})}),e._v(" "),i("el-table-column",{attrs:{fixed:"right",width:"110px",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return t.row.poolAuthList?[t.row.poolAuthList.receive?i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){e.handleClick("receive",t.row)}}},[e._v("领取")]):e._e(),e._v(" "),t.row.poolAuthList.distribute?i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){e.handleClick("distribute",t.row)}}},[e._v("分配")]):e._e()]:void 0}}])})],2):e._e(),e._v(" "),e.showTable?i("div",{staticClass:"duplicate-check__footer"},[e._v("注查重结果最多显示10条如不完整请完善查重条件")]):e._e(),e._v(" "),i("c-r-m-full-screen-detail",{attrs:{visible:e.showFullDetail,"crm-type":e.relationCrmType,id:e.relationId,"pool-id":e.poolId},on:{"update:visible":function(t){e.showFullDetail=t},handle:e.getList}}),e._v(" "),i("alloc-handle",{attrs:{"pool-id":e.poolId,"selection-list":[e.relationData],"dialog-visible":e.allocDialogShow,"crm-type":"customer"},on:{"update:dialogVisible":function(t){e.allocDialogShow=t},handle:e.getList}})],1)])},[],!1,null,"65f835b1",null);h.options.__file="index.vue";var p=h.exports,m={name:"CRMListHead",components:{CRMAllCreate:l.default,DuplicateCheck:p},props:{title:{type:String,default:""},placeholder:{type:String,default:"请输入内容"},mainTitle:{type:String,default:""},crmType:{type:String,default:""},isSeas:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!0},search:String,createFun:Function},data:function(){return{inputContent:"",moreTypes:[],createActionInfo:{type:"save"},createCRMType:"",isCreate:!1,dupCheckShow:!1}},computed:n()({},Object(a.b)(["crm"]),{canSave:function(){return!this.isSeas&&this.crm[this.crmType].save},titleIcon:function(){return i("p3hS")("./"+this.crmType+".png")},showDupCheck:function(){return["leads","customer","contacts"].includes(this.crmType)&&!this.isSeas}}),mounted:function(){var e=this;this.crm[this.crmType]&&this.crm[this.crmType].excelimport&&!this.isSeas&&this.moreTypes.push({type:"enter",name:"导入",icon:"import"}),this.crm[this.crmType]&&this.crm[this.crmType].excelexport&&this.moreTypes.push({type:"out",name:"导出",icon:"export"}),this.$bus.on("import-crm-done-bus",function(t){e.crmType==t&&e.$emit("on-handle",{type:"import-crm"})})},beforeDestroy:function(){this.$bus.off("import-crm-done-bus")},methods:{handleTypeDrop:function(e){"out"==e?this.$emit("on-export"):"enter"==e&&this.$bus.emit("import-crm-bus",this.crmType,{ownerSelectShow:!this.isSeas,poolSelectShow:this.isSeas})},createClick:function(){this.createFun?this.createFun():(this.createCRMType=this.crmType,this.createActionInfo={type:"save"},this.isCreate=!this.isCreate)},inputChange:function(){this.$emit("update:search",this.inputContent)},searchInput:function(){this.$emit("on-search",this.inputContent)},createSaveSuccess:function(e){e&&e.createContacts?"customer"==e.type&&(this.createCRMType="contacts",this.createActionInfo={type:"relative",crmType:"customer",data:{}},this.createActionInfo.data.customer=e.data,this.isCreate=!0):this.$emit("on-handle",{type:"save-success"})},hideView:function(){this.isCreate=!1}}},f=(i("mmDs"),Object(d.a)(m,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"c-container"},[e.$slots.icon?e._t("icon"):i("flexbox",{staticClass:"title"},[i("img",{staticClass:"title-icon",attrs:{src:e.titleIcon}}),e._v(e._s(e.title))]),e._v(" "),e.showSearch?i("el-input",{staticClass:"sc-container",attrs:{placeholder:e.placeholder},on:{input:e.inputChange},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.searchInput(t):null}},model:{value:e.inputContent,callback:function(t){e.inputContent=t},expression:"inputContent"}},[i("el-button",{attrs:{slot:"append",type:"primary"},nativeOn:{click:function(t){return e.searchInput(t)}},slot:"append"},[e._v("搜索")])],1):e._e(),e._v(" "),i("div",{staticClass:"right-container"},[e.canSave?i("el-button",{staticClass:"xr-btn--orange",attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.createClick}},[e._v(e._s(e.mainTitle))]):e._e(),e._v(" "),e.showDupCheck?i("el-button",{staticClass:"dup-check-btn",on:{click:function(t){e.dupCheckShow=!0}}},[e._v("查重")]):e._e(),e._v(" "),e.moreTypes.length>0?i("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handleTypeDrop}},[i("el-button",{attrs:{icon:"el-icon-more"}}),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.moreTypes,function(t,s){return i("el-dropdown-item",{key:s,attrs:{icon:e._f("wkIconPre")(t.icon),command:t.type}},[e._v(e._s(t.name))])}))],1):e._e()],1),e._v(" "),e.isCreate?i("c-r-m-all-create",{attrs:{"crm-type":e.createCRMType,action:e.createActionInfo},on:{"save-success":e.createSaveSuccess,close:e.hideView}}):e._e(),e._v(" "),i("duplicate-check",{attrs:{visible:e.dupCheckShow},on:{"update:visible":function(t){e.dupCheckShow=t}}})],2)},[],!1,null,"9a906ecc",null));f.options.__file="CRMListHead.vue";var v=f.exports,y=i("YEIV"),_=i.n(y),g=i("4XAY"),b=i("c2Co"),w=i("AAeT"),C=i("ERJp"),k=i("d9x6"),x=i("1DpC"),T=i("Y4Le"),I=i("zhwh"),S=i("TAVA"),D=i("j4Q1"),L={name:"SceneList",components:{},props:{crmType:{type:String,default:""}},data:function(){return{sceneSelectId:-1,sceneList:[]}},computed:n()({},Object(a.b)(["crm"])),watch:{},mounted:function(){this.crm[this.crmType].index&&this.getSceneList()},methods:{getSceneList:function(){var e=this;Object(g.s)({types:o.a[this.crmType]}).then(function(t){var i=t.data.list.filter(function(e,t){return 1===e.is_default});if(i&&i.length>0){var s=i[0];e.sceneSelectId=s.scene_id,e.$emit("scene",{id:s.scene_id,name:s.name,bydata:s.bydata||""})}else e.sceneSelectId="",e.$emit("scene",{id:"",name:"",bydata:""});e.sceneList=t.data.list}).catch(function(){e.$emit("scene",{id:"",name:"",bydata:""})})},selectScene:function(e,t){this.sceneSelectId=e.scene_id,this.$emit("scene",{id:e.scene_id,name:e.name,bydata:e.bydata}),this.$emit("hidden-scene")},addScene:function(){this.$emit("scene-handle",{type:"add"})},setScene:function(){this.$emit("scene-handle",{type:"set"})}}},O=(i("3Byl"),Object(d.a)(L,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"scene-container"},[i("div",{staticClass:"scene-list"},e._l(e.sceneList,function(t,s){return i("div",{key:s,staticClass:"scene-list-item",class:{"scene-list-item-select":t.scene_id==e.sceneSelectId},on:{click:function(i){e.selectScene(t,s)}}},[e._v("\n "+e._s(t.name)+"\n ")])})),e._v(" "),i("div",{staticClass:"handle-interval"},[i("flexbox",{staticClass:"handle-button",nativeOn:{click:function(t){return e.addScene(t)}}},[i("i",{staticClass:"wk wk-add handle-button-icon"}),e._v(" "),i("div",{staticClass:"handle-button-name"},[e._v("新建场景")])]),e._v(" "),i("flexbox",{staticClass:"handle-button",nativeOn:{click:function(t){return e.setScene(t)}}},[i("i",{staticClass:"wk wk-manage handle-button-icon"}),e._v(" "),i("div",{staticClass:"handle-button-name"},[e._v("管理")])])],1)])},[],!1,null,"0e18b384",null));O.options.__file="SceneList.vue";var A=O.exports,j=i("t2rG"),N=i.n(j),$=i("EJiy"),F=i.n($),M=i("KTTK"),E=i("6iAj"),P=i("8GhS"),B=i("Woz+"),V=i("7Qib"),R=i("QEKj"),H={name:"SceneCreate",components:{XhUserCell:P.p,XhProuctCate:P.j,VDistpicker:B.a,XhStructureCell:P.n},mixins:[R.a],props:{dialogVisible:{type:Boolean,required:!0,default:!1},fieldList:{type:Array,required:!0,default:function(){return[]}},obj:{type:Object,required:!0,default:function(){return{}}},crmType:{type:String,default:""},name:{type:String,default:""},isDefault:{type:Boolean,default:!1},edit_id:{type:String,default:""}},data:function(){return{form:[],visible:!1,showErrors:!1,saveDefault:!1,saveName:null}},watch:{dialogVisible:{handler:function(e){var t=this;if(e){if(this.edit_id){this.form=[];var i=function(e){var i=t.obj.obj[e],s=t.getItem();if(s.field=i.type,s.form_type=i.form_type,s.type=e,t.getAdvancedFilterOptions(i.form_type).forEach(function(e){i.condition===e.value&&(s.condition=e.value)}),"checkbox"!==s.form_type&&"select"!==s.form_type&&"deal_status"!==s.form_type&&"check_status"!==s.form_type||(s.setting=t.getEditSetting(s.form_type,s.field)),"date"==i.form_type)s.value=i.value;else if("datetime"==i.form_type)s.value=i.value;else if("business_type"==i.form_type){if(s.type_id=i.value[0],s.status_id=i.value.length>1?i.value[1]:null,s.typeOption=t.getEditSetting(s.form_type,s.field),i.type_id){var n=s.typeOption.find(function(e){return e.type_id===i.type_id});s.statusOption=n?n.statusList:[]}}else if("user"==i.form_type||"single_user"==i.form_type)s.value=[],t.getEditUserValue(s,i.value[0]);else if("structure"==i.form_type)s.value=[],t.getEditDepValue(s,i.value[0]);else if("checkbox"==i.form_type)s.value=i.value;else if("select"==i.form_type)"string"!=t.getSettingValueType(s.setting)?s.value=i.value[0]:s.value=i.value;else if("category"==i.form_type)s.value=[],t.getProductCategoryValue(s,i.value[0]);else if("map_address"==i.form_type){var a=i.value[0].split(",");s.address={state:a.length>0?a[0]:"",city:a.length>1?a[1]:"",area:a.length>2?a[2]:""}}else s.setting=i.setting,s.value=i.value;t.form.push(s)};for(var s in this.obj.obj)i(s)}else this.form=Object(V.t)(this.obj.form),0==this.form.length&&this.form.push(this.getItem());this.name?this.saveName=this.name:this.saveName="",this.isDefault?this.saveDefault=this.isDefault:this.saveDefault=!1}this.visible=this.dialogVisible},deep:!0,immediate:!0},form:function(){this.$nextTick(function(){var e=document.getElementById("scene-filter-container");e.scrollTop=e.scrollHeight})}},methods:{getEditSetting:function(e,t){var i=this.fieldList.find(function(i){return i.form_type==e&&i.field==t});return i?i.setting:[]},getEditUserValue:function(e,t){t&&Object(M.w)({pageType:0}).then(function(i){for(var s=i.data||[],n=0;n<s.length;n++){var a=s[n];if(a.userId==t){e.value=[a];break}}}).catch(function(){})},getEditDepValue:function(e,t){t&&Object(M.j)().then(function(i){for(var s=i.data||[],n=0;n<s.length;n++){var a=s[n];if(a.id==t){e.value=[a];break}}}).catch(function(){})},getProductCategoryValue:function(e,t){var i=this;Object(E.K)().then(function(s){var n=s.data||[],a=[];i.filterProductTree(n,t,a),e.value=a.reverse()}).catch(function(){})},filterProductTree:function(e,t,i){for(var s=0;s<e.length;s++){var n=e[s];if(n.categoryId==t){i.push(t),this.filterProductTree(e,n.pid,i);break}}},selectProvince:function(e,t){t.address.state=e.value},selectCity:function(e,t){t.address.city=e.value},selectArea:function(e,t){t.address.area=e.value},getItem:function(){return{field:"",name:"",type:3,form_type:"",condition:"is",value:"",setting:[],typeOption:[],statusOption:[],type_id:"",status_id:""}},typeOptionsChange:function(e){if(e.type_id){var t=e.typeOption.find(function(t){return t.type_id===e.type_id});e.statusOption=t.statusList||[]}else e.statusOption=[];e.status_id=""},arrayValueChange:function(e){e.value.length>0?(e.item.value=e.value,e.item.valueContent=e.valueContent):e.item.value=[]},selectChange:function(e,t){this.getAdvancedFilterOptions(t.form_type).forEach(function(i){i.value===e&&(t.type=i.type)})},showCalCondition:function(e){return"date"!=e&&"datetime"!=e&&"business_type"!=e&&"category"!=e&&"map_address"!=e},fieldFocus:function(){this.$el.click()},fieldChange:function(e){var t=this.fieldList.find(function(t){return t.field===e.field});t&&(e.form_type=t.form_type,e.name=t.name,"business_type"==e.form_type?(e.typeOption=t.setting,e.statusOption=[],e.type_id="",e.status_id="",e.value=""):"check_status"==e.form_type||"deal_status"==e.form_type?(e.setting=t.setting||[],e.value=""):"map_address"==e.form_type?e.address={state:"",city:"",area:""}:"date"===e.form_type||"datetime"===e.form_type||"user"===e.form_type||"single_user"===e.form_type||"structure"===e.form_type||"category"===e.form_type?e.value=[]:"select"==e.form_type||"checkbox"===e.form_type?(e.setting=t.setting||[],e.value=[]):e.value="","checkbox"==e.form_type||"check_status"==e.form_type||"deal_status"==e.form_type?(e.condition="is",e.type=1):"user"==e.form_type||"single_user"==e.form_type||"structure"==e.form_type?(e.condition="contains",e.type=3):"select"==e.form_type?(e.condition="in",e.type=1):(e.condition="is",e.type=1)),this.getError()},handleCancel:function(){this.visible=!1,this.$emit("update:dialogVisible",!1)},getError:function(){this.showErrors=!1;for(var e=[],t=0;t<this.form.length;t++){var i=this.form[t];if(e.includes(i.field)){this.showErrors=!0;break}e.push(i.field)}},handleConfirm:function(){var e=this;if(this.showErrors)this.$message.error("筛选条件中有重复项!");else if(this.saveName&&""!==this.saveName){for(var t=0;t<this.form.length;t++){var i=this.form[t];if(!i.field||""===i.field)return void this.$message.error("要筛选的字段名称不能为空!");if("business_type"==i.form_type){if(!i.type_id&&!i.status_id)return void this.$message.error("筛选内容不能为空!")}else if("map_address"==i.form_type){if(!i.address.state&&!i.address.city&&!i.address.area)return void this.$message.error("筛选内容不能为空!")}else if("date"==i.form_type||"datetime"==i.form_type||"user"==i.form_type||"single_user"==i.form_type||"structure"==i.form_type||"category"==i.form_type||"checkbox"==i.form_type){if(!i.value||0===i.value.length)return void this.$message.error("筛选内容不能为空!")}else if(""===i.value||void 0===i.value||null===i.value)return void this.$message.error("筛选内容不能为空!")}var s=[];this.form.forEach(function(t){if("datetime"==t.form_type||"date"==t.form_type)s.push({condition:t.condition,form_type:t.form_type,name:t.name,type:t.field,value:t.value,start:new Date(t.value[0]).getTime()/1e3,end:new Date(t.value[1]).getTime()/1e3});else if("business_type"==t.form_type)s.push({type_id:t.type_id,status_id:t.status_id,type:t.field,form_type:t.form_type,name:t.status_id?"status_id":"type_id"});else if("user"==t.form_type||"single_user"==t.form_type)s.push({condition:t.condition,type:t.field,value:[t.value[0].id],form_type:t.form_type,name:t.name});else if("structure"==t.form_type)s.push({condition:t.condition,type:t.field,value:[t.value[0].id],form_type:t.form_type,name:t.name});else if("checkbox"==t.form_type)s.push({condition:t.condition,type:t.field,value:t.value,form_type:t.form_type,name:t.name});else if("category"==t.form_type)s.push({condition:t.condition,value:[t.value[t.value.length-1]],form_type:t.form_type,name:t.name,type:t.field});else if("select"==t.form_type){var i=t.value;"string"!=e.getSettingValueType(t.setting)&&(i=[t.value]),s.push({condition:t.condition,type:t.field,value:i,form_type:t.form_type,name:t.name})}else if("map_address"==t.form_type)s.push({condition:t.condition,value:t.address,form_type:t.form_type,name:t.name,type:t.field});else{var n=[];if("string"==typeof t.value)n=t.value.replace(//g,";").split(";").filter(function(e){return""!==e&&null!==e});else n=[t.value];s.push({type:t.field,value:n,form_type:t.form_type,name:t.name,condition:t.condition})}});var n={obj:s,form:this.form,saveDefault:this.saveDefault,saveName:this.saveName};this.requestCreateScene(n)}else this.$message.error("场景名称不能为空!")},requestCreateScene:function(e){var t=this;this.edit_id?Object(g.w)({is_default:e.saveDefault?1:0,name:e.saveName,id:this.edit_id,types:o.a[this.crmType],data:e.obj.map(function(e){return _()({},e.type,e)})}).then(function(e){t.$message({type:"success",message:"编辑成功"}),t.$emit("save-success"),t.handleCancel()}).catch(function(){}):Object(g.t)({types:o.a[this.crmType],is_default:e.saveDefault?1:0,name:e.saveName,data:e.obj.map(function(e){return _()({},e.type,e)})}).then(function(e){t.$emit("save-success"),t.$message({type:"success",message:"创建成功"}),t.handleCancel()}).catch(function(){})},handleAdd:function(){this.form.push(this.getItem())},handleDelete:function(e){var t=this;this.$confirm("您确定要删除这一条数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.form.splice(e,1),t.getError()}).catch(function(){})},getSettingValueType:function(e){if(e&&e.length>0){var t=e[0];return void 0===t?"undefined":F()(t)}return[]}}},z=(i("577y"),Object(d.a)(H,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{title:e.edit_id?"编辑场景":"新建场景",visible:e.visible,"close-on-click-modal":!1,"append-to-body":!0,width:"800px"},on:{"update:visible":function(t){e.visible=t},close:e.handleCancel}},[i("div",{staticClass:"scene-name-container"},[i("div",{staticClass:"scene-name"},[e._v("场景名称")]),e._v(" "),i("el-input",{staticClass:"scene-input",attrs:{maxlength:10,placeholder:"请输入场景名称最多10个字符"},model:{value:e.saveName,callback:function(t){e.saveName="string"==typeof t?t.trim():t},expression:"saveName"}})],1),e._v(" "),i("div",{staticClass:"scene-name"},[e._v("筛选条件")]),e._v(" "),i("el-form",{staticClass:"filter-container",attrs:{id:"scene-filter-container"}},[i("el-form-item",[e._l(e.form,function(t,s){return[i("el-row",{key:s},[i("el-col",{attrs:{span:8}},[i("el-select",{attrs:{placeholder:"请选择要筛选的字段名"},on:{change:function(i){e.fieldChange(t)},focus:e.fieldFocus},model:{value:t.field,callback:function(i){e.$set(t,"field",i)},expression:"formItem.field"}},e._l(e.fieldList,function(e){return i("el-option",{key:e.field,attrs:{label:e.name,value:e.field}})}))],1),e._v(" "),e.showCalCondition(t.form_type)?i("el-col",{attrs:{span:1}},[e._v(" ")]):e._e(),e._v(" "),e.showCalCondition(t.form_type)?i("el-col",{attrs:{span:4}},[i("el-select",{attrs:{placeholder:"请选择范围"},on:{change:function(i){e.selectChange(i,t)}},model:{value:t.condition,callback:function(i){e.$set(t,"condition",i)},expression:"formItem.condition"}},e._l(e.getAdvancedFilterOptions(t.form_type),function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1):e._e(),e._v(" "),"business_type"==t.form_type?i("el-col",{attrs:{span:1}},[e._v(" ")]):e._e(),e._v(" "),"business_type"==t.form_type?i("el-col",{attrs:{span:4}},[i("el-select",{on:{change:function(i){e.typeOptionsChange(t)}},model:{value:t.type_id,callback:function(i){e.$set(t,"type_id",i)},expression:"formItem.type_id"}},e._l(t.typeOption,function(e){return i("el-option",{key:e.type_id,attrs:{label:e.name,value:e.type_id}})}))],1):e._e(),e._v(" "),i("el-col",{attrs:{span:1}},[e._v(" ")]),e._v(" "),i("el-col",{attrs:{span:"datetime"===t.form_type||"date"===t.form_type||"map_address"===t.form_type?13:8}},["check_status"===t.form_type||"deal_status"===t.form_type||"select"===t.form_type&&"string"!=e.getSettingValueType(t.setting)?i("el-select",{attrs:{placeholder:"请选择筛选条件"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}},e._l(t.setting,function(e){return i("el-option",{key:e,attrs:{label:e,value:e}})})):"select"===t.form_type||"checkbox"===t.form_type?i("el-select",{attrs:{multiple:"",placeholder:"请选择筛选条件"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}},e._l(t.setting,function(e){return i("el-option",{key:e,attrs:{label:e,value:e}})})):"date"===t.form_type||"datetime"===t.form_type?i("el-date-picker",{staticStyle:{padding:"0px 10px"},attrs:{"value-format":"date"===t.form_type?"yyyy-MM-dd":"yyyy-MM-dd HH:mm:ss",type:"date"===t.form_type?"daterange":"datetimerange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}}):"business_type"===t.form_type?i("el-select",{model:{value:t.status_id,callback:function(i){e.$set(t,"status_id",i)},expression:"formItem.status_id"}},e._l(t.statusOption,function(e){return i("el-option",{key:e.status_id,attrs:{label:e.name,value:e.status_id}})})):"user"===t.form_type||"single_user"===t.form_type?i("xh-user-cell",{attrs:{item:t,"info-params":{m:"crm",c:e.crmType,a:"index"},value:t.value},on:{"value-change":e.arrayValueChange}}):"structure"===t.form_type?i("xh-structure-cell",{attrs:{item:t,value:t.value},on:{"value-change":e.arrayValueChange}}):"category"===t.form_type?i("xh-prouct-cate",{attrs:{item:t,value:t.value},on:{"value-change":e.arrayValueChange}}):"map_address"===t.form_type?i("v-distpicker",{attrs:{province:t.address.state,city:t.address.city,area:t.address.area},on:{province:function(i){e.selectProvince(i,t)},city:function(i){e.selectCity(i,t)},area:function(i){e.selectArea(i,t)}}}):i("el-input",{attrs:{placeholder:"多个条件请用;隔开"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}})],1),e._v(" "),i("el-col",{staticClass:"delete",attrs:{span:1}},[i("i",{staticClass:"el-icon-error delete-btn",on:{click:function(t){e.handleDelete(s)}}})])],1)]})],2)],1),e._v(" "),i("p",{directives:[{name:"show",rawName:"v-show",value:e.showErrors,expression:"showErrors"}],staticClass:"el-icon-warning warning-info"},[i("span",{staticClass:"desc"},[e._v("筛选条件中有重复项!")])]),e._v(" "),i("el-button",{attrs:{type:"text"},on:{click:e.handleAdd}},[e._v("+ 添加筛选条件")]),e._v(" "),i("div",{staticClass:"save"},[i("div",{staticClass:"save-setting"},[i("el-checkbox",{model:{value:e.saveDefault,callback:function(t){e.saveDefault=t},expression:"saveDefault"}},[e._v("设置为默认")])],1)]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:e.handleConfirm,expression:"handleConfirm"}],attrs:{type:"primary"}},[e._v("确 定")])],1)],1)},[],!1,null,"473d539a",null));z.options.__file="SceneCreate.vue";var W=z.exports,U={name:"SceneSet",components:{draggable:N.a,SceneCreate:W},props:{dialogVisible:{type:Boolean,required:!0,default:!1},crmType:{type:String,default:""}},data:function(){return{default_id:"",visible:!1,isleftIndeterminate:!1,checkleftAll:!1,checkedLeftData:[],leftCheckItems:[],isrightIndeterminate:!1,checkrightAll:!1,checkedRightData:[],rightCheckItems:[],moveItem:{},handlDefaultItem:{},showCreateScene:!1,fieldList:[],filterObj:{form:[]},filterName:"",filterDefault:!1,filterEditId:""}},computed:{},watch:{dialogVisible:{handler:function(e){this.visible=e,e&&this.getSceneList()},deep:!0,immediate:!0}},mounted:function(){},methods:{getSceneList:function(){var e=this;Object(g.u)({types:o.a[this.crmType]}).then(function(t){e.checkedLeftData=t.data.list.map(function(e){return e.check=!1,e}),e.checkedRightData=t.data.hideList.map(function(e){return e.check=!1,e});var i=e.checkedLeftData.filter(function(e){return 1==e.is_default});i&&i.length>0?e.default_id=i[0].scene_id:e.default_id=""}).catch(function(){})},handleConfirm:function(){var e=this;0==this.checkedLeftData.filter(function(t){return t.scene_id==e.default_id}).length&&(this.default_id=""),Object(g.v)({types:o.a[this.crmType],ids:this.checkedLeftData.map(function(e){return e.scene_id}),hide_ids:this.checkedRightData.map(function(e){return e.scene_id})}).then(function(t){e.$message({type:"success",message:"操作成功"}),e.handleCancel(),e.$emit("save-success")}).catch(function(){})},itemHandle:function(e,t,i){var s=this;"edit"==e?this.addAndEditScene("edit",t):"delete"==e?this.$confirm("您确定要删除这一条数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(g.r)({id:t.scene_id}).then(function(e){s.$message({type:"success",message:"删除成功"}),s.checkedLeftData.splice(i,1),s.leftCheckItemChange(),s.$emit("save-success")}).catch(function(){})}).catch(function(){}):"default"==e&&(this.handlDefaultItem=t)},defaultHandle:function(){var e=this;Object(g.q)({id:this.handlDefaultItem.scene_id,types:"crm_"+this.crmType}).then(function(t){e.$message({type:"success",message:"操作成功"}),e.default_id=e.handlDefaultItem.scene_id}).catch(function(){})},addAndEditScene:function(e,t){var i=this;Object(g.E)({types:o.a[this.crmType]}).then(function(s){i.fieldList=s.data,"edit"==e?(i.filterObj={form:[],obj:t.data},i.filterName=t.name,i.filterDefault=1==t.is_default,i.filterEditId=t.scene_id.toString()):(i.filterObj={form:[]},i.filterEditId="",i.filterName="",i.filterDefault=!1),i.showCreateScene=!0}).catch(function(){"失败了"})},handleCancel:function(){this.visible=!1,this.$emit("update:dialogVisible",!1)},rightMoveEnd:function(e){this.moveItem.check=!1,this.leftCheckItemChange(),this.rightCheckItemChange()},rightMove:function(e){this.moveItem=e.draggedContext.element},leftMoveEnd:function(e){this.moveItem.check=!1,this.leftCheckItemChange(),this.rightCheckItemChange()},leftMove:function(e){this.moveItem=e.draggedContext.element},handleleftCheckAllChange:function(e){e&&(this.isleftIndeterminate=!1),this.checkedLeftData.forEach(function(t){t.check=1!=t.type&&e}),this.leftCheckItems=e?this.checkedLeftData.filter(function(e){return e.check}):[]},leftCheckItemChange:function(){this.leftCheckItems=this.checkedLeftData.filter(function(e){return 1==e.check}),this.leftCheckItems.length>0?this.leftCheckItems.length==this.checkedLeftData.length?(this.checkleftAll=!0,this.isleftIndeterminate=!1):(this.checkleftAll=!1,this.isleftIndeterminate=!0):(this.checkleftAll=!1,this.isleftIndeterminate=!1)},handlerightCheckAllChange:function(e){e&&(this.isrightIndeterminate=!1),this.checkedRightData.forEach(function(t){t.check=e}),this.rightCheckItems=e?this.checkedRightData:[]},rightCheckItemChange:function(){this.rightCheckItems=this.checkedRightData.filter(function(e){return 1==e.check}),this.rightCheckItems.length>0?this.rightCheckItems.length==this.checkedRightData.length?(this.checkrightAll=!0,this.isrightIndeterminate=!1):(this.checkrightAll=!1,this.isrightIndeterminate=!0):(this.checkrightAll=!1,this.isrightIndeterminate=!1)},changePositon:function(e){var t=this;"left"==e?(this.checkedRightData=this.checkedRightData.filter(function(e,i,s){var n=!1;return t.rightCheckItems.forEach(function(t,i){e.scene_id==t.scene_id&&(n=!0)}),!n}),this.rightCheckItems.forEach(function(e,i){e.check=!1,t.checkedLeftData.push(e)}),this.rightCheckItems=[],this.isrightIndeterminate=!1,this.checkrightAll=!1,this.leftCheckItemChange(),this.rightCheckItemChange()):(this.checkedLeftData=this.checkedLeftData.filter(function(e,i,s){var n=!1;return t.leftCheckItems.forEach(function(t,i){e.scene_id==t.scene_id&&(n=!0)}),!n}),this.leftCheckItems.forEach(function(e,i){e.check=!1,t.checkedRightData.push(e)}),this.leftCheckItems=[],this.isleftIndeterminate=!1,this.checkleftAll=!1,this.leftCheckItemChange(),this.rightCheckItemChange())}}},Z=(i("0IZ6"),Object(d.a)(U,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{visible:e.visible,"append-to-body":!0,"close-on-click-modal":!1,title:"场景管理",width:"700px"},on:{"update:visible":function(t){e.visible=t},close:e.handleCancel}},[i("div",{staticClass:"scene-name"},[e._v("您可通过拖拽管理标签")]),e._v(" "),i("flexbox",{staticClass:"scene-list"},[i("div",{staticClass:"scene-list-box"},[i("flexbox",{staticClass:"scene-list-head"},[i("el-checkbox",{attrs:{indeterminate:e.isleftIndeterminate},on:{change:e.handleleftCheckAllChange},model:{value:e.checkleftAll,callback:function(t){e.checkleftAll=t},expression:"checkleftAll"}}),e._v(" "),i("div",{staticClass:"scene-list-head-name"},[e._v("显示的标签")]),e._v(" "),i("div",{staticClass:"scene-list-head-detail"},[e._v(e._s(e.leftCheckItems.length+"/"+e.checkedLeftData.length))])],1),e._v(" "),i("div",{staticClass:"scene-list-body"},[e._l(e.checkedLeftData,function(t,s){return 1==t.type?i("flexbox",{key:s,staticClass:"list-item"},[i("div",{staticClass:"default-mark",class:{"default-mark-active":t.scene_id==e.default_id}}),e._v(" "),i("el-checkbox",{staticClass:"list-item-check",attrs:{disabled:!0},on:{change:e.leftCheckItemChange},model:{value:t.check,callback:function(i){e.$set(t,"check",i)},expression:"item.check"}}),e._v(" "),i("div",{staticClass:"list-item-name"},[e._v(e._s(t.name))]),e._v(" "),i("div",{staticClass:"list-item-handle"},[i("el-dropdown",{attrs:{trigger:"click"},on:{command:e.defaultHandle}},[i("i",{staticClass:"el-icon-arrow-down",on:{click:function(i){e.itemHandle("default",t,s)}}}),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",[e._v("设置为默认标签")])],1)],1)],1)],1):e._e()}),e._v(" "),i("draggable",{staticStyle:{"min-height":"100px"},attrs:{move:e.leftMove,options:{group:"list",forceFallback:!1,fallbackClass:"draggingStyle"}},on:{end:e.leftMoveEnd},model:{value:e.checkedLeftData,callback:function(t){e.checkedLeftData=t},expression:"checkedLeftData"}},e._l(e.checkedLeftData,function(t,s){return 1!=t.type?i("flexbox",{key:s,staticClass:"list-item"},[i("div",{staticClass:"default-mark",class:{"default-mark-active":t.scene_id==e.default_id}}),e._v(" "),i("el-checkbox",{staticClass:"list-item-check",on:{change:e.leftCheckItemChange},model:{value:t.check,callback:function(i){e.$set(t,"check",i)},expression:"item.check"}}),e._v(" "),i("div",{staticClass:"list-item-name"},[e._v(e._s(t.name))]),e._v(" "),i("div",{staticClass:"list-item-handle"},[i("i",{staticClass:"el-icon-edit",on:{click:function(i){e.itemHandle("edit",t,s)}}}),e._v(" "),i("i",{staticClass:"el-icon-delete",on:{click:function(i){e.itemHandle("delete",t,s)}}}),e._v(" "),i("el-dropdown",{on:{command:e.defaultHandle}},[i("i",{staticClass:"el-icon-arrow-down",on:{click:function(i){e.itemHandle("default",t,s)}}}),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",[e._v("设置为默认标签")])],1)],1)],1)],1):e._e()}))],2)],1),e._v(" "),i("div",{staticClass:"scene-middle-list"},[i("el-button",{staticClass:"scene-middle-left-button",class:{"scene-middle-button-select":e.rightCheckItems.length>0},attrs:{disabled:0==e.rightCheckItems.length},on:{click:function(t){e.changePositon("left")}}},[i("i",{staticClass:"el-icon-arrow-left scene-middle-icon"})]),e._v(" "),i("el-button",{staticClass:"scene-middle-right-button",class:{"scene-middle-button-select":e.leftCheckItems.length>0},attrs:{disabled:0==e.leftCheckItems.length},on:{click:function(t){e.changePositon("right")}}},[i("i",{staticClass:"el-icon-arrow-right scene-middle-icon"})])],1),e._v(" "),i("div",{staticClass:"scene-list-box"},[i("flexbox",{staticClass:"scene-list-head"},[i("el-checkbox",{attrs:{indeterminate:e.isrightIndeterminate},on:{change:e.handlerightCheckAllChange},model:{value:e.checkrightAll,callback:function(t){e.checkrightAll=t},expression:"checkrightAll"}}),e._v(" "),i("div",{staticClass:"scene-list-head-name"},[e._v("隐藏的标签")]),e._v(" "),i("div",{staticClass:"scene-list-head-detail"},[e._v(e._s(e.rightCheckItems.length+"/"+e.checkedRightData.length))])],1),e._v(" "),i("div",{staticClass:"scene-list-body"},[i("draggable",{staticStyle:{"min-height":"100px"},attrs:{move:e.rightMove,options:{group:"list",forceFallback:!1,fallbackClass:"draggingStyle"}},on:{end:e.rightMoveEnd},model:{value:e.checkedRightData,callback:function(t){e.checkedRightData=t},expression:"checkedRightData"}},e._l(e.checkedRightData,function(t,s){return i("flexbox",{key:s,staticClass:"list-item"},[i("el-checkbox",{staticClass:"list-item-check",staticStyle:{"margin-left":"9px"},on:{change:e.rightCheckItemChange},model:{value:t.check,callback:function(i){e.$set(t,"check",i)},expression:"item.check"}}),e._v(" "),i("div",{staticClass:"list-item-name"},[e._v(e._s(t.name))])],1)}))],1)],1)]),e._v(" "),i("div",{staticClass:"handle-bar"},[i("div",{staticClass:"handle-bar-add",on:{click:function(t){e.addAndEditScene("add",{})}}},[e._v("+ 新建场景")])]),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{nativeOn:{click:function(t){return e.handleCancel(t)}}},[e._v("取消")]),e._v(" "),i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:e.handleConfirm,expression:"handleConfirm"}],attrs:{type:"primary"}},[e._v("保存")])],1),e._v(" "),i("scene-create",{attrs:{"field-list":e.fieldList,"crm-type":e.crmType,"dialog-visible":e.showCreateScene,obj:e.filterObj,name:e.filterName,edit_id:e.filterEditId,"is-default":e.filterDefault},on:{"update:dialogVisible":function(t){e.showCreateScene=t},"save-success":e.getSceneList}})],1)},[],!1,null,"4d516d28",null));Z.options.__file="SceneSet.vue";var Q=Z.exports,G=i("+lNB"),J=i("p3/6"),q=i("nslc"),X=i("JCWM"),Y=i("XJYT"),K={name:"CRMTableHead",components:{FilterForm:S.a,FilterContent:D.a,SceneList:A,TransferHandle:G.a,TeamsHandle:J.a,AllocHandle:r.a,SceneCreate:W,SceneSet:Q,DealStatusHandle:q.a,PutPoolHandle:X.a},props:{title:{type:String,default:""},crmType:{type:String,default:""},isSeas:{type:Boolean,default:!1},poolId:[String,Number],poolAuth:Object,sortData:Object},data:function(){return{loading:!1,loadingObj:null,sceneType:null,showScene:!1,showFilter:!1,fieldList:[],filterObj:{form:[]},sceneData:{id:"",bydata:"",name:""},showSceneSet:!1,showSceneCreate:!1,sceneFilterObj:{form:[]},selectionList:[],transferDialogShow:!1,teamsDialogShow:!1,teamsTitle:"",allocDialogShow:!1,dealStatusShow:!1,putPoolShow:!1}},computed:n()({},Object(a.b)(["crm"]),{iconClass:function(){return this.showScene?"arrow-up":"arrow-down"},sceneName:function(){return this.sceneData.name||this.getDefaultSceneName()},showSceneView:function(){return!this.isSeas},showFilterView:function(){return![].includes(this.crmType)}}),watch:{loading:function(e){e?this.loadingObj=Y.Loading.service({target:document.querySelector("#crm-main-container")}):this.loadingObj&&this.loadingObj.close()}},mounted:function(){},methods:{handleTypeDrop:function(e){this.sceneType=e},showFilterClick:function(){this.getFilterFieldInfo()},getFilterFieldInfo:function(){var e=this,t={};this.isSeas,t.types=o.a[this.crmType],(this.isSeas?g.D:g.E)(t).then(function(t){e.fieldList=t.data,e.showFilter=!0}).catch(function(){})},handleFilter:function(e){var t=this;this.filterObj=e,this.showFilter=!1,e.saveChecked&&Object(g.t)({types:o.a[this.crmType],is_default:e.saveDefault?1:0,name:e.saveName,data:e.obj.map(function(e){return _()({},e.type,e)})}).then(function(e){t.updateSceneList()}).catch(function(){}),this.$emit("filter",e.obj)},handleDeleteField:function(e){this.filterObj=e.obj,this.$emit("filter",this.filterObj.obj)},sceneSelect:function(e){this.sceneData=e,this.$emit("scene",e)},sceneHandle:function(e){var t=this;"set"==e.type?this.showSceneSet=!0:"add"==e.type&&Object(g.E)({types:o.a[this.crmType]}).then(function(e){t.fieldList=e.data,t.showSceneCreate=!0}).catch(function(){})},updateSceneList:function(){this.$refs.sceneList.getSceneList()},headSelectionChange:function(e){this.selectionList=e},selectionBarClick:function(e){var t=this;if("transfer"==e)this.transferDialogShow=!0;else if("export"==e){var i={},s=null;this.isSeas?(s=c.r,i.customer_id=this.selectionList.map(function(e){return e.customer_id})):(s={customer:c.g,leads:b.d,contacts:w.d,business:C.d,contract:k.d,receivables:x.c,product:T.d}[this.crmType],i[this.crmType+"_id"]=this.selectionList.map(function(e){return e[t.crmType+"_id"]})),s(i).then(function(e){Object(V.c)(e)}).catch(function(){})}else if("transform"==e||"delete"==e||"lock"==e||"unlock"==e||"start"==e||"disable"==e||"get"==e){var n="";"transform"==e?n="确定将这些线索转换为客户吗?":"delete"==e?n=this.isSeas?"若客户下有联系人,联系人将一并删除。确定删除?":"确定删除选中的"+this.selectionList.length+"项吗?":"lock"==e?n="确定要锁定这些客户吗?锁定后将不会掉入公海。":"unlock"==e?n="确定要解锁这些客户吗?":"start"==e?n="确定要上架这些产品吗?":"disable"==e?n="确定要下架这些产品吗?":"get"==e&&(n="确定要领取该客户吗?"),this.$confirm(n,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.confirmHandle(e)}).catch(function(){})}else"add_user"==e?(this.teamsTitle="添加团队成员",this.teamsDialogShow=!0):"delete_user"==e?(this.teamsTitle="移除团队成员",this.teamsDialogShow=!0):"alloc"==e?this.allocDialogShow=!0:"deal_status"==e?this.dealStatusShow=!0:"put_seas"==e&&(this.putPoolShow=!0)},confirmHandle:function(e){var t=this;if("lock"===e||"unlock"===e)this.loading=!0,Object(c.n)({is_lock:"lock"===e?1:2,customer_id:this.selectionList.map(function(e){return e.customer_id})}).then(function(i){t.loading=!1,t.$message({type:"success",message:"操作成功"}),t.$emit("handle",{type:e})}).catch(function(){t.loading=!1});else if("transform"===e)this.loading=!0,Object(b.n)(_()({},this.crmType+"_id",this.selectionList.map(function(e){return e[t.crmType+"_id"]}))).then(function(i){t.loading=!1,t.$message({type:"success",message:"转化成功"}),t.$store.dispatch("GetMessageNum"),t.$emit("handle",{type:e})}).catch(function(){t.loading=!1});else if("start"===e||"disable"===e)this.loading=!0,Object(T.l)({id:this.selectionList.map(function(e){return e.product_id}),status:"start"===e?"上架":"下架"}).then(function(i){t.loading=!1,t.$message({type:"success",message:"操作成功"}),t.$emit("handle",{type:e})}).catch(function(){t.loading=!1});else if("delete"===e){var i=this.selectionList.map(function(e){return e[t.crmType+"_id"]}),s={leads:b.a,customer:this.isSeas?c.p:c.c,contacts:w.a,business:C.b,contract:k.b,receivables:x.a,visit:I.a,product:T.a}[this.crmType],n={};this.isSeas&&(n.isSeas=1),n.id=i,this.loading=!0,s(this.isSeas?n:{id:i}).then(function(i){t.loading=!1,t.$message({type:"success",message:"删除成功"}),t.$emit("handle",{type:e})}).catch(function(){t.loading=!1})}else"get"===e&&(this.loading=!0,Object(c.E)({customer_id:this.selectionList.map(function(e){return e.customer_id})}).then(function(i){t.loading=!1,t.$message({type:"success",message:"操作成功"}),t.$store.dispatch("GetMessageNum"),t.$emit("handle",{type:e})}).catch(function(){t.loading=!1}))},getSelectionHandleItemsInfo:function(){var e={transfer:{name:"转移",type:"transfer",icon:"transfer"},transform:{name:"转化为客户",type:"transform",icon:"transform"},export:{name:"导出选中",type:"export",icon:"export"},delete:{name:"删除",type:"delete",icon:"delete"},put_seas:{name:"放入公海",type:"put_seas",icon:"seas"},lock:{name:"锁定",type:"lock",icon:"lock"},unlock:{name:"解锁",type:"unlock",icon:"unlock"},add_user:{name:"添加团队成员",type:"add_user",icon:"add"},delete_user:{name:"移除团队成员",type:"delete_user",icon:"remove"},alloc:{name:"分配",type:"alloc",icon:"alloc"},get:{name:"领取",type:"get",icon:"receive"},start:{name:"上架",type:"start",icon:"shelves"},disable:{name:"下架",type:"disable",icon:"sold-out"},deal_status:{name:"更改成交状态",type:"deal_status",icon:"s-status"}};return"leads"==this.crmType?this.forSelectionHandleItems(e,["transfer","transform","export","delete"]):"customer"==this.crmType?this.isSeas?this.forSelectionHandleItems(e,["alloc","get","export","delete"]):this.forSelectionHandleItems(e,["transfer","put_seas","deal_status","export","delete","lock","unlock","add_user","delete_user"]):"contacts"==this.crmType?this.forSelectionHandleItems(e,["transfer","export","delete"]):"business"==this.crmType?this.forSelectionHandleItems(e,["transfer","export","delete","add_user","delete_user"]):"contract"==this.crmType?this.forSelectionHandleItems(e,["transfer","export","delete","add_user","delete_user"]):"receivables"==this.crmType?this.forSelectionHandleItems(e,["transfer","export","delete"]):"product"==this.crmType?this.forSelectionHandleItems(e,["transfer","export","delete","start","disable"]):"product"==this.crmType?this.forSelectionHandleItems(e,["export","start","disable"]):"visit"==this.crmType?this.forSelectionHandleItems(e,["delete"]):void 0},forSelectionHandleItems:function(e,t){for(var i=[],s=0;s<t.length;s++)i.push(e[t[s]]);return i},whetherTypeShowByPermision:function(e){if("transfer"==e)return"transform"!=this.sceneData.bydata&&this.crm[this.crmType].transfer;if("transform"==e)return"transform"!=this.sceneData.bydata&&this.crm[this.crmType].transform;if("export"==e)return this.isSeas?this.poolId?this.poolAuth.excelexport:this.crm.pool.excelexport:!this.crm[this.crmType]||this.crm[this.crmType].excelexport;if("delete"==e)return this.isSeas?this.poolId?this.poolAuth.delete:this.crm.pool.delete:this.crm[this.crmType].delete;if("put_seas"==e)return this.crm[this.crmType].putinpool;if("lock"==e||"unlock"==e)return this.crm[this.crmType].lock;if("add_user"==e||"delete_user"==e)return this.crm[this.crmType].teamsave;if("alloc"==e)return this.poolId?this.poolAuth.distribute:this.crm.pool.distribute;if("get"==e)return this.poolId?this.poolAuth.receive:this.crm.pool.receive;if("start"==e){for(var t=0;t<this.selectionList.length;t++){if(1==this.selectionList[t].status)return!1}return this.crm[this.crmType].status}if("disable"==e){for(var i=0;i<this.selectionList.length;i++){if(0==this.selectionList[i].status)return!1}return this.crm[this.crmType].status}return"deal_status"!=e||this.crm[this.crmType].dealStatus},handleCallBack:function(e){this.$emit("handle",{type:e.type})},getDefaultSceneName:function(){return"leads"==this.crmType?"全部线索":"customer"==this.crmType?"全部客户":"contacts"==this.crmType?"全部联系人":"business"==this.crmType?"全部商机":"contract"==this.crmType?"全部合同":"receivables"==this.crmType?"全部回款":"product"==this.crmType?"全部产品":"visit"===this.crmType?"全部回访":void 0}}},ee=(i("ZYyo"),Object(d.a)(K,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"table-head-container"},[i("flexbox",{directives:[{name:"show",rawName:"v-show",value:0==e.selectionList.length,expression:"selectionList.length == 0"}],staticClass:"th-container"},[e._t("custom"),e._v(" "),e.showSceneView?i("div",[e._v("场景:")]):e._e(),e._v(" "),e.showSceneView?i("el-popover",{attrs:{trigger:"click","popper-class":"no-padding-popover",width:"180"},model:{value:e.showScene,callback:function(t){e.showScene=t},expression:"showScene"}},[i("el-input",{staticClass:"scene-select",attrs:{slot:"reference",readonly:!0},slot:"reference",model:{value:e.sceneName,callback:function(t){e.sceneName=t},expression:"sceneName"}},[i("i",{class:["el-input__icon","el-icon-"+e.iconClass],attrs:{slot:"suffix"},slot:"suffix"})]),e._v(" "),i("scene-list",{ref:"sceneList",attrs:{"crm-type":e.crmType},on:{scene:e.sceneSelect,"scene-handle":e.sceneHandle,"hidden-scene":function(t){e.showScene=!1}}})],1):e._e(),e._v(" "),e.showFilterView?i("el-button",{staticClass:"filter-button",attrs:{type:"primary",icon:"wk wk-screening"},on:{click:e.showFilterClick}},[e._v("高级筛选")]):e._e(),e._v(" "),e.sortData&&e.sortData.order&&e.sortData.column?i("el-button",{attrs:{type:"primary",plain:""},on:{click:function(t){e.handleCallBack({type:"clear-sort"})}}},[e._v("\n "+e._s(""+e.sortData.column.label+{ascending:"升序",descending:"降序"}[e.sortData.order])),i("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"5px"}})]):e._e(),e._v(" "),e.showFilterView?i("filter-form",{attrs:{"field-list":e.fieldList,"dialog-visible":e.showFilter,obj:e.filterObj,"crm-type":e.crmType,"save-scene":!e.isSeas},on:{"update:dialogVisible":function(t){e.showFilter=t},filter:e.handleFilter}}):e._e(),e._v(" "),e._t("default")],2),e._v(" "),e.selectionList.length>0?i("flexbox",{staticClass:"selection-bar"},[i("div",{staticClass:"selected—title"},[e._v("已选中 "),i("span",{staticClass:"selected—count"},[e._v(e._s(e.selectionList.length))]),e._v(" 项")]),e._v(" "),i("flexbox",{staticClass:"selection-items-box"},e._l(e.getSelectionHandleItemsInfo(),function(t,s){return e.whetherTypeShowByPermision(t.type)?i("el-button",{key:s,attrs:{icon:e._f("wkIconPre")(t.icon),type:"primary"},nativeOn:{click:function(i){e.selectionBarClick(t.type)}}},[e._v(e._s(t.name))]):e._e()}))],1):e._e(),e._v(" "),e.filterObj.form&&e.filterObj.form.length>0?i("filter-content",{attrs:{obj:e.filterObj},on:{delete:e.handleDeleteField}}):e._e(),e._v(" "),i("transfer-handle",{attrs:{"crm-type":e.crmType,"selection-list":e.selectionList,"dialog-visible":e.transferDialogShow},on:{"update:dialogVisible":function(t){e.transferDialogShow=t},handle:e.handleCallBack}}),e._v(" "),i("teams-handle",{attrs:{"crm-type":e.crmType,title:e.teamsTitle,"selection-list":e.selectionList,"dialog-visible":e.teamsDialogShow},on:{"update:dialogVisible":function(t){e.teamsDialogShow=t},handle:e.handleCallBack}}),e._v(" "),i("alloc-handle",{attrs:{"crm-type":e.crmType,"pool-id":e.poolId,"selection-list":e.selectionList,"dialog-visible":e.allocDialogShow},on:{"update:dialogVisible":function(t){e.allocDialogShow=t},handle:e.handleCallBack}}),e._v(" "),i("deal-status-handle",{attrs:{"crm-type":e.crmType,"selection-list":e.selectionList,visible:e.dealStatusShow},on:{"update:visible":function(t){e.dealStatusShow=t},handle:e.handleCallBack}}),e._v(" "),i("scene-set",{attrs:{"dialog-visible":e.showSceneSet,"crm-type":e.crmType},on:{"update:dialogVisible":function(t){e.showSceneSet=t},"save-success":e.updateSceneList}}),e._v(" "),i("scene-create",{attrs:{"field-list":e.fieldList,"crm-type":e.crmType,"dialog-visible":e.showSceneCreate,obj:e.sceneFilterObj},on:{"update:dialogVisible":function(t){e.showSceneCreate=t},"save-success":e.updateSceneList}}),e._v(" "),i("put-pool-handle",{attrs:{visible:e.putPoolShow,"selection-list":e.selectionList},on:{"update:visible":function(t){e.putPoolShow=t},handle:e.handleCallBack}})],1)},[],!1,null,"ad644a88",null));ee.options.__file="CRMTableHead.vue";var te=ee.exports,ie={name:"FieldSet",components:{Draggable:N.a},props:{crmType:String,isSeas:{type:Boolean,default:!1},poolId:[String,Number]},data:function(){return{loading:!1,show:!1,poolConfig:1,fields:[],copyfields:[],search:""}},computed:{},watch:{show:function(e){e&&this.getList()},poolId:function(){this.fields=[]}},mounted:function(){},beforeDestroy:function(){},methods:{getList:function(){var e=this;this.loading=0==this.fields.length;var t=null,i={};this.isSeas?(t=g.n,i.poolId=this.poolId,i.types=o.a[this.crmType]+"_pool"):(t=g.j,i.types=o.a[this.crmType]),t(i).then(function(t){var i=t.data.value_list.map(function(e,t){return e.left="",e.center="",e.right="",e.check=!0,e}),s=t.data.hide_list.map(function(e,t){return e.left="",e.center="",e.right="",e.check=!1,e});e.fields=i.concat(s),e.copyfields=Object(V.t)(e.fields),e.loading=!1}).catch(function(){e.loading=!1})},searchClick:function(){var e=this;this.fields=this.fields.map(function(t){var i=t.name.indexOf(e.search);if(-1!=i){t.left=t.name.substr(0,i),t.center=t.name.substr(i,e.search.length);var s=i+e.search.length;t.right=t.name.substr(s,t.name.length-s)}else t.left="",t.center="",t.right="";return t})},save:function(){var e=this;if(this.fields.filter(function(e){return e.check}).length<2)this.$message.error("至少要显示两列");else{this.fields.filter(function(e){return!e.check});this.loading=!0;var t=null,i={value:this.fields.filter(function(e){return e.check}),hide_value:this.fields.filter(function(e){return!e.check})};this.isSeas?(t=g.m,i.poolId=this.poolId,i.types=o.a[this.crmType]+"_pool"):(t=g.i,i.types=o.a[this.crmType]),t(i).then(function(t){e.$message.success("操作成功"),e.show=!1,e.loading=!1,e.$emit("change")}).catch(function(){e.loading=!1})}},reSet:function(){this.fields=Object(V.t)(this.copyfields)}}},se=(i("eAw8"),Object(d.a)(ie,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-popover",{attrs:{"popper-class":"no-padding-popover",placement:"bottom",width:"240",trigger:"click"},model:{value:e.show,callback:function(t){e.show=t},expression:"show"}},[i("div",{staticClass:"field-set"},[i("el-input",{staticClass:"field-set__search",attrs:{placeholder:"搜索字段"},on:{input:e.searchClick},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),e._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"field-set__content"},[i("draggable",{attrs:{options:{dragClass:"sortable-drag",forceFallback:!1}},model:{value:e.fields,callback:function(t){e.fields=t},expression:"fields"}},e._l(e.fields,function(t,s){return i("div",{directives:[{name:"show",rawName:"v-show",value:1!=e.poolConfig&&"poolDay"!==t.fieldName||1==e.poolConfig,expression:"(poolConfig != 1 && item.fieldName !== 'poolDay') || poolConfig == 1"}],key:s,staticClass:"field-set__content--item text-one-line"},[i("el-switch",{model:{value:t.check,callback:function(i){e.$set(t,"check",i)},expression:"item.check"}}),e._v(" "),t.center?i("span",[e._v(e._s(t.left)),i("span",{staticClass:"input-word"},[e._v(e._s(t.center))]),e._v(e._s(t.right))]):i("span",[e._v(e._s(t.name))])],1)}))],1),e._v(" "),i("div",{staticClass:"field-set__ft"},[i("el-button",{attrs:{type:"text"},on:{click:e.reSet}},[e._v("重置")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)],1),e._v(" "),e.$slots.reference?e._t("default",null,{slot:"reference"}):i("i",{staticClass:"wk wk-config table-set",attrs:{slot:"reference"},on:{click:function(t){e.show=!e.show}},slot:"reference"})],2)},[],!1,null,"16ff9819",null));se.options.__file="index.vue";var ne=se.exports,ae=i("4peS"),oe=i.n(ae),le=i("dAOq"),ce=i("jHPx");t.a={components:{CRMListHead:v,CRMTableHead:te,FieldSet:ne},data:function(){return{loading:!1,tableHeight:document.documentElement.clientHeight-235,list:[],fieldList:[],sortData:{},currentPage:1,pageSize:oe.a.get("crmPageSizes")||15,pageSizes:[15,30,60,100],total:0,search:"",rowID:"",rowType:"",showDview:!1,filterObj:[],scene_id:"",sceneName:"",selectionList:[],moneyFields:[],isRequested:!1}},mixins:[le.a],computed:n()({},Object(a.b)(["crm"])),watch:{},mounted:function(){var e=this;window.onresize=function(){e.updateTableHeight()},this.isSeas&&this.crm.pool.index||this.crm[this.crmType].index&&(this.loading=!0)},methods:{getList:function(){var e=this;this.loading=!0;var t=this.getIndexRequest(),i={page:this.currentPage,limit:this.pageSize,search:this.search};this.sortData.order&&(i.order_field={create_user_name:"create_user_id",owner_user_name:"owner_user_id",customer_name:"customer_id",type_id_info:"type_id",status_id_info:"status_id",business_name:"business_id",contacts_name:"contacts_id",order_user_name:"order_user_id",category_name:"category_id",contract_num:"contract_id"}[this.sortData.prop]||this.sortData.prop,i.order_type="ascending"==this.sortData.order?"asc":"desc"),this.scene_id&&(i.scene_id=this.scene_id),this.poolId,this.filterObj&&this.filterObj.length>0&&this.filterObj.forEach(function(e){i[{create_user_name:"create_user_id",owner_user_name:"owner_user_id",type_id_info:"type_id",status_id_info:"status_id",business_name:"business_id",contacts_name:"contacts_id",order_user_name:"order_user_id",category_name:"category_id",contract_num:"contract_id"}[e.type]||e.type]=e}),t(i).then(function(t){e.isRequested=!0,"customer"===e.crmType?e.list=t.data.list.map(function(e){return e.show=!1,e}):("contract"!==e.crmType&&"receivables"!==e.crmType&&"business"!==e.crmType||(e.moneyData=t.data.extraData&&t.data.extraData.money||{}),e.list=t.data.list),t.data.dataCount&&Math.ceil(t.data.dataCount/e.pageSize)<e.currentPage&&e.currentPage>1?(e.currentPage=e.currentPage-1,e.getList()):(e.total=t.data.dataCount,e.loading=!1),e.$nextTick(function(){document.querySelector(".el-table__body-wrapper").scrollTop=1})}).catch(function(){e.loading=!1})},getIndexRequest:function(){return"leads"===this.crmType?b.g:"customer"===this.crmType?this.isSeas?c.t:c.k:"contacts"===this.crmType?w.g:"business"===this.crmType?C.g:"contract"===this.crmType?k.g:"product"===this.crmType?T.g:"receivables"===this.crmType?x.e:"visit"===this.crmType?I.c:void 0},getFieldList:function(e){var t=this;if(0==this.fieldList.length||e){this.loading=!0;var i={};this.isSeas?(this.poolId&&(i.poolId=this.poolId),i={types:"crm_"+this.crmType,module:"crm",action:"pool",controller:this.crmType}):i={types:"crm_"+this.crmType,module:"crm",action:"index",controller:this.crmType},(this.isSeas?g.z:g.A)(i).then(function(e){for(var i=[],s=[],n=0;n<e.data.length;n++){var a=e.data[n],o=0;o=a.width?a.width:a.name&&a.name.length<=6?15*a.name.length+45:140,"floatnumber"===a.formType&&s.push(a.fieldName||""),i.push({prop:a.fieldName||a.field,label:a.name,width:o,sortId:a.id})}t.moneyFields=s,t.fieldList=i,t.getList()}).catch(function(){t.loading=!1})}else this.getList()},fieldFormatter:function(e,t,i){return this.moneyFields.includes(t.property)?Object(ce.h)(e[t.property]||0):"isTransform"===t.property?["否","是"][i]||"--":""===e[t.property]||null===e[t.property]?"--":e[t.property]},crmSearch:function(e){this.currentPage=1,this.search=e,this.fieldList.length&&this.getList()},handleRowClick:function(e,t,i){if("selection"!==t.type){if("leads"===this.crmType)"name"===t.property?(this.rowID=e.leads_id,this.rowType="leads",this.showDview=!0):this.showDview=!1;else if("customer"===this.crmType){if("businessCheck"===t.property&&e.businessCount>0)return;"name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):this.showDview=!1}else"contacts"===this.crmType?"customer_id"===t.property||"customer_name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):"name"===t.property?(this.rowID=e.contacts_id,this.rowType="contacts",this.showDview=!0):this.showDview=!1:"business"===this.crmType?"customer_id"===t.property||"customer_name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):"name"===t.property?(this.rowID=e.business_id,this.rowType="business",this.showDview=!0):this.showDview=!1:"contract"===this.crmType?"customer_id"===t.property||"customer_name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):"business_id"===t.property||"business_name"===t.property?(this.rowID=e.business_id,this.rowType="business",this.showDview=!0):"contacts_id"===t.property?(this.rowID=e.contacts_id,this.rowType="contacts",this.showDview=!0):"num"===t.property?(this.rowID=e.contract_id,this.rowType="contract",this.showDview=!0):this.showDview=!1:"product"===this.crmType?"name"===t.property?(this.rowID=e.product_id,this.showDview=!0):this.showDview=!1:"receivables"===this.crmType?"customer_id"===t.property||"customer_name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):"contract_id"===t.property||"contract_num"===t.property?(this.rowID=e.contract_id,this.rowType="contract",this.showDview=!0):"number"===t.property?(this.rowID=e.receivables_id,this.rowType="receivables",this.showDview=!0):this.showDview=!1:"visit"==this.crmType&&("number"===t.property?(this.rowID=e.visit_id,this.rowType="visit",this.showDview=!0):"customer_name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):"contract_number"===t.property?(this.rowID=e.contract_id,this.rowType="contract",this.showDview=!0):"contacts_name"===t.property?(this.rowID=e.contacts_id,this.rowType="contacts",this.showDview=!0):this.showDview=!1);this.showDview&&this.$store.commit("SET_COLLAPSE",this.showDview)}},exportInfos:function(){var e={search:this.search};this.scene_id&&(e.scene_id=this.scene_id),this.poolId,this.filterObj&&this.filterObj.length>0&&this.filterObj.forEach(function(t){e[{create_user_name:"create_user_id",owner_user_name:"owner_user_id",type_id_info:"type_id",status_id_info:"status_id",business_name:"business_id",contacts_name:"contacts_id",order_user_name:"order_user_id",category_name:"category_id",contract_num:"contract_id"}[t.type]||t.type]=t});var t=void 0;t=this.isSeas?c.q:{customer:c.f,leads:b.c,contacts:w.c,business:C.c,contract:k.c,receivables:x.b,product:T.c}[this.crmType];var i=Y.Loading.service({fullscreen:!0,text:"导出中..."});t(e).then(function(e){Object(V.c)(e),i.close()}).catch(function(){i.close()})},handleFilter:function(e){this.filterObj=e;var t=document.documentElement.clientHeight,i=this.filterObj.length>0?295:235;this.tableHeight=t-i,this.currentPage=1,this.getList()},handleScene:function(e){this.scene_id=e.id,this.sceneName=e.name,this.currentPage=1,this.getFieldList()},handleHandle:function(e){["alloc","get","transfer","transform","delete","put_seas","exit-team"].includes(e.type)&&(this.showDview=!1),"clear-sort"==e.type?(this.getMainTable().clearSort(),this.sortChange()):this.getList()},getMainTable:function(){var e=null;return this.$children.forEach(function(t){t.$options&&"ElTable"===t.$options.name&&(e=t)}),e},setSave:function(){this.getFieldList(!0)},listHeadHandle:function(e){"save-success"!==e.type&&"import-crm"!==e.type||(this.currentPage=1,this.getList())},sortChange:function(e,t,i){this.currentPage=1,this.sortData=e||{},this.getList()},handleSelectionChange:function(e){this.selectionList=e,this.$refs.crmTableHead.headSelectionChange(e)},handleHeaderDragend:function(e,t,i,s){if(i.property){var n,a=null;if(this.fieldList.forEach(function(e){i.property===e.prop&&(n=e.prop)}),!n)return;var o={types:"crm_"+this.crmType,width:e,field:i.property};if(this.isSeas){if(!this.poolId)return;a=g.l,o.poolId=this.poolId}else a=g.h;a(o).then(function(e){}).catch(function(){})}},handleSizeChange:function(e){oe.a.set("crmPageSizes",e),this.pageSize=e,this.getList()},handleCurrentChange:function(e){this.currentPage=e,this.getList()},getStatusStyle:function(e){return{backgroundColor:this.getCRMStatusColor(e)}},toggleStar:function(e){var t=this;this.loading=!0;var i={leads:b.l,customer:c.K,contacts:w.m,business:C.r}[this.crmType],s={};s.type="crm_"+this.crmType,s.crmType=this.crmType,s.target_id=e[this.crmType+"_id"],i(s).then(function(){t.loading=!1,t.$message.success(e.star>0?"取消关注成功":"关注成功"),e.star=e.star>0?0:1}).catch(function(){t.loading=!1})},updateTableHeight:function(){var e=document.documentElement.clientHeight,t=this.filterObj.length>0?285:235;this.tableHeight=e-t}},beforeDestroy:function(){}}},"5Qyd":function(e,t,i){},"77fj":function(e,t,i){"use strict";var s=i("Btlj");i.n(s).a},"96cJ":function(e,t,i){"use strict";var s=i("QMvF");i.n(s).a},AeXB:function(e,t,i){},Bi8a:function(e,t,i){"use strict";var s=i("pRnp");i.n(s).a},Bp2F:function(e,t,i){"use strict";var s=i("1r1B");i.n(s).a},Btlj:function(e,t,i){},BzA1:function(e,t,i){"use strict";var s=i("a/5N"),n={name:"ImportInfo",components:{},props:{list:Array},data:function(){return{}},computed:{showList:function(){return this.list.filter(function(e){return"file"!==e.form_type})}},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{getValueContent:function(e){if("map_address"===e.form_type)return e.value?e.value.detail_address:"";if("structure"===e.form_type||"user"===e.form_type||"checkbox"===e.form_type){if(Object(s.a)(e.value)){var t={structure:"name",user:"realname",checkbox:""}[e.form_type];return e.value.map(function(e){return t?e[t]:e}).join("")}return""}if("single_user"===e.form_type)return Object(s.c)(e.value)&&e.value.realname?e.value.realname:"";if("customer"===e.form_type||"business"===e.form_type||"contract"===e.form_type||"contacts"===e.form_type||"category"===e.form_type||"statusName"===e.form_type||"typeName"===e.form_type){var i={customer:"name",business:"name",contract:"name",contacts:"name",category:"name",statusName:"name",typeName:"name"}[e.form_type];return Object(s.a)(e.value)?e.value.length>0?e.value[0][i]:"":e.value?e.value[i]:""}return e.value}}},a=(i("m7P8"),i("KHd+")),o=Object(a.a)(n,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[i("div",{staticClass:"content-title"},[e._v("基本信息")]),e._v(" "),e._l(e.showList,function(t,s){return i("p",{key:s,staticClass:"detail-cell"},[i("span",{staticClass:"detail-cell__label"},[e._v("\n "+e._s(t.name)+"\n ")]),i("br"),e._v(" "),i("span",{staticClass:"detail-cell__value"},[e._v("\n "+e._s(e.getValueContent(t))+"\n ")])])})],2)},[],!1,null,"17796cac",null);o.options.__file="ImportInfo.vue";t.a=o.exports},Cbbk:function(e,t,i){},D67r:function(e,t,i){},EtuZ:function(e,t,i){},FM4U:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAtCAYAAACqCZtVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4MzAzQzVFRjIyMDkxMUVBOTNFNkI3ODQ5MzVCRUIyNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo4MzAzQzVGMDIyMDkxMUVBOTNFNkI3ODQ5MzVCRUIyNyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjgzMDNDNUVEMjIwOTExRUE5M0U2Qjc4NDkzNUJFQjI3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjgzMDNDNUVFMjIwOTExRUE5M0U2Qjc4NDkzNUJFQjI3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+6GqSmAAAAP5JREFUeNpi/P//PwMtAItK8h+aGMzEQCPAAqU7gbiMBH0gb37GIz8dZnAVEGsAsR8JDhLEIbcJiOtgQfEXiCOB+CSFIXASas5f5DD+BsS+QHyHTEPvQPV/wxZ5r4HYE4jfkGgoTN9rfKkCZHM4EP8i0lCsPsWV3PYBcRIQE8o9OOMGXzpeCk0t+EAuNBWQnEE6QGmSDDmicl4BNGhI8g0xBoMiMQiIL5MS/sSWFR+B2AuIt0Mt+UVsWUEMeAI1fGBLN0ZaFfQ0c/HQM5jlz0Kp0ToPXOcx/l4gCWIwA/E6Euo8fABU2gWN1nmjdd5onTda543WeaMGjxSDAQIMANHDYvwVeewXAAAAAElFTkSuQmCC"},"I+NK":function(e,t,i){"use strict";var s=i("PWYh");i.n(s).a},J8i2:function(e,t,i){},JBWo:function(e,t,i){"use strict";var s=i("k3SN");i.n(s).a},JftJ:function(e,t,i){"use strict";var s=i("i2VW");i.n(s).a},Jz0M:function(e,t,i){},"M5/U":function(e,t,i){},"N8+3":function(e,t,i){"use strict";var s=i("epE4");i.n(s).a},NYF1:function(e,t,i){"use strict";var s={name:"AddRelateList",components:{},props:{data:Array,type:{type:[String,Number],require:!0},label:String},data:function(){return{}},computed:{typeName:function(){return this.label?this.label:{customer:"客户",contacts:"联系人",business:"商机",contract:"合同"}[this.type]}},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{getItemName:function(e){return e[{customer:"customerName",contacts:"name",business:"businessName",contract:"name"}[this.type]]||e.name},deleteItem:function(e,t){this.$emit("delete",e,t,this.type)}}},n=(i("s357"),i("KHd+")),a=Object(n.a)(s,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("section",{staticClass:"c-cont"},[i("flexbox",{staticClass:"c-header"},[i("i",{class:["wk","wk-"+e.type]}),e._v(" "),i("div",{staticClass:"c-name"},[e._v(e._s(e.typeName))])]),e._v(" "),i("div",{staticClass:"c-body"},[i("flexbox",{attrs:{wrap:"wrap"}},e._l(e.data,function(t,s){return i("flexbox",{key:s,staticClass:"c-item"},[i("div",{staticClass:"c-item-name"},[e._v(e._s(e.getItemName(t)))]),e._v(" "),i("div",{staticClass:"c-item-close",on:{click:function(i){e.deleteItem(t,s)}}},[e._v("×")])])}))],1)],1)},[],!1,null,"60fd2091",null);a.options.__file="AddRelateList.vue";t.a=a.exports},Nx4I:function(e,t,i){},O8VQ:function(e,t,i){"use strict";var s=i("QbLZ"),n=i.n(s),a=i("4XAY"),o=i("Vm8M"),l=i("7Qib"),c=i("Z+Ht"),r=i("vvxI"),u=i("L2JU"),d={name:"LogCell",components:{MapView:o.a},filters:{getFileSize:function(e){return Object(l.h)(e)}},mixins:[c.a,r.a],props:{item:{type:Object,default:function(){return{}}},section:[String,Number],index:[String,Number],canDelete:{type:Boolean,default:!0}},data:function(){return{showMapView:!1,mapViewInfo:{}}},computed:n()({},Object(u.b)(["crm"]),{hasEditAuth:function(){return this.crm&&this.crm.activity&&this.crm.activity.update},hasDeleteAuth:function(){return this.crm&&this.crm.activity&&this.crm.activity.delete},activityIcon:function(){return this.getXrIcon(this.getActivityType(this.item.activity_type))},activityIconColor:function(){return this.getXrIconColor(this.getActivityType(this.item.activity_type))}}),mounted:function(){},methods:{previewImg:function(e,t){this.$bus.emit("preview-image-bus",{index:t,data:e.map(function(e){return e.url=e.file_path,e})})},downloadFile:function(e){Object(l.d)({path:e.file_path,save_name:e.save_name,name:e.name})},handleCommand:function(e){var t=this;"delete"==e?this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){(4==t.item.type?a.d:a.b)({activity_id:t.item.activity_id}).then(function(e){t.$emit("delete",t.item,t.index,t.section),t.$store.dispatch("GetMessageNum"),t.$message.success("操作成功")}).catch(function(){})}).catch(function(){}):"edit"==e&&this.$emit("edit",this.item,this.index,this.section)},checkRelationDetail:function(e,t){this.$emit("crm-detail",e,t)},checkMapView:function(e){e.address&&(this.mapViewInfo={title:e.address,lat:e.lat,lng:e.lng},this.showMapView=!0)}}},h=(i("JBWo"),i("KHd+")),p=Object(h.a)(d,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"fl-c"},[i("flexbox",{staticClass:"fl-h"},[i("xr-avatar",{staticClass:"fl-h-img",attrs:{name:e.item.create_user_name,id:e.item.create_user_id,size:30,src:e.item.thumb_img,disabled:!1}}),e._v(" "),i("div",{staticClass:"fl-h-b"},[i("div",{staticClass:"fl-h-name"},[e._v(e._s(e.item.create_user_name))]),e._v(" "),i("div",{staticClass:"fl-h-time"},[e._v(e._s(e.item.update_time))])]),e._v(" "),e.item.category?i("div",{staticClass:"follow"},[i("span",{staticClass:"follow-info"},[e._v(e._s(e.item.category))])]):e._e(),e._v(" "),i("span",{staticClass:"log-mark",style:{right:e.canDelete?"40px":"15px"}},[i("i",{class:e.activityIcon,style:{color:e.activityIconColor}}),e._v(" "),i("span",{staticClass:"log-mark__label"},[e._v(e._s(e.getActivityTypeName(e.item.activity_type)+"-"+e.getRecordLogTypeName(e.item.type)))])]),e._v(" "),e.canDelete&&(e.hasDeleteAuth||e.hasEditAuth)?i("el-dropdown",{staticClass:"more-drop",attrs:{trigger:"click"},on:{command:e.handleCommand}},[i("i",{staticClass:"el-icon-arrow-down el-icon-more"}),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e.hasEditAuth?i("el-dropdown-item",{attrs:{command:"edit"}},[e._v("编辑")]):e._e(),e._v(" "),e.hasDeleteAuth?i("el-dropdown-item",{attrs:{command:"delete"}},[e._v("删除")]):e._e()],1)],1):e._e()],1),e._v(" "),i("div",{staticClass:"fl-b"},[i("div",{staticClass:"fl-b-content"},[e._v(e._s(e.item.content))]),e._v(" "),e.item.imgList&&e.item.imgList.length>0?i("flexbox",{staticClass:"fl-b-images",attrs:{wrap:"wrap"}},e._l(e.item.imgList,function(t,s){return i("div",{directives:[{name:"src",rawName:"v-src:background-image",value:t.file_path,expression:"file.file_path",arg:"background-image"}],key:t.file_path,staticClass:"fl-b-img-item",on:{click:function(t){e.previewImg(e.item.imgList,s)}}})})):e._e(),e._v(" "),e.item.fileList&&e.item.fileList.length>0?i("div",e._l(e.item.fileList,function(t,s){return i("flexbox",{key:s,staticClass:"cell",attrs:{align:"stretch"}},[i("div",{staticClass:"cell-hd first-show"},[i("i",{staticClass:"wk wk-file"})]),e._v(" "),i("div",{staticClass:"cell-hd first-show"},[e._v("\n 附件:\n ")]),e._v(" "),i("div",{staticClass:"cell-bd text-one-line"},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),i("div",{staticClass:"cell-ft"},[i("span",{staticClass:"des"},[e._v(""+e._s(e._f("getFileSize")(t.size))+"")]),e._v(" "),i("a",{on:{click:function(t){e.previewImg(e.item.fileList,s)}}},[e._v("预览")]),e._v(" "),i("a",{on:{click:function(i){e.downloadFile(t)}}},[e._v("下载")])])])})):e._e(),e._v(" "),e.item.contacts_list&&e.item.contacts_list.length>0?i("div",[i("flexbox",{staticClass:"cell",attrs:{align:"stretch"}},[i("div",{staticClass:"cell-hd"},[i("i",{staticClass:"wk wk-contacts"})]),e._v(" "),i("div",{staticClass:"cell-bd"},[e._v("\n 相关联系人:\n ")]),e._v(" "),e._l(e.item.contacts_list,function(t,s){return i("div",{key:s,staticClass:"cell-ft__item text-one-line"},[i("a",{on:{click:function(i){e.checkRelationDetail("contacts",t.contacts_id)}}},[e._v(e._s(t.name))])])})],2)],1):e._e(),e._v(" "),e.item.business_list&&e.item.business_list.length>0?i("div",[i("flexbox",{staticClass:"cell",attrs:{align:"stretch"}},[i("div",{staticClass:"cell-hd"},[i("i",{staticClass:"wk wk-business"})]),e._v(" "),i("div",{staticClass:"cell-bd"},[e._v("\n 相关商机:\n ")]),e._v(" "),i("div",{staticClass:"cell-ft"},e._l(e.item.business_list,function(t,s){return i("div",{key:s,staticClass:"cell-ft__item text-one-line"},[i("a",{on:{click:function(i){e.checkRelationDetail("business",t.business_id)}}},[e._v(e._s(t.name))])])}))])],1):e._e(),e._v(" "),e.item.next_time?i("div",{staticClass:"cell-top"},[i("flexbox",{staticClass:"cell",attrs:{align:"stretch"}},[i("div",{staticClass:"cell-hd"},[i("i",{staticClass:"wk wk-time"})]),e._v(" "),i("div",{staticClass:"cell-bd text-one-line"},[e._v("\n 下次联系时间:"+e._s(e.item.next_time)+"\n ")])])],1):e._e(),e._v(" "),e.item.address?i("div",{staticClass:"cell-top"},[i("flexbox",{staticClass:"cell",attrs:{align:"stretch"}},[i("div",{staticClass:"cell-hd is-address"},[i("i",{staticClass:"wk wk-location"})]),e._v(" "),i("div",{staticClass:"cell-bd text-one-line can-visit--underline",on:{click:function(t){e.checkMapView(e.item)}}},[e._v(e._s(e.item.address))])])],1):e._e()],1),e._v(" "),e.showMapView?i("map-view",{attrs:{title:e.mapViewInfo.title,lat:e.mapViewInfo.lat,lng:e.mapViewInfo.lng},on:{hidden:function(t){e.showMapView=!1}}}):e._e(),e._v(" "),e._t("default")],2)},[],!1,null,"0f095540",null);p.options.__file="LogCell.vue";t.a=p.exports},OTwp:function(e,t,i){},PWYh:function(e,t,i){},Po6l:function(e,t,i){"use strict";var s=i("EtuZ");i.n(s).a},QEKj:function(e,t,i){"use strict";t.a={methods:{getAdvancedFilterOptions:function(e){return"check_status"==e||"deal_status"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2}]:"user"==e||"single_user"==e||"structure"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2}]:"select"==e?[{value:"in",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2}]:"checkbox"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"contains",label:"包含",disabled:!1,type:3}]:"module"==e||"text"==e||"textarea"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"contains",label:"包含",disabled:!1,type:3},{value:"notContains",label:"不包含",disabled:!1,type:4}]:"floatnumber"==e||"number"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"contains",label:"包含",disabled:!1,type:3},{value:"notContains",label:"不包含",disabled:!1,type:4},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6},{value:"gt",label:"大于",disabled:!1,type:7},{value:"egt",label:"大于等于",disabled:!1,type:8},{value:"lt",label:"小于",disabled:!1,type:9},{value:"elt",label:"小于等于",disabled:!1,type:10}]:"category"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"contains",label:"包含",disabled:!1,type:3},{value:"not_contain",label:"不包含",disabled:!1,type:4}]:"mobile"==e||"email"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"contains",label:"包含",disabled:!1,type:3},{value:"notContains",label:"不包含",disabled:!1,type:4},{value:"startWith",label:"开始于",disabled:!1,type:8},{value:"endWith",label:"结束于",disabled:!1,type:10},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6}]:[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"contains",label:"包含",disabled:!1,type:3},{value:"notContains",label:"不包含",disabled:!1,type:4},{value:"startWith",label:"开始于",disabled:!1,type:8},{value:"endWith",label:"结束于",disabled:!1,type:10},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6},{value:"gt",label:"大于",disabled:!1,type:7},{value:"egt",label:"大于等于",disabled:!1,type:8},{value:"lt",label:"小于",disabled:!1,type:9},{value:"elt",label:"小于等于",disabled:!1,type:10}]}}}},QMvF:function(e,t,i){},TAVA:function(e,t,i){"use strict";var s=i("EJiy"),n=i.n(s),a=i("8GhS"),o=i("Woz+"),l=i("7Qib"),c=i("QEKj"),r={name:"Index",components:{XhUserCell:a.p,XhProuctCate:a.j,VDistpicker:o.a,XhStructureCell:a.n},mixins:[c.a],props:{dialogVisible:{type:Boolean,required:!0,default:!1},fieldList:{type:Array,required:!0,default:function(){return[]}},obj:{type:Object,required:!0,default:function(){return{}}},crmType:{type:String,default:""},saveScene:{type:Boolean,default:!0}},data:function(){return{form:[],visible:!1,showErrors:!1,saveChecked:!1,saveDefault:!1,saveName:null}},computed:{infoParams:function(){return this.crmType?{m:"crm",c:this.crmType,a:"index"}:{}}},watch:{dialogVisible:{handler:function(e){e&&(this.form=Object(l.t)(this.obj.form),0==this.form.length&&this.form.push({field:"",name:"",form_type:"",condition:"contains",type:3,value:"",typeOption:[],statusOption:[],type_id:"",status_id:"",address:{state:"",city:"",area:""}}),this.saveChecked=!1,this.saveDefault=!1,this.saveName=null),this.visible=this.dialogVisible},deep:!0,immediate:!0},form:function(){this.$nextTick(function(){var e=document.getElementById("filter-container");e.scrollTop=e.scrollHeight})}},methods:{selectProvince:function(e,t){t.address.state=e.value},selectCity:function(e,t){t.address.city=e.value},selectArea:function(e,t){t.address.area=e.value},typeOptionsChange:function(e){if(e.type_id){var t=e.typeOption.find(function(t){return t.type_id===e.type_id});e.statusOption=t.statusList||[]}else e.statusOption=[];e.status_id=""},arrayValueChange:function(e){e.value.length>0?(e.item.value=e.value,e.item.valueContent=e.valueContent):e.item.value=[]},selectChange:function(e,t){this.getAdvancedFilterOptions(t.form_type).forEach(function(i){i.value===e&&(t.type=i.type)})},showCalCondition:function(e){return"date"!=e&&"datetime"!=e&&"business_type"!=e&&"category"!=e&&"map_address"!=e},fieldFocus:function(){this.$el.click()},fieldChange:function(e){var t=this.fieldList.find(function(t){return t.field===e.field});t&&(e.form_type=t.form_type,e.name=t.name,"business_type"==e.form_type?(e.typeOption=t.setting,e.statusOption=[],e.type_id="",e.status_id="",e.value=""):"check_status"==e.form_type||"deal_status"==e.form_type?(e.setting=t.setting||[],e.value=""):"map_address"==e.form_type?e.address={state:"",city:"",area:""}:"date"===e.form_type||"datetime"===e.form_type||"user"===e.form_type||"single_user"===e.form_type||"structure"===e.form_type||"category"===e.form_type?e.value=[]:"select"==e.form_type||"checkbox"===e.form_type?(e.setting=t.setting||[],e.value=[]):e.value="","checkbox"==e.form_type||"check_status"==e.form_type||"deal_status"==e.form_type?(e.type=1,e.condition="is"):"user"==e.form_type||"single_user"==e.form_type||"structure"==e.form_type?(e.condition="is",e.type=1):"select"==e.form_type?(e.condition="in",e.type=1):(e.condition="is",e.type=1)),this.getError()},handleCancel:function(){this.$emit("update:dialogVisible",!1)},getError:function(){this.showErrors=!1;for(var e=[],t=0;t<this.form.length;t++){var i=this.form[t];if(e.includes(i.field)){this.showErrors=!0;break}e.push(i.field)}},handleConfirm:function(){var e=this;if(this.showErrors)this.$message.error("筛选条件中有重复项!");else if(!this.saveChecked||this.saveName&&""!==this.saveName){for(var t=0;t<this.form.length;t++){var i=this.form[t];if(!i.field||""===i.field)return void this.$message.error("筛选的字段名称不能为空!");if("business_type"==i.form_type){if(!i.type_id&&!i.status_id)return void this.$message.error("筛选内容不能为空!")}else if("map_address"==i.form_type){if(!i.address.state&&!i.address.city&&!i.address.area)return void this.$message.error("筛选内容不能为空!")}else if("date"==i.form_type||"datetime"==i.form_type||"user"==i.form_type||"single_user"==i.form_type||"structure"==i.form_type||"category"==i.form_type||"checkbox"==i.form_type){if((!i.value||0===i.value.length)&&"isNull"!=i.condition&&"isNotNull"!=i.condition)return void this.$message.error("筛选内容不能为空!")}else if((""===i.value||void 0===i.value||null===i.value)&&"isNull"!=i.condition&&"isNotNull"!=i.condition)return void this.$message.error("筛选内容不能为空")}var s=[];this.form.forEach(function(t){if("datetime"==t.form_type||"date"==t.form_type)s.push({condition:t.condition,form_type:t.form_type,name:t.name,type:t.field,value:t.value,start:new Date(t.value[0]).getTime()/1e3,end:new Date(t.value[1]).getTime()/1e3});else if("business_type"==t.form_type)s.push({form_type:t.form_type,name:t.status_id?"status_id":"type_id",type:t.field,type_id:t.type_id,status_id:t.status_id});else if("user"==t.form_type||"single_user"==t.form_type)s.push({condition:t.condition,value:[t.value[0].id],form_type:t.form_type,name:t.name,type:t.field});else if("structure"==t.form_type)s.push({condition:t.condition,value:[t.value[0].id],form_type:t.form_type,name:t.name,type:t.field});else if("checkbox"==t.form_type)s.push({condition:t.condition,value:t.value,form_type:t.form_type,name:t.name,type:t.field});else if("category"==t.form_type)s.push({condition:t.condition,value:[t.value[t.value.length-1]],form_type:t.form_type,name:t.name,type:t.field});else if("select"==t.form_type){var i=t.value;"string"!=e.getSettingValueType(t.setting)&&(i=[t.value]),s.push({condition:t.condition,value:i,form_type:t.form_type,name:t.name,type:t.field})}else if("map_address"==t.form_type)s.push({condition:t.condition,value:t.address,form_type:t.form_type,name:t.name,type:t.field});else{var n=[];if("string"==typeof t.value)n=t.value.replace(//g,";").split(";").filter(function(e){return""!==e&&null!==e});else n=[t.value];s.push({value:n,form_type:t.form_type,name:t.name,type:t.field,condition:t.condition})}});var n={obj:s,form:this.form,saveChecked:this.saveChecked,saveDefault:this.saveDefault,saveName:this.saveName};this.$emit("filter",n)}else this.$message.error("场景名称不能为空!")},handleAdd:function(){this.form.push({field:"",condition:"contains",value:"",type:"",form_type:"",setting:[],typeOption:[],statusOption:[],type_id:"",status_id:""})},handleDelete:function(e){var t=this;this.$confirm("您确定要删除这一条数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.form.splice(e,1),t.getError()}).catch(function(){})},getSettingValueType:function(e){if(e&&e.length>0){var t=e[0];return void 0===t?"undefined":n()(t)}return[]}}},u=(i("1w5D"),i("KHd+")),d=Object(u.a)(r,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{visible:e.visible,"close-on-click-modal":!1,title:"高级筛选",width:"900px"},on:{"update:visible":function(t){e.visible=t},close:e.handleCancel}},[i("div",{staticStyle:{"margin-bottom":"10px"}},[e._v("筛选条件")]),e._v(" "),i("el-form",{staticClass:"filter-container",attrs:{id:"filter-container"}},[i("el-form-item",[e._l(e.form,function(t,s){return[i("el-row",{key:s},[i("el-col",{attrs:{span:8}},[i("el-select",{attrs:{placeholder:"请选择要筛选的字段名"},on:{change:function(i){e.fieldChange(t)},focus:e.fieldFocus},model:{value:t.field,callback:function(i){e.$set(t,"field",i)},expression:"formItem.field"}},e._l(e.fieldList,function(e){return i("el-option",{key:e.field,attrs:{label:e.name,value:e.field}})}))],1),e._v(" "),e.showCalCondition(t.form_type)?i("el-col",{attrs:{span:1}},[e._v(" ")]):e._e(),e._v(" "),e.showCalCondition(t.form_type)?i("el-col",{attrs:{span:4}},[i("el-select",{attrs:{placeholder:"请选择范围"},on:{change:function(i){e.selectChange(i,t)}},model:{value:t.condition,callback:function(i){e.$set(t,"condition",i)},expression:"formItem.condition"}},e._l(e.getAdvancedFilterOptions(t.form_type),function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1):e._e(),e._v(" "),"business_type"==t.form_type?i("el-col",{attrs:{span:1}},[e._v(" ")]):e._e(),e._v(" "),"business_type"==t.form_type?i("el-col",{attrs:{span:4}},[i("el-select",{on:{change:function(i){e.typeOptionsChange(t)}},model:{value:t.type_id,callback:function(i){e.$set(t,"type_id",i)},expression:"formItem.type_id"}},e._l(t.typeOption,function(e){return i("el-option",{key:e.type_id,attrs:{label:e.name,value:e.type_id}})}))],1):e._e(),e._v(" "),i("el-col",{attrs:{span:1}},[e._v(" ")]),e._v(" "),i("el-col",{attrs:{span:"datetime"===t.form_type||"date"===t.form_type||"map_address"===t.form_type?13:8}},["check_status"===t.form_type||"deal_status"===t.form_type||"select"===t.form_type&&"string"!=e.getSettingValueType(t.setting)?i("el-select",{attrs:{placeholder:"请选择筛选条件"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}},e._l(t.setting,function(e){return i("el-option",{key:e,attrs:{label:e,value:e}})})):"select"===t.form_type||"checkbox"===t.form_type?i("el-select",{attrs:{multiple:"",placeholder:"请选择筛选条件"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}},e._l(t.setting,function(e){return i("el-option",{key:e,attrs:{label:e,value:e}})})):"date"===t.form_type||"datetime"===t.form_type?i("el-date-picker",{staticStyle:{padding:"0px 10px"},attrs:{"value-format":"date"===t.form_type?"yyyy-MM-dd":"yyyy-MM-dd HH:mm:ss",type:"date"===t.form_type?"daterange":"datetimerange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}}):"business_type"===t.form_type?i("el-select",{model:{value:t.status_id,callback:function(i){e.$set(t,"status_id",i)},expression:"formItem.status_id"}},e._l(t.statusOption,function(e){return i("el-option",{key:e.status_id,attrs:{label:e.name,value:e.status_id}})})):"user"===t.form_type||"single_user"===t.form_type?i("xh-user-cell",{attrs:{item:t,"info-params":e.infoParams,value:t.value},on:{"value-change":e.arrayValueChange}}):"structure"===t.form_type?i("xh-structure-cell",{attrs:{item:t,value:t.value},on:{"value-change":e.arrayValueChange}}):"category"===t.form_type?i("xh-prouct-cate",{attrs:{item:t,value:t.value},on:{"value-change":e.arrayValueChange}}):"map_address"===t.form_type?i("v-distpicker",{attrs:{province:t.address.state,city:t.address.city,area:t.address.area},on:{province:function(i){e.selectProvince(i,t)},city:function(i){e.selectCity(i,t)},area:function(i){e.selectArea(i,t)}}}):i("el-input",{attrs:{placeholder:"多个条件请用;隔开"},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"formItem.value"}})],1),e._v(" "),i("el-col",{staticClass:"delete",attrs:{span:1}},[i("i",{staticClass:"el-icon-error delete-btn",on:{click:function(t){e.handleDelete(s)}}})])],1)]})],2)],1),e._v(" "),i("p",{directives:[{name:"show",rawName:"v-show",value:e.showErrors,expression:"showErrors"}],staticClass:"el-icon-warning warning-info"},[i("span",{staticClass:"desc"},[e._v("筛选条件中有重复项!")])]),e._v(" "),i("el-button",{attrs:{type:"text"},on:{click:e.handleAdd}},[e._v("+ 添加筛选条件")]),e._v(" "),e.saveScene?i("div",{staticClass:"save"},[i("el-checkbox",{model:{value:e.saveChecked,callback:function(t){e.saveChecked=t},expression:"saveChecked"}},[e._v("保存为场景")]),e._v(" "),i("el-input",{directives:[{name:"show",rawName:"v-show",value:e.saveChecked,expression:"saveChecked"}],staticClass:"name",attrs:{maxlength:10,placeholder:"请输入场景名称最多10个字符"},model:{value:e.saveName,callback:function(t){e.saveName="string"==typeof t?t.trim():t},expression:"saveName"}}),e._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:e.saveChecked,expression:"saveChecked"}],staticClass:"save-setting"},[i("el-checkbox",{model:{value:e.saveDefault,callback:function(t){e.saveDefault=t},expression:"saveDefault"}},[e._v("设置为默认")])],1)],1):e._e(),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:e.handleCancel}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确 定")])],1)],1)},[],!1,null,"ef8bd880",null);d.options.__file="index.vue";t.a=d.exports},TDiV:function(e,t,i){},Vm8M:function(e,t,i){"use strict";var s=i("7Qib"),n={name:"MapView",components:{},props:{title:{type:String,default:""},lat:{type:[String,Number],default:0},lng:{type:[String,Number],default:0}},data:function(){return{}},computed:{},mounted:function(){var e=this;this.$el.style.zIndex=Object(s.q)(),document.body.appendChild(this.$el),Object(s.l)().then(function(){var t=new BMap.Map("choicemap",{enableMapClick:!1}),i=new BMap.Point(parseFloat(e.lng),parseFloat(e.lat));t.centerAndZoom(i,18),t.enableScrollWheelZoom();var s=new BMap.Marker(i);t.addOverlay(s);var n=new BMap.InfoWindow(e.title);s.addEventListener("click",function(){t.openInfoWindow(n,i)})})},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},methods:{hiddenView:function(){this.$emit("hidden")}}},a=(i("I+NK"),i("KHd+")),o=Object(a.a)(n,function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"map-view"},[t("div",{attrs:{id:"choicemap"}}),this._v(" "),t("i",{staticClass:"el-icon-close map-close",on:{click:this.hiddenView}})])},[],!1,null,"33a9f6bf",null);o.options.__file="MapView.vue";t.a=o.exports},WhDH:function(e,t,i){"use strict";var s=i("fV8c");i.n(s).a},"Y+PO":function(e,t,i){},YIeP:function(e,t,i){"use strict";var s=i("4XAY"),n=i("XJYT"),a=i("t2rG"),o={name:"Set",components:{draggable:i.n(a).a},props:{visible:{type:Boolean,required:!0,default:!1},list:Array},data:function(){return{setList:[],isDrag:!1}},computed:{},watch:{list:{handler:function(){this.initInfo()},immediate:!0},visible:function(e){e&&this.initInfo()}},created:function(){},beforeDestroy:function(){},methods:{initInfo:function(){this.setList=this.list.map(function(e){return{value:e}}),0==this.setList.length&&(this.setList=[{value:""}])},close:function(){this.$emit("update:visible",!1)},addClick:function(){this.setList.push({value:""})},deleteClick:function(e){this.setList.splice(e,1)},sureClick:function(){for(var e=this,t=[],i=0;i<this.setList.length;i++){var a=this.setList[i];a.value&&t.push(a.value)}if(0!=t.length){var o=n.Loading.service({target:document.querySelector('.el-dialog[aria-label="常用语管理"]')});Object(s.G)({phrase:t}).then(function(i){o.close(),e.$emit("update",t),e.close()}).catch(function(){o.close()})}else this.$message.error("请输入常用语")},dragEnter:function(){this.isDrag=!0},dragLeave:function(){this.isDrag=!1}}},l=(i("WhDH"),i("KHd+")),c=Object(l.a)(o,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{visible:e.visible,"append-to-body":!0,"close-on-click-modal":!1,title:"常用语管理",width:"600px"},on:{close:e.close}},[i("div",{staticClass:"set"},[i("draggable",{attrs:{options:{group:"list",forceFallback:!1,fallbackClass:"draggingStyle",filter:".el-input__inner",preventOnFilter:!1}},model:{value:e.setList,callback:function(t){e.setList=t},expression:"setList"}},e._l(e.setList,function(t,s){return i("flexbox",{key:s,staticClass:"set-item",class:{"is-drag":e.isDrag}},[i("el-input",{attrs:{maxlength:100},model:{value:t.value,callback:function(i){e.$set(t,"value",i)},expression:"item.value"}},[i("div",{staticClass:"drag-handle",attrs:{slot:"suffix"},on:{mouseenter:e.dragEnter,mouseleave:e.dragLeave},slot:"suffix"},[e._v("⋮⋮")])]),e._v(" "),i("i",{staticClass:"el-icon-remove",on:{click:function(t){e.deleteClick(s)}}})],1)})),e._v(" "),i("el-button",{attrs:{type:"text",icon:"el-icon-circle-plus"},on:{click:e.addClick}},[e._v("添加常用语")])],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:e.sureClick,expression:"sureClick"}],attrs:{type:"primary"}},[e._v("保存")])],1)])},[],!1,null,"1acbaeb8",null);c.options.__file="Set.vue";var r={name:"CommonWords",components:{Set:c.exports},props:{},data:function(){return{loading:!1,showPopover:!1,setShow:!1,list:[]}},computed:{},watch:{showPopover:function(e){e&&0==this.list.length&&this.getCommonWords()}},mounted:function(){},beforeDestroy:function(){},methods:{selectScene:function(e,t){this.$emit("select",e),this.showPopover=!1},setClick:function(){this.setShow=!0},getCommonWords:function(){var e=this;this.loading=!0,Object(s.F)().then(function(t){e.loading=!1,e.list=t.data||[]}).catch(function(){e.loading=!1})},udpateCommonWords:function(e){this.list=e}}},u=(i("q0fG"),Object(l.a)(r,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-popover",{attrs:{placement:"bottom",width:"320",trigger:"click","popper-class":"no-padding-popover"},model:{value:e.showPopover,callback:function(t){e.showPopover=t},expression:"showPopover"}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"common-words"},[i("div",{directives:[{name:"empty",rawName:"v-empty",value:e.list&&0==e.list.length,expression:"list && list.length == 0"}],staticClass:"word",attrs:{"xs-empty-icon":"none"}},e._l(e.list,function(t,s){return i("div",{key:s,staticClass:"word-item",on:{click:function(i){e.selectScene(t,s)}}},[e._v("\n "+e._s(t)+"\n ")])})),e._v(" "),i("div",{staticClass:"handle-interval"},[i("flexbox",{staticClass:"handle-button",nativeOn:{click:function(t){return e.setClick(t)}}},[i("i",{staticClass:"wk wk-manage handle-button-icon"}),e._v(" "),i("div",{staticClass:"handle-button-name"},[e._v("管理")])])],1)]),e._v(" "),i("el-button",{staticClass:"word-button",attrs:{slot:"reference"},slot:"reference"},[e._v("常用语")]),e._v(" "),i("set",{attrs:{visible:e.setShow,list:e.list},on:{"update:visible":function(t){e.setShow=t},update:e.udpateCommonWords}})],1)},[],!1,null,"6ddd3652",null));u.options.__file="index.vue";t.a=u.exports},"Z+Ht":function(e,t,i){"use strict";t.a={methods:{getXrIcon:function(e){return{leads:"wk wk-leads",customer:"wk wk-customer",contacts:"wk wk-contacts",product:"wk wk-product",business:"wk wk-business",contract:"wk wk-contract",receivables:"wk wk-receivables",invoice:"wk wk-invoice",log:"wk wk-log",examine:"wk wk-approve",task:"wk wk-o-task",record:"wk wk-record"}[e]},getXrIconColor:function(e){return{leads:"#704afd",customer:"#487DFF",contacts:"#27BA4A",product:"#26d4da",business:"#FB9323",contract:"#FD5B4A",receivables:"#FFB940",invoice:"#1cbaf5",log:"#5864FF",approve:"#9376FF",task:"#D376FF",record:"#19B5F6"}[e]}}}},ZX9L:function(e,t,i){"use strict";var s={name:"TimeTypeSelect",props:{defaultType:[String,Object],width:{type:Number,default:200},options:{type:Array,default:function(){return[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"本周",value:"week"},{label:"上周",value:"lastWeek"},{label:"本月",value:"month"},{label:"上月",value:"lastMonth"},{label:"本季度",value:"quarter"},{label:"上季度",value:"lastQuarter"},{label:"本年",value:"year"},{label:"去年",value:"lastYear"}]}}},data:function(){return{selectType:{label:"本年",value:"year"},showTypePopover:!1,showCustomContent:!1,sureCustomContent:!1,startTime:"",endTime:""}},computed:{typeShowValue:function(){return this.sureCustomContent?this.startTime||this.endTime?(this.startTime||"")+"-"+(this.endTime||""):"":this.selectType.label}},watch:{defaultType:function(){this.selectType.value!=this.defaultType&&(this.selectType=this.getDefaultTypeValue(this.defaultType))}},mounted:function(){void 0!==this.defaultType?"string"==typeof this.defaultType?this.selectType=this.getDefaultTypeValue(this.defaultType):this.defaultType.label?this.selectType=this.defaultType:"default"==this.defaultType.type?this.selectType=this.getDefaultTypeValue(this.defaultType.value):"custom"==this.defaultType.type&&(this.sureCustomContent=!0,this.showCustomContent=!0,this.startTime=this.defaultType.startTime,this.endTime=this.defaultType.endTime):this.$emit("change",{type:"default",value:this.selectType.value})},methods:{getDefaultTypeValue:function(e){for(var t=0;t<this.options.length;t++){var i=this.options[t];if(i.value==e)return i}return{label:"本年",value:"year"}},typeSelectClick:function(e){this.showTypePopover=!1,this.sureCustomContent=!1,this.showCustomContent=!1,this.selectType=e,this.$emit("change",{type:"default",value:this.selectType.value})},customSureClick:function(){this.startTime&&this.endTime&&(this.sureCustomContent=!0,this.showTypePopover=!1,this.$emit("change",{type:"custom",startTime:this.startTime,endTime:this.endTime}))}}},n=(i("77fj"),i("KHd+")),a=Object(n.a)(s,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-popover",{staticClass:"time-type-select",attrs:{width:e.width,placement:"bottom","popper-class":"no-padding-popover",trigger:"click"},model:{value:e.showTypePopover,callback:function(t){e.showTypePopover=t},expression:"showTypePopover"}},[i("div",{staticClass:"type-popper"},[i("div",{staticClass:"type-content"},[e._l(e.options,function(t,s){return i("div",{key:s,staticClass:"type-content-item",class:{selected:e.selectType.value==t.value&&!e.showCustomContent},on:{click:function(i){e.typeSelectClick(t)}}},[i("div",{staticClass:"mark"}),e._v(e._s(t.label)+"\n ")])}),e._v(" "),i("div",{staticClass:"type-content-item",class:{selected:e.showCustomContent},on:{click:function(t){e.showCustomContent=!0}}},[i("div",{staticClass:"mark"}),e._v("自定义\n ")])],2),e._v(" "),e.showCustomContent?i("div",{staticClass:"type-content-custom"},[i("el-date-picker",{attrs:{type:"date","value-format":"yyyy.MM.dd",placeholder:"选择日期"},model:{value:e.startTime,callback:function(t){e.startTime=t},expression:"startTime"}}),e._v(" "),i("el-date-picker",{attrs:{type:"date","value-format":"yyyy.MM.dd",placeholder:"选择日期"},model:{value:e.endTime,callback:function(t){e.endTime=t},expression:"endTime"}}),e._v(" "),i("el-button",{on:{click:e.customSureClick}},[e._v("确定")])],1):e._e()]),e._v(" "),i("el-input",{staticClass:"type-select",style:{width:e.width+"px"},attrs:{slot:"reference",readonly:!0},slot:"reference",model:{value:e.typeShowValue,callback:function(t){e.typeShowValue=t},expression:"typeShowValue"}},[i("i",{class:["el-icon-arrow-up",{"is-reverse":e.showTypePopover}],attrs:{slot:"suffix"},slot:"suffix"})])],1)},[],!1,null,"20503202",null);a.options.__file="index.vue";t.a=a.exports},ZYyo:function(e,t,i){"use strict";var s=i("5Qyd");i.n(s).a},ZkfS:function(e,t,i){"use strict";var s=i("e6H/");i.n(s).a},bmyS:function(e,t,i){},cjSm:function(e,t,i){"use strict";var s=i("nBY6");i.n(s).a},deZW:function(e,t,i){},"e6H/":function(e,t,i){},eAw8:function(e,t,i){"use strict";var s=i("M5/U");i.n(s).a},eOwn:function(e,t,i){"use strict";var s=i("m1cH"),n=i.n(s),a=i("QbLZ"),o=i.n(a),l=i("7Dod"),c=i("6iAj"),r=i("4XAY"),u=i("KTTK"),d=i("mkuN"),h=i("zMq1"),p=i("ye9D"),m=i("NYF1"),f=i("YIeP"),v=i("7Qib");var y={methods:{dispatch:function(e,t,i){for(var s=this.$parent||this.$root,n=s.$options.componentName;s&&(!n||n!==e);)(s=s.$parent)&&(n=s.$options.componentName);s&&s.$emit.apply(s,[t].concat(i))},broadcast:function(e,t,i){(function e(t,i,s){this.$children.forEach(function(n){n.$options.componentName===t?n.$emit.apply(n,[i].concat(s)):e.apply(n,[t,i].concat([s]))})}).call(this,e,t,i)}}},_={name:"LogAdd",components:{CrmRelative:d.a,AddImageList:h.a,AddFileList:p.a,AddRelateList:m.a,CommonWords:f.a},mixins:[y],props:{showBusiness:{type:Boolean,default:!1},showContacts:{type:Boolean,default:!1},contacts:Array,contactsId:[String,Number],followTypes:Array,id:[String,Number],crmType:{type:String,default:""}},data:function(){return{isUnfold:!1,content:"",imgFiles:[],businessAction:{},files:[],showBusinessPopover:!1,business:[],selectContactsId:"",followType:"",nextTime:"",showRelativeType:"",batchId:Object(v.s)()}},computed:{autosize:function(){return this.isUnfold?{minRows:3,maxRows:6}:{minRows:1,maxRows:1}}},watch:{followTypes:function(){this.getDefalutFollowType()},content:function(e){var t=!!(e&&e.length>0);this.dispatch("SlideView","setEditClose",[t])},contactsId:function(){this.selectContactsId=this.contactsId||""},id:{handler:function(){this.businessAction={type:"condition",data:{moduleType:this.crmType,customer_id:this.id}}},immediate:!0}},created:function(){this.selectContactsId=this.contactsId||"",this.getDefalutFollowType()},beforeDestroy:function(){},methods:{getDefalutFollowType:function(){this.followTypes&&this.followTypes.length>0?this.followType=this.followTypes[0].value:this.followType=""},resetInfo:function(){this.nextTime="",this.isUnfold=!1,this.content="",this.dispatch("SlideView","setEditClose",[!1]),this.imgFiles=[],this.files=[],this.business=[],this.selectContactsId=this.contactsId||"",this.showRelativeType="",this.batchId=Object(v.s)(),this.getDefalutFollowType()},commonWordsSelect:function(e){var t=this;this.content?this.$confirm("您选中的常用语将覆盖当前填写内容?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",customClass:"is-particulars"}).then(function(){t.content=e}).catch(function(){}):this.content=e},checkRelativeInfos:function(e){"business"==this.showRelativeType&&(this.business=e.data)},barClick:function(e){this.showRelativeType=e,"business"==e?this.showBusinessPopover=!0:"file"==e?this.$refs.fileInput.click():"img"==e&&this.$refs.imgInput.click()},uploadFile:function(e){var t=e.target.files;if(t.length){for(var i=0;i<t.length;i++){if(-1==t[i].type.indexOf("image")&&"img"==this.showRelativeType)return void this.$message.error("请上传正确的文件类型")}for(var s="image/*"==e.target.accept?"img":"file",n=0;n<t.length;n++){var a=t[n];this.uploadFileRequest(a,s)}e.target.value=""}},uploadFileRequest:function(e,t,i){var s=this;this.$wkUploadFile.upload({file:e,params:{module_id:this.id,module:"crm_"+this.crmType,type:t}}).then(function(n){var a=n.res.data||{};a.size=Object(v.h)(e.size),"img"==t?s.imgFiles.push(a):(a.icon=Object(v.o)(e),s.files.push(a)),i&&i()}).catch(function(){})},deleteImage:function(e,t){this.deleteImgOrFile("image",e,t)},deleteFile:function(e,t){this.deleteImgOrFile("file",e,t)},deleteImgOrFile:function(e,t,i){var s=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(u.c)({module:"crm_"+s.crmType,module_id:s.id,save_name:"image"==e?s.imgFiles[i].save_name:s.files[i].save_name}).then(function(t){"image"==e?s.imgFiles.splice(i,1):s.files.splice(i,1),s.$message.success("操作成功")}).catch(function(){})}).catch(function(){})},deleteAllFile:function(e){var t=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(u.e)({module:"crm_"+t.crmType,module_id:t.id,file_id:[].concat(n()(t.imgFiles.map(function(e){return e.file_id})),n()(t.files.map(function(e){return e.file_id}))),batchId:t.batchId,type:e}).then(function(i){2==e?t.imgFiles=[]:t.files=[],t.$message.success("操作成功")}).catch(function(){})}).catch(function(){})},deleteRelate:function(e,t){this.business.splice(t,1)},inputFocus:function(){var e=this;this.isUnfold=!0,this.$nextTick(function(){e.$refs.textarea.focus(),e.$emit("focus")})},sendClick:function(){this.$emit("send",{id:this.id,content:this.content,files:this.files,images:this.imgFiles,business:this.business,contactsId:this.selectContactsId,batchId:this.batchId,followType:this.followType,nextTime:this.nextTime})},close:function(){this.isUnfold=!1,this.$emit("close")}}},g=(i("uoQ8"),i("KHd+")),b=Object(g.a)(_,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["mix-content",{unfold:!e.isUnfold}]},[e.isUnfold?i("i",{staticClass:"wk wk-close",on:{click:e.close}}):e._e(),e._v(" "),e.isUnfold?i("div",{staticClass:"mix-content-select"},[e.showContacts?i("el-select",{attrs:{clearable:"",placeholder:"选择联系人"},model:{value:e.selectContactsId,callback:function(t){e.selectContactsId=t},expression:"selectContactsId"}},e._l(e.contacts,function(e){return i("el-option",{key:e.contactsId,attrs:{label:e.name,value:e.contacts_id}})})):e._e(),e._v(" "),i("el-select",{attrs:{clearable:"",placeholder:"选择跟进方式"},model:{value:e.followType,callback:function(t){e.followType=t},expression:"followType"}},e._l(e.followTypes,function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),e._v(" "),i("el-date-picker",{attrs:{editable:!1,type:"datetime",placeholder:"选择下次联系时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.nextTime,callback:function(t){e.nextTime=t},expression:"nextTime"}}),e._v(" "),i("common-words",{on:{select:e.commonWordsSelect}})],1):e._e(),e._v(" "),i("div",{class:["i-cont",{unfold:!e.isUnfold}]},[e.isUnfold?e._e():i("i",{staticClass:"wk wk-write"}),e._v(" "),i("el-input",{ref:"textarea",attrs:{autosize:e.autosize,maxlength:800,type:"textarea",clearable:"",resize:"none",placeholder:"请输入内容"},on:{focus:e.inputFocus},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}})],1),e._v(" "),e.imgFiles.length>0&&e.isUnfold?i("add-image-list",{attrs:{data:e.imgFiles},on:{delete:e.deleteImage,"delete-all":function(t){e.deleteAllFile(2)},upload:e.uploadFile}}):e._e(),e._v(" "),e.files.length>0&&e.isUnfold?i("add-file-list",{attrs:{data:e.files},on:{delete:e.deleteFile,"delete-all":function(t){e.deleteAllFile(1)}}}):e._e(),e._v(" "),e.business.length>0&&e.isUnfold?i("add-relate-list",{attrs:{data:e.business,type:"business"},on:{delete:e.deleteRelate}}):e._e(),e._v(" "),e.isUnfold?i("div",{staticClass:"bar-cont"},[i("el-button",{staticClass:"handle-button",attrs:{type:"text",icon:"wk wk-picture"},on:{click:function(t){e.barClick("img")}}},[e._v("图片")]),e._v(" "),i("el-button",{staticClass:"handle-button",attrs:{type:"text",icon:"wk wk-file"},on:{click:function(t){e.barClick("file")}}},[e._v("附件")]),e._v(" "),e.showBusiness?i("el-popover",{attrs:{placement:"bottom",width:"700","popper-class":"no-padding-popover",trigger:"click"},model:{value:e.showBusinessPopover,callback:function(t){e.showBusinessPopover=t},expression:"showBusinessPopover"}},[i("crm-relative",{ref:"crmrelative",attrs:{show:e.showBusinessPopover,radio:!1,action:e.businessAction,"selected-data":{business:e.business},"crm-type":"business"},on:{close:function(t){e.showBusinessPopover=!1},changeCheckout:e.checkRelativeInfos}}),e._v(" "),i("el-button",{staticClass:"handle-button",staticStyle:{"margin-left":"10px"},attrs:{slot:"reference",type:"text",icon:"wk wk-associate"},on:{click:function(t){e.barClick("business")}},slot:"reference"},[e._v("关联商机")])],1):e._e(),e._v(" "),i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:e.sendClick,expression:"sendClick"}],staticClass:"send-btn",attrs:{type:"primary"}},[e._v("发布")])],1):e._e(),e._v(" "),i("input",{ref:"fileInput",staticClass:"file-input",attrs:{accept:"*.*",type:"file",multiple:""},on:{change:e.uploadFile}}),e._v(" "),i("input",{ref:"imgInput",staticClass:"file-input",attrs:{accept:"image/*",type:"file",multiple:""},on:{change:e.uploadFile}})],1)},[],!1,null,"3cdb3711",null);b.options.__file="LogAdd.vue";var w=b.exports,C=i("O8VQ"),k=i("/G0b"),x=i("8OTK"),T=i("C3Po"),I=i("ZoMv"),S=i("Z+Ht"),D=i("vvxI"),L=i("ZX9L"),O=i("ehos"),A=i("L2JU"),j={name:"Activity",components:{LogAdd:w,LogCell:C.a,CRMAllCreate:x.default,TaskQuickAdd:T.a,TimeTypeSelect:L.a,LogEditDialog:k.a,CRMFullScreenDetail:function(){return Promise.all([i.e("chunk-7122"),i.e("chunk-9e99"),i.e("chunk-7a7a"),i.e("chunk-1409"),i.e("chunk-4ee54")]).then(i.bind(null,"3z7q"))}},mixins:[S.a,D.a],props:{handle:{type:Array,default:function(){return[]}},id:[String,Number],contactsId:[String,Number],crmType:{type:String,default:""},isSeas:{type:Boolean,default:!1},typeList:{type:Array,default:function(){return[]}},detail:{type:Object,default:function(){return{}}}},data:function(){return{loading:!1,isSearchRequest:!1,filterValue:{},timeOptions:[{label:"全部",value:""},{label:"最近7天",value:"7"},{label:"最近30天",value:"30"},{label:"最近60天",value:"60"}],contacts:[],followTypes:[],handleType:"",activityType:{icon:"all",color:"#2362FB",command:"",label:"全部活动"},list:[],noMore:!1,page:1,isCRMCreate:!1,createActionInfo:{type:"relative",crmType:this.crmType,data:{}},createCRMType:"",isTaskCreate:!1,showFullDetail:!1,relationID:"",relationCrmType:"",scrollKey:Date.now(),logEditData:null,logEditPosition:{seciton:0,index:0},logEditDialogVisible:!1}},computed:o()({},Object(A.b)(["crm"]),{canCreateFollowRecord:function(){return this.crm&&this.crm.activity&&this.crm.activity.save},showRelate:function(){return"customer"==this.crmType},scrollDisabled:function(){return this.loading||this.noMore},taskParams:function(){var e={};return e[this.crmType+"_ids"]=this.id,e},taskProps:function(){var e={};e[this.crmType]=[this.detail];var t={};return t[this.crmType+"Ids"]=[this.id],{relatedObj:e,relatedObjIds:t}}}),watch:{id:function(){this.initInfo(),this.refreshLogList()}},created:function(){this.debouncedRefreshLogList=Object(O.debounce)(300,this.refreshLogList),this.initInfo()},methods:{getLogTypeList:function(){var e=this;Object(c.r)().then(function(t){e.followTypes=t.data.map(function(e){return{value:e,label:e}})}).catch(function(){})},getContactsList:function(){var e=this;Object(l.y)({customer_id:this.id}).then(function(t){e.contacts=t.data.list}).catch(function(){})},sendLog:function(e){var t=this;if(e.content){var i={category:e.followType,activity_type:I.a.keyToTypeData[this.crmType],activity_type_id:e.id,content:e.content,next_time:e.nextTime||"",is_event:0,file_id:[].concat(n()(e.files.map(function(e){return e.file_id})),n()(e.images.map(function(e){return e.file_id}))),business_ids:[].concat(n()(e.business.map(function(e){return e.business_id}))),contacts_ids:e.contactsId};this.sendLoading=!0,Object(r.a)(i).then(function(e){t.sendLoading=!1,t.$message.success("发布成功"),t.$refs.logAdd&&t.$refs.logAdd.resetInfo(),t.refreshLogList()}).catch(function(){t.sendLoading=!1})}else this.$message.error("请输入跟进内容")},handleClick:function(e){var t=this;if(this.handleType==e?this.handleType="":this.handleType=e,"log"==e)this.isTaskCreate=!1,this.$nextTick(function(){t.$refs.logAdd&&(t.$refs.logAdd.isUnfold=t.handleType==e)});else if("task"==e)this.isTaskCreate=!0,this.$nextTick(function(){t.$refs.taskAdd.inputFocus()});else{this.isTaskCreate=!1;var i={type:"relative",crmType:this.crmType,data:{}};"contacts"==this.crmType?(i.data.customer=Object(v.t)(this.detail),"business"==e&&(i.relativeData={contactsId:this.detail.contactsId})):"customer"==this.crmType?i.data.customer=Object(v.t)(this.detail):"business"==this.crmType?(i.data.customer=Object(v.t)(this.detail),i.data.business=Object(v.t)(this.detail),"contacts"==e&&(i.relativeData={businessId:this.detail.businessId})):"contract"==this.crmType&&(i.data.customer=Object(v.t)(this.detail),i.data.contract=Object(v.t)(this.detail)),this.createActionInfo=i,this.createCRMType=e,this.isCRMCreate=!0}},initInfo:function(){var e=this;this.$nextTick(function(){e.$refs.logAdd&&e.$refs.logAdd.resetInfo(),e.$refs.taskAdd&&e.$refs.taskAdd.resetSendData()}),this.filterValue={search:"",timeLine:{label:"全部",value:""}},this.getLogTypeList(),this.showRelate&&this.getContactsList()},refreshLogList:function(e){this.isSearchRequest=e||!1,this.page=1,this.noMore=!1,this.list=[],this.scrollKey=Date.now()},handleSelectClick:function(e){this.activityType=e,this.refreshLogList()},timeTypeChange:function(e){this.filterValue.timeLine=e,this.refreshLogList()},getLogList:function(){var e=this;this.loading=!0;var t={module:this.crmType,page:this.page,crmType:I.a[this.crmType],activity_type:this.activityType.command||"",activity_type_id:this.id};this.filterValue.search&&(t.search=this.filterValue.search),this.filterValue.timeLine.type&&("custom"===this.filterValue.timeLine.type?(t.start_date=this.filterValue.timeLine.startTime.replace(/\./g,"-"),t.end_date=this.filterValue.timeLine.endTime.replace(/\./g,"-")):t.interval_day=this.filterValue.timeLine.value||""),Object(r.c)(t).then(function(t){if(e.loading=!1,!e.noMore)if(e.page++,e.list.length){var i=e.list[e.list.length-1];t.data.time&&t.data.list.length&&i.time!=t.data.time&&e.list.push(t.data)}else t.data.time&&t.data.list.length&&e.list.push(t.data);e.noMore=t.data.lastPage,e.isSearchRequest&&e.$nextTick(function(){e.$refs.activitySearchInput.focus()})}).catch(function(){e.noMore=!0,e.loading=!1})},createCRMSuccess:function(){this.handleType="",this.refreshLogList()},createCRMClose:function(){this.isCRMCreate=!1,this.handleType=""},checkCRMDetail:function(e,t){this.relationID=t,this.relationCrmType=e,this.showFullDetail=!0},getActivityIcon:function(e){return this.getXrIcon(this.getActivityType(e))},getActivityTypeColor:function(e){return this.getXrIconColor(this.getActivityType(e))},logCellDelete:function(e,t,i){this.list[i].list.splice(t,1),0==this.list[i].list.length&&this.list.splice(i,1),this.scrollKey=Date.now()},logCellEdit:function(e,t,i){this.logEditData=e,this.logEditPosition={seciton:i,index:t},this.logEditDialogVisible=!0},logEditSave:function(e){this.logEditPosition.seciton>=0&&this.logEditPosition.index>=0&&this.list[this.logEditPosition.seciton].list.splice(this.logEditPosition.index,1,e),this.getLogList()}}},N=(i("N8+3"),Object(g.a)(j,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:e.getLogList,expression:"getLogList"}],key:e.scrollKey,staticClass:"main",attrs:{"infinite-scroll-distance":"100","infinite-scroll-disabled":"scrollDisabled"}},[i("div",[!e.isSeas&&e.handle&&e.handle.length?i("div",{staticClass:"main-handle"},e._l(e.handle,function(t,s){return i("el-button",{key:s,class:{"is-select":e.handleType===t.type},attrs:{type:"primary",icon:"wk wk-add"},on:{click:function(i){e.handleClick(t.type)}}},[e._v("\n "+e._s(t.label)+"\n ")])})):e._e(),e._v(" "),!e.isSeas&&e.handle&&e.handle.length?[!e.isTaskCreate&&e.canCreateFollowRecord?i("log-add",{ref:"logAdd",staticClass:"log-add",attrs:{id:e.id,"show-business":e.showRelate,"show-contacts":e.showRelate,contacts:e.contacts,"contacts-id":e.contactsId,"follow-types":e.followTypes,"crm-type":e.crmType},on:{send:e.sendLog,focus:function(t){e.handleType="log"},close:function(t){e.handleClick(e.handleType)}}}):i("task-quick-add",{ref:"taskAdd",staticClass:"task-quick-add",attrs:{params:e.taskParams,props:e.taskProps},on:{focus:function(t){e.handleType="task"},send:e.refreshLogList}})]:e._e(),e._v(" "),i("div",{staticClass:"log",class:{"is-top":e.handle&&0==e.handle.length}},[i("flexbox",{staticClass:"log__header",attrs:{justify:"flex-end"}},[i("el-input",{ref:"activitySearchInput",attrs:{placeholder:"关键字搜索","prefix-icon":"el-icon-search"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.debouncedRefreshLogList(!0)}},model:{value:e.filterValue.search,callback:function(t){e.$set(e.filterValue,"search",t)},expression:"filterValue.search"}}),e._v(" "),i("time-type-select",{attrs:{width:190,options:e.timeOptions,"default-type":e.filterValue.timeLine},on:{change:e.timeTypeChange}}),e._v(" "),e.typeList.length>1?i("el-dropdown",{attrs:{trigger:"click"},on:{command:e.handleSelectClick}},[i("span",{staticClass:"el-dropdown-link"},[i("i",{class:["wk","dropdown-icon","wk-"+e.activityType.icon],style:{backgroundColor:e.activityType.color}}),e._v(e._s(e.activityType.label)),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.typeList,function(t,s){return i("el-dropdown-item",{key:s,attrs:{command:t}},[i("i",{class:["wk","dropdown-icon","wk-"+t.icon],style:{backgroundColor:t.color}}),e._v(e._s(t.label))])}))],1):e._e()],1),e._v(" "),e._l(e.list,function(t,s){return i("div",{key:s,staticClass:"log-section"},[i("div",{staticClass:"log-section__title"},[i("span",{staticClass:"section-title"},[i("span",{staticClass:"section-title__time"},[e._v(e._s(t.time))])])]),e._v(" "),e._l(t.list,function(n,a){return[1==n.type?i("div",{key:a,staticClass:"log-cell",class:{"only-one":1==t.list.length}},[i("log-cell",{attrs:{item:n,section:s,index:a,"can-delete":!e.isSeas},on:{"crm-detail":e.checkCRMDetail,delete:e.logCellDelete,edit:e.logCellEdit}}),e._v(" "),i("i",{staticClass:"wk wk-message log-cell__mark"})],1):i("div",{key:a,staticClass:"log-cell activity-cell",class:{"only-one":1==t.list.length}},[2==n.type?i("div",{staticClass:"activity-cell"},[i("span",{staticClass:"activity-cell__label"},[e._v(e._s(n.update_time)+" "+e._s(n.create_user_name)+"创建了"+e._s(e.getActivityTypeName(n.activity_type))+"")]),i("span",{staticClass:"activity-cell__content",on:{click:function(t){e.checkCRMDetail(e.getActivityType(n.activity_type),n.activity_type_id)}}},[e._v(e._s(n.activity_type_name||"查看详情"))])]):3==n.type?i("div",{staticClass:"activity-cell"},[i("span",{staticClass:"activity-cell__label"},[e._v(e._s(n.update_time)+" "+e._s(n.create_user_name)+"将商机:")]),e._v(" "),i("span",{staticClass:"activity-cell__content",on:{click:function(t){e.checkCRMDetail("business",n.activity_type_id)}}},[e._v(e._s(n.activity_type_name))]),e._v(" "),i("span",[e._v(e._s(" "+n.content))])]):4==n.type?i("log-cell",{attrs:{item:n,section:s,index:a,"can-delete":""},on:{"crm-detail":e.checkCRMDetail,delete:e.logCellDelete}}):e._e(),e._v(" "),i("i",{staticClass:"log-cell__mark",class:e.getActivityIcon(n.activity_type),staticStyle:{"background-color":"#FB9323"},style:{backgroundColor:e.getActivityTypeColor(n.activity_type)}})],1)]})],2)}),e._v(" "),e.loading?i("p",{staticClass:"scroll-bottom-tips"},[e._v("加载中...")]):e._e(),e._v(" "),e.noMore?i("p",{staticClass:"scroll-bottom-tips"},[e._v("没有更多了")]):e._e()],2)],2),e._v(" "),e.isCRMCreate?i("c-r-m-all-create",{attrs:{"crm-type":e.createCRMType,action:e.createActionInfo},on:{"save-success":e.createCRMSuccess,close:e.createCRMClose}}):e._e(),e._v(" "),i("c-r-m-full-screen-detail",{attrs:{visible:e.showFullDetail,"crm-type":e.relationCrmType,id:e.relationID},on:{"update:visible":function(t){e.showFullDetail=t}}}),e._v(" "),i("log-edit-dialog",{attrs:{visible:e.logEditDialogVisible,data:e.logEditData},on:{"update:visible":function(t){e.logEditDialogVisible=t},save:e.logEditSave}})],1)},[],!1,null,"344bab02",null));N.options.__file="index.vue";t.a=N.exports},ep8U:function(e,t,i){},epE4:function(e,t,i){},fV8c:function(e,t,i){},i2VW:function(e,t,i){},j4Q1:function(e,t,i){"use strict";var s=i("EJiy"),n=i.n(s),a={name:"FilterContent",props:{obj:{type:Object,required:!0,default:function(){return{}}}},data:function(){return{optionsNames:{is:"等于",in:"等于",isNot:"不等于",contains:"包含",notContains:"不包含",startWith:"开始于",endWith:"结束于",isNull:"为空",isNotNull:"不为空",eq:"等于",neq:"不等于",gt:"大于",egt:"大于等于",lt:"小于",elt:"小于等于"},showObj:{}}},computed:{},watch:{obj:function(e){this.showObj=e}},mounted:function(){this.showObj=this.obj},methods:{handleDelete:function(e,t){this.showObj.obj.splice(t,1),this.showObj.form.splice(t,1),this.$emit("delete",{item:e,index:t,obj:this.showObj})},getTypesName:function(e){return e.type_id&&e.typeOption.find(function(t){return t.type_id===e.type_id}).name||""},getNameValue:function(e){var t=e.setting.find(function(t){return t.value===e.value});return t?t.name:""},getStatusName:function(e){if(e.status_id){var t=e.statusOption.find(function(t){return t.status_id===e.status_id});return t.name?"-"+t.name:""}return""},getDealStatus:function(e){return"未成交"==e?"未成交":"已成交"==e?"已成交":""},getSettingValueType:function(e){if(e&&e.length>0){var t=e[0];return void 0===t?"undefined":n()(t)}return[]}}},o=(i("96cJ"),i("KHd+")),l=Object(o.a)(a,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wrapper"},[i("ul",{staticClass:"list"},e._l(e.showObj.form,function(t,s){return i("li",{key:s,staticClass:"list-item"},["date"==t.form_type?i("span",[e._v(e._s(t.name+" “"+t.value[0]+"-"+t.value[1]+"”"))]):"datetime"===t.form_type?i("span",[e._v(e._s(t.name+" “"+t.value[0]+"-"+t.value[1]+"”"))]):"business_type"===t.form_type?i("span",[e._v(e._s(t.name+" “"+e.getTypesName(t)+e.getStatusName(t)+"”"))]):"map_address"===t.form_type?i("span",[e._v(e._s(t.name+" "+t.address.state+" "+t.address.city+" "+t.address.area))]):"check_status"===t.form_type?i("span",[e._v(e._s(t.name+" “"+e.optionsNames[t.condition]+"” "+e.getNameValue(t)))]):"deal_status"===t.form_type?i("span",[e._v(e._s(t.name+" “"+e.optionsNames[t.condition]+"” "+e.getDealStatus(t.value)))]):"user"===t.form_type||"single_user"===t.form_type?i("span",[e._v(e._s(t.name+" "+e.optionsNames[t.condition]+"“"+t.value[0].realname+"”"))]):"structure"===t.form_type?i("span",[e._v(e._s(t.name+" "+e.optionsNames[t.condition]+"“"+t.value[0].name+"”"))]):"category"===t.form_type&&t.value.length>0?i("span",[e._v(e._s(t.name+" “"+t.valueContent+"”"))]):"select"===t.form_type&&"string"!=e.getSettingValueType(t.setting)?i("span",[e._v(e._s(t.name+" “"+e.getNameValue(t)+"”"))]):i("span",[e._v(e._s(t.name+" "+e.optionsNames[t.condition]+"“"+t.value+"”"))]),e._v(" "),i("i",{staticClass:"el-icon-close icon",on:{click:function(i){e.handleDelete(t,s)}}})])}))])},[],!1,null,"fa40f606",null);l.options.__file="FilterContent.vue";t.a=l.exports},k3SN:function(e,t,i){},m1cH:function(e,t,i){"use strict";t.__esModule=!0;var s,n=i("rfXi"),a=(s=n)&&s.__esModule?s:{default:s};t.default=function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return(0,a.default)(e)}},m7P8:function(e,t,i){"use strict";var s=i("deZW");i.n(s).a},mmDs:function(e,t,i){"use strict";var s=i("OTwp");i.n(s).a},nBY6:function(e,t,i){},pRnp:function(e,t,i){},paiq:function(e,t,i){"use strict";var s=i("D67r");i.n(s).a},q0fG:function(e,t,i){"use strict";var s=i("ep8U");i.n(s).a},s357:function(e,t,i){"use strict";var s=i("TDiV");i.n(s).a},"uX/8":function(e,t,i){"use strict";var s=i("AeXB");i.n(s).a},uiUa:function(e,t,i){"use strict";var s=i("Cbbk");i.n(s).a},uoQ8:function(e,t,i){"use strict";var s=i("Y+PO");i.n(s).a},vvxI:function(e,t,i){"use strict";t.a={filters:{},methods:{getActivityType:function(e){return{1:"leads",2:"customer",3:"contacts",4:"product",5:"business",6:"contract",7:"receivables",8:"log",9:"examine",10:"schedule",11:"task"}[e]},getActivityTypeName:function(e){return{1:"线索",2:"客户",3:"联系人",4:"产品",5:"商机",6:"合同",7:"回款",8:"日志",9:"审批",10:"日程",11:"任务",12:"发邮件"}[e]},getRecordLogTypeName:function(e){return e?{1:"跟进记录",2:"创建记录",3:"商机阶段变更",4:"外勤签到"}[e]:"跟进记录"}}}},ye9D:function(e,t,i){"use strict";var s={name:"AddFileList",components:{},props:{data:Array},data:function(){return{}},computed:{},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{deleteItem:function(e,t){this.$emit("delete",e,t)},deleteAll:function(){this.$emit("delete-all")}}},n=(i("paiq"),i("KHd+")),a=Object(n.a)(s,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("section",{staticClass:"file-cont"},[i("flexbox",{staticClass:"f-header"},[i("i",{staticClass:"wk wk-file"}),e._v(" "),i("div",{staticClass:"f-name"},[e._v("附件")])]),e._v(" "),i("div",{staticClass:"f-body"},e._l(e.data,function(t,s){return i("flexbox",{key:s,staticClass:"f-item"},[i("img",{staticClass:"f-img",attrs:{src:t.icon}}),e._v(" "),i("div",{staticClass:"f-name"},[e._v(e._s(t.name)),i("span",{staticClass:"f-size"},[e._v(e._s(""+t.size+""))])]),e._v(" "),i("div",{staticClass:"close-button",on:{click:function(i){e.deleteItem(t,s)}}},[e._v("×")])])})),e._v(" "),i("el-button",{attrs:{type:"text"},on:{click:e.deleteAll}},[e._v("全部删除")])],1)},[],!1,null,"472fadca",null);a.options.__file="AddFileList.vue";t.a=a.exports},zMq1:function(e,t,i){"use strict";var s={name:"AddImageList",components:{},props:{data:Array},data:function(){return{}},computed:{},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{mouseImgOver:function(e,t){e.showDelete=!0,this.$set(this.data,t,e)},mouseImgLeave:function(e,t){e.showDelete=!1,this.$set(this.data,t,e)},deleteItem:function(e,t){this.$emit("delete",e,t)},deleteAll:function(){this.$emit("delete-all")},uploadFile:function(e){this.$emit("upload",e)}}},n=(i("JftJ"),i("KHd+")),a=Object(n.a)(s,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("section",{staticClass:"img-cont"},[i("flexbox",{attrs:{wrap:"wrap"}},[e._l(e.data,function(t,s){return i("div",{directives:[{name:"src",rawName:"v-src:background-image",value:t.file_path||t.path||t.url,expression:" item.file_path || item.path || item.url",arg:"background-image"}],key:s,staticClass:"img-item",on:{mouseover:function(i){e.mouseImgOver(t,s)},mouseleave:function(i){e.mouseImgLeave(t,s)}}},[t.showDelete?i("div",{staticClass:"img-delete",on:{click:function(i){e.deleteItem(t,s)}}},[e._v("×")]):e._e()])}),e._v(" "),i("div",{staticClass:"img-item-add"},[i("input",{staticClass:"img-item-iput",attrs:{type:"file",accept:"image/*",multiple:""},on:{change:e.uploadFile}})])],2),e._v(" "),i("el-button",{attrs:{type:"text"},on:{click:e.deleteAll}},[e._v("全部删除")])],1)},[],!1,null,"99238776",null);a.options.__file="AddImageList.vue";t.a=a.exports},zqSx:function(e,t,i){"use strict";i.r(t);var s=i("QbLZ"),n=i.n(s),a=i("8OTK"),o=i("L2JU"),l=i("yPq4"),c=i("7Dod"),r={name:"BusinessCheck",components:{},props:{show:Boolean,data:{type:Object,default:function(){return{row:{name:""}}}}},data:function(){return{loading:!1,list:[],fieldList:[]}},computed:n()({},Object(o.b)(["crm"]),{canShowIndex:function(){return this.crm.business&&this.crm.business.index}}),watch:{show:{handler:function(e){this.canShowIndex&&e&&this.data.row&&this.data.row.business_count>0&&0==this.list.length&&this.getDetail()},deep:!0,immediate:!0}},mounted:function(){this.fieldList.push({prop:"name",width:"200",label:"商机名称"}),this.fieldList.push({prop:"money",width:"200",label:"商机金额"}),this.fieldList.push({prop:"customer_name",width:"200",label:"客户名称"}),this.fieldList.push({prop:"type_id_info",width:"200",label:"商机状态组"}),this.fieldList.push({prop:"status_id_info",width:"200",label:"状态"})},methods:{getDetail:function(){var e=this;this.loading=!0,Object(c.x)({pageType:"all",customer_id:this.data.row.customer_id}).then(function(t){e.loading=!1,e.list=t.data.list}).catch(function(){e.loading=!1})},hidenView:function(){document.querySelector("#app").click(),this.$emit("close",this.$el,this.data)},handleRowClick:function(e,t,i){this.$emit("click",e)},cellStyle:function(e){e.row,e.column,e.rowIndex,e.columnIndex;return{fontSize:"12px",textAlign:"center",cursor:"pointer"}},headerCellStyle:function(e){e.row,e.column,e.rowIndex,e.columnIndex;return{fontSize:"12px",textAlign:"center"}}}},u=(i("Po6l"),i("KHd+")),d=Object(u.a)(r,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"empty",rawName:"v-empty",value:!e.canShowIndex,expression:"!canShowIndex"}],staticClass:"container",attrs:{"xs-empty-icon":"nopermission","xs-empty-text":"暂无权限"}},[i("div",{staticClass:"header"},[i("i",{staticClass:"wk wk-customer"}),e._v(" "),i("span",{staticClass:"name"},[e._v(e._s(e.data.row.customerName))]),e._v(" "),i("span",{staticClass:"detail"},[e._v(e._s("商机个数:("+e.list.length+")个"))]),e._v(" "),i("i",{staticClass:"el-icon-close close",on:{click:e.hidenView}})]),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{"margin-right":"3px"},attrs:{data:e.list,"cell-style":e.cellStyle,"header-cell-style":e.headerCellStyle,height:"250",stripe:"","highlight-current-row":""},on:{"row-click":e.handleRowClick}},e._l(e.fieldList,function(e,t){return i("el-table-column",{key:t,attrs:{prop:e.prop,label:e.label,align:"center","header-align":"center","show-overflow-tooltip":""}})}))],1)},[],!1,null,"541e45c4",null);d.options.__file="BusinessCheck.vue";var h=d.exports,p=i("5QVi"),m={name:"CustomerIndex",components:{CRMAllDetail:l.a,BusinessCheck:h,CRMAllCreate:a.default},filters:{dealIcon:function(e){return"已成交"==e?"wk wk-success deal-suc":"wk wk-close deal-un"},dealName:function(e){return"已成交"==e?"已成交":"未成交"}},mixins:[p.a],data:function(){return{crmType:"customer",createType:"customer",createAction:{type:"save",id:"",data:{}},createShow:!1}},computed:n()({},Object(o.b)(["CRMConfig"]),{menuItems:function(){var e=[];return this.crm&&this.crm.customer&&e.push({title:"客户",path:"customer",icon:i("wfwE")}),this.crm&&this.crm.pool&&e.push({title:"公海",path:"seas",icon:i("goM+")}),this.crm&&this.crm.customer&&this.crm.customer.nearbyCustomer&&e.push({title:"附近客户",path:"nearby",icon:i("L+lS")}),e}}),mounted:function(){},activated:function(){this.isRequested&&this.getList()},deactivated:function(){this.$refs.elMenu.activeIndex=this.crmType},methods:{menuSelect:function(e,t){this.$emit("menu-select",e,t)},relativeBusinessClick:function(e){this.rowID=e.business_id,this.rowType="business",this.showDview=!0},cellClassName:function(e){e.row;var t=e.column;e.rowIndex,e.columnIndex;return"name"===t.property||"customer_name"===t.property?"can-visit--underline":"businessCheck"===t.property?"can-visit":""},businessCheckClick:function(e,t){if(0!=t.row.business_count){var i=e.target.parentNode;this.$set(t.row,"show",!t.row.show),i.__vue__.showPopper=!t.row.show}},businessClose:function(e,t){e.parentNode.__vue__.showPopper=!1,this.$set(t.row,"show",!1)},createClick:function(){this.createType=this.crmType,this.createAction={type:"save",id:"",data:{}},this.createShow=!0},saveSuccess:function(e){"customer"==e.type&&(this.handleHandle(e),e.createContacts&&(this.createType="contacts",this.createAction={type:"relative",crmType:"customer",data:{customer:e.data}},this.createShow=!0))}}},f=(i("ZkfS"),Object(u.a)(m,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("c-r-m-list-head",{attrs:{search:e.search,"crm-type":e.crmType,"create-fun":e.createClick,title:"客户管理",placeholder:"请输入客户名称/手机/电话","main-title":"新建客户"},on:{"update:search":function(t){e.search=t},"on-handle":e.listHeadHandle,"on-search":e.crmSearch,"on-export":e.exportInfos}},[i("el-menu",{ref:"elMenu",attrs:{slot:"icon","default-active":e.crmType,mode:"horizontal","active-text-color":"#2362FB"},on:{select:e.menuSelect},slot:"icon"},e._l(e.menuItems,function(t,s){return i("el-menu-item",{key:s,attrs:{index:t.path}},[i("img",{attrs:{src:t.icon}}),e._v(" "),i("span",[e._v(e._s(t.title))])])}))],1),e._v(" "),i("div",{directives:[{name:"empty",rawName:"v-empty",value:!e.crm.customer.index,expression:"!crm.customer.index"}],staticClass:"crm-container",attrs:{"xs-empty-icon":"nopermission","xs-empty-text":"暂无权限"}},[i("c-r-m-table-head",{ref:"crmTableHead",attrs:{"crm-type":e.crmType,"sort-data":e.sortData},on:{filter:e.handleFilter,handle:e.handleHandle,scene:e.handleScene}}),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"n-table--border",staticStyle:{width:"100%"},attrs:{id:"crm-table","row-height":40,data:e.list,height:e.tableHeight,"cell-class-name":e.cellClassName,"use-virtual":"",stripe:"",border:"","highlight-current-row":""},on:{"row-click":e.handleRowClick,"sort-change":e.sortChange,"header-dragend":e.handleHeaderDragend,"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection",align:"center",width:"55"}}),e._v(" "),i("el-table-column",{attrs:{resizable:!1,prop:"businessCheck",fixed:"",label:"",width:"38"},scopedSlots:e._u([{key:"header",fn:function(e){return[i("i",{staticClass:"wk wk-business",staticStyle:{cursor:"not-allowed",color:"#9DA9C2"}})]}},{key:"default",fn:function(t){return[i("el-popover",{attrs:{disabled:0==t.row.business_count,offset:250,placement:"right","popper-class":"no-padding-popover",width:"500",trigger:"click"}},[i("business-check",{attrs:{data:t,show:t.row.show},on:{click:e.relativeBusinessClick,close:function(i){e.businessClose(i,t)}}}),e._v(" "),i("i",{staticClass:"wk wk-business",staticStyle:{color:"#FC6E51"},style:{opacity:t.row.business_count>0?1:0},attrs:{slot:"reference"},on:{click:function(i){e.businessCheckClick(i,t)}},slot:"reference"})],1)]}}])}),e._v(" "),e._l(e.fieldList,function(t,s){return i("el-table-column",{key:s,attrs:{fixed:0==s,prop:t.prop,label:t.label,width:t.width,sortable:"pool_day"!=t.prop&&"custom","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(s){return["deal_status"==t.prop?[i("i",{class:e._f("dealIcon")(s.row[t.prop])}),e._v(" "),i("span",[e._v(e._s(e._f("dealName")(s.row[t.prop])))])]:"is_lock"==t.prop?[1==s.row.is_lock?i("i",{staticClass:"wk wk-circle-password customer-lock"}):e._e()]:[e._v(e._s(e.fieldFormatter(s.row,s.column)))]]}}])})}),e._v(" "),i("el-table-column"),e._v(" "),i("el-table-column",{attrs:{label:"关注",align:"center",fixed:"right",width:"60"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-tooltip",{attrs:{content:0==t.row.star?"添加关注":"取消关注",effect:"dark",placement:"top"}},[i("i",{staticClass:"wk wk-focus-on focus-icon",class:{active:0!=t.row.star},on:{click:function(i){e.toggleStar(t.row)}}})])]}}])}),e._v(" "),i("el-table-column",{attrs:{resizable:!1,fixed:"right",width:"40"},scopedSlots:e._u([{key:"header",fn:function(t){return[i("field-set",{attrs:{"crm-type":e.crmType},on:{change:e.setSave}})]}}])})],2),e._v(" "),i("div",{staticClass:"p-contianer"},[i("el-pagination",{staticClass:"p-bar",attrs:{"current-page":e.currentPage,"page-sizes":e.pageSizes,"page-size":e.pageSize,total:e.total,"pager-count":5,background:"",layout:"prev, pager, next, sizes, total, jumper"},on:{"update:pageSize":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),e._v(" "),i("c-r-m-all-detail",{staticClass:"d-view",attrs:{visible:e.showDview,"crm-type":e.rowType,id:e.rowID},on:{"update:visible":function(t){e.showDview=t},handle:e.handleHandle}}),e._v(" "),e.createShow?i("c-r-m-all-create",{attrs:{"crm-type":e.createType,action:e.createAction},on:{close:function(t){e.createShow=!1},"save-success":e.saveSuccess}}):e._e()],1)},[],!1,null,"88da303e",null));f.options.__file="index.vue";var v=f.exports,y=i("t3Un");var _=i("1bNe"),g=i("7Qib"),b={name:"NearbyIndex",components:{ChangeAddress:function(){return i.e("chunk-6759").then(i.bind(null,"oVWf"))},CustomerDetail:_.a},props:{},data:function(){return{map:null,radiusSelectWidth:100,showTypePopover:!1,showCustomContent:!1,selectType:{},currentId:-1,changeAddressShow:!1,address:"",mapList:[],markerArr:[],loading:!0,circle:null,memterOptions:[{label:"1千米",value:"1000"},{label:"3千米",value:"3000"},{label:"5千米",value:"5000"},{label:"10千米",value:"10000"}],centerPoint:{},mapData:{distance:"1000",type:""},mapHeight:document.documentElement.clientHeight-210,typeOptions:[{value:"",label:"全部"},{value:2,label:"客户"},{value:9,label:"公海"}],showDview:!1,rowID:null}},computed:n()({},Object(o.b)(["crm"]),{menuItems:function(){var e=[];return this.crm&&this.crm.customer&&e.push({title:"客户",path:"customer",icon:i("cLla")}),this.crm&&this.crm.pool&&e.push({title:"公海",path:"seas",icon:i("goM+")}),this.crm&&this.crm.customer&&this.crm.customer.nearbyCustomer&&e.push({title:"附近客户",path:"nearby",icon:i("t4Dm")}),e}}),watch:{},mounted:function(){var e=this;Object(g.l)().then(function(){var t=new BMap.Map("choicemap"),i=new BMap.Point(116.404,39.915);t.centerAndZoom(i,14),t.enableScrollWheelZoom(!0),e.map=t,e.centerPoint=i,e.getMyPosition()})},deactivated:function(){this.$refs.elMenu.activeIndex="nearby"},methods:{menuSelect:function(e,t){this.$emit("menu-select",e,t)},getMyPosition:function(){(new BMap.LocalCity).get(this.getFirstPosition)},getFirstPosition:function(e){this.centerPoint=e.center,this.address=e.name,this.getMapInfo()},radiusChange:function(e){e?(this.mapData.distance=e.value,this.selectType=e,this.showCustomContent=!1):(this.mapData.distance||(this.mapData.distance=1e3),this.showCustomContent=!0),this.getMapInfo(),this.showTypePopover=!1},getMapInfo:function(){var e=this;this.loading=!0,this.map.clearOverlays();var t,i=n()({},this.mapData);i.lat=this.centerPoint.lat,i.lng=this.centerPoint.lng,(t=i,Object(y.a)({url:"crm/customer/nearby",method:"post",data:t})).then(function(t){e.mapList=t.data.list,e.addMarkerLabel(),e.setCircle(),e.loading=!1}).catch(function(){e.loading=!1})},selectAddress:function(e){var t=this.map.getOverlays();this.currentId=e.customer_id;for(var i=0;i<t.length;i++){var s=t[i];"ComplexCustomOverlay"===s._type&&(s._customer_id===e.customer_id?(this.map.centerAndZoom(s._point,this.map.getZoom()),s._changeOverStyle()):s._changeOutStyle())}},setCircle:function(){this.circle&&this.removeOverlay(this.circle);var e=new BMap.Circle(this.centerPoint,this.mapData.distance,{strokeColor:"#2362FB",fillColor:"#2362FB",strokeWeight:2,fillOpacity:.05,strokeOpacity:.5,strokeStyle:"solid"});e.setCenter(this.centerPoint),this.circle=e,this.circle.type="circle",this.map.addOverlay(e),this.map.setCenter(this.centerPoint),this.map.panTo(this.centerPoint),this.map.setViewport(this.markerArr)},addMarkerLabel:function(){function e(e,t,i){this._type="ComplexCustomOverlay",this._point=e,this._name=t,this._customer_id=i}this.markerArr=[],e.prototype=new BMap.Overlay,e.prototype.initialize=function(e){var s=this;this._map=e;var n=this._div=document.createElement("div"),a=this._span=document.createElement("span");n.className="map-marker--custom marker--"+this._customer_id,a.className="map-custom--text",n.appendChild(a),n.style.position="absolute",n.style.zIndex=this._zIndex=BMap.Overlay.getZIndex(this._point.lat),n.style.color="white",n.style.padding="2px",n.style.whiteSpace="nowrap",n.style.MozUserSelect="none",n.style.fontSize="12px",a.innerHTML=this._name,n.appendChild(a);var o=this._arrow=document.createElement("div");o.style.background="url("+i("FM4U")+") no-repeat",o.style.position="absolute",o.style.width="20px",o.style.height="15px",o.style.transform="scale(0.5)",o.style.top="24px",o.style.left="75px",o.style.opacity="0.95",o.style.overflow="hidden",n.appendChild(o),this._changeOverStyle=function(){this._div.style.backgroundColor="#fba019",this._div.style.whiteSpace="normal",this._div.style.zIndex="1",this._arrow.style.backgroundPosition="0px -20px"},this._changeOutStyle=function(){t.currentId!==this._customer_id&&(this._div.style.backgroundColor="#2362FB",this._div.style.whiteSpace="nowrap",this._div.style.zIndex=this._zIndex,this._arrow.style.backgroundPosition="0px 0px")};var l=this;return n.onmouseover=function(){l._changeOverStyle()},n.onmouseout=function(){l._changeOutStyle()},n.onclick=function(){for(var e=null,i=0;i<t.mapList.length;i++)if(s._customer_id===t.mapList[i].customer_id){e=t.mapList.splice(i,1),t.mapList.unshift(e[0]),t.$refs.nearbyList.scrollTop=0,t.selectAddress(e[0]);break}},t.map.getPanes().labelPane.appendChild(n),n},e.prototype.draw=function(){var e=this._map.pointToOverlayPixel(this._point);this._div.style.left=e.x-parseInt(this._arrow.style.left)-10+"px",this._div.style.top=e.y-30+"px"};var t=this;this.mapList.forEach(function(i){var s=new BMap.Point(i.lng,i.lat),n=new e(s,i.name,i.customer_id);t.markerArr.push(s),t.map.addOverlay(n)})},removeOverlay:function(e){for(var t=this.map.getOverlays(),i=0;i<t.length;i++)t[i].type==e.type&&this.map.removeOverlay(t[i])},handleSelect:function(e){this.centerPoint=e.point,this.address=e.address+e.title,this.getMapInfo()},checkCustomerDetail:function(e){this.rowID=e,this.showDview=!0}}},w=(i("Bi8a"),Object(u.a)(b,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"map-box"},[i("div",{staticClass:"map-title"},[i("el-menu",{ref:"elMenu",attrs:{"default-active":"nearby",mode:"horizontal","active-text-color":"#2362FB"},on:{select:e.menuSelect}},e._l(e.menuItems,function(t,s){return i("el-menu-item",{key:s,attrs:{index:t.path}},[i("img",{attrs:{src:t.icon}}),e._v(" "),i("span",[e._v(e._s(t.title))])])}))],1),e._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"map-content"},[i("flexbox",{staticClass:"map-content--title",attrs:{align:"stretch"}},[i("flexbox-item",[i("div",{staticClass:"title--position"},[i("span",{staticClass:"wk wk-position"}),e._v(" "),i("el-tooltip",{staticClass:"item",attrs:{content:e.address,effect:"dark",placement:"top-start"}},[i("span",{staticClass:"title--address"},[e._v(e._s(e.address))])])],1),e._v(" "),i("el-button",{staticClass:"el-button--text",attrs:{type:"text"},on:{click:function(t){e.changeAddressShow=!0}}},[e._v("重新选择地址")]),e._v(" "),i("span",{staticClass:"place-text"},[e._v("附近 ")]),e._v(" "),i("el-popover",{attrs:{width:e.radiusSelectWidth,placement:"bottom","popper-class":"no-padding-popover",trigger:"click"},model:{value:e.showTypePopover,callback:function(t){e.showTypePopover=t},expression:"showTypePopover"}},[i("div",{staticClass:"type-popper"},[i("div",{staticClass:"type-content"},[e._l(e.memterOptions,function(t,s){return i("div",{key:s,staticClass:"type-content-item",class:{selected:e.selectType.value==t.value&&!e.showCustomContent},on:{click:function(i){e.radiusChange(t)}}},[i("div",{staticClass:"mark"}),e._v(e._s(t.label)+"\n ")])}),e._v(" "),i("div",{staticClass:"type-content-item",class:{selected:e.showCustomContent},on:{click:function(t){e.showCustomContent=!0}}},[i("div",{staticClass:"mark"}),e._v("自定义\n ")])],2),e._v(" "),e.showCustomContent?i("div",{staticClass:"type-content-custom"},[i("el-input",{directives:[{name:"wk-number",rawName:"v-wk-number",value:"positiveInt",expression:"'positiveInt'"}],model:{value:e.mapData.distance,callback:function(t){e.$set(e.mapData,"distance",t)},expression:"mapData.distance"}},[i("template",{slot:"append"},[e._v("米")])],2),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){e.radiusChange(null)}}},[e._v("确定")])],1):e._e()]),e._v(" "),i("el-input",{staticClass:"type-select",style:{width:e.radiusSelectWidth+"px"},attrs:{slot:"reference",readonly:!0},slot:"reference",model:{value:e.mapData.distance,callback:function(t){e.$set(e.mapData,"distance",t)},expression:"mapData.distance"}},[i("i",{class:["el-icon-arrow-up",{"is-reverse":e.showTypePopover}],attrs:{slot:"suffix"},slot:"suffix"})])],1),e._v(" "),i("span",{staticClass:"place-text"},[e._v(" 米的客户")])],1),e._v(" "),i("div",{staticClass:"title--right"},[i("label",{staticClass:"title-label"},[e._v("客户类型: ")]),e._v(" "),i("el-select",{on:{change:e.getMapInfo},model:{value:e.mapData.type,callback:function(t){e.$set(e.mapData,"type",t)},expression:"mapData.type"}},e._l(e.typeOptions,function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1)],1),e._v(" "),i("flexbox",{staticClass:"box-content",attrs:{align:"stretch"}},[i("div",{directives:[{name:"empty",rawName:"v-empty",value:e.mapList,expression:"mapList"}],staticClass:"map-content--left",attrs:{"xs-empty-icon":"none"}},[i("div",{attrs:{id:"map-scroll"}},[i("ul",{ref:"nearbyList",style:{height:e.mapHeight+"px"}},e._l(e.mapList,function(t,s){return i("li",{key:s,staticClass:"map-info--box",style:{backgroundColor:t.customer_id===e.currentId?"#f7f7f7":""},on:{click:function(i){e.selectAddress(t)}}},[i("span",{staticClass:"wk wk-location"}),e._v(" "),i("div",{staticClass:"map-box--content"},[i("div",{staticClass:"map-info--name"},[i("el-tooltip",{staticClass:"item",attrs:{content:t.name,effect:"dark",placement:"top-start"}},[i("div",{staticClass:"map-customer-name can-visit--underline",on:{click:function(i){i.stopPropagation(),e.checkCustomerDetail(t.customer_id)}}},[e._v(e._s(t.name))])])],1),e._v(" "),i("div",{staticClass:"map-info--content"},[e._v("负责人: "+e._s(t.owner_user_name))]),e._v(" "),i("div",{staticClass:"map-info--content",attrs:{title:t.detailAddress}},[e._v(e._s(t.detail_address))]),e._v(" "),i("div",{staticClass:"map-info--content"},[e._v("距离选择地址: "+e._s(t.distance/1e3)+" km")])])])}))])]),e._v(" "),i("flexbox-item",{staticClass:"map-primity",style:{height:e.mapHeight+"px"}},[i("div",{staticClass:"map",attrs:{id:"choicemap"}})])],1)],1),e._v(" "),i("change-address",{attrs:{show:e.changeAddressShow,value:e.centerPoint},on:{select:e.handleSelect,close:function(t){e.changeAddressShow=!1}}}),e._v(" "),e.showDview?i("customer-detail",{staticClass:"d-view",attrs:{id:e.rowID,"no-listener-class":["map-customer-name"]},on:{"hide-view":function(t){e.showDview=!1}}}):e._e()],1)},[],!1,null,"dec363cc",null));w.options.__file="index.vue";var C=w.exports,k={name:"SeacIndex",components:{CustomerDetail:_.a},filters:{dealIcon:function(e){return 1==e?"wk wk-success deal-suc":"wk wk-close deal-un"},dealName:function(e){return 1==e?"已成交":"未成交"}},mixins:[p.a],data:function(){return{crmType:"customer",isSeas:!0,poolId:"",poolAuth:{},poolList:[]}},computed:{menuItems:function(){var e=[];return this.crm&&this.crm.customer&&e.push({title:"客户",path:"customer",icon:i("cLla")}),this.crm&&this.crm.pool&&e.push({title:"公海",path:"seas",icon:i("riSQ")}),this.crm&&this.crm.customer&&this.crm.customer.nearbyCustomer&&e.push({title:"附近客户",path:"nearby",icon:i("L+lS")}),e}},watch:{poolId:{handler:function(e){e&&this.getCustomerPoolAuth(e)},deep:!0,immediate:!0}},created:function(){this.getPoolList()},activated:function(){this.getFieldList()},deactivated:function(){this.$refs.elMenu.activeIndex="seas"},methods:{getCustomerPoolAuth:function(e){var t=this;Object(c.v)({poolId:e}).then(function(e){t.poolAuth=e.data||{}}).catch(function(){})},menuSelect:function(e,t){this.$emit("menu-select",e,t)},getPoolList:function(){var e=this;Object(c.u)().then(function(t){e.poolList=t.data||[],e.poolId=1}).catch(function(){e.poolList=[{poolId:1,poolName:"系统默认公海",adminUserId:null,memberUserId:null,memberDeptId:null,status:null,preOwnerSetting:null,preOwnerSettingDay:null,receiveSetting:null,receiveNum:null,remindSetting:null,remindDay:null,putInRule:null,createUserId:null,createTime:null,companyId:null}],e.poolId=1})},poolChange:function(){this.currentPage=1,this.getFieldList(!0)},cellClassName:function(e){e.row;var t=e.column;e.rowIndex,e.columnIndex;return"name"===t.property?"can-visit--underline":"businessCheck"===t.property?"can-visit":""}}},x=(i("Bp2F"),Object(u.a)(k,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("c-r-m-list-head",{attrs:{search:e.search,"is-seas":!0,title:"公海管理",placeholder:"请输入客户名称/手机/电话","main-title":"新建客户","crm-type":"customer"},on:{"update:search":function(t){e.search=t},"on-handle":e.listHeadHandle,"on-search":e.crmSearch,"on-export":e.exportInfos}},[i("el-menu",{ref:"elMenu",attrs:{slot:"icon","default-active":"seas",mode:"horizontal","active-text-color":"#2362FB"},on:{select:e.menuSelect},slot:"icon"},e._l(e.menuItems,function(t,s){return i("el-menu-item",{key:s,attrs:{index:t.path}},[i("img",{attrs:{src:t.icon}}),e._v(" "),i("span",[e._v(e._s(t.title))])])}))],1),e._v(" "),i("div",{directives:[{name:"empty",rawName:"v-empty",value:!e.crm.customer.pool&&e.poolAuth.index,expression:"!crm.customer.pool && poolAuth.index"}],staticClass:"crm-container",attrs:{"xs-empty-icon":"nopermission","xs-empty-text":"暂无权限"}},[i("c-r-m-table-head",{ref:"crmTableHead",attrs:{"is-seas":e.isSeas,"pool-id":e.poolId,"pool-auth":e.poolAuth,"sort-data":e.sortData,"crm-type":"customer"},on:{filter:e.handleFilter,handle:e.handleHandle,scene:e.handleScene}},[i("template",{slot:"custom"},[i("div",[e._v("公海:")]),e._v(" "),i("el-select",{on:{change:e.poolChange},model:{value:e.poolId,callback:function(t){e.poolId=t},expression:"poolId"}},e._l(e.poolList,function(e){return i("el-option",{key:e.poolId,attrs:{label:e.poolName,value:e.poolId}})}))],1)],2),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"n-table--border",staticStyle:{width:"100%"},attrs:{id:"crm-table","row-height":40,data:e.list,height:e.tableHeight,"cell-class-name":e.cellClassName,"use-virtual":"",stripe:"",border:"","highlight-current-row":""},on:{"row-click":e.handleRowClick,"sort-change":e.sortChange,"header-dragend":e.handleHeaderDragend,"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection",align:"center",width:"55"}}),e._v(" "),e._l(e.fieldList,function(t,s){return i("el-table-column",{key:s,attrs:{fixed:0==s,prop:t.prop,label:t.label,width:t.width,sortable:"custom","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(s){return["dealStatus"==t.prop?[i("i",{class:e._f("dealIcon")(s.row[t.prop])}),e._v(" "),i("span",[e._v(e._s(e._f("dealName")(s.row[t.prop])))])]:"status"==t.prop?[2==s.row.status?i("i",{staticClass:"wk wk-circle-password customer-lock"}):e._e()]:[e._v(e._s(e.fieldFormatter(s.row,s.column)))]]}}])})}),e._v(" "),i("el-table-column"),e._v(" "),i("el-table-column",{attrs:{resizable:!1,fixed:"right",width:"40"},scopedSlots:e._u([{key:"header",fn:function(t){return[i("field-set",{attrs:{"is-seas":e.isSeas,"crm-type":e.crmType,"pool-id":e.poolId},on:{change:e.setSave}})]}}])})],2),e._v(" "),i("div",{staticClass:"p-contianer"},[i("el-pagination",{staticClass:"p-bar",attrs:{"current-page":e.currentPage,"page-sizes":e.pageSizes,"page-size":e.pageSize,total:e.total,"pager-count":5,background:"",layout:"prev, pager, next, sizes, total, jumper"},on:{"update:pageSize":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1),e._v(" "),e.showDview?i("customer-detail",{staticClass:"d-view",attrs:{id:e.rowID,"pool-id":e.poolId,"is-seas":e.isSeas},on:{handle:e.handleHandle,"hide-view":function(t){e.showDview=!1}}}):e._e()],1)},[],!1,null,"3ecd72bb",null));x.options.__file="index.vue";var T={name:"CustomerAllIndex",components:{CustomerIndex:v,NearbyIndex:C,SeasIndex:x.exports},props:{},data:function(){return{componentName:""}},computed:n()({},Object(o.b)(["crm"])),watch:{},mounted:function(){this.crm&&this.crm.customer?this.componentName="CustomerIndex":this.crm&&this.crm.customer.pool?this.componentName="SeasIndex":this.crm&&this.crm.customer&&this.crm.customer.nearbyCustomer&&(this.componentName="NearbyIndex")},beforeDestroy:function(){},methods:{menuSelect:function(e,t){this.componentName={customer:"CustomerIndex",seas:"SeasIndex",nearby:"NearbyIndex"}[e]}}},I=(i("uiUa"),Object(u.a)(T,function(){var e=this.$createElement,t=this._self._c||e;return t("keep-alive",[t(this.componentName,{tag:"component",on:{"menu-select":this.menuSelect}})],1)},[],!1,null,"acefe992",null));I.options.__file="AllIndex.vue";t.default=I.exports}}]);