diff --git a/api/app/lib/controllers/report/index.js b/api/app/lib/controllers/report/index.js index ac36f7c..460b1cf 100644 --- a/api/app/lib/controllers/report/index.js +++ b/api/app/lib/controllers/report/index.js @@ -58,7 +58,7 @@ async function getSalersReport(ctx) { const salersRes = await clickHouse.hr.query(` SELECT * from sales_distribution as sales ${innerSelectQuery} - order by id asc + order by id desc ${!toExport && limit ? `LIMIT ${limit}` : ''} ${!toExport && limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''} `).toPromise() diff --git a/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx b/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx index 101c3f5..853adf1 100644 --- a/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx +++ b/web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx @@ -14,6 +14,7 @@ const SalesDistributionDetails = (props) => { const [limits, setLimits] = useState()//每页实际条数 const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 const [tableData, setTableData] = useState([]); + const [loading, setLoading] = useState(false) const [exportUrl, setExportUrl] = useState('') const page = useRef(query.page); function seachValueChange(value) { @@ -29,11 +30,13 @@ const SalesDistributionDetails = (props) => { }, [query]) function getMemberSearchList() { + setLoading(true); let kt = keywordTarget == 'place' ? '' : keywordTarget; let k = keywordTarget == 'place' ? '' : keyword; let placeSearch = keywordTarget == 'place' ? keyword : ''; dispatch(businessManagement.getSalesList({ keywordTarget: kt, keyword: k, placeSearch, ...query })).then(r => { if (r.success) { + setLoading(false); setTableData(r.payload?.data?.rows); setLimits(r.payload?.data?.count) } @@ -233,7 +236,7 @@ const SalesDistributionDetails = (props) => {