diff --git a/src/views/SalesCustomerCareRegular.jsx b/src/views/SalesCustomerCareRegular.jsx index ed8cd22..ebc44c8 100644 --- a/src/views/SalesCustomerCareRegular.jsx +++ b/src/views/SalesCustomerCareRegular.jsx @@ -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) => { - + + +