Pārlūkot izejas kodu

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

tags/Baseline_30082024_FRONTEND_UAT
MSI\derek pirms 1 gada
vecāks
revīzija
fe6a611df7
1 mainītis faili ar 14 papildinājumiem un 6 dzēšanām
  1. +14
    -6
      src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx

+ 14
- 6
src/components/Report/FinancialStatusReportGen/FinancialStatusReportGen.tsx Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt