import{_ as a,r as e,by as t,bu as l,f as s,o,c as n,d as i,a as m,b as r,W as u,S as d,t as c,a0 as v,v as p,aU as g,aY as f,ag as b,aZ as y}from"./index-BhrLSE9x.js";import{E as C}from"./el-pagination-D-QLvIpf.js";import{a as h,E as j}from"./el-table-column-BSUoH3qj.js";import"./el-tooltip-l0sNRNKZ.js";import{a as _,E as N}from"./el-form-DT7MBZet.js";import"./el-form-item-l0sNRNKZ.js";import{f as T,h as D}from"./agencyCenter-C3B7tV0O.js";/* empty css              */import"./raf-ClpXBvnZ.js";const Y={class:"my-commission-page"},S={class:"level-block"},x={class:"filter-area"},z={class:"items"},k={class:"item has-btn"},A={class:"btn"},M={class:"table-content"},P={class:"info"},w={class:"num"},B={class:"num"},E={class:"num"},U={class:"pagination-box"},V=a({__name:"MyCommission",setup(a){const V=e({date:[t,l]}),I=e({startTime:t,endTime:l}),O=e(!1),W=e([]),Z=e({pageNo:1,pageSize:10,totalPage:0,totalCount:0}),q=()=>{const a={...Z.value,startSummaryDay:I.value.startTime,endSummaryDay:I.value.endTime};O.value=!0,T(a).then((a=>{if(1===a.code){const{records:e,totalPage:t,totalCount:l}=a.data;W.value=e,Z.value.totalPage=t,Z.value.totalCount=l}})).finally((()=>{O.value=!1})),L()},F=()=>{Z.value.pageNo=1,q()},G=()=>{Z.value.pageNo=1,V.value.date=[t,l],I.value={startTime:t,endTime:l},q()},H=a=>{Z.value.pageNo=a,q()},J=a=>{Z.value.pageSize=a,Z.value.pageNo=1,q()},K=e({teamNum:"0",directNum:"0",agentNum:"0",betAmount:"0",directBetAmount:"0",agentBetAmount:"0",totalCommission:"0",directCommission:"0",agentCommission:"0"}),L=()=>{const a={startSummaryDay:I.value.startTime,endSummaryDay:I.value.endTime};D(a).then((a=>{K.value=a.data;for(const e in K.value)if(Object.prototype.hasOwnProperty.call(K.value,e)){const a=K.value[e];K.value[e]=a||0}}))},Q=a=>{if(Array.isArray(a)&&2===a.length){const e=g(a[0]).format("YYYY-MM-DD 00:00:00"),t=g(a[1]).format("YYYY-MM-DD 23:59:59");V.value.date=[e,t],I.value.startTime=e,I.value.endTime=t}};return s((()=>{q()})),(a,e)=>{const t=f,l=_,s=b,g=N,T=h,D=j,I=C,q=y;return o(),n("div",Y,[i("div",S,[i("div",x,[m(g,{model:V.value},{default:r((()=>[i("div",z,[i("div",k,[m(l,{label:"日期:"},{default:r((()=>[m(t,{modelValue:V.value.date,"onUpdate:modelValue":e[0]||(e[0]=a=>V.value.date=a),type:"daterange","range-separator":"~","start-placeholder":"开始日期","end-placeholder":"结束日期",size:"large",onChange:Q,teleported:!1},null,8,["modelValue"])])),_:1}),i("div",A,[m(s,{loading:O.value,onClick:F},{default:r((()=>e[2]||(e[2]=[u("查询")]))),_:1},8,["loading"]),m(s,{class:"reset",onClick:G},{default:r((()=>e[3]||(e[3]=[u("重置")]))),_:1})])])])])),_:1},8,["model"])])]),i("div",M,[i("div",P,[m(d,{class:"tip-icon",name:"affiliate-tipIcon"}),i("div",w,"总佣金 "+c(K.value.totalCommission),1),i("div",B,"直属佣金 "+c(K.value.directCommission),1),i("div",E,"其他佣金 "+c(K.value.agentCommission),1)]),v((o(),p(D,{"header-cell-class-name":"my-header-cell-class-name",stripe:"",data:W.value,style:{width:"100%","min-height":"550px"}},{default:r((()=>[m(T,{label:"结算日期",align:"center","class-name":"table-items table-items-1"},{default:r((a=>[i("p",null,c(a.row.summaryDay),1)])),_:1}),m(T,{prop:"directCommission",label:"直属佣金",align:"center","class-name":"table-items table-items-2"}),m(T,{prop:"commission",label:"总佣金",align:"center","class-name":"table-items table-items-3"}),m(T,{prop:"agentCommission",label:"其他佣金",align:"center","class-name":"table-items table-items-3"})])),_:1},8,["data"])),[[q,O.value]]),i("div",U,[m(I,{"current-page":Z.value.pageNo,"onUpdate:currentPage":e[1]||(e[1]=a=>Z.value.pageNo=a),background:"",layout:"prev, pager, next",total:+Z.value.totalCount,"page-size":10,onSizeChange:J,onCurrentChange:H,style:{"z-index":"99"}},null,8,["current-page","total"])])])])}}},[["__scopeId","data-v-4edb528d"]]);export{V as default};
