|
@@ -7,6 +7,7 @@ import { useTranslation } from "react-i18next"; |
|
|
import { TeamResult } from "@/app/api/team"; |
|
|
import { TeamResult } from "@/app/api/team"; |
|
|
import { fetchProjectManhourSummaryReport } from "@/app/api/reports/actions"; |
|
|
import { fetchProjectManhourSummaryReport } from "@/app/api/reports/actions"; |
|
|
import { downloadFile } from "@/app/utils/commonUtil"; |
|
|
import { downloadFile } from "@/app/utils/commonUtil"; |
|
|
|
|
|
import dayjs from "dayjs"; |
|
|
|
|
|
|
|
|
interface Props { |
|
|
interface Props { |
|
|
teams: TeamResult[] |
|
|
teams: TeamResult[] |
|
@@ -48,17 +49,16 @@ const ProjectManhourSummaryReport: React.FC<Props> = ({ teams }) => { |
|
|
criteria={searchCriteria} |
|
|
criteria={searchCriteria} |
|
|
onSearch={async (query: any) => { |
|
|
onSearch={async (query: any) => { |
|
|
console.log(query); |
|
|
console.log(query); |
|
|
var start = query.startDate |
|
|
|
|
|
var start = query.startDate |
|
|
|
|
|
|
|
|
var startDate = dayjs(query.startDate).format("YYYY-MM-DD") |
|
|
|
|
|
var endDate = dayjs(query.endDate).add(1, "month").format("YYYY-MM-DD") |
|
|
const args = { |
|
|
const args = { |
|
|
teamId: query.teamId, |
|
|
teamId: query.teamId, |
|
|
startDate: query.startDate + "-01", |
|
|
|
|
|
endDate: query.endDate + "-01", |
|
|
|
|
|
|
|
|
startDate: startDate, |
|
|
|
|
|
endDate: endDate, |
|
|
} |
|
|
} |
|
|
console.log(args) |
|
|
console.log(args) |
|
|
const response = await fetchProjectManhourSummaryReport(args);// |
|
|
const response = await fetchProjectManhourSummaryReport(args);// |
|
|
if (response) { |
|
|
if (response) { |
|
|
console.log("asdasdas") |
|
|
|
|
|
downloadFile( |
|
|
downloadFile( |
|
|
new Uint8Array(response.blobValue), |
|
|
new Uint8Array(response.blobValue), |
|
|
response.filename!! |
|
|
response.filename!! |
|
|