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-a3e9.a1e709fe.js

1 line
13 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a3e9"],{"0H8t":function(t,e,i){"use strict";var s=i("QVgs");i.n(s).a},HTnC:function(t,e,i){"use strict";var s=i("e1ag");i.n(s).a},KmSi:function(t,e,i){"use strict";var s=i("YEIV"),r=i.n(s),n=i("QbLZ"),o=i.n(n),a=i("4XAY"),c=i("ZoMv"),l=i("yPq4"),h=i("O8VQ"),p=i("Ew9n"),u={name:"RecordList",components:{LogCell:h.a,SlideView:p.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-"+c.a.convertTypeToKey(t)},crmName:function(t){return c.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?c.a.convertTypeToKey(t):t,this.showFullDetail=!0},hideView:function(){this.$emit("hide")}}},d=(i("0H8t"),i("KHd+")),m=Object(d.a)(u,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,s){return i("log-cell",{key:s,attrs:{item:e,index:s,"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 w=m.exports,_=i("iWcH"),y=i("L2JU"),v=i("4peS"),g=i.n(v),f=i("dAOq"),b={name:"ReportList",components:{CRMAllDetail:l.a,RecordList:w,WkFieldView:_.default},filters:{dealIcon:function(t){return"已成交"==t?"wk wk-success deal-suc":"wk wk-close deal-un"},dealName:function(t){return"已成交"==t?"已成交":"未成交"}},mixins:[f.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:g.a.get("crmPageSizes")||15,pageSizes:[15,30,60,100],total:0,rowID:"",rowType:"",showDview:!1,recordParams:{},recordShow:!1}},computed:o()({},Object(y.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,r()({},"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"==c.a[e]?"crm_activity":c.a[e],module:"crm",action:"index",controller:this.crmType};Object(a.A)(i).then(function(e){for(var i=0;i<e.data.length;i++){var s=e.data[i],r=0;r=s.width?s.width:s.name&&s.name.length<=6?15*s.name.length+45:140,t.showFieldList.push({prop:s.fieldName||s.field,label:s.name,width:r,form_type:s.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){g.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 s=0;s<i.length;s++){if(i[s].contains(t.target)){e=!1;break}}document.getElementById("slide")&&document.getElementById("slide").contains(t.target)&&(e=!1),e&&(this.showDview=!1)}}},D=(i("HTnC"),Object(d.a)(b,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,s){return i("el-table-column",{key:s,attrs:{sortable:"pool_day"!=e.prop&&"custom",fixed:0==s,prop:e.prop,label:e.label,width:e.width,"show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(s){var r=s.row,n=s.column;return s.$index,["deal_status"==e.prop?[i("i",{class:t._f("dealIcon")(r[e.prop])}),t._v(" "),i("span",[t._v(t._s(t._f("dealName")(r[e.prop])))])]:"is_lock"==e.prop?[1==r.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(r.check_status)}}),t._v(" "),i("span",[t._v(t._s(t.getCRMStatusName(r.check_status)))])]:i("wk-field-view",{attrs:{props:e,form_type:e.form_type,value:r[n.property]},scopedSlots:t._u([{key:"default",fn:function(i){return i.data,[t._v("\n "+t._s(t.fieldFormatter(r,n,r[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));D.options.__file="index.vue";e.a=D.exports},QVgs:function(t,e,i){},e1ag:function(t,e,i){}}]);