Parcourir la source

gen financail status report

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi il y a 1 an
Parent
révision
2c54e80b9f
1 fichiers modifiés avec 14 ajouts et 6 suppressions
  1. +14
    -6
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 14
- 6
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx Voir le fichier

@@ -40,12 +40,20 @@ const GenFinancialStatusReport: React.FC<Props> = ({ projects, projectCombo }) =
<SearchBox
criteria={searchCriteria}
onSearch={async (query) => {
const projectIndex = projectCombo.findIndex((project) => `${project.code} - ${project.name}` === query.code)
console.log(projectCombo[projectIndex].id)
const response = await fetchProjectsFinancialStatusReport({ projectId: projects[projectIndex].id })
if (response) {
downloadFile(new Uint8Array(response.blobValue), response.filename!!)
}
if (query.code.length > 0 && query.code.toLocaleLowerCase() !== "all") {
const projectIndex = projectCombo.findIndex((project) => `${project.code} - ${project.name}` === query.code)
console.log(projectCombo[projectIndex].id)
const response = await fetchProjectsFinancialStatusReport({ projectId: projects[projectIndex].id })
if (response) {
downloadFile(new Uint8Array(response.blobValue), response.filename!!)
}
}else{
console.log(query.code)
const response = await fetchProjectsFinancialStatusReport({ projectId: -1 })
if (response) {
downloadFile(new Uint8Array(response.blobValue), response.filename!!)
}
}
}}
/>
{/* <DownloadReportButton /> */}


Chargement…
Annuler
Enregistrer