(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-74c5","chunk-371b"],{"/Qhs":function(e,t,i){"use strict";var s=i("7F5A");i.n(s).a},"/TkR":function(e,t,i){},"0IZ6":function(e,t,i){"use strict";var s=i("bmyS");i.n(s).a},"2uQb":function(e,t,i){"use strict";i.r(t);var s=i("5lrv"),a=i("yPq4"),n=i("5QVi"),o={name:"VisitIndex",components:{VisitCreate:s.a,CRMAllDetail:a.a},mixins:[n.a],data:function(){return{crmType:"visit",createShow:!1}},computed:{},mounted:function(){},methods:{cellClassName:function(e){e.row;var t=e.column;e.rowIndex,e.columnIndex;return"number"===t.property||"customer_name"===t.property||"contract_num"===t.property||"contract_number"===t.property||"contacts_name"===t.property?"can-visit--underline":""},headerCellClassName:function(e){e.row;var t=e.column;e.rowIndex,e.columnIndex;return"visitNumber"===t.property?"header-can-visit-backgroud":""},createClick:function(){this.createShow=!0}}},l=(i("aMd6"),i("KHd+")),c=Object(l.a)(o,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,"show-search":!1,title:"回访管理",placeholder:"请输入回访名称","main-title":"新建回访"},on:{"update:search":function(t){e.search=t},"on-handle":e.listHeadHandle,"on-search":e.crmSearch,"on-export":e.exportInfos}}),e._v(" "),i("div",{directives:[{name:"empty",rawName:"v-empty",value:!e.crm.visit.index,expression:"!crm.visit.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,"header-cell-class-name":e.headerCellClassName,"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,formatter:e.fieldFormatter,sortable:"custom","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(s){var a=s.row,n=s.column;return s.$index,[i("wk-field-view",{attrs:{props:t,form_type:t.form_type,value:a[n.property]},scopedSlots:e._u([{key:"default",fn:function(i){return i.data,[e._v("\n "+e._s(e.fieldFormatter(a,n,a[n.property],t))+"\n ")]}}])})]}}])})}),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:{"crm-type":e.crmType},on:{change:e.setSave}})]}}])}),e._v(" "),i("wk-empty",{attrs:{slot:"empty",props:{buttonTitle:"新建回访",showButton:e.saveAuth}},on:{click:e.createClick},slot:"empty"})],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,"page-list":e.crmType==e.rowType?e.list:[],"page-index":e.rowIndex},on:{"update:visible":function(t){e.showDview=t},"update:id":function(t){e.rowID=t},"update:pageIndex":function(t){e.rowIndex=t},handle:e.handleHandle}}),e._v(" "),e.createShow?i("visit-create",{on:{close:function(t){e.createShow=!1},"save-success":e.handleHandle}}):e._e()],1)},[],!1,null,"293a17a3",null);c.options.__file="index.vue";t.default=c.exports},"3Byl":function(e,t,i){"use strict";var s=i("J8i2");i.n(s).a},"3ojK":function(e,t,i){"use strict";var s=i("c2Co"),a=i("4XAY"),n=i("Ew9n"),o=i("raay"),l=i("eOwn"),c=i("BzA1"),r=i("w4ZA"),u=i("3gPr"),d=i("CjUg"),h=i("8OTK"),p=i("f6dm"),f={name:"LeadsDetail",components:{SlideView:n.a,CRMDetailHead:o.a,Activity:l.a,CRMEditBaseInfo:r.a,RelativeFiles:u.a,RelativeHandle:d.a,ImportInfo:c.a,CRMAllCreate:h.default},mixins:[p.a],props:{id:[String,Number],listenerIDs:{type:Array,default:function(){return["crm-main-container"]}},noListenerIDs:{type:Array,default:function(){return[]}},noListenerClass:{type:Array,default:function(){return["el-table__body"]}}},data:function(){return{loading:!1,crmType:"leads",headDetails:[{title:"姓名",value:""},{title:"线索来源",value:""},{title:"手机",value:""},{title:"负责人",value:""},{title:"创建时间",value:""}],tabCurrentName:"Activity",isCreate:!1,showImportInfo:!0,importList:[]}},computed:{activityHandle:function(){var e=[];return this.canCreateFollowRecord&&(e=[{type:"log",label:"写跟进"}]),e},tabNames:function(){return[{label:"活动",name:"Activity"},{label:"详细资料",name:"CRMEditBaseInfo"},{label:this.getTabName("附件",this.tabsNumber.fileCount),name:"RelativeFiles"},{label:"操作记录",name:"RelativeHandle"}]}},mounted:function(){},methods:{getDetial:function(){var e=this;this.loading=!0,Object(s.i)({id:this.id}).then(function(t){e.detailData=t.data,0!==e.detailData.dataAuth&&(e.headDetails[0].value=t.data.name,e.headDetails[1].value=t.data.source,e.headDetails[2].value=t.data.mobile,e.headDetails[3].value=t.data.owner_user_id_info.realname||"",e.headDetails[4].value=t.data.create_time,e.loading=!1)}).catch(function(){e.loading=!1,e.hideView()}),this.getBaseInfo()},getBaseInfo:function(){var e=this;this.loading=!0,Object(a.y)({id:this.id,types:"crm_"+this.crmType,action_id:this.id,module:"crm",controller:this.crmType,action:"read",system:1}).then(function(t){e.importList=t.data,e.loading=!1}).catch(function(){e.loading=!1})},hideView:function(){this.$emit("hide-view")}}},m=(i("/Qhs"),i("KHd+")),v=Object(m.a)(f,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("slide-view",{directives:[{name:"empty",rawName:"v-empty",value:!e.canShowDetail,expression:"!canShowDetail"}],attrs:{"listener-ids":e.listenerIDs,"no-listener-ids":e.noListenerIDs,"no-listener-class":e.noListenerClass,"body-style":{padding:0,height:"100%"},"xs-empty-icon":"nopermission","xs-empty-text":"暂无权限"},on:{afterEnter:e.viewAfterEnter,close:e.hideView}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"crmDetailMain",staticClass:"detail-main"},[e.canShowDetail&&e.detailData?i("flexbox",{staticClass:"d-container",attrs:{direction:"column",align:"stretch"}},[i("c-r-m-detail-head",{attrs:{detail:e.detailData,"head-details":e.headDetails,id:e.id,"page-list":e.pageList,"crm-type":e.crmType},on:{pageChange:e.pageChange,handle:e.detailHeadHandle,close:e.hideView}},[i("template",{slot:"name"},[i("el-tooltip",{attrs:{content:0==e.detailData.star?"添加关注":"取消关注",effect:"dark",placement:"top"}},[i("i",{staticClass:"wk wk-focus-on focus-icon",class:{active:0!=e.detailData.star},on:{click:function(t){e.toggleStar()}}})])],1)],2),e._v(" "),i("flexbox",{staticClass:"d-container-bd",attrs:{align:"stretch"}},[i("el-tabs",{staticClass:"d-container-bd--left",attrs:{type:"border-card"},model:{value:e.tabCurrentName,callback:function(t){e.tabCurrentName=t},expression:"tabCurrentName"}},e._l(e.tabNames,function(t,s){return i("el-tab-pane",{key:s,attrs:{label:t.label,name:t.name,lazy:""}},[i(t.name,{tag:"component",attrs:{detail:e.detailData,id:e.id,handle:e.activityHandle,"crm-type":e.crmType},on:{handle:e.detailHeadHandle}})],1)})),e._v(" "),i("transition",{attrs:{name:"slide-fade"}},[i("el-tabs",{directives:[{name:"show",rawName:"v-show",value:e.showImportInfo,expression:"showImportInfo"}],staticClass:"d-container-bd--right",attrs:{value:"chiefly-contacts",type:"border-card"}},[i("el-tab-pane",{attrs:{label:"重要信息",name:"chiefly-contacts",lazy:""}},[i("import-info",{staticClass:"import-info",attrs:{list:e.importList}})],1)],1)],1)],1)],1):e._e()],1),e._v(" "),i("el-button",{staticClass:"firse-button",on:{click:function(t){e.showImportInfo=!e.showImportInfo}}},[e._v("重"),i("br"),e._v("要"),i("br"),e._v("信"),i("br"),e._v("息"),i("br"),i("i",{staticClass:"el-icon-arrow-right el-icon--right",class:{"is-reverse":!e.showImportInfo}})]),e._v(" "),e.isCreate?i("c-r-m-all-create",{attrs:{action:{type:"update",id:e.id,batchId:e.detailData.batchId},"crm-type":e.crmType},on:{"save-success":e.editSaveSuccess,close:function(t){e.isCreate=!1}}}):e._e()],1)},[],!1,null,"136f936f",null);v.options.__file="Detail.vue";t.a=v.exports},"5Nny":function(e,t,i){},"5QVi":function(e,t,i){"use strict";var s=i("QbLZ"),a=i.n(s),n=i("L2JU"),o=i("8OTK"),l=i("7Dod"),c=i("WGjG"),r=i("ZoMv"),u={name:"DuplicateCheck",components:{AllocHandle:c.a,CRMFullScreenDetail:function(){return Promise.all([i.e("chunk-3146"),i.e("chunk-29ec"),i.e("chunk-2a3e"),i.e("chunk-21d9"),i.e("chunk-78d3")]).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:{},pool_id:"",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(l.a)(t).then(function(t){e.loading=!1;var i=t.data||[];e.tableData=i.map(function(t){return t.pool_name&&(t.module=t.module+"("+t.pool_name+")"),e.isCustomerFilter||(t.mobile=e.searchContent,t.type==r.a.contacts&&(t.contactsName=t.name,t.contactsId=t.id,t.name=t.customerName,t.id=t.customerId,t.type=r.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.pool_id=e.poolAuthList.pool_id:this.pool_id="";var s=r.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(l.O)({customer_id:[t.id],pool_id:t.poolAuthList.pool_id}).then(function(e){i.$message.success("操作成功"),i.getList()}).catch(function(){})}).catch(function(){}):(t.customer_id=t.id,this.relationData=t,this.allocDialogShow=!0)}}},d=(i("fd0J"),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.pool_id},on:{"update:visible":function(t){e.showFullDetail=t},handle:e.getList}}),e._v(" "),i("alloc-handle",{attrs:{pool_id:e.pool_id,"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,"3345d4b3",null);h.options.__file="index.vue";var p=h.exports,f={name:"CRMListHead",components:{CRMAllCreate:o.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:a()({},Object(n.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.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,{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}}},m=(i("zMNN"),Object(d.a)(f,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,"fce8e416",null));m.options.__file="CRMListHead.vue";var v=m.exports,y=i("YEIV"),_=i.n(y),g=i("4XAY"),b=i("c2Co"),w=i("AAeT"),C=i("ERJp"),k=i("d9x6"),T=i("1DpC"),x=i("Y4Le"),S=i("zhwh"),D=i("TAVA"),I=i("j4Q1"),L={name:"SceneList",components:{},props:{crmType:{type:String,default:""}},data:function(){return{sceneSelectId:-1,sceneList:[]}},computed:a()({},Object(n.b)(["crm"])),watch:{},mounted:function(){this.crm[this.crmType].index&&this.getSceneList()},methods:{getSceneList:function(){var e=this;Object(g.s)({types:r.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 j=O.exports,$=i("t2rG"),N=i.n($),A=i("EJiy"),F=i.n(A),E=i("KTTK"),V=i("6iAj"),M=i("8GhS"),R=i("Woz+"),H=i("7Qib"),P=i("QEKj"),B=i("a/5N"),z={name:"SceneCreate",components:{XhUserCell:M.p,XhProuctCate:M.j,VDistpicker:R.a,XhStructureCell:M.n},mixins:[P.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 a=s.typeOption.find(function(e){return e.type_id===i.type_id});s.statusOption=a?a.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 n=i.value;s.address=n}else s.setting=i.setting,s.value=Object(B.a)(i.value)?i.value.join(";"):i.value;t.form.push(s)};for(var s in this.obj.obj)i(s)}else this.form=Object(H.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(E.y)({pageType:0}).then(function(i){for(var s=i.data||[],a=0;a0?(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;t0){var t=e[0];return void 0===t?"undefined":F()(t)}return[]}}},q=(i("Rih2"),Object(d.a)(z,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&&"string"!=e.getSettingValueType(t.setting)||"deal_status "===t.form_type&&"string"!=e.getSettingValueType(t.setting)||"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.value,attrs:{label:e.value,value:e.value}})})):"select"===t.form_type||"checkbox"===t.form_type||"check_status"===t.form_type||"deal_status"===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,"404b44b9",null));q.options.__file="SceneCreate.vue";var U=q.exports,W={name:"SceneSet",components:{draggable:N.a,SceneCreate:U},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:r.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:r.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:r.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 a=!1;return t.rightCheckItems.forEach(function(t,i){e.scene_id==t.scene_id&&(a=!0)}),!a}),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 a=!1;return t.leftCheckItems.forEach(function(t,i){e.scene_id==t.scene_id&&(a=!0)}),!a}),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())}}},K=(i("0IZ6"),Object(d.a)(W,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));K.options.__file="SceneSet.vue";var Q=K.exports,X=i("+lNB"),Y=i("p3/6"),J=i("nslc"),Z=i("JCWM"),G=i("XJYT"),ee={name:"CRMTableHead",components:{FilterForm:D.a,FilterContent:I.a,SceneList:j,TransferHandle:X.a,TeamsHandle:Y.a,AllocHandle:c.a,SceneCreate:U,SceneSet:Q,DealStatusHandle:J.a,PutPoolHandle:Z.a},props:{title:{type:String,default:""},crmType:{type:String,default:""},isSeas:{type:Boolean,default:!1},pool_id:[String,Number],poolAuth:Object,sortData:Object,handleFun:Function},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,teamsType:"",allocDialogShow:!1,dealStatusShow:!1,putPoolShow:!1}},computed:a()({},Object(n.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=G.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="crm_customer_pool":t.types=r.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:r.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:r.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(this.handleFun)this.handleFun(e);else if("transfer"==e)this.transferDialogShow=!0;else if("export"==e){var i={},s=null;this.isSeas?(s=l.s,i.pool_id=this.pool_id,i.customer_id=this.selectionList.map(function(e){return e.customer_id})):(s={customer:l.g,leads:b.d,contacts:w.d,business:C.d,contract:k.d,receivables:T.c,product:x.d}[this.crmType],i[this.crmType+"_id"]=this.selectionList.map(function(e){return e[t.crmType+"_id"]})),s(i).then(function(e){Object(H.c)(e)}).catch(function(){})}else if("transform"==e||"delete"==e||"lock"==e||"unlock"==e||"start"==e||"disable"==e||"get"==e){var a="";"transform"==e?a="确定将这些线索转换为客户吗?":"delete"==e?a=this.isSeas?"若客户下有联系人,联系人将一并删除。确定删除?":"确定删除选中的"+this.selectionList.length+"项吗?":"lock"==e?a="确定要锁定这些客户吗?锁定后将不会掉入公海。":"unlock"==e?a="确定要解锁这些客户吗?":"start"==e?a="确定要上架这些产品吗?":"disable"==e?a="确定要下架这些产品吗?":"get"==e&&(a="确定要领取该客户吗?"),this.$confirm(a,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.confirmHandle(e)}).catch(function(){})}else"add_user"==e?(this.teamsType="add",this.teamsDialogShow=!0):"delete_user"==e?(this.teamsType="delete",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(l.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(x.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?l.p:l.c,contacts:w.a,business:C.b,contract:k.b,receivables:T.a,visit:S.a,product:x.a}[this.crmType],a={};this.isSeas&&(a.pool_id=this.pool_id,a.isSeas=1),a.id=i,this.loading=!0,s(this.isSeas?a:{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(l.O)({customer_id:this.selectionList.map(function(e){return e.customer_id}),pool_id:this.pool_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"},reset_invoice_status:{name:"重置开票信息",type:"reset_invoice_status",icon:"reset"}};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","add_user","delete_user"]):"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","add_user","delete_user"]):"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"]):"invoice"==this.crmType?this.forSelectionHandleItems(e,["delete","reset_invoice_status","transfer"]):void 0},forSelectionHandleItems:function(e,t){for(var i=[],s=0;s0?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(" "),e.transferDialogShow?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._e(),e._v(" "),e.teamsDialogShow?i("teams-handle",{attrs:{"crm-type":e.crmType,type:e.teamsType,"selection-list":e.selectionList,"dialog-visible":e.teamsDialogShow},on:{"update:dialogVisible":function(t){e.teamsDialogShow=t},handle:e.handleCallBack}}):e._e(),e._v(" "),i("alloc-handle",{attrs:{"crm-type":e.crmType,pool_id:e.pool_id,"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,"4ea53f98",null));te.options.__file="CRMTableHead.vue";var ie=te.exports,se={name:"FieldSet",components:{Draggable:N.a},props:{crmType:String,isSeas:{type:Boolean,default:!1},pool_id:[String,Number]},data:function(){return{loading:!1,show:!1,poolConfig:1,fields:[],copyfields:[],search:""}},computed:{},watch:{show:function(e){e&&this.getList()},pool_id: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.pool_id=this.pool_id):(t=g.j,i.types=r.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(H.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.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.pool_id=this.pool_id,i.types=r.a[this.crmType]+"_pool"):(t=g.i,i.types=r.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(H.t)(this.copyfields)}}},ae=(i("feCj"),Object(d.a)(se,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,"5c1e4d05",null));ae.options.__file="index.vue";var ne=ae.exports,oe=i("VcMt"),le=i("jtZb"),ce={emptyText:"",showButton:!1,buttonIcon:"el-icon-plus",buttonTitle:""},re={name:"WkEmpty",components:{},props:{props:Object},data:function(){return{}},computed:{config:function(){return Object(le.a)(a()({},ce),this.props||{})}},watch:{},created:function(){},mounted:function(){},beforeDestroy:function(){},methods:{btnClick:function(){this.$emit("click")}}},ue=(i("zlLh"),Object(d.a)(re,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"wk-empty"},[i("div",{staticClass:"wk-empty__title"},[e._v(e._s(e.config.emptyText||"暂无数据"))]),e._v(" "),e.config.showButton?i("el-button",{staticClass:"wk-empty__button xr-btn--orange",attrs:{icon:e.config.buttonIcon,type:"primary"},on:{click:e.btnClick}},[e._v(e._s(e.config.buttonTitle||"新建"))]):e._e()],1)},[],!1,null,null,null));ue.options.__file="index.vue";var de=ue.exports,he=i("4peS"),pe=i.n(he),fe=i("dAOq"),me=i("jHPx"),ve=i("m77o"),ye=i("iWcH");t.a={components:{CRMListHead:v,CRMTableHead:ie,FieldSet:ne,WkEmpty:de,WkFieldView:ye.default},data:function(){return{loading:!1,tableHeight:document.documentElement.clientHeight-235,list:[],fieldList:[],sortData:{},currentPage:1,pageSize:pe.a.get("crmPageSizes")||15,pageSizes:[15,30,60,100],total:0,search:"",rowID:"",rowType:"",showDview:!1,filterObj:[],scene_id:"",sceneName:"",selectionList:[],moneyFields:[],isRequested:!1,rowIndex:0}},mixins:[fe.a],computed:a()({},Object(n.b)(["crm"]),{saveAuth:function(){return!this.isSeas&&this.crm[this.crmType].save}}),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",contract_number:"contract_id",plan_id_info:"plan_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.pool_id&&(i.pool_id=this.pool_id),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",plan_id_info:"plan_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)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?l.u:l.k:"contacts"===this.crmType?w.g:"business"===this.crmType?C.f:"contract"===this.crmType?k.f:"product"===this.crmType?x.g:"receivables"===this.crmType?T.e:"visit"===this.crmType?S.c:"invoice"===this.crmType?oe.e:void 0},getFieldList:function(e){var t=this;if(0==this.fieldList.length||e){this.loading=!0;var i={};this.isSeas?(this.pool_id&&(i.pool_id=this.pool_id),i={types:"crm_"+this.crmType,module:"crm",action:"pool",controller:this.crmType,pool_id:this.pool_id}):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=[],a=0;a0)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.rowType="product",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_num"===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:"invoice"==this.crmType&&("customer_name"===t.property?(this.rowID=e.customer_id,this.rowType="customer",this.showDview=!0):"contract_num"===t.property?(this.rowID=e.contract_id,this.rowType="contract",this.showDview=!0):"invoice_apple_number"===t.property?(this.rowID=e.invoice_id,this.rowType="invoice",this.showDview=!0):this.showDview=!1);this.rowIndex=this.getRowIndex(),this.showDview&&this.$store.commit("SET_COLLAPSE",this.showDview)}},getRowIndex:function(){for(var e=0,t=0;t0&&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",plan_id_info:"plan_id"}[t.type]||t.type]=t});var t=void 0;t=this.isSeas?l.r:{customer:l.f,leads:b.c,contacts:w.c,business:C.c,contract:k.c,receivables:T.b,product:x.c,invoice:oe.c}[this.crmType];var i=G.Loading.service({fullscreen:!0,text:"导出中..."});t(e).then(function(e){Object(H.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()},refreshList:function(){this.currentPage=1,this.getFieldList()},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 a,n=null;if(this.fieldList.forEach(function(e){i.property===e.prop&&(a=e.prop)}),!a)return;var o={types:"crm_"+this.crmType,width:e,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",contract_number:"contract_id",plan_id_info:"plan_id"}[i.property]||a};if(this.isSeas){if(!this.pool_id)return;n=g.l,o.pool_id=this.pool_id}else n=g.h;n(o).then(function(e){}).catch(function(){})}},handleSizeChange:function(e){pe.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:l.U,contacts:w.m,business:C.o}[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(){}}},"77fj":function(e,t,i){"use strict";var s=i("Btlj");i.n(s).a},"7F5A":function(e,t,i){},"90Gi":function(e,t,i){},"9m+X":function(e,t,i){},Btlj:function(e,t,i){},BzA1:function(e,t,i){"use strict";var s=i("iWcH"),a=i("a/5N"),n=i("m77o"),o={name:"ImportInfo",components:{WkFieldView:s.default},props:{list:Array,detail:{type:Object,default:function(){return{}}}},data:function(){return{}},computed:{showList:function(){return this.list.filter(function(e){return"file"!==e.form_type&&"detail_table"!==e.form_type&&"map_address"!==e.form_type})}},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{getCommonShowValue:function(e){return this.isModule(e)?this.getModuleName(e):Object(n.a)(e.form_type,e.value,"",e)},isModule:function(e){return["customer","business","contract","contacts"].includes(e.form_type)},getModuleName:function(e){var t={customer:"name",business:"name",contract:"name",contacts:"name"}[e.form_type];if(t){var i={};return Object(a.c)(e.value)?i=e.value:Object(a.a)(e.value)&&e.value.length>0&&(i=e.value[0]),i[t]||""}var s={category:"categoryName"}[e.form_type];return e.value?e.value[s]:""}}},l=(i("EWN0"),i("KHd+")),c=Object(l.a)(o,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("div",{key:s,staticClass:"detail-cell"},[i("div",{staticClass:"detail-cell__label"},[e._v("\n "+e._s(t.name)+"\n ")]),e._v(" "),i("div",{staticClass:"detail-cell__value"},[i("wk-field-view",{attrs:{props:t,form_type:t.form_type,value:t.value},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.data;return["business_type"===s.form_type?i("span",[e._v(e._s(e.detail?e.detail.typeName:""))]):"business_status"===s.form_type?i("span",[e._v(e._s(e.detail?e.detail.statusName:""))]):"category"===s.form_type?i("span",[e._v(e._s(e.detail?e.detail.categoryName:""))]):"receivables_plan"===s.form_type?i("span",[e._v(e._s(e.detail?e.detail.planNum:""))]):i("span",[e._v(e._s(e.getCommonShowValue(s)))])]}}])})],1)])})],2)},[],!1,null,"1e9b3d61",null);c.options.__file="ImportInfo.vue";t.a=c.exports},EWN0:function(e,t,i){"use strict";var s=i("NdXD");i.n(s).a},"I+NK":function(e,t,i){"use strict";var s=i("PWYh");i.n(s).a},J8i2:function(e,t,i){},Lc7H:function(e,t,i){},"N8+3":function(e,t,i){"use strict";var s=i("epE4");i.n(s).a},NdXD:function(e,t,i){},PQ21:function(e,t,i){"use strict";var s=i("xPe9");i.n(s).a},PWYh:function(e,t,i){},QEKj:function(e,t,i){"use strict";t.a={methods:{getAdvancedFilterOptions:function(e,t){return"text"==e||"textarea"==e||"website"==e||"mobile"==e||"email"==e||"module"==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:12},{value:"endWith",label:"结束于",disabled:!1,type:13},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6}]:"invoice_status"===t||"check_status"==e||"deal_status"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2}]:"select"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6}]:"boolean_value"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2}]:"checkbox"==e||"location"==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}]:"number"==e||"floatnumber"==e||"percent"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{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},{value:"range",label:"等于(范围)",disabled:!1,type:14},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6}]:"date"==e||"datetime"==e?[{value:"is",label:"等于",disabled:!1,type:1},{value:"isNot",label:"不等于",disabled:!1,type:2},{value:"lt",label:"早于",disabled:!1,type:9},{value:"gt",label:"晚于",disabled:!1,type:7},{value:"egt",label:"不早于",disabled:!1,type:8},{value:"elt",label:"不晚于",disabled:!1,type:10},{value:"range",label:"等于(时间段)",disabled:!1,type:14},{value:"isNull",label:"为空",disabled:!1,type:5},{value:"isNotNull",label:"不为空",disabled:!1,type:6}]:"date_interval"==e||"position"==e?[]:"user"==e||"structure"==e||"single_user"==e?[{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}]:[]}}}},Rih2:function(e,t,i){"use strict";var s=i("jxmF");i.n(s).a},TAVA:function(e,t,i){"use strict";var s=i("EJiy"),a=i.n(s),n=i("8GhS"),o=i("Woz+"),l=i("Cj4h"),c=i("XAon"),r=i("3pgX"),u=i("7Qib"),d=i("QEKj"),h=i("a/5N"),p={name:"Index",components:{XhProuctCate:n.j,VDistpicker:o.a,WkPosition:l.a,WkUserSelect:c.a,WkDepSelect:r.a},mixins:[d.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(u.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=[]},userDepChange:function(e,t,i){e.valueContent=i},selectChange:function(e,t){this.getAdvancedFilterOptions(t.form_type).forEach(function(i){i.value===e&&(t.type=i.type)})},showCalCondition:function(e,t){return this.getAdvancedFilterOptions(e,t).length>0},getValueSpan:function(e,t){return"business_type"==e?8:this.showCalCondition(e,t)?8:13},fieldFocus:function(){this.$el.click()},fieldChange:function(e){var t=this.fieldList.find(function(t){return t.field===e.field});if(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:""}:"user"===e.form_type||"single_user"===e.form_type||"structure"===e.form_type||"category"===e.form_type||"position"===e.form_type?e.value=[]:"date"===e.form_type||"datetime"===e.form_type?(e.value="",this.$set(e,"timeType",""),this.$set(e,"timeTypeName",""),this.$set(e,"range",[])):"select"==e.form_type||"checkbox"===e.form_type?(e.setting=t.setting||[],e.value=[]):"number"==e.form_type||"floatnumber"==e.form_type||"percent"==e.form_type?(e.min="",e.max="",e.value=""):e.value="";var i=this.getAdvancedFilterOptions(e.form_type,e.field);if(i.length>0){var s=i[0];e.condition=s.value,e.type=s.type}else 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;t0){var t=e[0];return void 0===t?"undefined":a()(t)}return[]},dateRangeSelect:function(e,t){var i=this.$refs["wkDatePicker"+t][0];this.$nextTick(function(){i.focus(),i.pickerVisible=!0})},datePickerChange:function(e){e.timeTypeName="",e.timeType=""},getPickerOptions:function(e,t){for(var i=this,s=[{text:"本年度",value:"year"},{text:"上一年度",value:"lastYear"},{text:"下一年度",value:"nextYear"},{text:"上半年",value:"firstHalfYear"},{text:"下半年",value:"nextHalfYear"},{text:"本季度",value:"quarter"},{text:"上一季度",value:"lastQuarter"},{text:"下一季度",value:"nextQuarter"},{text:"本月",value:"month"},{text:"上月",value:"lastMonth"},{text:"下月",value:"nextMonth"},{text:"本周",value:"week"},{text:"上周",value:"lastWeek"},{text:"下周",value:"nextWeek"},{text:"今天",value:"today"},{text:"昨天",value:"yesterday"},{text:"明天",value:"tomorrow"},{text:"过去7天",value:"previous7day"},{text:"过去30天",value:"previous30day"},{text:"未来7天",value:"future7day"},{text:"未来30天",value:"future30day"}],a=[],n=function(t){var n=s[t];a.push({text:n.text,onClick:function(t){t.$emit("pick",[],!1),i.$nextTick(function(){e.timeTypeName=n.text,e.timeType=n.value})}})},o=0;o0);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;i0&&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,"2caf5be7",null);b.options.__file="LogAdd.vue";var w=b.exports,C=i("O8VQ"),k=i("/G0b"),T=i("8OTK"),x=i("C3Po"),S=i("ZoMv"),D=i("Z+Ht"),I=i("vvxI"),L=i("ZX9L"),O=i("ehos"),j=i("L2JU"),$={name:"Activity",components:{LogAdd:w,LogCell:C.a,CRMAllCreate:T.default,TaskQuickAdd:x.a,TimeTypeSelect:L.a,LogEditDialog:k.a,CRMFullScreenDetail:function(){return Promise.all([i.e("chunk-29ec"),i.e("chunk-21d9"),i.e("chunk-a3e9"),i.e("chunk-55538")]).then(i.bind(null,"3z7q"))}},mixins:[D.a,I.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(j.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.I)({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:S.a.keyToTypeData[this.crmType],activity_type_id:e.id,content:e.content,next_time:e.nextTime||"",is_event:0,file_id:[].concat(a()(e.files.map(function(e){return e.file_id})),a()(e.images.map(function(e){return e.file_id}))),business_ids:[].concat(a()(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:S.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)($,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(a,n){return[1==a.type?i("div",{key:n,staticClass:"log-cell",class:{"only-one":1==t.list.length}},[i("log-cell",{attrs:{item:a,section:s,index:n,"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:n,staticClass:"log-cell activity-cell",class:{"only-one":1==t.list.length}},[2==a.type?i("div",{staticClass:"activity-cell"},[i("span",{staticClass:"activity-cell__label"},[e._v(e._s(a.update_time)+" "+e._s(a.create_user_name)+"创建了"+e._s(e.getActivityTypeName(a.activity_type))+":")]),i("span",{staticClass:"activity-cell__content",on:{click:function(t){e.checkCRMDetail(e.getActivityType(a.activity_type),a.activity_type_id)}}},[e._v(e._s(a.activity_type_name||"查看详情"))])]):3==a.type?i("div",{staticClass:"activity-cell"},[i("span",{staticClass:"activity-cell__label"},[e._v(e._s(a.update_time)+" "+e._s(a.create_user_name)+"将商机:")]),e._v(" "),i("span",{staticClass:"activity-cell__content",on:{click:function(t){e.checkCRMDetail("business",a.activity_type_id)}}},[e._v(e._s(a.activity_type_name))]),e._v(" "),i("span",[e._v(e._s(" "+a.content))])]):4==a.type?i("log-cell",{attrs:{item:a,section:s,index:n,"can-delete":""},on:{"crm-detail":e.checkCRMDetail,delete:e.logCellDelete}}):e._e(),e._v(" "),i("i",{staticClass:"log-cell__mark",class:e.getActivityIcon(a.activity_type),staticStyle:{"background-color":"#FB9323"},style:{backgroundColor:e.getActivityTypeColor(a.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},epE4:function(e,t,i){},fd0J:function(e,t,i){"use strict";var s=i("bTmj");i.n(s).a},feCj:function(e,t,i){"use strict";var s=i("9m+X");i.n(s).a},j4Q1:function(e,t,i){"use strict";var s=i("EJiy"),a=i.n(s),n=i("a/5N"),o={name:"FilterContent",mixins:[i("QEKj").a],props:{obj:{type:Object,required:!0,default:function(){return{}}}},data:function(){return{showObj:{}}},computed:{},watch:{obj:function(e){this.showObj=e}},mounted:function(){this.showObj=this.obj},methods:{isNullCondition:function(e){return"isNull"===e.condition||"isNotNull"===e.condition},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})},getConditionName:function(e){var t="";return this.getAdvancedFilterOptions(e.form_type,e.field).forEach(function(i){i.type===e.type&&(t=i.label)}),t},getTypesName:function(e){return e.type_id&&e.typeOption.find(function(t){return t.type_id===e.type_id}).name||""},getNameValue:function(e){return this.isNullCondition(e)?"":e.setting.find(function(t){return t===e.value})||""},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){if(this.isNullCondition(e))return"";var t=e.type;return"未成交"==t?"未成交":"已成交"==t?"已成交":""},getSettingValueType:function(e){if(e&&e.length>0){var t=e[0];return void 0===t?"undefined":a()(t)}return[]},getDateContent:function(e){return this.isNullCondition(e)?"":14===e.type?Object(n.b)(e.timeType)?"“"+e.range.join("-")+"”":"“"+e.timeTypeName+"”":"“"+e.value+"”"},getValueContent:function(e){return this.isNullCondition(e)?"":"number"==e.form_type||"floatnumber"==e.form_type||"percent"==e.form_type?14===e.type?"“"+(Object(n.b)(e.min)?"":e.min)+"-"+(Object(n.b)(e.max)?"":e.max)+"”":"“"+e.value+"”":"user"==e.form_type?"“"+(e.valueContent||e.value).map(function(e){return e.realname}).join(",")+"”":"structure"==e.form_type?"“"+(e.valueContent||e.value).map(function(e){return e.name}).join(",")+"”":"“"+e.value+"”"},getPositionContent:function(e){return e.value.filter(function(e){return!Object(n.b)(e.name)}).map(function(e){return e.name}).join("/")}}},l=(i("mE6H"),i("KHd+")),c=Object(l.a)(o,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||"datetime"===t.form_type?i("span",[e._v(e._s(t.name+" "+e.getConditionName(t)+e.getDateContent(t)))]):"position"==t.form_type?i("span",[e._v(e._s(t.name+" “"+e.getPositionContent(t)+"”"))]):"boolean_value"==t.form_type?i("span",[e._v(e._s(t.name+" "+e.getConditionName(t))+"“"),i("el-switch",{attrs:{value:t.value,disabled:"","active-value":"1","inactive-value":"0"}}),e._v("”")],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.getConditionName(t)+e.getNameValue(t)))]):"deal_status"===t.form_type?i("span",[e._v(e._s(t.name+" "+e.getConditionName(t)+e.getDealStatus(t)))]):"user"===t.form_type||"single_user"===t.form_type?i("span",[e._v(e._s(t.name+" "+e.getConditionName(t)+e.getValueContent(t)))]):"structure"===t.form_type?i("span",[e._v(e._s(t.name+" "+e.getConditionName(t)+e.getValueContent(t)))]):"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.getConditionName(t)+e.getNameValue(t)))]):i("span",[e._v(e._s(t.name+" "+e.getConditionName(t)+e.getValueContent(t)))]),e._v(" "),i("i",{staticClass:"el-icon-close icon",on:{click:function(i){e.handleDelete(t,s)}}})])}))])},[],!1,null,"226a62af",null);c.options.__file="FilterContent.vue";t.a=c.exports},jxmF:function(e,t,i){},mE6H:function(e,t,i){"use strict";var s=i("90Gi");i.n(s).a},rA5U:function(e,t,i){},t1Sh:function(e,t,i){"use strict";var s=i("Lc7H");i.n(s).a},xPe9:function(e,t,i){},zMNN:function(e,t,i){"use strict";var s=i("/TkR");i.n(s).a},zlLh:function(e,t,i){"use strict";var s=i("W6Pm");i.n(s).a}}]);