Преглед на файлове

gen financail status report

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi преди 1 година
родител
ревизия
2c54e80b9f
променени са 1 файла, в които са добавени 14 реда и са изтрити 6 реда
  1. +14
    -6
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 14
- 6
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx Целия файл

@@ -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 /> */}


Зареждане…
Отказ
Запис