浏览代码

update P&L

tags/Baseline_180220205_Frontend
cyril.tsui 8 个月前
父节点
当前提交
e799f35186
共有 1 个文件被更改,包括 15 次插入14 次删除
  1. +15
    -14
      src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx

+ 15
- 14
src/components/GenerateProjectPandLReport/GenerateProjectPandLReport.tsx 查看文件

@@ -19,7 +19,7 @@ interface Props {
} }


interface SubComponents { interface SubComponents {
Loading: typeof GenerateProjectPandLReportLoading;
// Loading: typeof GenerateProjectPandLReportLoading;
} }




@@ -43,16 +43,16 @@ const GenerateProjectPandLReport: React.FC<Props> & SubComponents = ({ projects
[t], [t],
); );


const [loading, setLoading] = React.useState(false);
// const [loading, setLoading] = React.useState(false);


return ( return (
<> <>
{loading && <GenerateProjectPandLReport.Loading />}
{!loading &&
{/* {loading && <GenerateProjectPandLReport.Loading />} */}
{/* {!loading && */}
<SearchBox <SearchBox
criteria={searchCriteria} criteria={searchCriteria}
onSearch={async (query) => { onSearch={async (query) => {
setLoading(true);
// setLoading(true);
if (query.project && query.project !== "All") { if (query.project && query.project !== "All") {
if (query.project && query.startMonth && query.startMonthTo) { if (query.project && query.startMonth && query.startMonthTo) {
try { try {
@@ -66,25 +66,26 @@ const GenerateProjectPandLReport: React.FC<Props> & SubComponents = ({ projects
} }
} catch (error) { } catch (error) {
errorDialogWithContent(t("Download Fail"), t("Please try it later"), t) errorDialogWithContent(t("Download Fail"), t("Please try it later"), t)
.then(() => {
window.location.reload();
});
// .then(() => {
// window.location.reload();
// });
} }
} else { } else {
errorDialogWithContent(t("Download Fail"), t("Please check the required field"), t) errorDialogWithContent(t("Download Fail"), t("Please check the required field"), t)
.then(() => {
window.location.reload();
});
// .then(() => {
// window.location.reload();
// });
} }
} }
setLoading(false);
// setLoading(false);
}} }}
formType={"download"} formType={"download"}
/>}
/>
{/* } */}
</> </>
); );
}; };


GenerateProjectPandLReport.Loading = GenerateProjectPandLReportLoading;
// GenerateProjectPandLReport.Loading = GenerateProjectPandLReportLoading;


export default GenerateProjectPandLReport; export default GenerateProjectPandLReport;

正在加载...
取消
保存