diff --git a/src/pages/Reports/DailyReport/index.jsx b/src/pages/Reports/DailyReport/index.jsx index 64241af..4c9dca5 100644 --- a/src/pages/Reports/DailyReport/index.jsx +++ b/src/pages/Reports/DailyReport/index.jsx @@ -1,10 +1,9 @@ import moment from 'moment' -import { Button } from 'antd' -import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react' +import { Button, DatePicker } from 'antd' import { FileExcelOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons' +import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react' import LoaderPortal from '@components/LoaderPortal' -import DateRangeWrapper from '@components/Table/DateRangeWrapper' import { Table, makeDateColumn, makeColumn } from '@components/Table' import { download, invokeWebApiWrapperAsync } from '@components/factory' import { DailyReportService } from '@api' @@ -16,7 +15,7 @@ import { IdWellContext } from '@pages/Well' export const DailyReport = memo(() => { const [data, setData] = useState([]) const [isLoading, setIsLoading] = useState(false) - const [searchDate, setSearchDate] = useState(null) + const [searchDate, setSearchDate] = useState([moment().subtract(1, 'week'), moment()]) const [selectedReport, setSelectedReport] = useState(null) const [isEditorVisible, setIsEditorVisible] = useState(false) @@ -42,9 +41,8 @@ export const DailyReport = memo(() => { type={'link'} icon={} onClick={async () => await download(`/api/well/${idWell}/DailyReport/${report.reportDate}/excel`)} - > - Скачать XLSX - + children={'Скачать XLSX'} + /> + children={'Редактировать'} + /> )}), ], [idWell]) const filteredData = useMemo(() => { if (!searchDate) return data - return data.filter((row) => moment(row.date).isBetween(...searchDate)) + return data.filter((row) => moment.utc(row.reportDate).local().isBetween(...searchDate)) }, [data, searchDate]) return ( @@ -71,7 +68,13 @@ export const DailyReport = memo(() => {
Диапозон дат отчёта
- + date.isAfter(moment())} + />