| 1 |
- !function(){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function n(t,r,n){var o;return o=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(r,"string"),(r="symbol"==e(o)?o:String(o))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return r};var t,r={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(t){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),l=new F(n||[]);return a(i,"_invoke",{value:k(e,r,l)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var m="suspendedStart",d="suspendedYield",g="executing",v="completed",y={};function _(){}function b(){}function w(){}var x={};f(x,c,(function(){return this}));var S=Object.getPrototypeOf,L=S&&S(S(M([])));L&&L!==n&&o.call(L,c)&&(x=L);var T=w.prototype=_.prototype=Object.create(x);function O(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function j(t,r){function n(a,i,l,c){var u=h(t[a],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,l,c)}),(function(e){n("throw",e,l,c)})):r.resolve(f).then((function(e){s.value=e,l(s)}),(function(e){return n("throw",e,l,c)}))}c(u.arg)}var i;a(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,o){n(e,t,r,o)}))}return i=i?i.then(o,o):o()}})}function k(e,r,n){var o=m;return function(a,i){if(o===g)throw new Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var c=D(l,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var u=h(e,r,n);if("normal"===u.type){if(o=n.done?v:d,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function D(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,D(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function F(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function M(r){if(r||""===r){var n=r[c];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var a=-1,i=function e(){for(;++a<r.length;)if(o.call(r,a))return e.value=r[a],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(e(r)+" is not iterable")}return b.prototype=w,a(T,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,s,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,f(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},r.awrap=function(e){return{__await:e}},O(j.prototype),f(j.prototype,u,(function(){return this})),r.AsyncIterator=j,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new j(p(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(T),f(T,s,"Generator"),f(T,c,(function(){return this})),f(T,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=M,F.prototype={constructor:F,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return l.type="throw",l.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},r}function l(e,t,r,n,o,a,i){try{var l=e[a](i),c=l.value}catch(u){return void r(u)}l.done?t(c):Promise.resolve(c).then(n,o)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){l(a,n,o,i,c,"next",e)}function c(e){l(a,n,o,i,c,"throw",e)}i(void 0)}))}}System.register(["./vendor-legacy-2701520b.js","./index-legacy-b39dcc6a.js"],(function(e,t){"use strict";var n,a,l,u,s;return{setters:[function(e){n=e.r,a=e.i,l=e.o},function(e){u=e.n,s=e.$}],execute:function(){var t={__name:"byTeamViews",setup:function(e){var t=n(),u=n(),f=n(!1),p=n([]),h=n(),m=a({}),d=n();function g(e){var t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)}var v=function(e,t){h.value&&h.value.length?(m.start_date=h.value[0],m.end_date=h.value[1]):(delete m.start_date,delete m.end_date),m.customer_pool_id||delete m.customer_pool_id,m.source||delete m.source,m.team_id__in||delete m.team_id__in,"khmb"==e&&w(),"xsc"==e&&(m.customer_pool_id?T():S()),P()},y=function(){var e=c(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={offset:0,limit:9999,ordering:"-id",fileds:"id,name",del_flag:0,is_default:0},e.next=3,HTTP.get("used_customer_templates",t).then((function(e){return d.value=e.data.results,e.data.results})).then((function(e){m.customer_templates_id=e[0].id})).then((function(){w()}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=n(),b=n(),w=function(){var e={company:s.getters.company,customer_templates:m.customer_templates_id,ordering:"weight"};HTTP.get("customer_templates_member_level",e).then((function(e){_.value=e.data.results}))},x=function(){var e={offset:0,limit:999,ordering:"-id",fields:"id,name",del_flag:0,company:s.getters.company};HTTP.get("customerPools",e).then((function(e){0==e.code?t.value=e.data.results:t.value=[]}))},S=function(){delete m.clue_templates_id,L.value=[]},L=n(),T=function(){var e={offset:0,limit:999,ordering:"-id",fields:"id,name",del_flag:0,company:s.getters.company,customer_pool:m.customer_pool_id};HTTP.get("clue_customer_templates",e).then((function(e){0==e.code?L.value=e.data.results:L.value=[]}))};function O(e){for(var t=[],n=o(e);n.length;){var a=n.pop();t.push(r(r({},a),{},{children:void 0})),a.children&&a.children.length&&n.push.apply(n,o(a.children.reverse()))}return t.reverse()}var j=n(),k=function(){var e={offset:0,limit:999,ordering:"-id",del_flag:0,company:s.getters.company};HTTP.get("member_team",e).then((function(e){0==e.code?j.value=O(e.data.results):j.value=[]}))},D=function(){HTTP.get("get_uniq_source",{}).then((function(e){0==e.code?u.value=e.data:u.value=[]}))};function P(){f.value=!0,HTTP.post("get_customer_conversion_by_team",m).then((function(e){p.value=e.data})).then((function(){setTimeout((function(){return f.value=!1}),100)}))}return l(c(i().mark((function e(){var t,r,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new Date,r=new Date(t.getFullYear(),t.getMonth()-1,1),n=new Date(t.getFullYear(),t.getMonth()+1,0),h.value=[g(r),g(n)],D(),k(),x(),e.next=9,y();case 9:v();case 10:case"end":return e.stop()}}),e)})))),{__sfc:!0,customer_pool:t,source_names:u,loading:f,tableData:p,dateSearch:h,filter:m,canUseCustomerTemplates:d,formatDate:g,choseThisMouth:function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),r=new Date(e.getFullYear(),e.getMonth()+1,0);h.value=[g(t),g(r)],v()},choseLastTwoMouth:function(){var e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,1),r=new Date(e.getFullYear(),e.getMonth()+1,0);h.value=[g(t),g(r)],v()},choseLastTDays:function(){var e=new Date,t=new Date;t.setDate(e.getDate()-29),h.value=[g(t),g(e)],v()},choseLastSDays:function(){var e=new Date,t=new Date;t.setDate(e.getDate()-59),h.value=[g(t),g(e)],v()},changeFilter:v,get_customer_tmp:y,tableCulomns:_,member_level:b,getMemberLevel:w,getClueList:x,clearXSC:S,canUseClueTemplates:L,getClueTemplates:T,flattenDataIterative:O,teams:j,getTeam:k,getUniqSource:D,getCustomerConversion:P}}};e("default",u(t,(function(){var e=this,t=e._self._c,r=e._self._setupProxy;return t("div",[t("div",{staticClass:"search-title"},[t("div",{staticStyle:{"margin-bottom":"10px","margin-top":"10px"}},[t("LJTableHeader",{attrs:{dropdown:!1,search:!1}},[t("div",[t("el-select",{attrs:{placeholder:"客户模板",size:"large"},on:{change:function(e){return r.changeFilter("khmb",r.filter.customer_templates_id)}},model:{value:r.filter.customer_templates_id,callback:function(t){e.$set(r.filter,"customer_templates_id",t)},expression:"filter.customer_templates_id"}},e._l(r.canUseCustomerTemplates,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),t("el-select",{staticStyle:{"margin-left":"10px"},attrs:{placeholder:"线索池",size:"large",clearable:""},on:{change:function(e){return r.changeFilter("xsc")},clear:r.clearXSC},model:{value:r.filter.customer_pool_id,callback:function(t){e.$set(r.filter,"customer_pool_id",t)},expression:"filter.customer_pool_id"}},e._l(r.customer_pool,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),r.filter.customer_pool_id?t("el-select",{staticStyle:{"margin-left":"10px"},attrs:{placeholder:"线索模板",size:"large",clearable:""},on:{change:r.changeFilter},model:{value:r.filter.clue_templates_id,callback:function(t){e.$set(r.filter,"clue_templates_id",t)},expression:"filter.clue_templates_id"}},e._l(r.canUseClueTemplates,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1):e._e(),t("el-select",{staticStyle:{"margin-left":"10px"},attrs:{placeholder:"来源",size:"large",clearable:""},on:{change:r.changeFilter},model:{value:r.filter.source,callback:function(t){e.$set(r.filter,"source",t)},expression:"filter.source"}},e._l(r.source_names,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),t("el-select",{staticStyle:{"margin-left":"10px"},attrs:{multiple:"",placeholder:"团队",size:"large",clearable:""},on:{change:r.changeFilter},model:{value:r.filter.team_id__in,callback:function(t){e.$set(r.filter,"team_id__in",t)},expression:"filter.team_id__in"}},e._l(r.teams,(function(e){return t("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),t("el-date-picker",{staticStyle:{"margin-left":"10px","margin-right":"-10px",width:"215px"},attrs:{"value-format":"yyyy-MM-dd",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},on:{change:r.changeFilter},model:{value:r.dateSearch,callback:function(e){r.dateSearch=e},expression:"dateSearch"}}),t("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:r.choseThisMouth}},[e._v("本月")]),t("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:r.choseLastTwoMouth}},[e._v("最近两月")]),t("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:r.choseLastTDays}},[e._v("近30天")]),t("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:r.choseLastSDays}},[e._v("近60天")])],1)])],1)]),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:r.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:r.tableData,"header-cell-style":{background:"#F6FAFF"}}},[t("el-table-column",{attrs:{prop:"team_name",align:"center",label:"姓名",width:"180"}}),t("el-table-column",{attrs:{prop:"clue_customers_count",align:"center",label:"线索数",width:"180"}}),t("el-table-column",{attrs:{prop:"customers_count",align:"center",label:"客户数量"}}),t("el-table-column",{attrs:{prop:"customers_rate",align:"center",label:"客户转化率"}}),e._l(r.tableCulomns,(function(e){return t("el-table-column",{key:e.id,attrs:{align:"center",label:e.name}},[t("el-table-column",{attrs:{prop:"level_"+e.weight+"_customer",align:"center",label:"用户数量"}}),t("el-table-column",{attrs:{prop:"level_"+e.weight+"_rate",align:"center",label:"转化率"}})],1)})),t("el-table-column",{attrs:{prop:"deal_count",align:"center",label:"成交率"}})],2)],1)}),[],!1,null,null,null,null).exports)}}}))}();
|