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-6ff8.38f8b09d.js

1 line
101 KiB

This file contains ambiguous Unicode 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-6ff8","chunk-a3e9","chunk-7f40"],{"/Qhs":function(t,e,i){"use strict";var a=i("7F5A");i.n(a).a},"0H8t":function(t,e,i){"use strict";var a=i("QVgs");i.n(a).a},"1F+2":function(t,e,i){},"1h2A":function(t,e,i){t.exports={xrColorPrimary:"#2362FB"}},"2GGO":function(t,e,i){"use strict";var a=i("61Eu");i.n(a).a},"2MCj":function(t,e,i){"use strict";var a=i("1F+2");i.n(a).a},"3ojK":function(t,e,i){"use strict";var a=i("c2Co"),s=i("4XAY"),n=i("Ew9n"),o=i("raay"),l=i("eOwn"),r=i("BzA1"),c=i("w4ZA"),d=i("3gPr"),u=i("CjUg"),h=i("8OTK"),p=i("f6dm"),m={name:"LeadsDetail",components:{SlideView:n.a,CRMDetailHead:o.a,Activity:l.a,CRMEditBaseInfo:c.a,RelativeFiles:d.a,RelativeHandle:u.a,ImportInfo:r.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 t=[];return this.canCreateFollowRecord&&(t=[{type:"log",label:"写跟进"}]),t},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 t=this;this.loading=!0,Object(a.i)({id:this.id}).then(function(e){t.detailData=e.data,0!==t.detailData.dataAuth&&(t.headDetails[0].value=e.data.name,t.headDetails[1].value=e.data.source,t.headDetails[2].value=e.data.mobile,t.headDetails[3].value=e.data.owner_user_id_info.realname||"",t.headDetails[4].value=e.data.create_time,t.loading=!1)}).catch(function(){t.loading=!1,t.hideView()}),this.getBaseInfo()},getBaseInfo:function(){var t=this;this.loading=!0,Object(s.y)({id:this.id,types:"crm_"+this.crmType,action_id:this.id,module:"crm",controller:this.crmType,action:"read",system:1}).then(function(e){t.importList=e.data,t.loading=!1}).catch(function(){t.loading=!1})},hideView:function(){this.$emit("hide-view")}}},f=(i("/Qhs"),i("KHd+")),v=Object(f.a)(m,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("slide-view",{directives:[{name:"empty",rawName:"v-empty",value:!t.canShowDetail,expression:"!canShowDetail"}],attrs:{"listener-ids":t.listenerIDs,"no-listener-ids":t.noListenerIDs,"no-listener-class":t.noListenerClass,"body-style":{padding:0,height:"100%"},"xs-empty-icon":"nopermission","xs-empty-text":"暂无权限"},on:{afterEnter:t.viewAfterEnter,close:t.hideView}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"crmDetailMain",staticClass:"detail-main"},[t.canShowDetail&&t.detailData?i("flexbox",{staticClass:"d-container",attrs:{direction:"column",align:"stretch"}},[i("c-r-m-detail-head",{attrs:{detail:t.detailData,"head-details":t.headDetails,id:t.id,"page-list":t.pageList,"crm-type":t.crmType},on:{pageChange:t.pageChange,handle:t.detailHeadHandle,close:t.hideView}},[i("template",{slot:"name"},[i("el-tooltip",{attrs:{content:0==t.detailData.star?"添加关注":"取消关注",effect:"dark",placement:"top"}},[i("i",{staticClass:"wk wk-focus-on focus-icon",class:{active:0!=t.detailData.star},on:{click:function(e){t.toggleStar()}}})])],1)],2),t._v(" "),i("flexbox",{staticClass:"d-container-bd",attrs:{align:"stretch"}},[i("el-tabs",{staticClass:"d-container-bd--left",attrs:{type:"border-card"},model:{value:t.tabCurrentName,callback:function(e){t.tabCurrentName=e},expression:"tabCurrentName"}},t._l(t.tabNames,function(e,a){return i("el-tab-pane",{key:a,attrs:{label:e.label,name:e.name,lazy:""}},[i(e.name,{tag:"component",attrs:{detail:t.detailData,id:t.id,handle:t.activityHandle,"crm-type":t.crmType},on:{handle:t.detailHeadHandle}})],1)})),t._v(" "),i("transition",{attrs:{name:"slide-fade"}},[i("el-tabs",{directives:[{name:"show",rawName:"v-show",value:t.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:t.importList}})],1)],1)],1)],1)],1):t._e()],1),t._v(" "),i("el-button",{staticClass:"firse-button",on:{click:function(e){t.showImportInfo=!t.showImportInfo}}},[t._v("重"),i("br"),t._v("要"),i("br"),t._v("信"),i("br"),t._v("息"),i("br"),i("i",{staticClass:"el-icon-arrow-right el-icon--right",class:{"is-reverse":!t.showImportInfo}})]),t._v(" "),t.isCreate?i("c-r-m-all-create",{attrs:{action:{type:"update",id:t.id,batchId:t.detailData.batchId},"crm-type":t.crmType},on:{"save-success":t.editSaveSuccess,close:function(e){t.isCreate=!1}}}):t._e()],1)},[],!1,null,"136f936f",null);v.options.__file="Detail.vue";e.a=v.exports},"61Eu":function(t,e,i){},"77fj":function(t,e,i){"use strict";var a=i("Btlj");i.n(a).a},"7F5A":function(t,e,i){},BsgX:function(t,e,i){"use strict";var a={name:"ReportMenu",components:{},mixins:[i("Z+Ht").a],props:{list:Array},data:function(){return{}},computed:{},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{itemClick:function(t){this.$emit("select",t)}}},s=(i("2MCj"),i("KHd+")),n=Object(s.a)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("span",{staticClass:"report-menu"},t._l(t.list,function(e,a){return i("span",{key:a,staticClass:"report-menu-btn",on:{click:function(i){t.itemClick(e)}}},[i("i",{staticClass:"report-menu-btn__icon",class:t.getXrIcon(e.type),style:{color:t.getXrIconColor(e.type)}}),t._v(" "),i("span",{staticClass:"report-menu-btn__name"},[t._v(t._s(e.name))])])}))},[],!1,null,"37799401",null);n.options.__file="ReportMenu.vue";e.a=n.exports},Btlj:function(t,e,i){},BzA1:function(t,e,i){"use strict";var a=i("iWcH"),s=i("a/5N"),n=i("m77o"),o={name:"ImportInfo",components:{WkFieldView:a.default},props:{list:Array,detail:{type:Object,default:function(){return{}}}},data:function(){return{}},computed:{showList:function(){return this.list.filter(function(t){return"file"!==t.form_type&&"detail_table"!==t.form_type&&"map_address"!==t.form_type})}},watch:{},mounted:function(){},beforeDestroy:function(){},methods:{getCommonShowValue:function(t){return this.isModule(t)?this.getModuleName(t):Object(n.a)(t.form_type,t.value,"",t)},isModule:function(t){return["customer","business","contract","contacts"].includes(t.form_type)},getModuleName:function(t){var e={customer:"name",business:"name",contract:"name",contacts:"name"}[t.form_type];if(e){var i={};return Object(s.c)(t.value)?i=t.value:Object(s.a)(t.value)&&t.value.length>0&&(i=t.value[0]),i[e]||""}var a={category:"categoryName"}[t.form_type];return t.value?t.value[a]:""}}},l=(i("EWN0"),i("KHd+")),r=Object(l.a)(o,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[i("div",{staticClass:"content-title"},[t._v("基本信息")]),t._v(" "),t._l(t.showList,function(e,a){return i("div",{key:a,staticClass:"detail-cell"},[i("div",{staticClass:"detail-cell__label"},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),i("div",{staticClass:"detail-cell__value"},[i("wk-field-view",{attrs:{props:e,form_type:e.form_type,value:e.value},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.data;return["business_type"===a.form_type?i("span",[t._v(t._s(t.detail?t.detail.typeName:""))]):"business_status"===a.form_type?i("span",[t._v(t._s(t.detail?t.detail.statusName:""))]):"category"===a.form_type?i("span",[t._v(t._s(t.detail?t.detail.categoryName:""))]):"receivables_plan"===a.form_type?i("span",[t._v(t._s(t.detail?t.detail.planNum:""))]):i("span",[t._v(t._s(t.getCommonShowValue(a)))])]}}])})],1)])})],2)},[],!1,null,"1e9b3d61",null);r.options.__file="ImportInfo.vue";e.a=r.exports},EWN0:function(t,e,i){"use strict";var a=i("NdXD");i.n(a).a},HTnC:function(t,e,i){"use strict";var a=i("e1ag");i.n(a).a},"I+NK":function(t,e,i){"use strict";var a=i("PWYh");i.n(a).a},IDBX:function(t,e,i){},KmSi:function(t,e,i){"use strict";var a=i("YEIV"),s=i.n(a),n=i("QbLZ"),o=i.n(n),l=i("4XAY"),r=i("ZoMv"),c=i("yPq4"),d=i("O8VQ"),u=i("Ew9n"),h={name:"RecordList",components:{LogCell:d.a,SlideView:u.a,CRMFullScreenDetail:function(){return Promise.all([i.e("chunk-21d9"),i.e("chunk-555382")]).then(i.bind(null,"3z7q"))}},filters:{crmIconClass:function(t){return"wk wk-"+r.a.convertTypeToKey(t)},crmName:function(t){return r.a.convertTypeToName(t)}},props:{crmType:String,request:Function,params:Object,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,page:1,noMore:!1,list:[],scrollKey:Date.now(),showFullDetail:!1,relationID:"",relationCrmType:""}},computed:{crmIcon:function(){var t=this.crmType.replace("crm_","");return i("p3hS")("./"+t+".png")},scrollDisabled:function(){return this.loading||this.noMore}},watch:{params:function(){this.refreshList()}},mounted:function(){},methods:{refreshList:function(){this.page=1,this.list=[],this.noMore=!1,this.scrollKey=Date.now()},getList:function(){var t=this;this.loading=!0,this.request(o()({page:this.page,limit:15},this.params,{label:1,activity_type:{crm_leads:1,crm_customer:2,crm_contacts:3,crm_business:5,crm_contract:6}[this.crmType]})).then(function(e){t.page++,t.list=t.list.concat(e.data.list),t.noMore=e.data.lastPage,t.loading=!1}).catch(function(){t.noMore=!0,t.loading=!1})},checkRelationDetail:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.relationID=e,this.relationCrmType=i?r.a.convertTypeToKey(t):t,this.showFullDetail=!0},hideView:function(){this.$emit("hide")}}},p=(i("0H8t"),i("KHd+")),m=Object(p.a)(h,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("slide-view",{staticClass:"d-view",attrs:{"listener-ids":t.listenerIDs,"no-listener-ids":t.noListenerIDs,"no-listener-class":t.noListenerClass,"body-style":{padding:0,height:"100%"}},on:{close:t.hideView}},[i("flexbox",{staticClass:"t-section"},[i("img",{staticClass:"t-img",attrs:{src:t.crmIcon}}),t._v(" "),i("div",{staticClass:"t-name"},[t._v("跟进记录")])]),t._v(" "),i("div",{staticClass:"t-content"},[i("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:t.getList,expression:"getList"}],key:t.scrollKey,attrs:{"infinite-scroll-disabled":"scrollDisabled","infinite-scroll-distance":"100"}},t._l(t.list,function(e,a){return i("log-cell",{key:a,attrs:{item:e,index:a,"can-delete":!1},on:{"crm-detail":t.checkRelationDetail}},[i("div",{staticClass:"relate-cell",on:{click:function(i){t.checkRelationDetail(e.activity_type,e.activity_type_id,!0)}}},[i("i",{staticClass:"relate-cell-icon",class:t._f("crmIconClass")(e.activity_type)}),t._v(" "),i("span",{staticClass:"relate-cell-type"},[t._v(t._s(t._f("crmName")(e.activity_type))+"-")]),t._v(" "),i("span",{staticClass:"relate-cell-name"},[t._v(t._s(e.activity_type_name))])])])})),t._v(" "),t.loading?i("p",{staticClass:"scroll-bottom-tips"},[t._v("加载中...")]):t._e(),t._v(" "),t.noMore?i("p",{staticClass:"scroll-bottom-tips"},[t._v("没有更多了")]):t._e()]),t._v(" "),i("c-r-m-full-screen-detail",{attrs:{visible:t.showFullDetail,"crm-type":t.relationCrmType,id:t.relationID},on:{"update:visible":function(e){t.showFullDetail=e}}})],1)},[],!1,null,"54aab209",null);m.options.__file="RecordList.vue";var f=m.exports,v=i("iWcH"),g=i("L2JU"),_=i("4peS"),y=i.n(_),b=i("dAOq"),w={name:"ReportList",components:{CRMAllDetail:c.a,RecordList:f,WkFieldView:v.default},filters:{dealIcon:function(t){return"已成交"==t?"wk wk-success deal-suc":"wk wk-close deal-un"},dealName:function(t){return"已成交"==t?"已成交":"未成交"}},mixins:[b.a],props:{show:{type:Boolean,default:!1},title:String,placeholder:{type:String,default:"请输入搜索内容"},crmType:String,fieldList:Array,recordRequest:Function,request:Function,params:Object,paging:{type:Boolean,default:!0},sortable:{type:[Boolean,String],default:!1}},data:function(){return{inputContent:"",loading:!1,tableHeight:this.getTableHeight(),list:[],showFieldList:[],sortData:{},currentPage:1,pageSize:y.a.get("crmPageSizes")||15,pageSizes:[15,30,60,100],total:0,rowID:"",rowType:"",showDview:!1,recordParams:{},recordShow:!1}},computed:o()({},Object(g.b)(["crm"]),{showExamineStatus:function(){return"contract"==this.crmType&&"receivables"==this.crmType},showFillColumn:function(){return!this.fieldList||!this.fieldList.length}}),watch:{show:function(t){t&&this.initInfo()}},mounted:function(){this.$el.addEventListener("click",this.handleDocumentClick,!1)},destroyed:function(){this.$el&&this.$el.removeEventListener("click",this.handleDocumentClick,!1)},methods:{getTableHeight:function(){var t=document.documentElement.clientHeight;return t-.2*t-200},initInfo:function(){var t=this;this.inputContent="",this.showFieldList=[],this.sortData={},this.$nextTick(function(){t.$refs.crmTable.clearSort()}),this.list=[],this.currentPage=1,window.onresize=function(){t.tableHeight=t.getTableHeight()},this.fieldList?(this.showFieldList=this.fieldList,this.getList()):this.getFieldList()},searchInput:function(){this.currentPage=1,this.getList()},getList:function(){var t=this;this.loading=!0;var e={};e={page:this.currentPage,limit:this.pageSize,types:"crm_"+this.crmType=="crm_record"?"crm_activity":"crm_"+this.crmType},this.placeholder&&(e.search=this.inputContent),this.sortData.order&&(e.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,e.order_type="ascending"==this.sortData.order?"asc":"desc"),this.request(o()({},e,this.params,s()({},"record"!=this.crmType&&"log_type",{customer:1,business:2,receivables:4,contract:3}[this.crmType]))).then(function(e){t.paging?(t.list=e.data.list,t.total=e.data.dataCount):t.list=e.data,t.loading=!1}).catch(function(){t.loading=!1})},getFieldList:function(){var t=this;if(0==this.showFieldList.length){this.loading=!0;var e="business_status"==this.crmType?"business":this.crmType,i={types:"crm_record"==r.a[e]?"crm_activity":r.a[e],module:"crm",action:"index",controller:this.crmType};Object(l.A)(i).then(function(e){for(var i=0;i<e.data.length;i++){var a=e.data[i],s=0;s=a.width?a.width:a.name&&a.name.length<=6?15*a.name.length+45:140,t.showFieldList.push({prop:a.fieldName||a.field,label:a.name,width:s,form_type:a.form_type})}t.getList()}).catch(function(){t.loading=!1})}else this.getList()},fieldFormatter:function(t,e){return this.fieldList&&this.fieldList.length&&"types"==e.property?{crm_leads:"线索",crm_customer:"客户",crm_contacts:"联系人",crm_product:"产品",crm_business:"商机",crm_contract:"合同",crm_receivables:"回款",crm_receivables_plan:"回款计划",crm_pool:"公海",crm_visit:"回访",crm_invoice:"发票"}[t[e.property]]:""===t[e.property]||null===t[e.property]?"--":t[e.property]},sortChange:function(t,e,i){this.sortData=t,this.getList()},handleSizeChange:function(t){y.a.set("crmPageSizes",t),this.pageSize=t,this.getList()},handleCurrentChange:function(t){this.currentPage=t,this.getList()},handleRowClick:function(t,e,i){"leads"===this.crmType?"name"===e.property?(this.rowID=t.leads_id,this.showDview=!0):this.showDview=!1:"customer"===this.crmType?"name"===e.property?(this.rowID=t.customer_id,this.rowType="customer",this.showDview=!0):this.showDview=!1:"contacts"===this.crmType?"name"===e.property?(this.rowID=t.contacts_id,this.rowType="contacts",this.showDview=!0):"customer_name"===e.property?(this.rowID=t.customer_id,this.rowType="customer",this.showDview=!0):this.showDview=!1:"business"===this.crmType||"business_status"===this.crmType?"customer_name"===e.property?(this.rowID=t.customer_id,this.rowType="customer",this.showDview=!0):"name"===e.property?(this.rowID=t.business_id,this.rowType="business",this.showDview=!0):this.showDview=!1:"contract"===this.crmType?"name"===e.property?(this.rowID=t.contract_id,this.rowType="contract",this.showDview=!0):"customer_name"===e.property?(this.rowID=t.customer_id,this.rowType="customer",this.showDview=!0):"business_name"===e.property?(this.rowID=t.business_id,this.rowType="business",this.showDview=!0):"contacts_name"===e.property?(this.rowID=t.contacts_id,this.rowType="contacts",this.showDview=!0):"num"===e.property||"name"===e.property?(this.rowID=t.contract_id,this.rowType="contract",this.showDview=!0):this.showDview=!1:"product"===this.crmType?"name"===e.property?(this.rowID=t.product_id,this.showDview=!0):this.showDview=!1:"receivables"===this.crmType?"customer_name"===e.property?(this.rowID=t.customer_id,this.rowType="customer",this.showDview=!0):"contract_num"===e.property?(this.rowID=t.contract_id,this.rowType="contract",this.showDview=!0):"number"===e.property?(this.rowID=t.receivables_id,this.rowType="receivables",this.showDview=!0):this.showDview=!1:"activity"!==this.crmType&&"record"!==this.crmType||("dataCount"===e.property&&t.dataCount?(this.rowType=t.types,this.recordParams=o()({crmType:t.types,queryType:0},this.params),this.recordShow=!0):this.recordShow=!1)},handleHandle:function(t){"alloc"!==t.type&&"get"!==t.type&&"transfer"!==t.type&&"transform"!==t.type&&"delete"!==t.type&&"put_seas"!==t.type||(this.showDview=!1),"edit"!==t.type&&this.getList()},cellClassName:function(t){var e=t.row,i=t.column;t.rowIndex,t.columnIndex;return this.crmType&&("customer_name"===i.property||"business_name"===i.property||"name"===i.property||"contacts_name"===i.property||"num"===i.property||"contract_num"===i.property||"number"===i.property||("activity"===this.crmType||"record"===this.crmType)&&"dataCount"===i.property&&e.dataCount)?"can-visit--underline":""},hideView:function(){this.$emit("update:show",!1),this.$emit("hide")},handleDocumentClick:function(t){var e=!0,i=document.getElementsByClassName("el-table__row");if(i&&e)for(var a=0;a<i.length;a++){if(i[a].contains(t.target)){e=!1;break}}document.getElementById("slide")&&document.getElementById("slide").contains(t.target)&&(e=!1),e&&(this.showDview=!1)}}},C=(i("HTnC"),Object(p.a)(w,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{attrs:{visible:t.show,"append-to-body":!0,"close-on-click-modal":!1,top:"10vh",width:"80%","custom-class":"no-padding-dialog"},on:{close:t.hideView}},[i("div",{staticClass:"header",attrs:{slot:"title"},on:{click:function(e){t.showDview=!1}},slot:"title"},[i("span",{staticClass:"title"},[t._v(t._s(t.title))]),t._v(" "),t.placeholder?i("el-input",{staticClass:"search-input",attrs:{placeholder:t.placeholder},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.searchInput(e):null}},model:{value:t.inputContent,callback:function(e){t.inputContent=e},expression:"inputContent"}},[i("el-button",{attrs:{slot:"append",icon:"el-icon-search"},nativeOn:{click:function(e){return t.searchInput(e)}},slot:"append"})],1):t._e()],1),t._v(" "),i("div",{staticClass:"container"},[i("div",{staticClass:"content"},[i("div",{staticClass:"list-body"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"crmTable",staticStyle:{width:"100%"},attrs:{id:"crm-table",data:t.list,height:t.tableHeight,"cell-class-name":t.cellClassName,stripe:"",border:"","highlight-current-row":""},on:{"row-click":t.handleRowClick,"sort-change":t.sortChange}},[t._l(t.showFieldList,function(e,a){return i("el-table-column",{key:a,attrs:{sortable:"pool_day"!=e.prop&&"custom",fixed:0==a,prop:e.prop,label:e.label,width:e.width,"show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(a){var s=a.row,n=a.column;return a.$index,["deal_status"==e.prop?[i("i",{class:t._f("dealIcon")(s[e.prop])}),t._v(" "),i("span",[t._v(t._s(t._f("dealName")(s[e.prop])))])]:"is_lock"==e.prop?[1==s.is_lock?i("i",{staticClass:"wk wk-circle-password customer-lock"}):t._e()]:"check_status"==e.prop?[i("span",{staticClass:"status-mark",style:{backgroundColor:t.getCRMStatusColor(s.check_status)}}),t._v(" "),i("span",[t._v(t._s(t.getCRMStatusName(s.check_status)))])]:i("wk-field-view",{attrs:{props:e,form_type:e.form_type,value:s[n.property]},scopedSlots:t._u([{key:"default",fn:function(i){return i.data,[t._v("\n "+t._s(t.fieldFormatter(s,n,s[n.property],e))+"\n ")]}}])})]}}])})}),t._v(" "),t.showFillColumn?i("el-table-column"):t._e()],2),t._v(" "),t.paging?i("div",{staticClass:"p-contianer"},[i("el-pagination",{staticClass:"p-bar",attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pageSize,total:t.total,background:"",layout:"prev, pager, next, sizes, total, jumper"},on:{"update:pageSize":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1):t._e()],1)]),t._v(" "),i("c-r-m-all-detail",{staticClass:"d-view",attrs:{visible:t.showDview,"crm-type":t.rowType,id:t.rowID},on:{"update:visible":function(e){t.showDview=e},handle:t.handleHandle}}),t._v(" "),t.recordShow?i("record-list",{attrs:{"crm-type":t.rowType,request:t.recordRequest,params:t.recordParams},on:{handle:t.getList,hide:function(e){t.recordShow=!1}}}):t._e()],1)])},[],!1,null,"67177378",null));C.options.__file="index.vue";e.a=C.exports},Lc7H:function(t,e,i){},MdnP:function(t,e,i){"use strict";var a={name:"PictureListView",props:{list:{type:Array,required:!0}},methods:{imgZoom:function(t,e){this.$bus.emit("preview-image-bus",{index:e,data:t.map(function(t,e,i){return{url:t.filePath||t.url||t.file_path_thumb,name:t.name,save_name:t.save_name}})})}}},s=(i("fx3D"),i("KHd+")),n=Object(s.a)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"picture-list-view"},t._l(t.list,function(e,a){return i("div",{key:a,staticClass:"img-list-item",on:{click:function(e){t.imgZoom(t.list,a)}}},[i("img",{directives:[{name:"src",rawName:"v-src",value:e.filePath||e.url||e.file_path_thumb,expression:"imgItem.filePath || imgItem.url ||imgItem.file_path_thumb"}],key:e.filePath||e.url})])}))},[],!1,null,"3c82fb24",null);n.options.__file="PictureListView.vue";e.a=n.exports},"N8+3":function(t,e,i){"use strict";var a=i("epE4");i.n(a).a},NdXD:function(t,e,i){},PLZ3:function(t,e,i){},PWYh:function(t,e,i){},QVgs:function(t,e,i){},Thiw:function(t,e,i){"use strict";var a=i("wph1");i.n(a).a},USgC:function(t,e,i){},Uk6Q:function(t,e,i){"use strict";var a=i("USgC");i.n(a).a},Vm8M:function(t,e,i){"use strict";var a=i("7Qib"),s={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 t=this;this.$el.style.zIndex=Object(a.q)(),document.body.appendChild(this.$el),Object(a.l)().then(function(){var e=new BMap.Map("choicemap",{enableMapClick:!1}),i=new BMap.Point(parseFloat(t.lng),parseFloat(t.lat));e.centerAndZoom(i,18),e.enableScrollWheelZoom();var a=new BMap.Marker(i);e.addOverlay(a);var s=new BMap.InfoWindow(t.title);a.addEventListener("click",function(){e.openInfoWindow(s,i)})})},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},methods:{hiddenView:function(){this.$emit("hidden")}}},n=(i("I+NK"),i("KHd+")),o=Object(n.a)(s,function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"map-view"},[e("div",{attrs:{id:"choicemap"}}),this._v(" "),e("i",{staticClass:"el-icon-close map-close",on:{click:this.hiddenView}})])},[],!1,null,"33a9f6bf",null);o.options.__file="MapView.vue";e.a=o.exports},VmBU:function(t,e,i){"use strict";i.d(e,"e",function(){return s}),i.d(e,"a",function(){return n}),i.d(e,"c",function(){return o}),i.d(e,"b",function(){return l}),i.d(e,"k",function(){return r}),i.d(e,"i",function(){return c}),i.d(e,"g",function(){return d}),i.d(e,"h",function(){return u}),i.d(e,"j",function(){return h}),i.d(e,"d",function(){return p}),i.d(e,"n",function(){return m}),i.d(e,"m",function(){return f}),i.d(e,"l",function(){return v}),i.d(e,"p",function(){return g}),i.d(e,"f",function(){return _}),i.d(e,"o",function(){return y});var a=i("t3Un");function s(t){return Object(a.a)({url:"oa/log/index",method:"post",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t})}function n(t){return Object(a.a)({url:"oa/log/save",method:"post",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t})}function o(t){return Object(a.a)({url:"oa/log/"+(t.log_id?"update":"save"),method:"post",headers:{"Content-Type":"application/json;charset=UTF-8"},data:t})}function l(t){return Object(a.a)({url:"oa/log/delete",method:"post",data:t})}function r(t){return Object(a.a)({url:"oaLog/readLog",method:"post",data:t})}function c(t){return Object(a.a)({url:"oa/log/queryLog",method:"post",data:t})}function d(t){return Object(a.a)({url:"oa/log/logBulletin",method:"post",data:t})}function u(t){return Object(a.a)({url:"oa/log/newBulletin",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function h(t){return Object(a.a)({url:"oa/log/activityList",method:"post",data:t})}function p(t){return Object(a.a)({url:"oa/log/LogWelcomeSpeech",method:"post",data:t})}function m(t){return Object(a.a)({url:"oa/log/excelExport",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"},responseType:"blob"})}function f(t){return Object(a.a)({url:"oa/log/completeStats",method:"post",data:t})}function v(t){return Object(a.a)({url:"oa/log/completeLog",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function g(t){return Object(a.a)({url:"oa/log/inCompleteLog",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function _(t){return Object(a.a)({url:"oa/log/activityCount",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function y(t){return Object(a.a)({url:"oa/log/favourUpdate",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}},X45o:function(t,e,i){},YN3n:function(t,e,i){"use strict";var a=i("nTaQ");i.n(a).a},ZX9L:function(t,e,i){"use strict";var a={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(t){for(var e=0;e<this.options.length;e++){var i=this.options[e];if(i.value==t)return i}return{label:"本年",value:"year"}},typeSelectClick:function(t){this.showTypePopover=!1,this.sureCustomContent=!1,this.showCustomContent=!1,this.selectType=t,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}))}}},s=(i("77fj"),i("KHd+")),n=Object(s.a)(a,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-popover",{staticClass:"time-type-select",attrs:{width:t.width,placement:"bottom","popper-class":"no-padding-popover",trigger:"click"},model:{value:t.showTypePopover,callback:function(e){t.showTypePopover=e},expression:"showTypePopover"}},[i("div",{staticClass:"type-popper"},[i("div",{staticClass:"type-content"},[t._l(t.options,function(e,a){return i("div",{key:a,staticClass:"type-content-item",class:{selected:t.selectType.value==e.value&&!t.showCustomContent},on:{click:function(i){t.typeSelectClick(e)}}},[i("div",{staticClass:"mark"}),t._v(t._s(e.label)+"\n ")])}),t._v(" "),i("div",{staticClass:"type-content-item",class:{selected:t.showCustomContent},on:{click:function(e){t.showCustomContent=!0}}},[i("div",{staticClass:"mark"}),t._v("自定义\n ")])],2),t._v(" "),t.showCustomContent?i("div",{staticClass:"type-content-custom"},[i("el-date-picker",{attrs:{type:"date","value-format":"yyyy.MM.dd",placeholder:"选择日期"},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}}),t._v(" "),i("el-date-picker",{attrs:{type:"date","value-format":"yyyy.MM.dd",placeholder:"选择日期"},model:{value:t.endTime,callback:function(e){t.endTime=e},expression:"endTime"}}),t._v(" "),i("el-button",{on:{click:t.customSureClick}},[t._v("确定")])],1):t._e()]),t._v(" "),i("el-input",{staticClass:"type-select",style:{width:t.width+"px"},attrs:{slot:"reference",readonly:!0},slot:"reference",model:{value:t.typeShowValue,callback:function(e){t.typeShowValue=e},expression:"typeShowValue"}},[i("i",{class:["el-icon-arrow-up",{"is-reverse":t.showTypePopover}],attrs:{slot:"suffix"},slot:"suffix"})])],1)},[],!1,null,"20503202",null);n.options.__file="index.vue";e.a=n.exports},aOLc:function(t,e,i){"use strict";var a=i("IDBX");i.n(a).a},da4V:function(t,e,i){"use strict";i.r(e);var a=i("m1cH"),s=i.n(a),n=i("FyfS"),o=i.n(n),l=i("QbLZ"),r=i.n(l),c=i("VmBU"),d=i("kZxc"),u=i("BsgX"),h=i("Ir+r"),p=i("MdnP"),m=i("u2hk"),f=i("dPzk"),v=i("yPq4"),g={name:"RelatedBusinessList",components:{CRMAllDetail:v.a},props:{data:{type:Object,required:!0}},data:function(){return{options:{customer:{label:"客户",type:"customer",key:"customerName",icon:"wk-customer"},contacts:{label:"联系人",type:"contacts",key:"contactsName",icon:"wk-contacts"},business:{label:"商机",type:"business",key:"businessName",icon:"wk-business"},contract:{label:"合同",type:"contract",key:"name",icon:"wk-contract"}}}},methods:{handlerToDetail:function(t,e){this.$emit("select",t,this.data[t][e])}}},_=(i("s9xL"),i("KHd+")),y=Object(_.a)(g,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"related-business-list"},t._l(t.options,function(e,a){return t.data[e.type].length>0?i("div",{key:a,staticClass:"list-item"},[i("div",{staticClass:"left"},[i("span",{staticClass:"wk icon",class:e.icon}),t._v(" "),i("span",[t._v("相关"+t._s(e.label)+"")])]),t._v(" "),i("div",{staticClass:"content"},t._l(t.data[e.type],function(a,s){return i("div",{key:s,staticClass:"content-item",on:{click:function(i){t.handlerToDetail(e.type,s)}}},[t._v("\n "+t._s(a[e.key]||a.name)+"\n ")])}))]):t._e()}))},[],!1,null,"b5c303ea",null);y.options.__file="RelatedBusinessList.vue";var b=y.exports,w=i("z7oh"),C={name:"FavList",components:{XrUserView:function(){return i.e("chunk-1553").then(i.bind(null,"bE0L"))}},props:{isFavour:[Number,String],data:Array},data:function(){return{contentVisible:!1}},computed:{},watch:{},created:function(){},mounted:function(){},beforeDestroy:function(){},methods:{faveClick:function(){this.$emit("fav",this.data)}}},k=(i("YN3n"),Object(_.a)(C,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("flexbox",{staticClass:"fav-list"},[i("div",{staticClass:"good-btn",class:{"is-fav":t.isFavour},on:{click:t.faveClick}},[i("i",{staticClass:"wk wk-good"})]),t._v(" "),t.data&&t.data.length>0?[i("div",{staticClass:"fav-user"},t._l(t.data,function(e,a){return i("el-popover",{key:a,attrs:{placement:"bottom",width:"250",trigger:"click"},model:{value:e.show,callback:function(i){t.$set(e,"show",i)},expression:"user.show"}},[e.show?i("xr-user-view",{attrs:{id:e.id,data:e}}):t._e(),t._v(" "),i("span",{staticClass:"can-visit--underline",attrs:{slot:"reference"},slot:"reference"},[t._v(t._s(e.realname)+t._s(t.data.length-1===a?"":"、"))])],1)})),t._v(" "),t.data.length>10?i("span",{staticClass:"fav-total"},[t._v("等"),i("el-popover",{attrs:{"popper-class":"no-padding-popover",placement:"top",width:"200",trigger:"click"},model:{value:t.contentVisible,callback:function(e){t.contentVisible=e},expression:"contentVisible"}},[t.contentVisible?i("div",{staticClass:"fav-users"},[i("flexbox",{staticClass:"fav-users__header"},[i("div",{staticClass:"title"},[t._v(t._s("共"+t.data.length+"人点赞"))]),t._v(" "),i("i",{staticClass:"el-icon-close",on:{click:function(e){t.contentVisible=!1}}})]),t._v(" "),i("div",{staticClass:"fav-users__body"},t._l(t.data,function(e,a){return i("flexbox",{key:a,staticClass:"user"},[i("el-popover",{attrs:{placement:"bottom",width:"250",trigger:"click"},model:{value:e.favShow,callback:function(i){t.$set(e,"favShow",i)},expression:"user.favShow"}},[e.favShow?i("xr-user-view",{attrs:{id:e.id,data:e}}):t._e(),t._v(" "),i("xr-avatar",{staticClass:"user__img",attrs:{slot:"reference",src:e.img,name:e.realname,size:34},slot:"reference"})],1),t._v(" "),i("div",{staticClass:"text-one-line user__name"},[t._v(t._s(e.realname))])],1)}))],1):t._e(),t._v(" "),i("span",{attrs:{slot:"reference"},slot:"reference"},[t._v(t._s(t.data.length))])]),t._v("人点赞")],1):t._e()]:t._e()],2)},[],!1,null,"5354f4e8",null));k.options.__file="FavList.vue";var T=k.exports,L=i("L2JU"),D=i("jHPx"),x={name:"LogItem",components:{PictureListView:p.a,FileListView:m.a,RelatedBusinessList:b,CommentList:w.a,ReplyComment:f.a,ReportMenu:u.a,FavList:T},props:{data:{type:Object,required:!0},index:{type:Number,default:0},showHistoryBtn:{type:Boolean,default:!1}},data:function(){return{isWaiting:!1,showReply:!1,commentLoading:!1,replyList:[],reportList:[{type:"customer",key:"customerNum",info:"今日新增客户",name:"今日新增客户 0"},{type:"business",key:"businessNum",info:"今日新增商机",name:"今日新增商机 0"},{type:"contract",key:"contractNum",info:"今日新增合同",name:"今日新增合同 0"},{type:"receivables",key:"receivablesMoneyNum",info:"今日新增回款",name:"今日新增回款 0"},{type:"record",key:"recordNum",info:"今日新增跟进记录",name:"今日新增跟进记录 0"}]}},computed:r()({},Object(L.b)(["userInfo"]),{allData:function(){return{business:this.data?this.data.businessList:[],contacts:this.data?this.data.contactsList:[],contract:this.data?this.data.contractList:[],customer:this.data?this.data.customerList:[]}},allDataLen:function(){var t=this,e=0;if(!this.data)return e;return["businessList","contactsList","contractList","customerList"].forEach(function(i){e+=t.data[i].length||0}),e},replyTotal:function(){var t=0;return this.replyList.forEach(function(e){t++,t+=e.childCommentList.length||0}),t||this.data.replyList.length},logTitleName:function(){return{1:"今日",2:"本周",3:"本月"}[this.data.category_id]+"工作内容"},logNextTitleName:function(){return{1:"明日",2:"下周",3:"下月"}[this.data.category_id]+"工作内容"}}),created:function(){if(this.data.bulletin){var t=this.data.bulletin||{};this.reportList=this.reportList.map(function(e){return"receivablesMoneyNum"==e.key&&(t.receivablesMoneyNum=Object(D.h)(Math.floor(t.receivablesMoneyNum||0))),e.name=e.info+" "+t[e.key],e})}},beforeDestroy:function(){},methods:{getCategory:function(t){return{1:"日报",2:"周报",3:"月报"}[t]},handleCommand:function(t,e){var i=this;"delete"===t?this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(c.b)({log_id:i.data.log_id}).then(function(){i.$message.success("删除成功!"),i.$emit("delete",e)})}).catch(function(){i.$message.info("已取消删除")}):this.$emit("edit",this.index,this.data)},calcVisible:function(t){if(1===this.data.isRead)return!1;var e=this.$el.getBoundingClientRect();return t>e.top+e.height},readLog:function(){var t=this;1!==this.data.isRead&&(this.$emit("read"),Object(c.k)({log_id:this.data.log_id}).then(function(){t.$bus.off("load-more-work-log")}).catch())},handleReply:function(t){var e=this;this.commentLoading=!0,Object(h.d)({type:2,content:t,log_id:this.data.log_id}).then(function(t){t.data.userInfo={user_id:e.userInfo.id,realname:e.userInfo.realname,img:e.userInfo.img},t.data.childCommentList=[],e.replyList.push(t.data),e.commentLoading=!1,e.showReply=!1,e.$nextTick(function(){e.showReply=!0})}).catch(function(){e.commentLoading=!1})},deleteComment:function(t){this.replyList.splice(t,1)},closeOtherReply:function(t){!t&&this.$refs.comment_list&&this.$refs.comment_list.closeReply()},relatedClick:function(t,e){this.$emit("relate-detail",t,e)},replayClick:function(){this.showReply=!this.showReply,0==this.replyList.length&&this.getCommentList()},getCommentList:function(){var t=this;Object(h.b)({log_id:this.data.log_id}).then(function(e){var i=e.data.list||[];t.replyList=i}).catch(function(){})},reportSelect:function(t){this.$emit("report-detail",t,this.data)},checkHistoryClick:function(){this.$emit("check-history",this.data.create_user_info)},favourClick:function(){var t=this;this.$refs.favBtn.$el.blur(),Object(c.o)({favour_status:this.data.favour_status?0:1,log_id:this.data.log_id}).then(function(e){var i=e.data||{};t.data.favour_status=i.favour_status,t.data.favourUser=i.favourUser}).catch(function(){})}}},I=(i("aOLc"),Object(_.a)(x,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"log-item"},[i("div",{staticClass:"main"},[i("div",{staticClass:"user"},[t.data.create_user_info?i("xr-avatar",{staticClass:"user-imgList",attrs:{name:t.data.create_user_info.realname,id:t.data.create_user_info.id,size:38,src:t.data.create_user_info.thumb_img,disabled:!1}}):t._e(),t._v(" "),i("div",{staticClass:"box"},[i("div",{staticClass:"username"},[t._v("\n "+t._s(t.data.realname)+"\n ")]),t._v(" "),i("div",{staticClass:"time"},[t._v("\n 创建日志于 "+t._s(t.data.create_time)+" ")]),t._v(" "),i("div",{staticClass:"handle"},[t.showHistoryBtn?i("el-button",{attrs:{type:"text"},on:{click:t.checkHistoryClick}},[t._v("查看以往日志")]):t._e()],1),t._v(" "),i("div",{staticClass:"comment-status"},[i("span",{staticClass:"icon wk wk-task"}),t._v(" "),i("span",[t._v(t._s(t.getCategory(t.data.category_id))+"-"+t._s(0===t.data.replyList.length?"未点评":"已点评"))]),t._v(" "),i("span",{staticClass:"dot",class:{active:0!==t.data.replyList.length}})])])],1),t._v(" "),i("div",{staticClass:"content"},[t.data.content?i("div",{staticClass:"content-box"},[i("div",{staticClass:"content-title"},[t._v("\n "+t._s(t.logTitleName)+"\n ")]),t._v(" "),i("div",{staticClass:"content-text"},[t._v(t._s(t.data.content))])]):t._e(),t._v(" "),t.data.tomorrow?i("div",{staticClass:"content-box"},[i("div",{staticClass:"content-title"},[t._v("\n "+t._s(t.logNextTitleName)+"\n ")]),t._v(" "),i("div",{staticClass:"content-text"},[t._v(t._s(t.data.tomorrow))])]):t._e(),t._v(" "),t.data.question?i("div",{staticClass:"content-box"},[i("div",{staticClass:"content-title"},[t._v("\n 遇到的问题:\n ")]),t._v(" "),i("div",{staticClass:"content-text"},[t._v(t._s(t.data.question))])]):t._e()]),t._v(" "),t.data.imgList&&0!==t.data.imgList.length?i("picture-list-view",{attrs:{list:t.data.imgList}}):t._e(),t._v(" "),t.data.fileList&&0!==t.data.fileList.length?i("file-list-view",{attrs:{list:t.data.fileList}}):t._e(),t._v(" "),t.allDataLen>0?i("related-business-list",{attrs:{data:t.allData},on:{select:t.relatedClick}}):t._e(),t._v(" "),t.data.bulletin?i("div",{staticClass:"content"},[i("div",{staticClass:"content-box"},[i("div",{staticClass:"content-title"},[t._v("\n 销售简报\n ")]),t._v(" "),i("div",{staticClass:"content-text"},[i("report-menu",{attrs:{list:t.reportList},on:{select:t.reportSelect}})],1)])]):t._e(),t._v(" "),t.data.sendUserList&&t.data.sendUserList.length?i("flexbox",{staticClass:"send-list"},[i("span",{staticClass:"send-list__label"},[t._v("发送给:")]),t._v(" "),t._l(t.data.sendUserList,function(t,e){return i("span",{key:e,staticClass:"send-list__user"},[i("xr-avatar",{attrs:{name:t.realname,id:t.user_id,size:32,src:t.imgList,disabled:!1}})],1)})],2):t._e()],1),t._v(" "),i("div",{staticClass:"footer"},[i("div",{staticStyle:{flex:"1"}},[i("fav-list",{attrs:{"is-favour":t.data.favour_status,data:t.data.favourUser},on:{fav:t.favourClick}})],1),t._v(" "),t.data.permission&&(t.data.permission.is_update||t.data.permission.is_delete)?i("el-dropdown",{attrs:{trigger:"click"},on:{command:t.handleCommand}},[i("el-button",{staticClass:"more",attrs:{icon:"el-icon-more"}}),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[t.data.permission.is_update?i("el-dropdown-item",{attrs:{command:"edit"}},[t._v("编辑")]):t._e(),t._v(" "),t.data.permission.is_delete?i("el-dropdown-item",{attrs:{command:"delete"}},[t._v("删除")]):t._e()],1)],1):t._e(),t._v(" "),i("el-button",{ref:"favBtn",staticClass:"fav-btn",staticStyle:{"margin-left":"10px"},attrs:{type:t.data.favour_status?"primary":"",icon:"wk wk-good"},on:{click:t.favourClick}},[t._v("赞"+t._s(t.data.favourUser.length>0?"("+t.data.favourUser.length+")":""))]),t._v(" "),i("el-button",{staticClass:"replay-btn",attrs:{type:"primary",icon:"wk wk-message"},on:{click:t.replayClick}},[t._v(t._s("回复"+(t.replyTotal>0?"("+t.replyTotal+")":"")))])],1),t._v(" "),t.showReply?i("div",{staticClass:"reply-wrapper"},[i("reply-comment",{directives:[{name:"loading",rawName:"v-loading",value:t.commentLoading,expression:"commentLoading"}],ref:"f_reply",on:{toggle:t.closeOtherReply,reply:t.handleReply}}),t._v(" "),t.replyList.length>0?i("comment-list",{ref:"comment_list",attrs:{id:t.data.log_id,list:t.replyList,type:"2"},on:{delete:t.deleteComment,"close-other-reply":function(e){t.$refs.f_reply.toggleFocus(!0)}}}):t._e()],1):t._e()])},[],!1,null,"25faade7",null));I.options.__file="LogItem.vue";var F=I.exports,S=i("GQeE"),R=i.n(S),j=i("7Qib"),O=i("KTTK"),$=i("zMq1"),N=i("ye9D"),U=i("mkuN"),M=i("NYF1"),A=i("U8n8"),P={name:"CreateLog",components:{AddImageList:$.a,AddFileList:N.a,CrmRelative:U.a,AddRelateList:M.a,MembersDep:A.a},data:function(){return{form:{},isRelevanceReport:!0,textFormKeyList:[],activeTab:"day",activeMap:{day:"日报",week:"周报",month:"月报"},showLoading:!1,categoryIdMap:{day:1,week:2,month:3},showRelativeType:"",imgFiles:[],files:[],batchId:Object(j.s)(),showRelatePopover:!1,relateData:{},sendUserList:[],showMore:!1,completeInfo:{endCount:0,logCount:0}}},computed:{showRelateData:function(){var t=this,e={};return R()(this.relateData).forEach(function(i){var a=t.relateData[i];a&&a.length&&(e[i]=a)}),e},showSendUserList:function(){return this.sendUserList&&this.sendUserList.length>5?this.sendUserList.slice(0,5):this.sendUserList}},watch:{activeTab:{handler:function(){this.getCompelteInfo()},immediate:!0}},created:function(){this.handleTabToggle()},methods:{handleTabToggle:function(){var t={day:["今日","明日"],week:["本周","下周"],month:["本月","下月"]}[this.activeTab];this.textFormKeyList=[{label:t[0]+"工作的内容:",key:"content"},{label:t[1]+"工作的内容:",key:"tomorrow"},{label:"遇到的问题:",key:"question"}]},handleCreate:function(){var t=this;if(this.form.content||this.form.tomorrow||this.form.question){this.showLoading=!0;var e={},i=function(i){e[i+"_ids"]=t.relateData[i].map(function(t){return t[i+"_id"]})};for(var a in this.relateData)i(a);var n=r()({},this.form,{batchId:this.batchId,send_user_ids:this.sendUserList.map(function(t){return t.id})},e,{category_id:this.categoryIdMap[this.activeTab],file:[].concat(s()(this.files.map(function(t){return t.file_id})),s()(this.imgFiles.map(function(t){return t.file_id})))});this.isRelevanceReport&&(n.is_relation=1),Object(c.a)(n).then(function(){t.showLoading=!1,t.resetData(),t.$emit("update"),t.$message.success("添加成功")}).catch(function(){t.showLoading=!1})}else this.$message.error("请填写日志内容")},resetData:function(){this.form={},this.isRelevanceReport=!0,this.batchId=Object(j.s)(),this.imgFiles=[],this.files=[],this.sendUserList=[],this.relateData={}},barClick:function(t){this.showRelativeType=t,"relate"==t?this.showRelatePopover=!0:"file"==t?this.$refs.fileInput.click():"img"==t&&this.$refs.imgInput.click()},uploadFile:function(t){var e=t.target.files;if(e.length){for(var i=0;i<e.length;i++){if(-1==e[i].type.indexOf("image")&&"img"==this.showRelativeType)return void this.$message.error("请上传正确的文件类型")}for(var a="image/*"==t.target.accept?"img":"file",s=0;s<e.length;s++){var n=e[s];this.uploadFileRequest(n,a)}t.target.value=""}},uploadFileRequest:function(t,e,i){var a=this;this.$wkUploadFile.upload({file:t,params:{type:e,batchId:this.batchId}}).then(function(s){var n=s.res.data||{};n.size=Object(j.h)(t.size),"img"==e?a.imgFiles.push(n):(n.icon=Object(j.o)(t),a.files.push(n)),i&&i()}).catch(function(){})},deleteImage:function(t,e){this.deleteImgOrFile("image",t,e)},deleteFile:function(t,e){this.deleteImgOrFile("file",t,e)},deleteImgOrFile:function(t,e,i){var a=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(O.c)({module:"oa_log",module_id:a.id,save_name:e.save_name,type:t}).then(function(e){"image"==t?a.imgFiles.splice(i,1):a.files.splice(i,1),a.$message.success("操作成功")}).catch(function(){})}).catch(function(){a.$message({type:"info",message:"已取消操作"})})},deleteAllFile:function(t){var e=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(O.e)({module:"oa_log",module_id:e.id,file_id:[].concat(s()(e.imgFiles.map(function(t){return t.file_id})),s()(e.files.map(function(t){return t.file_id}))),batchId:e.batchId,type:t}).then(function(i){2==t?e.imgFiles=[]:e.files=[],e.$message.success("操作成功")}).catch(function(){})}).catch(function(){e.$message({type:"info",message:"已取消操作"})})},relateDataChange:function(t){this.showRelatePopover=!1,this.relateData=t.data},deleteRelate:function(t,e,i){this.relateData[i].splice(e,1)},sendUserChange:function(t){this.sendUserList=t},completeClick:function(){this.$emit("completeSelect",this.categoryIdMap[this.activeTab])},getCompelteInfo:function(){var t=this;Object(c.m)({type:this.categoryIdMap[this.activeTab]}).then(function(e){t.completeInfo=e.data}).catch(function(){})}}},B=(i("2GGO"),Object(_.a)(P,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.showLoading,expression:"showLoading"}],staticClass:"create-log"},[i("el-tabs",{on:{"tab-click":t.handleTabToggle},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[i("el-tab-pane",{attrs:{label:"日报",name:"day"}}),t._v(" "),i("el-tab-pane",{attrs:{label:"周报",name:"week"}}),t._v(" "),i("el-tab-pane",{attrs:{label:"月报",name:"month"}})],1),t._v(" "),0!==t.completeInfo.status?i("span",{staticClass:"complete-btn",on:{click:t.completeClick}},[i("i",{staticClass:"wk wk-log complete-btn__icon",staticStyle:{color:"#2362FB"}}),t._v(" "),i("span",{staticClass:"complete-btn__name"},[t._v(t._s(t.activeMap[t.activeTab])+"完成情况"),i("span",{staticClass:"value"},[t._v(t._s(t.completeInfo.endCount))]),t._v("/"),i("span",{staticClass:"value"},[t._v(t._s(t.completeInfo.logCount))])])]):t._e(),t._v(" "),t.showMore?[i("el-form",[t._l(t.textFormKeyList,function(e,a){return i("el-form-item",{key:a,attrs:{label:e.label}},[i("el-input",{attrs:{autosize:{minRows:2,maxRows:10},maxlength:1e3,type:"textarea",resize:"none",placeholder:"请输入内容"},model:{value:t.form[e.key],callback:function(i){t.$set(t.form,e.key,i)},expression:"form[item.key]"}})],1)}),t._v(" "),i("span",{staticClass:"wk wk-close close-icon",on:{click:function(e){t.showMore=!1}}})],2),t._v(" "),t.imgFiles.length>0?i("add-image-list",{attrs:{data:t.imgFiles},on:{delete:t.deleteImage,"delete-all":function(e){t.deleteAllFile(2)},upload:t.uploadFile}}):t._e(),t._v(" "),t.files.length>0?i("add-file-list",{attrs:{data:t.files},on:{delete:t.deleteFile,"delete-all":function(e){t.deleteAllFile(1)}}}):t._e(),t._v(" "),t._l(t.showRelateData,function(e,a,s){return i("add-relate-list",{key:s,attrs:{data:e,type:a},on:{delete:t.deleteRelate}})}),t._v(" "),i("div",{staticClass:"add-control"},[i("div",{staticClass:"control-item",on:{click:function(e){t.barClick("img")}}},[i("span",{staticClass:"icon wk wk-picture"}),t._v(" "),i("span",[t._v("图片")])]),t._v(" "),i("div",{staticClass:"control-item",on:{click:function(e){t.barClick("file")}}},[i("span",{staticClass:"icon wk wk-file"}),t._v(" "),i("span",[t._v("附件")])]),t._v(" "),i("el-popover",{attrs:{placement:"right-end",width:"800","popper-class":"no-padding-popover",trigger:"click"},model:{value:t.showRelatePopover,callback:function(e){t.showRelatePopover=e},expression:"showRelatePopover"}},[i("crm-relative",{ref:"crmrelative",attrs:{radio:!1,"show-types":["customer","contacts","business","contract"],"selected-data":t.relateData,show:t.showRelatePopover},on:{close:function(e){t.showRelatePopover=!1},changeCheckout:t.relateDataChange}}),t._v(" "),i("div",{staticClass:"control-item",attrs:{slot:"reference"},on:{click:function(e){t.barClick("relate")}},slot:"reference"},[i("span",{staticClass:"icon wk wk-associated"}),t._v(" "),i("span",[t._v("关联业务")])])],1),t._v(" "),i("div",{staticClass:"control-item"},[i("span",{staticClass:"cursor-default"},[t._v("发送给:")]),t._v(" "),t._l(t.showSendUserList,function(e,a){return i("span",{key:a,staticClass:"send-user"},[i("el-tooltip",{attrs:{placement:"bottom",effect:"light","popper-class":"tooltip-change-border"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("span",[t._v(t._s(e.realname))])]),t._v(" "),i("xr-avatar",{attrs:{name:e.realname,size:32,src:e.img||e.thumb_img}})],1)],1)}),t._v(" "),i("members-dep",{attrs:{"close-dep":!0,"content-block":!1,"user-checked-data":t.sendUserList},on:{popoverSubmit:t.sendUserChange}},[i("span",{attrs:{slot:"membersDep"},slot:"membersDep"},[i("el-tooltip",{attrs:{placement:"bottom",effect:"light","popper-class":"tooltip-change-border"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("span",[t._v(t._s("等"+t.sendUserList.length+"人"))])]),t._v(" "),i("i",{directives:[{name:"show",rawName:"v-show",value:t.sendUserList.length>5,expression:"sendUserList.length > 5"}],staticClass:"el-icon-more more-user-btn"})]),t._v(" "),i("i",{staticClass:"el-icon-plus add-user-btn"})],1)])],2),t._v(" "),i("span",{staticClass:"control-relevance"},[i("span",[t._v("关联销售简报")]),t._v(" "),i("el-switch",{model:{value:t.isRelevanceReport,callback:function(e){t.isRelevanceReport=e},expression:"isRelevanceReport"}}),t._v(" "),i("span",[t._v("是")])],1),t._v(" "),i("div",{staticClass:"others"},[i("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.handleCreate}},[t._v("\n 发布\n ")])],1)],1)]:[i("div",{staticClass:"content-box"},[i("flexbox",{staticClass:"box",attrs:{justify:"flex-start"},nativeOn:{click:function(e){t.showMore=!0}}},[i("span",{staticClass:"wk wk-write icon"}),t._v(" "),i("span",{staticClass:"info"},[t._v("请输入日志内容")])])],1)],t._v(" "),i("input",{ref:"fileInput",staticClass:"file-input",attrs:{accept:"*.*",type:"file",multiple:""},on:{change:t.uploadFile}}),t._v(" "),i("input",{ref:"imgInput",staticClass:"file-input",attrs:{accept:"image/*",type:"file",multiple:""},on:{change:t.uploadFile}})],2)},[],!1,null,"6ff258d0",null));B.options.__file="CreateLog.vue";var E=B.exports,V={name:"LogComDetail",components:{CRMFullScreenDetail:function(){return Promise.all([i.e("chunk-21d9"),i.e("chunk-79c4")]).then(i.bind(null,"3z7q"))}},props:{show:{type:Boolean,default:!1},type:[Number,String]},data:function(){return{loading:!1,activeType:"complete",fieldList:[{label:"姓名",prop:"user_name"},{label:"日志内容",prop:"content"},{label:"创建时间",prop:"create_time"}],tableHeight:this.getTableHeight(),list:[],currentPage:1,pageSize:15,pageSizes:[15,30,60],total:0,search:"",logDetailId:"",logDetailShow:!1}},computed:{},watch:{show:function(t){t&&this.initInfo()}},created:function(){var t=this;window.onresize=function(){t.tableHeight=t.getTableHeight()}},beforeDestroy:function(){},methods:{getTableHeight:function(){var t=document.documentElement.clientHeight;return t-.2*t-200},initInfo:function(){this.search="",this.list=[],this.refreshList()},refreshList:function(){this.currentPage=1,this.getList()},cellClassName:function(t){t.row;var e=t.column;t.rowIndex,t.columnIndex;return"content"===e.property?"can-visit--underline":""},hideView:function(){this.$emit("update:show",!1)},handleSizeChange:function(t){this.pageSize=t,this.getList()},handleCurrentChange:function(t){this.currentPage=t,this.getList()},getList:function(){var t=this;this.loading=!0;var e={page:this.currentPage,limit:this.pageSize,search:this.search};("complete"==this.activeType?c.l:c.p)(e).then(function(e){t.list=e.data.list,t.total=e.data.totalRow,t.loading=!1}).catch(function(){t.loading=!1})},handleRowClick:function(t,e,i){"complete"==this.activeType&&"content"===e.property&&(this.logDetailId=t.log_id,this.logDetailShow=!0)}}},z=(i("yXKV"),Object(_.a)(V,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{attrs:{visible:t.show,"append-to-body":!0,"close-on-click-modal":!1,top:"10vh",width:"900px","custom-class":"no-padding-dialog log-comp-detail"},on:{close:t.hideView}},[i("el-tabs",{on:{"tab-click":t.refreshList},model:{value:t.activeType,callback:function(e){t.activeType=e},expression:"activeType"}},[i("el-tab-pane",{attrs:{label:"已完成日志的员工",name:"complete"}}),t._v(" "),i("el-tab-pane",{attrs:{label:"未完成日志的员工",name:"uncomplete"}})],1),t._v(" "),i("el-input",{staticClass:"search-input",attrs:{placeholder:"请输入姓名"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.refreshList(e):null}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}},[i("el-button",{attrs:{slot:"append",icon:"el-icon-search"},nativeOn:{click:function(e){return t.refreshList(e)}},slot:"append"})],1),t._v(" "),i("div",{staticClass:"list-body"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.list,"cell-class-name":t.cellClassName,height:t.tableHeight,stripe:"",border:"","highlight-current-row":""},on:{"row-click":t.handleRowClick}},t._l(t.fieldList,function(t,e){return i("el-table-column",{key:e,attrs:{prop:t.prop,label:t.label,"show-overflow-tooltip":""}})})),t._v(" "),i("div",{staticClass:"p-contianer"},[i("el-pagination",{staticClass:"p-bar",attrs:{"current-page":t.currentPage,"page-sizes":t.pageSizes,"page-size":t.pageSize,total:t.total,background:"",layout:"prev, pager, next, sizes, total, jumper"},on:{"update:pageSize":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1),t._v(" "),i("c-r-m-full-screen-detail",{attrs:{visible:t.logDetailShow,id:t.logDetailId,"crm-type":"log"},on:{"update:visible":function(e){t.logDetailShow=e}}})],1)},[],!1,null,null,null));z.options.__file="LogComDetail.vue";var H=z.exports,q=i("HHBN"),K=i("gDS+"),Q=i.n(K),X=i("vDqi"),W=i.n(X),Z=i("ViDN"),Y=i("EBQf"),G={components:{CreateView:Z.a,MembersDep:A.a,RelatedBusiness:Y.a},props:{formData:Object,dialogTitle:{type:String,default:"写日志"},accessoryFileList:{type:Array,default:function(){return[]}},imgFileList:{type:Array,default:function(){return[]}},newLoading:Boolean},data:function(){return{activeName:"1",tabsData:[{label:"日报",key:"1"},{label:"周报",key:"2"},{label:"月报",key:"3"}],formList:[],dateList:[{label:"今日工作内容",model:"content"},{label:"明日工作内容",model:"tomorrow"},{label:"遇到的问题",model:"question"}],weekList:[{label:"本周工作内容",model:"content"},{label:"下周工作内容",model:"tomorrow"},{label:"遇到的问题",model:"question"}],monthList:[{label:"本月工作内容",model:"content"},{label:"下月工作内容",model:"tomorrow"},{label:"遇到的问题",model:"question"}],batchId:Object(j.s)(),imageFileList:[],fileList:[],dialogVisible:!1,relevanceAll:{},allData:{}}},computed:{crmFileSaveUrl:function(){return O.h},httpHeader:function(){return{authKey:W.a.defaults.headers.authKey,sessionId:W.a.defaults.headers.sessionId}},showSendUserList:function(){return this.formData?this.formData.sendUserList&&this.formData.sendUserList.length>5?this.formData.sendUserList.slice(0,5):this.formData.sendUserList||[]:[]}},mounted:function(){if(document.body.appendChild(this.$el),this.formList=this.dateList,this.formData.category_id)switch(this.formData.category_id){case 1:this.tabsData=[{label:"日报",key:"1"}],this.formList=this.dateList,this.activeName="1";break;case 2:this.tabsData=[{label:"周报",key:"2"}],this.formList=this.weekList,this.activeName="2";break;case 3:this.tabsData=[{label:"月报",key:"3"}],this.formList=this.monthList,this.activeName="3"}"写日志"!=this.dialogTitle&&this.formData.batchId&&(this.batchId=this.formData.batchId);var t={};t.business=(this.formData.businessList||[]).map(function(t){return t.id&&(t.business_id=t.id||t.business_id),t}),t.contacts=(this.formData.contactsList||[]).map(function(t){return t.id&&(t.contacts_id=t.id||t.contacts_id),t}),t.contract=(this.formData.contractList||[]).map(function(t){return t.id&&(t.contract_id=t.id||t.contract_id),t}),t.customer=(this.formData.customerList||[]).map(function(t){return t.id&&(t.customer_id=t.id||t.customer_id),t}),this.allData=t;var e={};e.business_ids=t.business.map(function(t){return t.business_id}),e.contacts_ids=t.contacts.map(function(t){return t.contacts_id}),e.contract_ids=t.contract.map(function(t){return t.contract_id}),e.customer_ids=t.customer.map(function(t){return t.customer_id}),this.relevanceAll=e,this.imageFileList=this.imgFileList.map(function(t){return t});for(var i=0;i<this.imageFileList.length;i++)this.setImageList(this.imageFileList[i],i);this.fileList=this.accessoryFileList.map(function(t){return t})},destroyed:function(){this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)},methods:{unbindRelatedInfo:function(t,e,i){var a=this;this.$confirm("确认取消关联?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",customClass:"is-particulars"}).then(function(){var e=JSON.parse(Q()(a.allData));e[t].splice(i,1),a.allData=e;var s={};s.business_ids=a.allData.business.map(function(t){return t.business_id}),s.contacts_ids=a.allData.contacts.map(function(t){return t.contacts_id}),s.contract_ids=a.allData.contract.map(function(t){return t.contract_id}),s.customer_ids=a.allData.customer.map(function(t){return t.customer_id}),a.relevanceAll=s}).catch(function(){a.$message.info("已取消操作")})},setImageList:function(t,e){var i=this;Object(j.p)(t.url).then(function(a){t.url=a.src,i.imageFileList.splice(e,1,t)}).catch(function(){})},close:function(){1==this.$route.query.routerKey?this.$router.go(-1):this.$emit("close")},tabClick:function(){switch(this.activeName){case"1":this.formList=this.dateList;break;case"2":this.formList=this.weekList;break;case"3":this.formList=this.monthList}},submitBtn:function(){this.formData.content||this.formData.tomorrow||this.formData.question?this.$emit("submitBtn",this.activeName,this.batchId,this.relevanceAll,this.imageFileList,this.fileList):this.$message.error("内容至少填写一项")},imgFileUploadSuccess:function(t,e,i){this.imageFileList=i},handleFilePreview:function(t){if(t.response||t.file_id){var e=void 0;e=t.response?t.response.data:t,this.$bus.emit("preview-image-bus",{index:0,data:[e]})}},beforeRemove:function(t,e){var i=this;if(t.response||t.file_id){var a=void 0;return a=t.response?t.response.data.file_id:t.file_id,this.$confirm("您确定要删除该文件吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(O.c)({id:a,module_id:a,module:"work_task",save_name:t.response?t.response.data.save_name:t.save_name}).then(function(t){i.$message.success("操作成功");var e=i.getFileIndex(i.$refs.imageUpload.uploadFiles,a);-1!=e&&i.$refs.imageUpload.uploadFiles.splice(e,1),-1!=(e=i.getFileIndex(i.imgFileList,a))&&i.imgFileList.splice(e,1)}).catch(function(){})}).catch(function(){i.$message({type:"info",message:"已取消操作"})}),!1}return!0},getFileIndex:function(t,e){for(var i=-1,a=0;a<t.length;a++){var s=t[a];if((s.response?s.response.data.file_id:s.file_id)==e){i=a;break}}return i},fileUploadSuccess:function(t,e,i){this.fileList=i},handleFileRemove:function(t,e){var i=this;if(t.response||t.file_id){var a=void 0;return a=t.response?t.response.data.file_id:t.file_id,this.$confirm("您确定要删除该文件吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(O.c)({id:a,module_id:a,module:"work_task",save_name:t.response?t.response.data.save_name:t.save_name}).then(function(t){i.$message.success("操作成功");var e=i.getFileIndex(i.$refs.fileUpload.uploadFiles,a);-1!=e&&i.$refs.fileUpload.uploadFiles.splice(e,1),-1!=(e=i.getFileIndex(i.fileList,a))&&i.fileList.splice(e,1)}).catch(function(){})}).catch(function(){i.$message({type:"info",message:"已取消操作"})}),!1}return!0},sendUserChange:function(t,e){this.formData.sendUserList=t},handleClose:function(){this.dialogVisible=!1},checkInfos:function(t){this.relevanceAll=t}}},J=(i("Thiw"),Object(_.a)(G,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("create-view",{attrs:{"body-style":{height:"100%"}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.newLoading,expression:"newLoading"}],staticClass:"new-journal"},[i("div",{staticClass:"header",attrs:{slot:"header"},slot:"header"},[i("span",{staticClass:"text"},[t._v(t._s(t.dialogTitle))]),t._v(" "),i("i",{staticClass:"el-icon-close rt",on:{click:t.close}})]),t._v(" "),i("div",{staticClass:"content"},[i("el-tabs",{on:{"tab-click":t.tabClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},t._l(t.tabsData,function(t,e){return i("el-tab-pane",{key:e,attrs:{label:t.label,name:t.key}})})),t._v(" "),i("div",{staticClass:"form"},[t._l(t.formList,function(e,a){return i("div",{key:a,staticClass:"row-list"},[i("label",{staticClass:"item-label"},[t._v(t._s(e.label)+"")]),t._v(" "),i("el-input",{attrs:{autosize:{minRows:4},maxlength:1e3,"show-word-limit":"",type:"textarea",placeholder:"请输入内容",resize:"none"},model:{value:t.formData[e.model],callback:function(i){t.$set(t.formData,e.model,i)},expression:"formData[item.model]"}})],1)}),t._v(" "),i("div",{staticClass:"img-accessory"},[i("div",{staticClass:"img-box"},[i("el-upload",{ref:"imageUpload",attrs:{action:t.crmFileSaveUrl,headers:t.httpHeader,data:{type:"img",batchId:t.batchId},"on-preview":t.handleFilePreview,"before-remove":t.beforeRemove,"on-success":t.imgFileUploadSuccess,"file-list":t.imageFileList,name:"file",multiple:"",accept:"image/*","list-type":"picture-card"}},[i("p",{staticClass:"add-img"},[i("span",{staticClass:"el-icon-picture"}),t._v(" "),i("span",[t._v("添加图片")])]),t._v(" "),i("i",{staticClass:"el-icon-plus"})])],1),t._v(" "),i("p",{staticClass:"add-accessory"},[i("el-upload",{ref:"fileUpload",attrs:{action:t.crmFileSaveUrl,headers:t.httpHeader,data:{type:"file",batchId:t.batchId},"on-preview":t.handleFilePreview,"before-remove":t.handleFileRemove,"on-success":t.fileUploadSuccess,"file-list":t.fileList,name:"file",multiple:"",accept:"*.*"}},[i("p",[i("i",{staticClass:"wukong wukong-file"}),t._v("\n 添加附件\n ")])])],1)]),t._v(" "),i("div",{staticClass:"sent-who"},[i("span",{staticClass:"cursor-default"},[t._v("发送给:")]),t._v(" "),t._l(t.showSendUserList,function(e,a){return i("span",{key:a,staticClass:"send-user"},[i("el-tooltip",{attrs:{placement:"bottom",effect:"light","popper-class":"tooltip-change-border"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("span",[t._v(t._s(e.realname))])]),t._v(" "),i("xr-avatar",{staticClass:"item-img",attrs:{name:e.realname,size:26,src:e.img||e.thumb_img}})],1)],1)}),t._v(" "),i("members-dep",{attrs:{"close-dep":!0,"content-block":!1,"user-checked-data":t.formData.sendUserList},on:{popoverSubmit:t.sendUserChange}},[i("span",{attrs:{slot:"membersDep"},slot:"membersDep"},[i("el-tooltip",{attrs:{placement:"bottom",effect:"light","popper-class":"tooltip-change-border"}},[i("div",{attrs:{slot:"content"},slot:"content"},[i("span",[t._v(t._s("等"+t.formData.sendUserList.length+"人"))])]),t._v(" "),i("i",{directives:[{name:"show",rawName:"v-show",value:t.formData.sendUserList.length>5,expression:"formData.sendUserList.length > 5"}],staticClass:"el-icon-more more-user-btn"})]),t._v(" "),i("i",{staticClass:"el-icon-plus add-user-btn"})],1)])],2),t._v(" "),i("related-business",{attrs:{"margin-left":"0","all-data":t.allData},on:{unbind:t.unbindRelatedInfo,checkInfos:t.checkInfos}})],2)],1),t._v(" "),i("div",{staticClass:"btn-group"},[i("el-button",{attrs:{type:"primary"},on:{click:t.submitBtn}},[t._v("提交")]),t._v(" "),i("el-button",{on:{click:t.close}},[t._v("取消")])],1)])])},[],!1,null,"7c4d165e",null));J.options.__file="NewDialog.vue";var tt=J.exports,et=i("ZX9L"),it=i("KmSi"),at=i("wd/R"),st=i.n(at),nt={name:"WorkLog",components:{ReportMenu:u.a,LogItem:F,CreateLog:E,LogComDetail:H,XhUserCell:q.a,CRMAllDetail:v.a,NewDialog:tt,TimeTypeSelect:et.a,ReportList:it.a},data:function(){return{logType:"",headData:{nowNum:0,allNum:0,timeLabel:"",timeRemind:"",startLog:0},reportList:[{type:"customer",key:"customerNum",info:"今日新增客户",name:"今日新增客户 0"},{type:"business",key:"businessNum",info:"今日新增商机",name:"今日新增商机 0"},{type:"contract",key:"contractNum",info:"今日新增合同",name:"今日新增合同 0"},{type:"receivables",key:"receivablesMoneyNum",info:"今日新增回款",name:"今日新增回款 0"},{type:"record",key:"recordNum",info:"今日新增跟进记录",name:"今日新增跟进记录 0"}],listData:[],loading:!1,noMore:!1,page:1,totalCount:0,scrollKey:Date.now(),options:[{label:"全部",value:0},{label:"日报",value:1},{label:"周报",value:2},{label:"月报",value:3}],filterForm:{category_id:0,create_user_id:""},userSelects:[],timeOptions:[{label:"今天",value:"today"},{label:"昨天",value:"yesterday"},{label:"本周",value:"week"},{label:"上周",value:"lastWeek"},{label:"最近30天",value:"recent30"},{label:"最近60天",value:"recent60"},{label:"本月",value:"month"},{label:"上月",value:"lastMonth"},{label:"本季度",value:"quarter"},{label:"上季度",value:"lastQuarter"},{label:"本年",value:"year"},{label:"去年",value:"lastYear"}],timeSelect:{type:"default",value:"recent30"},search:"",relatedID:"",relatedCRMType:"",showRelatedDetail:!1,newLoading:!1,showNewDialog:!1,formData:{},imgFileList:[],accessoryFileList:[],reportListShow:!1,fieldReportList:null,reportData:{title:"",placeholder:"",crmType:"",request:null,recordRequest:c.j,params:null,paging:!0,sortable:!1},logComDetailType:"",logComDetailShow:!1}},computed:r()({},Object(L.b)(["userInfo"]),{showUserSelect:function(){return"send"!=this.logType},showAdd:function(){return"received"!=this.logType},userDoneStatus:function(){return{icon:this.headData.startLog>0?"wk-success":"wk-close",label:this.headData.startLog>0?"今天日志已完成":"今天日志还未完成"}},scrollDisabled:function(){return this.loading||this.noMore},nickName:function(){if(!this.userInfo.realname)return this.userInfo.username;return/[a-zA-Z]+/.test(this.userInfo.realname)||!this.userInfo.sex?this.userInfo.realname:this.userInfo.realname.slice(0,1)+("男"==this.userInfo.sex?"先生":"女士")}}),watch:{filterForm:{handler:function(){this.refreshList()},deep:!0}},created:function(){this.logType=this.$route.params.type,this.getLogRemind(),this.getHeadDetail(),this.getReportData()},beforeRouteUpdate:function(t,e,i){this.logType=t.params.type,this.totalCount=0,this.$refs.createLog&&(this.$refs.createLog.showMore=!1),this.filterForm={category_id:0,create_user_id:""},this.userSelects=[],this.timeSelect={type:"default",value:"recent30"},this.refreshList(),i()},methods:{getHeadDetail:function(){var t=this;Object(c.g)().then(function(e){t.headData.nowNum=e.data.logCount,t.headData.allNum=e.data.mothEndCount,t.headData.startLog=e.data.startLog}).catch(function(){})},getReportData:function(){var t=this;this.loading=!0,Object(d.q)({}).then(function(e){t.loading=!1;var i=e.data.data||{};t.reportList=t.reportList.map(function(t){return"receivablesMoneyNum"==t.key&&(i.receivablesMoneyNum=Object(D.h)(Math.floor(i.receivablesMoneyNum||0))),t.name=t.info+" "+i[t.key],t})}).catch(function(){t.loading=!1})},getLogRemind:function(){this.getNetworkWelcome();var t=st()().format("H");this.headData.timeLabel=t<12?"早上好":t<18?"下午好":"晚上好"},getNetworkWelcome:function(){var t=this;Object(c.d)().then(function(e){t.headData.timeRemind=e.data}).catch(function(){})},refreshList:function(){this.page=1,this.listData=[],this.noMore=!1,this.totalCount=0,this.scrollKey=Date.now()},getList:function(){var t=this;arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.loading){this.loading=!0;var e=this.getBaseParams();e.page=this.page,e.limit=5,Object(c.e)(e).then(function(e){t.loading=!1,t.noMore||(t.listData=t.listData.concat(e.data.page.list),t.page++),t.totalCount=e.data.page.dataCount,t.noMore=e.data.page.lastPage}).catch(function(){t.noMore=!0,t.loading=!1})}},getBaseParams:function(){var t=r()({search:this.search},this.filterForm);return this.timeSelect.type&&("custom"===this.timeSelect.type?(t.start_time=this.timeSelect.startTime.replace(/\./g,"-"),t.end_time=this.timeSelect.endTime.replace(/\./g,"-")):t.type=this.timeSelect.value||""),"all"!=this.logType&&(t.by={send:"me",received:"other"}[this.logType]),"send"==this.logType&&t.hasOwnProperty("create_user_id")&&delete t.create_user_id,t.hasOwnProperty("category_id")&&0===t.category_id&&delete t.category_id,t},handleAddComment:function(t){this.listData[t.index].replyList.push(t.data)},handleDelete:function(t){this.listData.splice(t,1),this.getHeadDetail(),this.refreshList()},addLogSuccess:function(){this.refreshList(),this.headData.nowNum++,this.headData.allNum++},handleEdit:function(t,e){this.formData=e,this.imgFileList=e.imgList.map(function(t){return t.file_path&&(t.url=t.file_path),t}),this.accessoryFileList=e.fileList,this.showNewDialog=!0},submitEdit:function(t,e,i,a,n){var l=this;this.newLoading=!0;var r=[];if(this.formData.depData){var d=!0,u=!1,h=void 0;try{for(var p,m=o()(this.formData.depData);!(d=(p=m.next()).done);d=!0){var f=p.value;r.push(f.id)}}catch(t){u=!0,h=t}finally{try{!d&&m.return&&m.return()}finally{if(u)throw h}}}var v=[];if(this.formData.sendUserList){var g=!0,_=!1,y=void 0;try{for(var b,w=o()(this.formData.sendUserList);!(g=(b=w.next()).done);g=!0){var C=b.value;v.push(C.id)}}catch(t){_=!0,y=t}finally{try{!g&&w.return&&w.return()}finally{if(_)throw y}}}var k={log_id:this.formData.log_id,category_id:t,content:this.formData.content,tomorrow:this.formData.tomorrow,question:this.formData.question,send_user_ids:v,customer_ids:i.customerIds||i.customer_ids,contacts_ids:i.contactsIds||i.contacts_ids,business_ids:i.businessIds||i.business_ids,contract_ids:i.contractIds||i.contract_ids,file:[].concat(s()(a.map(function(t){return t.response?t.response.data.file_id:t.file_id})),s()(n.map(function(t){return t.response?t.response.data.file_id:t.file_id})))};Object(c.c)(k).then(function(t){l.showNewDialog=!1,l.refreshList(),l.$message.success("编辑成功"),l.newLoading=!1}).catch(function(){l.newLoading=!1,l.$message.error("编辑失败")})},handleRead:function(t){this.listData[t].isRead=1},userChange:function(t){this.userSelects=t.value||[],t.value.length>0?this.filterForm.create_user_id=t.value.map(function(t){return t.id}):this.filterForm.create_user_id=""},checkUserHistory:function(t){this.userSelects=t?[t]:[],this.filterForm.create_user_id=t?t.id:""},timeTypeChange:function(t){this.timeSelect=t,this.refreshList()},enterRelateDetail:function(t,e){this.relatedID=e[t+"_id"],this.relatedCRMType=t,this.showRelatedDetail=!0},reportSelect:function(t,e){t.type&&(this.reportData.title="销售简报-"+t.info,this.reportData.placeholder={customer:"请输入客户名称",business:"请输入商机名称",contract:"请输入合同名称",receivables:"请输入回款编号",record:""}[t.type],this.reportData.crmType=t.type,this.reportData.params=e?{log_id:e.log_id}:{today:1},this.reportData.params.type="today","record"==t.type?(this.fieldReportList=[{label:"模块",prop:"types",width:300},{label:"新增跟进记录数",prop:"dataCount"}],this.reportData.request=c.f,this.reportData.paging=!1,this.reportData.sortable=!1):(this.fieldReportList=this.getReportFieldList(t.type),this.reportData.request=c.h,this.reportData.paging=!0,this.reportData.sortable="custom"),this.reportListShow=!0)},getReportFieldList:function(t){return{customer:[{label:"客户名称",prop:"name"},{label:"成交状态",prop:"deal_status"},{label:"最后跟进时间",prop:"last_time"},{label:"创建时间",prop:"create_time"},{label:"负责人",prop:"owner_user_name"}],business:[{label:"商机名称",prop:"name"},{label:"商机阶段",prop:"status_name"},{label:"最后跟进时间",prop:"last_time"},{label:"创建时间",prop:"create_time"},{label:"负责人",prop:"owner_user_name"}],contract:[{label:"合同名称",prop:"name"},{label:"合同状态",prop:"check_status"},{label:"创建时间",prop:"create_time"},{label:"公司签约人",prop:"order_user_name"}],receivables:[{label:"回款编号",prop:"number"},{label:"回款时间",prop:"return_time"},{label:"负责人",prop:"owner_user_name"}]}[t]},logExportClick:function(){var t=this;0!=this.filterForm.category_id?(this.loading=!0,Object(c.n)(this.getBaseParams()).then(function(e){Object(j.c)(e),t.loading=!1}).catch(function(){t.loading=!1})):this.$message.error("请先选择”日报、周报、月报“中的一种类型导出")},completeSelect:function(t){this.logComDetailType=t,this.logComDetailShow=!0}}},ot=(i("Uk6Q"),Object(_.a)(nt,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:t.getList,expression:"getList"}],key:t.scrollKey,staticClass:"main",attrs:{"infinite-scroll-distance":"100","infinite-scroll-disabled":"scrollDisabled"}},[i("div",[i("div",{staticClass:"work-log scroll-body"},[i("div",{staticClass:"card"},[i("flexbox",{staticClass:"hello-card"},[i("xr-avatar",{staticClass:"user-img",attrs:{name:t.userInfo.realname,size:50,src:t.userInfo.img}}),t._v(" "),i("div",{staticClass:"greeting"},[i("div",{staticClass:"hello"},[t._v("\n "+t._s(t.headData.timeLabel)+""+t._s(t.nickName)+"\n "),i("span",{staticClass:"status"},[i("span",{staticClass:"icon wk",class:t.userDoneStatus.icon}),t._v(" "),i("span",[t._v(t._s(t.userDoneStatus.label))])])]),t._v(" "),t.headData&&t.headData.timeRemind?i("div",{staticClass:"text"},[t._v("\n "+t._s(t.headData.timeRemind)+"\n ")]):t._e()]),t._v(" "),i("div",{staticClass:"statistics"},[i("div",{staticClass:"title"},[i("span",[t._v("本月完成日志")])]),t._v(" "),i("div",{staticClass:"info"},[i("span",{staticClass:"special"},[t._v(t._s(t.headData.allNum))]),t._v("篇\n ")])])],1),t._v(" "),i("flexbox",{staticClass:"report-card",attrs:{align:"stretch"}},[i("div",{staticClass:"report-card__label"},[t._v("销售简报")]),t._v(" "),i("report-menu",{attrs:{list:t.reportList},on:{select:t.reportSelect}})],1)],1),t._v(" "),t.showAdd?i("create-log",{ref:"createLog",staticClass:"add-card card",on:{update:t.addLogSuccess,completeSelect:t.completeSelect}}):t._e(),t._v(" "),i("flexbox",{staticClass:"filter-control card"},[t.showUserSelect?i("xh-user-cell",{staticClass:"xh-user-cell",attrs:{radio:!1,value:t.userSelects,placeholder:"选择人员"},on:{"value-change":t.userChange}}):t._e(),t._v(" "),i("time-type-select",{attrs:{width:190,options:t.timeOptions,"default-type":t.timeSelect},on:{change:t.timeTypeChange}}),t._v(" "),i("el-select",{attrs:{placeholder:"类型"},model:{value:t.filterForm.category_id,callback:function(e){t.$set(t.filterForm,"category_id",e)},expression:"filterForm.category_id"}},t._l(t.options,function(t,e){return i("el-option",{key:e,attrs:{label:t.label,value:t.value}})})),t._v(" "),i("el-input",{attrs:{placeholder:"请输入工作内容","prefix-icon":"el-icon-search",type:"text"},on:{blur:t.refreshList},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.refreshList(e):null}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),t._v(" "),i("div",{staticClass:"filter-right"},[i("span",{staticClass:"total-count"},[t._v("已筛选出"),i("span",[t._v(t._s(t.totalCount))]),t._v("项")]),t._v(" "),i("el-button",{staticClass:"export-btn",on:{click:t.logExportClick}},[t._v("导出")])],1)],1)],1),t._v(" "),t._l(t.listData,function(e,a){return i("div",{key:a,staticClass:"card"},[i("log-item",{attrs:{data:e,index:a,"show-history-btn":t.showUserSelect},on:{read:function(e){t.handleRead(a)},"add-comment":t.handleAddComment,delete:t.handleDelete,edit:t.handleEdit,"relate-detail":t.enterRelateDetail,"report-detail":t.reportSelect,"check-history":t.checkUserHistory}})],1)})],2),t._v(" "),t.loading?i("p",{staticClass:"scroll-bottom-tips"},[t._v("加载中...")]):t._e(),t._v(" "),t.noMore?i("p",{staticClass:"scroll-bottom-tips"},[t._v("没有更多了")]):t._e(),t._v(" "),i("c-r-m-all-detail",{attrs:{visible:t.showRelatedDetail,"crm-type":t.relatedCRMType,id:t.relatedID,"no-listener-class":["content-item"]},on:{"update:visible":function(e){t.showRelatedDetail=e}}}),t._v(" "),t.showNewDialog?i("new-dialog",{attrs:{"form-data":t.formData,"img-file-list":t.imgFileList,"accessory-file-list":t.accessoryFileList,"new-loading":t.newLoading,"dialog-title":"编辑日志"},on:{close:function(e){t.showNewDialog=!1},submitBtn:t.submitEdit}}):t._e(),t._v(" "),i("report-list",{attrs:{show:t.reportListShow,title:t.reportData.title,placeholder:t.reportData.placeholder,"crm-type":t.reportData.crmType,request:t.reportData.request,params:t.reportData.params,"record-request":t.reportData.recordRequest,"field-list":t.fieldReportList,paging:t.reportData.paging,sortable:t.reportData.sortable},on:{"update:show":function(e){t.reportListShow=e}}}),t._v(" "),i("log-com-detail",{attrs:{show:t.logComDetailShow,type:t.logComDetailType},on:{"update:show":function(e){t.logComDetailShow=e}}})],1)},[],!1,null,"fc71a404",null));ot.options.__file="index.vue";e.default=ot.exports},e1ag:function(t,e,i){},eOwn:function(t,e,i){"use strict";var a=i("m1cH"),s=i.n(a),n=i("QbLZ"),o=i.n(n),l=i("7Dod"),r=i("6iAj"),c=i("4XAY"),d=i("KTTK"),u=i("mkuN"),h=i("zMq1"),p=i("ye9D"),m=i("NYF1"),f=i("YIeP"),v=i("7Qib");var g={methods:{dispatch:function(t,e,i){for(var a=this.$parent||this.$root,s=a.$options.componentName;a&&(!s||s!==t);)(a=a.$parent)&&(s=a.$options.componentName);a&&a.$emit.apply(a,[e].concat(i))},broadcast:function(t,e,i){(function t(e,i,a){this.$children.forEach(function(s){s.$options.componentName===e?s.$emit.apply(s,[i].concat(a)):t.apply(s,[e,i].concat([a]))})}).call(this,t,e,i)}}},_={name:"LogAdd",components:{CrmRelative:u.a,AddImageList:h.a,AddFileList:p.a,AddRelateList:m.a,CommonWords:f.a},mixins:[g],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(t){var e=!!(t&&t.length>0);this.dispatch("SlideView","setEditClose",[e])},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(t){var e=this;this.content?this.$confirm("您选中的常用语将覆盖当前填写内容?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",customClass:"is-particulars"}).then(function(){e.content=t}).catch(function(){}):this.content=t},checkRelativeInfos:function(t){"business"==this.showRelativeType&&(this.business=t.data)},barClick:function(t){this.showRelativeType=t,"business"==t?this.showBusinessPopover=!0:"file"==t?this.$refs.fileInput.click():"img"==t&&this.$refs.imgInput.click()},uploadFile:function(t){var e=t.target.files;if(e.length){for(var i=0;i<e.length;i++){if(-1==e[i].type.indexOf("image")&&"img"==this.showRelativeType)return void this.$message.error("请上传正确的文件类型")}for(var a="image/*"==t.target.accept?"img":"file",s=0;s<e.length;s++){var n=e[s];this.uploadFileRequest(n,a)}t.target.value=""}},uploadFileRequest:function(t,e,i){var a=this;this.$wkUploadFile.upload({file:t,params:{module_id:this.id,module:"crm_"+this.crmType,type:e}}).then(function(s){var n=s.res.data||{};n.size=Object(v.h)(t.size),"img"==e?a.imgFiles.push(n):(n.icon=Object(v.o)(t),a.files.push(n)),i&&i()}).catch(function(){})},deleteImage:function(t,e){this.deleteImgOrFile("image",t,e)},deleteFile:function(t,e){this.deleteImgOrFile("file",t,e)},deleteImgOrFile:function(t,e,i){var a=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(d.c)({module:"crm_"+a.crmType,module_id:a.id,save_name:"image"==t?a.imgFiles[i].save_name:a.files[i].save_name}).then(function(e){"image"==t?a.imgFiles.splice(i,1):a.files.splice(i,1),a.$message.success("操作成功")}).catch(function(){})}).catch(function(){})},deleteAllFile:function(t){var e=this;this.$confirm("确定删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(d.e)({module:"crm_"+e.crmType,module_id:e.id,file_id:[].concat(s()(e.imgFiles.map(function(t){return t.file_id})),s()(e.files.map(function(t){return t.file_id}))),batchId:e.batchId,type:t}).then(function(i){2==t?e.imgFiles=[]:e.files=[],e.$message.success("操作成功")}).catch(function(){})}).catch(function(){})},deleteRelate:function(t,e){this.business.splice(e,1)},inputFocus:function(){var t=this;this.isUnfold=!0,this.$nextTick(function(){t.$refs.textarea.focus(),t.$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")}}},y=(i("t1Sh"),i("KHd+")),b=Object(y.a)(_,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{class:["mix-content",{unfold:!t.isUnfold}]},[t.isUnfold?i("i",{staticClass:"wk wk-close",on:{click:t.close}}):t._e(),t._v(" "),t.isUnfold?i("div",{staticClass:"mix-content-select"},[t.showContacts?i("el-select",{attrs:{clearable:"",placeholder:"选择联系人"},model:{value:t.selectContactsId,callback:function(e){t.selectContactsId=e},expression:"selectContactsId"}},t._l(t.contacts,function(t){return i("el-option",{key:t.contactsId,attrs:{label:t.name,value:t.contacts_id}})})):t._e(),t._v(" "),i("el-select",{attrs:{clearable:"",placeholder:"选择跟进方式"},model:{value:t.followType,callback:function(e){t.followType=e},expression:"followType"}},t._l(t.followTypes,function(t){return i("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),t._v(" "),i("el-date-picker",{attrs:{editable:!1,type:"datetime",placeholder:"选择下次联系时间","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:t.nextTime,callback:function(e){t.nextTime=e},expression:"nextTime"}}),t._v(" "),i("common-words",{on:{select:t.commonWordsSelect}})],1):t._e(),t._v(" "),i("div",{class:["i-cont",{unfold:!t.isUnfold}]},[t.isUnfold?t._e():i("i",{staticClass:"wk wk-write"}),t._v(" "),i("el-input",{ref:"textarea",attrs:{autosize:t.autosize,maxlength:800,type:"textarea",clearable:"",resize:"none",placeholder:"请输入内容"},on:{focus:t.inputFocus},model:{value:t.content,callback:function(e){t.content=e},expression:"content"}})],1),t._v(" "),t.imgFiles.length>0&&t.isUnfold?i("add-image-list",{attrs:{data:t.imgFiles},on:{delete:t.deleteImage,"delete-all":function(e){t.deleteAllFile(2)},upload:t.uploadFile}}):t._e(),t._v(" "),t.files.length>0&&t.isUnfold?i("add-file-list",{attrs:{data:t.files},on:{delete:t.deleteFile,"delete-all":function(e){t.deleteAllFile(1)}}}):t._e(),t._v(" "),t.business.length>0&&t.isUnfold?i("add-relate-list",{attrs:{data:t.business,type:"business"},on:{delete:t.deleteRelate}}):t._e(),t._v(" "),t.isUnfold?i("div",{staticClass:"bar-cont"},[i("el-button",{staticClass:"handle-button",attrs:{type:"text",icon:"wk wk-picture"},on:{click:function(e){t.barClick("img")}}},[t._v("图片")]),t._v(" "),i("el-button",{staticClass:"handle-button",attrs:{type:"text",icon:"wk wk-file"},on:{click:function(e){t.barClick("file")}}},[t._v("附件")]),t._v(" "),t.showBusiness?i("el-popover",{attrs:{placement:"bottom",width:"700","popper-class":"no-padding-popover",trigger:"click"},model:{value:t.showBusinessPopover,callback:function(e){t.showBusinessPopover=e},expression:"showBusinessPopover"}},[i("crm-relative",{ref:"crmrelative",attrs:{show:t.showBusinessPopover,radio:!1,action:t.businessAction,"selected-data":{business:t.business},"crm-type":"business"},on:{close:function(e){t.showBusinessPopover=!1},changeCheckout:t.checkRelativeInfos}}),t._v(" "),i("el-button",{staticClass:"handle-button",staticStyle:{"margin-left":"10px"},attrs:{slot:"reference",type:"text",icon:"wk wk-associate"},on:{click:function(e){t.barClick("business")}},slot:"reference"},[t._v("关联商机")])],1):t._e(),t._v(" "),i("el-button",{directives:[{name:"debounce",rawName:"v-debounce",value:t.sendClick,expression:"sendClick"}],staticClass:"send-btn",attrs:{type:"primary"}},[t._v("发布")])],1):t._e(),t._v(" "),i("input",{ref:"fileInput",staticClass:"file-input",attrs:{accept:"*.*",type:"file",multiple:""},on:{change:t.uploadFile}}),t._v(" "),i("input",{ref:"imgInput",staticClass:"file-input",attrs:{accept:"image/*",type:"file",multiple:""},on:{change:t.uploadFile}})],1)},[],!1,null,"2caf5be7",null);b.options.__file="LogAdd.vue";var w=b.exports,C=i("O8VQ"),k=i("/G0b"),T=i("8OTK"),L=i("C3Po"),D=i("ZoMv"),x=i("Z+Ht"),I=i("vvxI"),F=i("ZX9L"),S=i("ehos"),R=i("L2JU"),j={name:"Activity",components:{LogAdd:w,LogCell:C.a,CRMAllCreate:T.default,TaskQuickAdd:L.a,TimeTypeSelect:F.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:[x.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(R.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 t={};return t[this.crmType+"_ids"]=this.id,t},taskProps:function(){var t={};t[this.crmType]=[this.detail];var e={};return e[this.crmType+"Ids"]=[this.id],{relatedObj:t,relatedObjIds:e}}}),watch:{id:function(){this.initInfo(),this.refreshLogList()}},created:function(){this.debouncedRefreshLogList=Object(S.debounce)(300,this.refreshLogList),this.initInfo()},methods:{getLogTypeList:function(){var t=this;Object(r.r)().then(function(e){t.followTypes=e.data.map(function(t){return{value:t,label:t}})}).catch(function(){})},getContactsList:function(){var t=this;Object(l.I)({customer_id:this.id}).then(function(e){t.contacts=e.data.list}).catch(function(){})},sendLog:function(t){var e=this;if(t.content){var i={category:t.followType,activity_type:D.a.keyToTypeData[this.crmType],activity_type_id:t.id,content:t.content,next_time:t.nextTime||"",is_event:0,file_id:[].concat(s()(t.files.map(function(t){return t.file_id})),s()(t.images.map(function(t){return t.file_id}))),business_ids:[].concat(s()(t.business.map(function(t){return t.business_id}))),contacts_ids:t.contactsId};this.sendLoading=!0,Object(c.a)(i).then(function(t){e.sendLoading=!1,e.$message.success("发布成功"),e.$refs.logAdd&&e.$refs.logAdd.resetInfo(),e.refreshLogList()}).catch(function(){e.sendLoading=!1})}else this.$message.error("请输入跟进内容")},handleClick:function(t){var e=this;if(this.handleType==t?this.handleType="":this.handleType=t,"log"==t)this.isTaskCreate=!1,this.$nextTick(function(){e.$refs.logAdd&&(e.$refs.logAdd.isUnfold=e.handleType==t)});else if("task"==t)this.isTaskCreate=!0,this.$nextTick(function(){e.$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"==t&&(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"==t&&(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=t,this.isCRMCreate=!0}},initInfo:function(){var t=this;this.$nextTick(function(){t.$refs.logAdd&&t.$refs.logAdd.resetInfo(),t.$refs.taskAdd&&t.$refs.taskAdd.resetSendData()}),this.filterValue={search:"",timeLine:{label:"全部",value:""}},this.getLogTypeList(),this.showRelate&&this.getContactsList()},refreshLogList:function(t){this.isSearchRequest=t||!1,this.page=1,this.noMore=!1,this.list=[],this.scrollKey=Date.now()},handleSelectClick:function(t){this.activityType=t,this.refreshLogList()},timeTypeChange:function(t){this.filterValue.timeLine=t,this.refreshLogList()},getLogList:function(){var t=this;this.loading=!0;var e={module:this.crmType,page:this.page,crmType:D.a[this.crmType],activity_type:this.activityType.command||"",activity_type_id:this.id};this.filterValue.search&&(e.search=this.filterValue.search),this.filterValue.timeLine.type&&("custom"===this.filterValue.timeLine.type?(e.start_date=this.filterValue.timeLine.startTime.replace(/\./g,"-"),e.end_date=this.filterValue.timeLine.endTime.replace(/\./g,"-")):e.interval_day=this.filterValue.timeLine.value||""),Object(c.c)(e).then(function(e){if(t.loading=!1,!t.noMore)if(t.page++,t.list.length){var i=t.list[t.list.length-1];e.data.time&&e.data.list.length&&i.time!=e.data.time&&t.list.push(e.data)}else e.data.time&&e.data.list.length&&t.list.push(e.data);t.noMore=e.data.lastPage,t.isSearchRequest&&t.$nextTick(function(){t.$refs.activitySearchInput.focus()})}).catch(function(){t.noMore=!0,t.loading=!1})},createCRMSuccess:function(){this.handleType="",this.refreshLogList()},createCRMClose:function(){this.isCRMCreate=!1,this.handleType=""},checkCRMDetail:function(t,e){this.relationID=e,this.relationCrmType=t,this.showFullDetail=!0},getActivityIcon:function(t){return this.getXrIcon(this.getActivityType(t))},getActivityTypeColor:function(t){return this.getXrIconColor(this.getActivityType(t))},logCellDelete:function(t,e,i){this.list[i].list.splice(e,1),0==this.list[i].list.length&&this.list.splice(i,1),this.scrollKey=Date.now()},logCellEdit:function(t,e,i){this.logEditData=t,this.logEditPosition={seciton:i,index:e},this.logEditDialogVisible=!0},logEditSave:function(t){this.logEditPosition.seciton>=0&&this.logEditPosition.index>=0&&this.list[this.logEditPosition.seciton].list.splice(this.logEditPosition.index,1,t),this.getLogList()}}},O=(i("N8+3"),Object(y.a)(j,function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"infinite-scroll",rawName:"v-infinite-scroll",value:t.getLogList,expression:"getLogList"}],key:t.scrollKey,staticClass:"main",attrs:{"infinite-scroll-distance":"100","infinite-scroll-disabled":"scrollDisabled"}},[i("div",[!t.isSeas&&t.handle&&t.handle.length?i("div",{staticClass:"main-handle"},t._l(t.handle,function(e,a){return i("el-button",{key:a,class:{"is-select":t.handleType===e.type},attrs:{type:"primary",icon:"wk wk-add"},on:{click:function(i){t.handleClick(e.type)}}},[t._v("\n "+t._s(e.label)+"\n ")])})):t._e(),t._v(" "),!t.isSeas&&t.handle&&t.handle.length?[!t.isTaskCreate&&t.canCreateFollowRecord?i("log-add",{ref:"logAdd",staticClass:"log-add",attrs:{id:t.id,"show-business":t.showRelate,"show-contacts":t.showRelate,contacts:t.contacts,"contacts-id":t.contactsId,"follow-types":t.followTypes,"crm-type":t.crmType},on:{send:t.sendLog,focus:function(e){t.handleType="log"},close:function(e){t.handleClick(t.handleType)}}}):i("task-quick-add",{ref:"taskAdd",staticClass:"task-quick-add",attrs:{params:t.taskParams,props:t.taskProps},on:{focus:function(e){t.handleType="task"},send:t.refreshLogList}})]:t._e(),t._v(" "),i("div",{staticClass:"log",class:{"is-top":t.handle&&0==t.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(e){if(!("button"in e)&&t._k(e.keyCode,"enter",13,e.key,"Enter"))return null;t.debouncedRefreshLogList(!0)}},model:{value:t.filterValue.search,callback:function(e){t.$set(t.filterValue,"search",e)},expression:"filterValue.search"}}),t._v(" "),i("time-type-select",{attrs:{width:190,options:t.timeOptions,"default-type":t.filterValue.timeLine},on:{change:t.timeTypeChange}}),t._v(" "),t.typeList.length>1?i("el-dropdown",{attrs:{trigger:"click"},on:{command:t.handleSelectClick}},[i("span",{staticClass:"el-dropdown-link"},[i("i",{class:["wk","dropdown-icon","wk-"+t.activityType.icon],style:{backgroundColor:t.activityType.color}}),t._v(t._s(t.activityType.label)),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.typeList,function(e,a){return i("el-dropdown-item",{key:a,attrs:{command:e}},[i("i",{class:["wk","dropdown-icon","wk-"+e.icon],style:{backgroundColor:e.color}}),t._v(t._s(e.label))])}))],1):t._e()],1),t._v(" "),t._l(t.list,function(e,a){return i("div",{key:a,staticClass:"log-section"},[i("div",{staticClass:"log-section__title"},[i("span",{staticClass:"section-title"},[i("span",{staticClass:"section-title__time"},[t._v(t._s(e.time))])])]),t._v(" "),t._l(e.list,function(s,n){return[1==s.type?i("div",{key:n,staticClass:"log-cell",class:{"only-one":1==e.list.length}},[i("log-cell",{attrs:{item:s,section:a,index:n,"can-delete":!t.isSeas},on:{"crm-detail":t.checkCRMDetail,delete:t.logCellDelete,edit:t.logCellEdit}}),t._v(" "),i("i",{staticClass:"wk wk-message log-cell__mark"})],1):i("div",{key:n,staticClass:"log-cell activity-cell",class:{"only-one":1==e.list.length}},[2==s.type?i("div",{staticClass:"activity-cell"},[i("span",{staticClass:"activity-cell__label"},[t._v(t._s(s.update_time)+" "+t._s(s.create_user_name)+"创建了"+t._s(t.getActivityTypeName(s.activity_type))+"")]),i("span",{staticClass:"activity-cell__content",on:{click:function(e){t.checkCRMDetail(t.getActivityType(s.activity_type),s.activity_type_id)}}},[t._v(t._s(s.activity_type_name||"查看详情"))])]):3==s.type?i("div",{staticClass:"activity-cell"},[i("span",{staticClass:"activity-cell__label"},[t._v(t._s(s.update_time)+" "+t._s(s.create_user_name)+"将商机:")]),t._v(" "),i("span",{staticClass:"activity-cell__content",on:{click:function(e){t.checkCRMDetail("business",s.activity_type_id)}}},[t._v(t._s(s.activity_type_name))]),t._v(" "),i("span",[t._v(t._s(" "+s.content))])]):4==s.type?i("log-cell",{attrs:{item:s,section:a,index:n,"can-delete":""},on:{"crm-detail":t.checkCRMDetail,delete:t.logCellDelete}}):t._e(),t._v(" "),i("i",{staticClass:"log-cell__mark",class:t.getActivityIcon(s.activity_type),staticStyle:{"background-color":"#FB9323"},style:{backgroundColor:t.getActivityTypeColor(s.activity_type)}})],1)]})],2)}),t._v(" "),t.loading?i("p",{staticClass:"scroll-bottom-tips"},[t._v("加载中...")]):t._e(),t._v(" "),t.noMore?i("p",{staticClass:"scroll-bottom-tips"},[t._v("没有更多了")]):t._e()],2)],2),t._v(" "),t.isCRMCreate?i("c-r-m-all-create",{attrs:{"crm-type":t.createCRMType,action:t.createActionInfo},on:{"save-success":t.createCRMSuccess,close:t.createCRMClose}}):t._e(),t._v(" "),i("c-r-m-full-screen-detail",{attrs:{visible:t.showFullDetail,"crm-type":t.relationCrmType,id:t.relationID},on:{"update:visible":function(e){t.showFullDetail=e}}}),t._v(" "),i("log-edit-dialog",{attrs:{visible:t.logEditDialogVisible,data:t.logEditData},on:{"update:visible":function(e){t.logEditDialogVisible=e},save:t.logEditSave}})],1)},[],!1,null,"344bab02",null));O.options.__file="index.vue";e.a=O.exports},epE4:function(t,e,i){},fx3D:function(t,e,i){"use strict";var a=i("PLZ3");i.n(a).a},kZxc:function(t,e,i){"use strict";i.d(e,"p",function(){return o}),i.d(e,"q",function(){return l}),i.d(e,"s",function(){return r}),i.d(e,"f",function(){return c}),i.d(e,"r",function(){return d}),i.d(e,"a",function(){return u}),i.d(e,"d",function(){return h}),i.d(e,"o",function(){return p}),i.d(e,"h",function(){return m}),i.d(e,"e",function(){return f}),i.d(e,"b",function(){return v}),i.d(e,"c",function(){return g}),i.d(e,"g",function(){return _}),i.d(e,"j",function(){return y}),i.d(e,"i",function(){return b}),i.d(e,"k",function(){return w}),i.d(e,"m",function(){return C}),i.d(e,"n",function(){return k}),i.d(e,"l",function(){return T});var a=i("GQeE"),s=i.n(a),n=i("t3Un");function o(t){return Object(n.a)({url:"crm/index/index",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function l(t){return Object(n.a)({url:"oa/log/oneBulletin",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function r(t){return Object(n.a)({url:"crm/index/queryDataInfo",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function c(t){return Object(n.a)({url:"crm/index/indexList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function d(t){return Object(n.a)({url:"crm/index/indexList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function u(t){return Object(n.a)({url:"crm/index/achievementData",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function h(t){return Object(n.a)({url:"crm/index/funnel",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function p(t){return Object(n.a)({url:"crm/index/businessList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function m(t){return Object(n.a)({url:"crm/index/saletrend",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function f(t){return Object(n.a)({url:"crm/index/activityList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function v(t){return Object(n.a)({url:"crm/index/forgottenCustomerCount",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function g(t){return Object(n.a)({url:"crm/index/forgottenCustomerPageList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function _(t){return Object(n.a)({url:"crm/index/ranking",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function y(t){return Object(n.a)({url:"crm/index/dashboard",method:"post",data:t})}function b(t){return Object(n.a)({url:"crm/index/updateDashboard",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function w(t){return Object(n.a)({url:"crm/index/forgottenCustomerPageList",method:"post",data:t,headers:{"Content-Type":"application/json;charset=UTF-8"}})}function C(t){var e=new FormData;return s()(t).forEach(function(i){e.append(i,t[i])}),Object(n.a)({url:"crm/activity/excelExport",method:"post",data:e,responseType:"blob",headers:{"Content-Type":"multipart/form-data"},timeout:6e4})}function k(t){var e=new FormData;return s()(t).forEach(function(i){e.append(i,t[i])}),Object(n.a)({url:"crm/activity/excelImport",method:"post",data:e,headers:{"Content-Type":"multipart/form-data"}})}function T(t){return Object(n.a)({url:"crm/activity/excelDownload",method:"post",data:t,responseType:"blob",headers:{"Content-Type":"application/json;charset=UTF-8"}})}},nTaQ:function(t,e,i){},s9xL:function(t,e,i){"use strict";var a=i("X45o");i.n(a).a},t1Sh:function(t,e,i){"use strict";var a=i("Lc7H");i.n(a).a},wph1:function(t,e,i){},yXKV:function(t,e,i){"use strict";var a=i("1h2A");i.n(a).a}}]);