Procházet zdrojové kódy

Merge branch 'main' of https://git.2fi-solutions.com/wayne.lee/tsms

tags/Baseline_30082024_FRONTEND_UAT
MSI\derek před 1 rokem
rodič
revize
fe6a611df7
1 změnil soubory, kde provedl 14 přidání a 6 odebrání
  1. +14
    -6
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 14
- 6
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx Zobrazit soubor

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


Načítá se…
Zrušit
Uložit