2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
import{_ as a}from"./index.DEDWMUkM.js";import{v as e,w as t}from"./account.Cdlpw0hs.js";import{b4 as n,ag as l,b6 as o,c as s,e as c,N as d,w as r,g as i,cB as p}from"./index.DLrOu3jP.js";import"./el-col.DGF9ic0j.js";const h={class:"home-container"},u=n({__name:"index",setup(n){let u=[];function m(){const a=new Date,e=new Date(a);e.setDate(a.getDate()-1);const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getDate()).padStart(2,"0");return[`${t}-${n}-${l}`,`${t}-${n}-${l}`]}const _=l({loading:!1,columns:[{label:"日期",prop:"date",align:"center"},{label:"服务商",prop:"service_name",align:"center"},{label:"合计",prop:"total_actual_amount",align:"center",needCount:!0}],columns2:[{label:"通道",prop:"channel_name",align:"center"},{label:"合计",prop:"channel_total",needCount:!0}],searchFields:[{prop:"completed_at",label:"完成时间",type:"date",dateType:"daterange",value:m(),format:"YYYY-MM-DD"},{label:"通道聚合",prop:"channel_id",type:"select",value:"",options:u}],tableData:[]});const g=()=>{_.searchFields.forEach(a=>{"daterange"==a.dateType?a.value=m():a.value=""}),w()},w=()=>{var a;_.loading=!0;let t=function(a){const e={};return a.forEach(a=>{a.prop&&void 0!==a.value&&(e[a.prop]=a.value)}),e}(_.searchFields);(null==(a=t.completed_at)?void 0:a.length)>0&&(t.startDate=t.completed_at[0]?p(t.completed_at[0]):"",t.endDate=t.completed_at[1]?p(t.completed_at[1]):""),delete t.completed_at,e(t).then(a=>{let e=Array.isArray(a.data)?a.data:[];e.forEach(a=>{a.children=[],a.channel_1_actual_amount&&a.children.push({channel_name:"淘宝复制",channel_total:a.channel_1_actual_amount}),a.channel_2_actual_amount&&a.children.push({channel_name:"淘宝直付",channel_total:a.channel_2_actual_amount})}),_.tableData=e,_.loading=!1}).catch(()=>{_.loading=!1})};return o(()=>{w(),t().then(a=>{let e=a.map(a=>({id:a.id,label:a.name,value:a.id}));_.searchFields[1].options=u=e})}),(e,t)=>{const n=a;return c(),s("div",h,[d(n,{type:"export",columns:i(_).columns,searchFields:i(_).searchFields,"onUpdate:searchFields":t[0]||(t[0]=a=>i(_).searchFields=a),data:i(_).tableData,onGetTableData:w,onResetForm:g,loading:i(_).loading,showSelection:!1,paginationSlot:!1,showRightRefreshSlot:!1,showSummary:!0,showExpand:!0,"expand-name":"customExpand",showBtns:!1},{customExpand:r(a=>[d(n,{type:"export",columns:i(_).columns2,data:a.row.children,loading:i(_).loading,showSelection:!1,paginationSlot:!1,showRightRefreshSlot:!1,showSummary:!0,showBtns:!1,style:{width:"80%",margin:"0 auto",padding:"0"}},null,8,["columns","data","loading"])]),_:1},8,["columns","searchFields","data","loading"])])}}},[["__scopeId","data-v-ea737ced"]]);export{u as default};
|