| 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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},a=Object.prototype,o=a.hasOwnProperty,i=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(r){f=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof _?t:_,o=Object.create(a.prototype),l=new j(n||[]);return i(o,"_invoke",{value:E(e,r,l)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var m="suspendedStart",d="suspendedYield",g="executing",v="completed",y={};function _(){}function b(){}function w(){}var x={};f(x,c,(function(){return this}));var L=Object.getPrototypeOf,S=L&&L(L(O([])));S&&S!==a&&o.call(S,c)&&(x=S);var T=w.prototype=_.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function D(t,r){function n(a,i,l,c){var u=p(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 a;i(this,"_invoke",{value:function(e,t){function o(){return new r((function(r,a){n(e,t,r,a)}))}return a=a?a.then(o,o):o()}})}function E(e,t,n){var a=m;return function(o,i){if(a===g)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:r,done:!0}}for(n.method=o,n.arg=i;;){var l=n.delegate;if(l){var c=F(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(a===m)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=g;var u=p(e,t,n);if("normal"===u.type){if(a=n.done?v:d,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=v,n.method="throw",n.arg=u.arg)}}}function F(e,t){var n=t.method,a=e.iterator[n];if(a===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,F(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=p(a,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,y;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.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 M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function O(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function e(){for(;++a<t.length;)if(o.call(t,a))return e.value=t[a],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return b.prototype=w,i(T,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,s,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,f(e,s,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},k(D.prototype),f(D.prototype,u,(function(){return this})),n.AsyncIterator=D,n.async=function(e,t,r,a,o){void 0===o&&(o=Promise);var i=new D(h(e,t,r,a),o);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(T),f(T,s,"Generator"),f(T,c,(function(){return this})),f(T,"toString",(function(){return"[object Generator]"})),n.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}},n.values=O,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(M),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},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 t=this;function n(n,a){return l.type="throw",l.arg=e,t.next=n,a&&(t.method="next",t.arg=r),!!a}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),M(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 a=n.arg;M(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),y}},n}function r(e,t,r,n,a,o,i){try{var l=e[o](i),c=l.value}catch(u){return void r(u)}l.done?t(c):Promise.resolve(c).then(n,a)}function n(e){return function(){var t=this,n=arguments;return new Promise((function(a,o){var i=e.apply(t,n);function l(e){r(i,a,o,l,c,"next",e)}function c(e){r(i,a,o,l,c,"throw",e)}l(void 0)}))}}System.register(["./vendor-legacy-d7943d95.js","./index-legacy-4c45bcb9.js"],(function(e,r){"use strict";var a,o,i,l,c;return{setters:[function(e){a=e.r,o=e.i,i=e.o},function(e){l=e.n,c=e.$}],execute:function(){var r={__name:"byMemberViews",setup:function(e){var r=a(),l=a(),u=a(),s=a(!1),f=a([]),h=a(),p=o({}),m=a();function d(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 g=function(e,t){h.value&&h.value.length?(p.start_date=h.value[0],p.end_date=h.value[1]):(delete p.start_date,delete p.end_date),p.customer_pool_id||delete p.customer_pool_id,p.source||delete p.source,p.member_id__in||delete p.member_id__in,"khmb"==e&&b(),"xsc"==e&&(p.customer_pool_id?S():x()),D()},v=function(){var e=n(t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={offset:0,limit:9999,ordering:"-id",fileds:"id,name",del_flag:0,is_default:0},e.next=3,HTTP.get("used_customer_templates",r).then((function(e){return m.value=e.data.results,e.data.results})).then((function(e){p.customer_templates_id=e[0].id})).then((function(){b()}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),y=a(),_=a(),b=function(){var e={company:c.getters.company,customer_templates:p.customer_templates_id,ordering:"weight"};HTTP.get("customer_templates_member_level",e).then((function(e){y.value=e.data.results}))},w=function(){var e={offset:0,limit:999,ordering:"-id",fields:"id,name",del_flag:0,company:c.getters.company};HTTP.get("customerPools",e).then((function(e){0==e.code?r.value=e.data.results:r.value=[]}))},x=function(){delete p.clue_templates_id,L.value=[]},L=a(),S=function(){var e={offset:0,limit:999,ordering:"-id",fields:"id,name",del_flag:0,company:c.getters.company,customer_pool:p.customer_pool_id};HTTP.get("clue_customer_templates",e).then((function(e){0==e.code?L.value=e.data.results:L.value=[]}))},T=function(){var e={offset:0,limit:999,ordering:"-id",fields:"id,name",is_auth_role:1,del_flag:0,company:c.getters.company};HTTP.get("get_uniq_members",e).then((function(e){0==e.code?u.value=e.data:u.value=[]}))},k=function(){HTTP.get("get_uniq_source",{}).then((function(e){0==e.code?l.value=e.data:l.value=[]}))};function D(){s.value=!0,HTTP.post("get_customer_conversion",p).then((function(e){f.value=e.data})).then((function(){setTimeout((function(){return s.value=!1}),100)}))}return i(n(t().mark((function e(){var r,n,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Date,n=new Date(r.getFullYear(),r.getMonth()-1,1),a=new Date(r.getFullYear(),r.getMonth()+1,0),h.value=[d(n),d(a)],k(),T(),w(),e.next=9,v();case 9:g();case 10:case"end":return e.stop()}}),e)})))),{__sfc:!0,customer_pool:r,source_names:l,members:u,loading:s,tableData:f,dateSearch:h,filter:p,canUseCustomerTemplates:m,formatDate:d,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=[d(t),d(r)],g()},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=[d(t),d(r)],g()},choseLastTDays:function(){var e=new Date,t=new Date;t.setDate(e.getDate()-29),h.value=[d(t),d(e)],g()},choseLastSDays:function(){var e=new Date,t=new Date;t.setDate(e.getDate()-59),h.value=[d(t),d(e)],g()},changeFilter:g,get_customer_tmp:v,tableCulomns:y,member_level:_,getMemberLevel:b,getClueList:w,clearXSC:x,canUseClueTemplates:L,getClueTemplates:S,getMember:T,getUniqSource:k,getCustomerConversion:D}}};e("default",l(r,(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.member_id__in,callback:function(t){e.$set(r.filter,"member_id__in",t)},expression:"filter.member_id__in"}},e._l(r.members,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),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:"member_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:"to_high_sea_clue_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)}}}))}();
|