Parcourir la source

update

tags/Baseline_30082024_FRONTEND_UAT
MSI\2Fi il y a 1 an
Parent
révision
a4c3057c4b
1 fichiers modifiés avec 20 ajouts et 18 suppressions
  1. +20
    -18
      src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx

+ 20
- 18
src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx Voir le fichier

@@ -53,27 +53,29 @@ const GenerateProjectPandLReport: React.FC<Props> & SubComponents = ({ projects
criteria={searchCriteria}
onSearch={async (query) => {
setLoading(true);
if (Boolean(query.project) && query.project !== "All") {
if(query.project != null && query.startMonth != "" && query.startMonthTo != undefined){
const response = await fetchProjectPandLReport({ projectId: parseFloat(query.project), startMonth: query.startMonth, endMonth: query.startMonthTo })
try{
if (query.project && query.project !== "All") {
if (query.project && query.startMonth && query.startMonthTo) {
try {
const response = await fetchProjectPandLReport({
projectId: parseFloat(query.project),
startMonth: query.startMonth,
endMonth: query.startMonthTo
});
if (response) {
downloadFile(new Uint8Array(response.blobValue), response.filename!!)
downloadFile(new Uint8Array(response.blobValue), response.filename);
}
}catch(error){
errorDialogWithContent(t("Download Fail"),
t(`Please try it later`), t)
.then(() => {
window.location.reload()
})
} catch (error) {
errorDialogWithContent(t("Download Fail"), t("Please try it later"), t)
.then(() => {
window.location.reload();
});
}
}else{
errorDialogWithContent(t("Download Fail"),
t(`Please check the required field`), t)
.then(() => {
window.location.reload()
})
}
} else {
errorDialogWithContent(t("Download Fail"), t("Please check the required field"), t)
.then(() => {
window.location.reload();
});
}
}
setLoading(false);
}}


Chargement…
Annuler
Enregistrer