|
|
|
@ -17,7 +17,6 @@ const SalesCustomerCareRegular = (props) => {
|
|
|
|
|
const { date_picker_store: searchFormStore, customer_store } = useContext(stores_Context);
|
|
|
|
|
const { formValues, formValuesToSub, siderBroken } = searchFormStore;
|
|
|
|
|
const { sales_regular_data: pageData } = customer_store;
|
|
|
|
|
const [dataForExport, setDataForExport] = useState([]);
|
|
|
|
|
|
|
|
|
|
const allOPI1 = uniqWith(
|
|
|
|
|
pageData.data.map((rr) => ({ text: rr.operatorName, value: rr.operatorName })),
|
|
|
|
@ -27,6 +26,8 @@ const SalesCustomerCareRegular = (props) => {
|
|
|
|
|
const [OPIFilters, setOPIFilters] = useState([]);
|
|
|
|
|
const [dataSource, setDataSource] = useState([]);
|
|
|
|
|
const [ifmerge, setIfmerge] = useState(false);
|
|
|
|
|
const [dataForExport, setDataForExport] = useState([]);
|
|
|
|
|
const [dataForExportS, setDataForExportS] = useState([]);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if ( ! ifmerge) {
|
|
|
|
@ -37,6 +38,7 @@ const SalesCustomerCareRegular = (props) => {
|
|
|
|
|
// setOPIFilters(allOPI1);
|
|
|
|
|
setDataSource(pageData.data);
|
|
|
|
|
setDataForExport(pageData.data.reduce((r, c) => r.concat([{...c, children: undefined}], c.children.map(ele => ({...ele, operatorName: ele.rowLabel}))), []));
|
|
|
|
|
setDataForExportS(pageData.data.reduce((r, c) => r.concat([{...c, children: undefined}]), []));
|
|
|
|
|
} else {
|
|
|
|
|
// const allOPI1 = uniqWith(
|
|
|
|
|
// pageData.mergedData.map((rr) => ({ text: rr.operatorName, value: rr.operatorName })),
|
|
|
|
@ -45,6 +47,7 @@ const SalesCustomerCareRegular = (props) => {
|
|
|
|
|
// setOPIFilters(allOPI1);
|
|
|
|
|
setDataSource(pageData.mergedData);
|
|
|
|
|
setDataForExport(pageData.mergedData.reduce((r, c) => r.concat([{...c, children: undefined}], c.children.map(ele => ({...ele, operatorName: ele.rowLabel}))), []));
|
|
|
|
|
setDataForExportS(pageData.mergedData.reduce((r, c) => r.concat([{...c, children: undefined}]), []));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
@ -126,7 +129,9 @@ const SalesCustomerCareRegular = (props) => {
|
|
|
|
|
<Divider type={'vertical'} />
|
|
|
|
|
<TableExportBtn btnTxt='导出明细' label={`${formValuesToSub.Date1}-销售.老客户-明细`} {...{ columns: rowColumns, dataSource: pageData.rawData }} />
|
|
|
|
|
<Divider type={'vertical'} />
|
|
|
|
|
<TableExportBtn btnTxt='导出下表' label={`${formValuesToSub.Date1}-销售.老客户`} {...{ columns, dataSource: dataForExport }} />
|
|
|
|
|
<TableExportBtn btnTxt='导出下表-展开' label={`${formValuesToSub.Date1}-销售.老客户`} {...{ columns, dataSource: dataForExport }} />
|
|
|
|
|
<Divider type={'vertical'} />
|
|
|
|
|
<TableExportBtn btnTxt='导出下表-总' label={`${formValuesToSub.Date1}-销售.老客户`} {...{ columns, dataSource: dataForExportS }} />
|
|
|
|
|
</Divider>
|
|
|
|
|
<Table
|
|
|
|
|
sticky
|
|
|
|
|