Browse Source

(*)销售人员分布明细 加载优化

master
wuqun 2 years ago
parent
commit
ea664a13bf
  1. 2
      api/app/lib/controllers/report/index.js
  2. 5
      web/client/src/sections/business/containers/salesReport/salesDistributionDetails.jsx

2
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()

5
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) => {
<div style={{ marginTop: 20 }}>
<Skeleton
loading={false}
loading={loading}
active={true}
placeholder={SkeletonScreen()}
>

Loading…
Cancel
Save