| 1 |
- import{r as i,i as P,o as H}from"./vendor-ef68d560.js";import{n as Y,$ as d}from"./index-87faf287.js";const z={__name:"byMemberViews",setup(S){const s=i(),a=i(),l=i(),e=i(!1),g=i([]),c=i(),o=P({}),f=i();function r(t){const n=t.getFullYear(),u=String(t.getMonth()+1).padStart(2,"0"),L=String(t.getDate()).padStart(2,"0");return`${n}-${u}-${L}`}const k=()=>{const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),1),u=new Date(t.getFullYear(),t.getMonth()+1,0);c.value=[r(n),r(u)],m()},F=()=>{const t=new Date,n=new Date(t.getFullYear(),t.getMonth()-1,1),u=new Date(t.getFullYear(),t.getMonth()+1,0);c.value=[r(n),r(u)],m()},M=()=>{const t=new Date,n=new Date;n.setDate(t.getDate()-29),c.value=[r(n),r(t)],m()},C=()=>{const t=new Date,n=new Date;n.setDate(t.getDate()-59),c.value=[r(n),r(t)],m()},m=(t,n)=>{c.value&&c.value.length?(o.start_date=c.value[0],o.end_date=c.value[1]):(delete o.start_date,delete o.end_date),o.customer_pool_id||delete o.customer_pool_id,o.source||delete o.source,o.member_id__in||delete o.member_id__in,t=="khmb"&&p(),t=="xsc"&&(o.customer_pool_id?w():y()),D()},h=async()=>{const t={offset:0,limit:9999,ordering:"-id",fileds:"id,name",del_flag:0,is_default:0};await HTTP.get("used_customer_templates",t).then(n=>(f.value=n.data.results,n.data.results)).then(n=>{o.customer_templates_id=n[0].id}).then(()=>{p()})},b=i(),$=i(),p=()=>{const t={company:d.getters.company,customer_templates:o.customer_templates_id,ordering:"weight"};HTTP.get("customer_templates_member_level",t).then(n=>{b.value=n.data.results})},v=()=>{const t={offset:0,limit:999,ordering:"-id",fields:"id,name",del_flag:0,company:d.getters.company};HTTP.get("customerPools",t).then(n=>{n.code==0?s.value=n.data.results:s.value=[]})},y=()=>{delete o.clue_templates_id,_.value=[]},_=i(),w=()=>{const t={offset:0,limit:999,ordering:"-id",fields:"id,name",del_flag:0,company:d.getters.company,customer_pool:o.customer_pool_id};HTTP.get("clue_customer_templates",t).then(n=>{n.code==0?_.value=n.data.results:_.value=[]})},x=()=>{const t={offset:0,limit:999,ordering:"-id",fields:"id,name",is_auth_role:1,del_flag:0,company:d.getters.company};HTTP.get("get_uniq_members",t).then(n=>{n.code==0?l.value=n.data:l.value=[]})},T=()=>{HTTP.get("get_uniq_source",{}).then(t=>{t.code==0?a.value=t.data:a.value=[]})};function D(){e.value=!0,HTTP.post("get_customer_conversion",o).then(t=>{g.value=t.data}).then(()=>{setTimeout(()=>e.value=!1,100)})}return H(async()=>{const t=new Date,n=new Date(t.getFullYear(),t.getMonth()-1,1),u=new Date(t.getFullYear(),t.getMonth()+1,0);c.value=[r(n),r(u)],T(),x(),v(),await h(),m()}),{__sfc:!0,customer_pool:s,source_names:a,members:l,loading:e,tableData:g,dateSearch:c,filter:o,canUseCustomerTemplates:f,formatDate:r,choseThisMouth:k,choseLastTwoMouth:F,choseLastTDays:M,choseLastSDays:C,changeFilter:m,get_customer_tmp:h,tableCulomns:b,member_level:$,getMemberLevel:p,getClueList:v,clearXSC:y,canUseClueTemplates:_,getClueTemplates:w,getMember:x,getUniqSource:T,getCustomerConversion:D}}};var U=function(){var s=this,a=s._self._c,l=s._self._setupProxy;return a("div",[a("div",{staticClass:"search-title"},[a("div",{staticStyle:{"margin-bottom":"10px","margin-top":"10px"}},[a("LJTableHeader",{attrs:{dropdown:!1,search:!1}},[a("div",[a("el-select",{attrs:{placeholder:"\u5BA2\u6237\u6A21\u677F",size:"large"},on:{change:function(e){return l.changeFilter("khmb",l.filter.customer_templates_id)}},model:{value:l.filter.customer_templates_id,callback:function(e){s.$set(l.filter,"customer_templates_id",e)},expression:"filter.customer_templates_id"}},s._l(l.canUseCustomerTemplates,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1),a("el-select",{staticStyle:{"margin-left":"10px"},attrs:{placeholder:"\u7EBF\u7D22\u6C60",size:"large",clearable:""},on:{change:function(e){return l.changeFilter("xsc")},clear:l.clearXSC},model:{value:l.filter.customer_pool_id,callback:function(e){s.$set(l.filter,"customer_pool_id",e)},expression:"filter.customer_pool_id"}},s._l(l.customer_pool,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1),l.filter.customer_pool_id?a("el-select",{staticStyle:{"margin-left":"10px"},attrs:{placeholder:"\u7EBF\u7D22\u6A21\u677F",size:"large",clearable:""},on:{change:l.changeFilter},model:{value:l.filter.clue_templates_id,callback:function(e){s.$set(l.filter,"clue_templates_id",e)},expression:"filter.clue_templates_id"}},s._l(l.canUseClueTemplates,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1):s._e(),a("el-select",{staticStyle:{"margin-left":"10px"},attrs:{placeholder:"\u6765\u6E90",size:"large",clearable:""},on:{change:l.changeFilter},model:{value:l.filter.source,callback:function(e){s.$set(l.filter,"source",e)},expression:"filter.source"}},s._l(l.source_names,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1),a("el-select",{staticStyle:{"margin-left":"10px"},attrs:{multiple:"",placeholder:"\u4EBA\u5458",size:"large",clearable:""},on:{change:l.changeFilter},model:{value:l.filter.member_id__in,callback:function(e){s.$set(l.filter,"member_id__in",e)},expression:"filter.member_id__in"}},s._l(l.members,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}),1),a("el-date-picker",{staticStyle:{"margin-left":"10px","margin-right":"-10px",width:"215px"},attrs:{"value-format":"yyyy-MM-dd",type:"daterange","range-separator":"-","start-placeholder":"\u5F00\u59CB\u65E5\u671F","end-placeholder":"\u7ED3\u675F\u65E5\u671F"},on:{change:l.changeFilter},model:{value:l.dateSearch,callback:function(e){l.dateSearch=e},expression:"dateSearch"}}),a("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:l.choseThisMouth}},[s._v("\u672C\u6708")]),a("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:l.choseLastTwoMouth}},[s._v("\u6700\u8FD1\u4E24\u6708")]),a("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:l.choseLastTDays}},[s._v("\u8FD130\u5929")]),a("el-button",{staticStyle:{"margin-left":"10px","margin-right":"-10px"},on:{click:l.choseLastSDays}},[s._v("\u8FD160\u5929")])],1)])],1)]),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:l.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:l.tableData,"header-cell-style":{background:"#F6FAFF"}}},[a("el-table-column",{attrs:{prop:"member_name",align:"center",label:"\u59D3\u540D",width:"180"}}),a("el-table-column",{attrs:{prop:"clue_customers_count",align:"center",label:"\u7EBF\u7D22\u6570",width:"180"}}),a("el-table-column",{attrs:{prop:"to_high_sea_clue_count",align:"center",label:"\u56DE\u6536\u7EBF\u7D22\u6570",width:"180"}}),a("el-table-column",{attrs:{prop:"customers_count",align:"center",label:"\u5BA2\u6237\u6570\u91CF"}}),a("el-table-column",{attrs:{prop:"customers_rate",align:"center",label:"\u5BA2\u6237\u8F6C\u5316\u7387"}}),s._l(l.tableCulomns,function(e){return a("el-table-column",{key:e.id,attrs:{align:"center",label:e.name}},[a("el-table-column",{attrs:{prop:"level_"+e.weight+"_customer",align:"center",label:"\u7528\u6237\u6570\u91CF"}}),a("el-table-column",{attrs:{prop:"level_"+e.weight+"_rate",align:"center",label:"\u8F6C\u5316\u7387"}})],1)}),a("el-table-column",{attrs:{prop:"deal_count",align:"center",label:"\u6210\u4EA4\u7387"}})],2)],1)},q=[],V=Y(z,U,q,!1,null,null,null,null);const J=V.exports;export{J as default};
|