// material-ui import { Grid, Typography, Stack } from '@mui/material'; // import MainCard from "components/MainCard"; import * as UrlUtils from "utils/ApiPathConst"; import * as React from "react"; import * as HttpUtils from "utils/HttpUtils"; // import * as DateUtils from "utils/DateUtils"; // import axios from "axios"; import Loadable from 'components/Loadable'; const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); const SearchForm = Loadable(React.lazy(() => import('./SearchForm'))); // const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', height: '100%', backgroundSize:'contain', backgroundRepeat: 'no-repeat', backgroundColor: '#0C489E', backgroundPosition: 'right' } // ==============================|| DASHBOARD - DEFAULT ||============================== // const Index = () => { // const [record,setRecord] = React.useState([]); const [searchCriteria, setSearchCriteria] = React.useState({ // dateTo: DateUtils.dateValue(new Date()), // dateFrom: DateUtils.dateValue(new Date().setDate(new Date().getDate()-14)), }); const [onReady] = React.useState(true); // const [onDownload, setOnDownload] = React.useState(false); const [onLoad, setonLoad] = React.useState(false); // React.useEffect(() => { // setOnReady(true); // }, [record]); React.useEffect(() => { if (Object.keys(searchCriteria).length > 0){ // console.log(searchCriteria) loadGrid(); } }, [searchCriteria]); function loadGrid(){ setonLoad(true) HttpUtils.get({ url: UrlUtils.VIEW_RECON_REPORT, params: searchCriteria, onSuccess: function(responseData){ // console.log(responseData) if(responseData.status != 200){ alert(responseData.content) setonLoad(false) } else { var myWindow = window.open(); myWindow.document.write(responseData.content); setonLoad(false) } }, onError:()=>{ setonLoad(false) } }); } function downloadXML(input) { // console.log(input) const hasCollRange = input.CollDateFrom!="" && input.CollDateTo!=""; const hasTxnRange = input.TxnDateFrom!="" && input.TxnDateTo!=""; const hasSysTxnRange = input.SysTxnDateFrom!="" && input.SysTxnDateTo!=""; let countRanges= 0; if(hasCollRange) countRanges+=1; if(hasTxnRange) countRanges+=1; if(hasSysTxnRange) countRanges+=1; if(countRanges>1){ alert("Only one date range is allowed Trans/Coll dates") // return "