Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

849 Zeilen
51 KiB

  1. // material-ui
  2. import {
  3. FormControl,
  4. Button,
  5. Grid,
  6. // InputAdornment,
  7. Typography, FormLabel,
  8. OutlinedInput,
  9. Stack,
  10. Dialog, DialogTitle, DialogContent, DialogActions
  11. } from '@mui/material';
  12. // import MainCard from "../../components/MainCard";
  13. const MainCard = Loadable(lazy(() => import('components/MainCard')));
  14. import { useForm } from "react-hook-form";
  15. import { useNavigate } from "react-router-dom";
  16. import {
  17. useEffect,
  18. useState,
  19. lazy
  20. } from "react";
  21. // import Checkbox from "@mui/material/Checkbox";
  22. import Loadable from 'components/Loadable';
  23. const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
  24. // import {useParams} from "react-router-dom";
  25. import * as HttpUtils from "utils/HttpUtils"
  26. import * as UrlUtils from "utils/ApiPathConst"
  27. import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
  28. import * as DateUtils from "utils/DateUtils";
  29. import * as FormatUtils from "utils/FormatUtils";
  30. import {
  31. isORGLoggedIn,
  32. // isDummyLoggedIn
  33. } from "utils/Utils";
  34. import * as utils from "auth/utils"
  35. // import BorderColorOutlinedIcon from '@mui/icons-material/BorderColorOutlined';
  36. // import DoneIcon from '@mui/icons-material/Done';
  37. import CloseIcon from '@mui/icons-material/Close';
  38. import EditNoteIcon from '@mui/icons-material/EditNote';
  39. import DownloadIcon from '@mui/icons-material/Download';
  40. import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst";
  41. import { ThemeProvider } from "@emotion/react";
  42. import { FormattedMessage, useIntl } from "react-intl";
  43. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  44. const ApplicationDetailCard = (
  45. { applicationDetailData,
  46. setStatus,
  47. fee
  48. }
  49. ) => {
  50. const [isPopUp, setIsPopUp] = useState(false);
  51. const [errorText, setErrorText] = useState("");
  52. const [errorPopUp, setErrorPopUp] = useState(false);
  53. const [paymentHoldedErrText, setPaymentHoldedErrText] = useState("");
  54. const [paymentHoldedErr, setPaymentHoldedErr] = useState(false);
  55. // const params = useParams();
  56. const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({});
  57. const [companyName, setCompanyName] = useState({});
  58. const [fileDetail, setfileDetail] = useState({});
  59. const [onReady, setOnReady] = useState(false);
  60. const [issueNum, setIssueNum] = useState("");
  61. const [issueDate, setIssueDate] = useState("");
  62. const [onDownload, setOnDownload] = useState(false);
  63. const [mode, setMode] = useState("");
  64. const { register,
  65. // getValues
  66. } = useForm();
  67. const navigate = useNavigate();
  68. const intl = useIntl();
  69. useEffect(() => {
  70. //if user data from parent are not null
  71. // console.log(applicationDetailData)
  72. if (Object.keys(applicationDetailData)?.length > 0 && applicationDetailData.data !== null) {
  73. setCurrentApplicationDetailData(applicationDetailData.data);
  74. setCompanyName(applicationDetailData.companyName);
  75. setfileDetail(applicationDetailData.fileDetail);
  76. setIssueNum(applicationDetailData.gazetteIssueDetail.volume + "/" + applicationDetailData.gazetteIssueDetail.issueYear
  77. + " No. " + applicationDetailData.gazetteIssueDetail.issueNo);
  78. setIssueDate(DateUtils.dateFormat(applicationDetailData.gazetteIssueDetail.issueDate, "D MMM YYYY (ddd)"));
  79. if (applicationDetailData.data.mode != null){
  80. setMode(applicationDetailData.data.mode);
  81. }
  82. }
  83. }, [applicationDetailData]);
  84. useEffect(() => {
  85. //if state data are ready and assign to different field
  86. // console.log(currentApplicationDetailData)
  87. if (Object.keys(currentApplicationDetailData)?.length > 0) {
  88. setOnReady(true);
  89. }
  90. }, [currentApplicationDetailData]);
  91. const onDownloadClick = () => () => {
  92. setOnDownload(true)
  93. HttpUtils.fileDownload({
  94. fileId: fileDetail?.id,
  95. skey: fileDetail?.skey,
  96. filename: fileDetail?.filename,
  97. onResponse:()=>{
  98. setOnDownload(false)
  99. },
  100. onError:()=>{
  101. setOnDownload(false)
  102. }
  103. });
  104. };
  105. const cancelledClick = () => () => {
  106. setStatus("cancel")
  107. };
  108. const checkExprityDate = () => {
  109. HttpUtils.post({
  110. url: UrlUtils.POST_CHECK_APP_EXPRITY_DATE,
  111. params: {
  112. ids: [currentApplicationDetailData.id]
  113. },
  114. onSuccess: (responData) => {
  115. if (responData.success == true) {
  116. let appIdList = [currentApplicationDetailData.id]
  117. handlePaymentCheck(appIdList)
  118. return;
  119. }
  120. setErrorText(intl.formatMessage({ id: "MSG.App" }));
  121. setErrorPopUp(true);
  122. }
  123. });
  124. };
  125. function doPayment() {
  126. setIsPopUp(false);
  127. let appIdList = [currentApplicationDetailData.id]
  128. navigate('/paymentPage', { state: { amount: fee, appIdList: appIdList } });
  129. }
  130. const handlePaymentCheck = (appIdList) => {
  131. HttpUtils.post({
  132. url: UrlUtils.PAYMENT_CHECK,
  133. params: {
  134. appIds: appIdList
  135. },
  136. onSuccess: (responseData) => {
  137. const latestData = {};
  138. responseData.forEach(item => {
  139. const { appId, timeDiff } = item;
  140. if (latestData[appId] === undefined || timeDiff < latestData[appId].timeDiff) {
  141. latestData[appId] = item;
  142. }
  143. });
  144. const latestDataObjects = Object.values(latestData);
  145. // const filteredData = latestDataObjects.filter(item => item.timeDiff > 20 || item.status !== "APPR");
  146. const filteredData = latestDataObjects.filter(item => item.timeDiff > 30 || item.status == "CANC" || item.status == "REJT");
  147. const filteredAppIds = filteredData.map(item => item.appId);
  148. const appIdsNotInData = appIdList.filter(appId => !latestDataObjects.some(item => item.appId === appId));
  149. const combinedAppIdsArray = [...appIdsNotInData, ...filteredAppIds];
  150. const readyToPayment = appIdList.every(appId => combinedAppIdsArray.includes(appId));
  151. if (readyToPayment) {
  152. setIsPopUp(true);
  153. return;
  154. } else {
  155. const appIdsInData = appIdList.filter(appId => !combinedAppIdsArray.some(item => item === appId));
  156. const HoldingApplication = latestDataObjects.filter(item => appIdsInData.includes(item.appId));
  157. const resultString = HoldingApplication.map(item => item.appNo).join(' , ');
  158. setPaymentHoldedErrText(resultString);
  159. // setPaymentHoldedErrText(intl.formatMessage({ id: 'MSG.paymentHolded' }, { appNo: record.appNo }));
  160. setPaymentHoldedErr(true);
  161. }
  162. }
  163. });
  164. };
  165. return (
  166. !onReady ?
  167. <LoadingComponent />
  168. :
  169. <MainCard elevation={0}
  170. border={false}
  171. content={false}
  172. >
  173. {mode != "offline"?
  174. <div>
  175. <Grid container spacing={1} direction="row">
  176. <Grid item xs={12}>
  177. <Stack
  178. direction="row"
  179. justifyContent="space-between"
  180. alignItems="center"
  181. spacing={2}
  182. mb={2}
  183. >
  184. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  185. {
  186. currentApplicationDetailData.status == "confirmed" ?
  187. <Button
  188. variant="contained"
  189. color="create"
  190. onClick={() => { checkExprityDate(true) }}
  191. disabled={currentApplicationDetailData.status == "rejected"
  192. || currentApplicationDetailData.status == "cancelled"
  193. || currentApplicationDetailData.status == "paid"
  194. || currentApplicationDetailData.creditor
  195. || currentApplicationDetailData.paymentMethod != "online"
  196. }
  197. startIcon={<EditNoteIcon />}
  198. aria-label={intl.formatMessage({ id: 'payFor' })}
  199. >
  200. <FormattedMessage id="payFor" />
  201. </Button>
  202. : null
  203. }
  204. <Button
  205. variant="contained"
  206. onClick={cancelledClick()}
  207. disabled={currentApplicationDetailData.status == "rejected"
  208. || currentApplicationDetailData.status == "cancelled"
  209. || currentApplicationDetailData.status == "withdrawn"
  210. || currentApplicationDetailData.status == "completed"
  211. || currentApplicationDetailData.status == "notAccepted"
  212. || currentApplicationDetailData.status == "resubmit"
  213. || (!currentApplicationDetailData.creditor
  214. && currentApplicationDetailData.status == "paid")
  215. || (currentApplicationDetailData.creditor
  216. && currentApplicationDetailData.status == "confirmed")
  217. || (currentApplicationDetailData.creditor
  218. && currentApplicationDetailData.status == "published")
  219. }
  220. title={intl.formatMessage({ id: 'cancelApp' })}
  221. startIcon={<CloseIcon />}
  222. aria-label={intl.formatMessage({ id: 'cancelApp' })}
  223. sx={{
  224. backgroundColor: '#0C489E',
  225. color: '#FFFFFF',
  226. '&:hover': { backgroundColor: '#093A7A' },
  227. }}
  228. >
  229. <FormattedMessage id="cancelApp" />
  230. </Button>
  231. </ThemeProvider>
  232. </Stack>
  233. </Grid>
  234. </Grid>
  235. </div>
  236. :null
  237. }
  238. <Typography variant="h4" sx={{ mb: 2, borderBottom: "1px solid black" }}>
  239. <FormattedMessage id="publicNoticeDetailTitle" />
  240. </Typography>
  241. <form>
  242. <Grid container direction="column">
  243. <Grid item xs={12} md={12}>
  244. <Grid container direction="row" justifyContent="space-between"
  245. alignItems="center">
  246. <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1 }}>
  247. <Grid container alignItems={"center"}>
  248. <Grid item xs={12} md={3} lg={3}
  249. sx={{ display: 'flex', alignItems: 'center' }}>
  250. <FormLabel><Typography variant="pnspsFormParagraph">
  251. <FormattedMessage id="applicationId" />:
  252. </Typography></FormLabel>
  253. </Grid>
  254. <Grid item xs={12} md={9} lg={9}>
  255. <FormControl variant="outlined" fullWidth disabled>
  256. <OutlinedInput
  257. fullWidth
  258. size="small"
  259. {...register("appNo",
  260. {
  261. value: currentApplicationDetailData.appNo,
  262. })}
  263. id='appNo'
  264. sx={{
  265. "& .MuiInputBase-input.Mui-disabled": {
  266. WebkitTextFillColor: "#000000",
  267. background: "#f8f8f8",
  268. },
  269. }}
  270. />
  271. </FormControl>
  272. </Grid>
  273. </Grid>
  274. </Grid>
  275. <Grid item xs={12} sm={12} md={9} lg={5} sx={{ mb: 1}}>
  276. <Grid container alignItems={"center"}>
  277. <Grid item xs={12} md={3} lg={3}
  278. sx={{ display: 'flex', alignItems: 'center' }}>
  279. <FormLabel><Typography variant="pnspsFormParagraph">
  280. <FormattedMessage id="applyStatus" />:
  281. </Typography></FormLabel>
  282. </Grid>
  283. <Grid item xs={12} md={9} lg={9}>
  284. <FormControl variant="outlined">
  285. {currentApplicationDetailData.status ? StatusUtils.getStatusByTextIntl(currentApplicationDetailData.status, currentApplicationDetailData.creditor, intl) : ""}
  286. </FormControl>
  287. </Grid>
  288. </Grid>
  289. {
  290. currentApplicationDetailData.reason ?
  291. <Grid item xs={12} md={12} lg={12}>
  292. <Grid container alignItems={"center"} direction="row" >
  293. <Grid item xs={12} md={3} lg={3}>
  294. <FormLabel><Typography variant="pnspsFormParagraph"><FormattedMessage id="reason" />:</Typography></FormLabel>
  295. </Grid>
  296. <Grid item xs={12} md={9} lg={9}>
  297. <FormLabel>
  298. <Typography id='reason' variant="pnspsFormParagraph">
  299. {currentApplicationDetailData.reason}
  300. </Typography>
  301. </FormLabel>
  302. </Grid>
  303. </Grid>
  304. </Grid>
  305. : ""
  306. }
  307. </Grid>
  308. </Grid>
  309. <Grid container direction="row" justifyContent="space-between"
  310. alignItems="center">
  311. <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1 }}>
  312. <Grid container alignItems={"center"}>
  313. <Grid item xs={12} md={3} lg={3}
  314. sx={{ display: 'flex', alignItems: 'center' }}>
  315. <FormLabel><Typography variant="pnspsFormParagraph">
  316. <FormattedMessage id="applyPerson" />:
  317. </Typography></FormLabel>
  318. </Grid>
  319. <Grid item xs={12} md={9} lg={9}>
  320. <FormControl variant="outlined" fullWidth disabled >
  321. {currentApplicationDetailData.orgId === null ?
  322. <OutlinedInput
  323. fullWidth
  324. size="small"
  325. {...register("contactPerson",
  326. {
  327. value: currentApplicationDetailData.contactPerson,
  328. })}
  329. id='contactPerson'
  330. sx={{
  331. "& .MuiInputBase-input.Mui-disabled": {
  332. WebkitTextFillColor: "#000000",
  333. background: "#f8f8f8",
  334. },
  335. }}
  336. /> :
  337. <OutlinedInput
  338. fullWidth
  339. size="small"
  340. {...register("companyName",
  341. {
  342. value: companyName.enCompanyName,
  343. })}
  344. id='companyName'
  345. sx={{
  346. "& .MuiInputBase-input.Mui-disabled": {
  347. WebkitTextFillColor: "#000000",
  348. background: "#f8f8f8",
  349. },
  350. }}
  351. />
  352. }
  353. </FormControl>
  354. </Grid>
  355. </Grid>
  356. </Grid>
  357. <Grid item xs={12} sm={12} md={9} lg={5} sx={{ mb: 1, ml: { lg: 1 } }}>
  358. <Grid container alignItems={"center"}>
  359. <Grid item xs={12} md={3} lg={3}
  360. sx={{ display: 'flex', alignItems: 'center' }}>
  361. <FormLabel><Typography variant="pnspsFormParagraph">
  362. <FormattedMessage id="gazetteCount" />:
  363. </Typography></FormLabel>
  364. </Grid>
  365. <Grid item xs={12} md={9} lg={9}>
  366. <Stack direction="row">
  367. <FormControl variant="outlined" fullWidth disabled>
  368. <OutlinedInput
  369. size="small"
  370. {...register("issueNum",
  371. {
  372. value: issueNum,
  373. })}
  374. id='issueNum'
  375. sx={{
  376. "& .MuiInputBase-input.Mui-disabled": {
  377. WebkitTextFillColor: "#000000",
  378. background: "#f8f8f8",
  379. },
  380. }}
  381. />
  382. </FormControl>
  383. </Stack>
  384. </Grid>
  385. </Grid>
  386. </Grid>
  387. </Grid>
  388. <Grid container direction="row" justifyContent="space-between"
  389. alignItems="center">
  390. <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1 }}>
  391. <Grid container alignItems={"center"}>
  392. <Grid item xs={12} md={3} lg={3}
  393. sx={{ display: 'flex', alignItems: 'center' }}>
  394. <FormLabel><Typography variant="pnspsFormParagraph">
  395. <FormattedMessage id="contactPerson" />:
  396. </Typography></FormLabel>
  397. </Grid>
  398. <Grid item xs={12} md={9} lg={9}>
  399. <FormControl variant="outlined" fullWidth disabled>
  400. <OutlinedInput
  401. fullWidth
  402. size="small"
  403. {...register("contactPerson",
  404. {
  405. value: currentApplicationDetailData.contactPerson,
  406. })}
  407. id='contactPerson'
  408. sx={{
  409. "& .MuiInputBase-input.Mui-disabled": {
  410. WebkitTextFillColor: "#000000",
  411. background: "#f8f8f8",
  412. },
  413. }}
  414. />
  415. </FormControl>
  416. </Grid>
  417. </Grid>
  418. </Grid>
  419. <Grid item xs={12} sm={12} md={9} lg={5} sx={{ mb: 1, ml: { lg: 1 } }}>
  420. <Grid container alignItems={"center"}>
  421. <Grid item xs={12} md={3} lg={3}
  422. sx={{ display: 'flex', alignItems: 'center' }}>
  423. <FormLabel><Typography variant="pnspsFormParagraph">
  424. <FormattedMessage id="publishDate" />:
  425. </Typography></FormLabel>
  426. </Grid>
  427. <Grid item xs={12} md={9} lg={9}>
  428. <Stack direction="row">
  429. <FormControl variant="outlined" fullWidth disabled>
  430. <OutlinedInput
  431. size="small"
  432. {...register("issueDate",
  433. {
  434. value: issueDate,
  435. })}
  436. id='issueDate'
  437. sx={{
  438. "& .MuiInputBase-input.Mui-disabled": {
  439. WebkitTextFillColor: "#000000",
  440. background: "#f8f8f8",
  441. },
  442. }}
  443. />
  444. </FormControl>
  445. </Stack>
  446. </Grid>
  447. </Grid>
  448. </Grid>
  449. </Grid>
  450. <Grid container direction="row" justifyContent="space-between"
  451. alignItems="center">
  452. <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1, }}>
  453. <Grid container alignItems={"center"}>
  454. <Grid item xs={12} md={3} lg={3}
  455. sx={{ display: 'flex', alignItems: 'center' }}>
  456. <FormLabel><Typography variant="pnspsFormParagraph">
  457. <FormattedMessage id="userContactNumber" />:
  458. </Typography></FormLabel>
  459. </Grid>
  460. <Grid item xs={12} md={9} lg={9}>
  461. <Stack direction="row">
  462. <FormControl variant="outlined" sx={{ width: '25%' }} disabled>
  463. <OutlinedInput
  464. size="small"
  465. {...register("countryCode",
  466. {
  467. value: currentApplicationDetailData.contactTelNo.countryCode,
  468. })}
  469. id='countryCode'
  470. sx={{
  471. "& .MuiInputBase-input.Mui-disabled": {
  472. WebkitTextFillColor: "#000000",
  473. background: "#f8f8f8",
  474. },
  475. }}
  476. />
  477. </FormControl>
  478. <FormControl variant="outlined" sx={{ width: '100%' }} disabled>
  479. <OutlinedInput
  480. size="small"
  481. {...register("phoneNumber",
  482. {
  483. value: currentApplicationDetailData.contactTelNo.phoneNumber,
  484. })}
  485. id='phoneNumber'
  486. sx={{
  487. "& .MuiInputBase-input.Mui-disabled": {
  488. WebkitTextFillColor: "#000000",
  489. background: "#f8f8f8",
  490. },
  491. }}
  492. />
  493. </FormControl>
  494. </Stack>
  495. </Grid>
  496. </Grid>
  497. </Grid>
  498. {
  499. fee > 0 ?
  500. <Grid item xs={12} sm={12} md={9} lg={5} sx={{ mb: 1, }}>
  501. <Grid container alignItems={"center"}>
  502. <Grid item xs={12} md={3} lg={3}
  503. sx={{ display: 'flex', alignItems: 'center' }}>
  504. <FormLabel>
  505. <Typography variant="pnspsFormParagraph">
  506. <FormattedMessage id="currencyAmountTitle" />
  507. </Typography>
  508. </FormLabel>
  509. </Grid>
  510. <Grid item xs={12} md={9} lg={9}>
  511. <FormControl variant="outlined" fullWidth disabled>
  512. <OutlinedInput
  513. size="small"
  514. value={FormatUtils.currencyFormat(fee)}
  515. sx={{
  516. "& .MuiInputBase-input.Mui-disabled": {
  517. WebkitTextFillColor: "#000000",
  518. background: "#f8f8f8",
  519. },
  520. }}
  521. />
  522. </FormControl>
  523. </Grid>
  524. </Grid>
  525. </Grid>
  526. :
  527. <></>
  528. }
  529. </Grid>
  530. <Grid container direction="row" justifyContent="space-between"
  531. alignItems="center">
  532. <Grid item xs={12} sm={12} md={9} lg={6} sx={{ mb: 1, }}>
  533. <Grid container alignItems={"center"}>
  534. <Grid item xs={12} md={3} lg={3}
  535. sx={{ display: 'flex', alignItems: 'center' }}>
  536. <FormLabel><Typography variant="pnspsFormParagraph">
  537. <FormattedMessage id="userFaxNumber" />:
  538. </Typography></FormLabel>
  539. </Grid>
  540. <Grid item xs={12} sm={12} md={9} lg={9}>
  541. <Stack direction="row">
  542. <FormControl variant="outlined" sx={{ width: '25%' }} disabled>
  543. <OutlinedInput
  544. size="small"
  545. {...register("countryCode",
  546. {
  547. value: currentApplicationDetailData.contactFaxNo.countryCode,
  548. })}
  549. id='countryCode'
  550. sx={{
  551. "& .MuiInputBase-input.Mui-disabled": {
  552. WebkitTextFillColor: "#000000",
  553. background: "#f8f8f8",
  554. },
  555. }}
  556. />
  557. </FormControl>
  558. <FormControl variant="outlined" sx={{ width: '100%' }} disabled>
  559. <OutlinedInput
  560. size="small"
  561. {...register("faxNumber",
  562. {
  563. value: currentApplicationDetailData.contactFaxNo.faxNumber,
  564. })}
  565. id='faxNumber'
  566. sx={{
  567. "& .MuiInputBase-input.Mui-disabled": {
  568. WebkitTextFillColor: "#000000",
  569. background: "#f8f8f8",
  570. },
  571. }}
  572. />
  573. </FormControl>
  574. </Stack>
  575. </Grid>
  576. </Grid>
  577. </Grid>
  578. {
  579. fee > 0 ?
  580. <Grid item xs={12} sm={12} md={9} lg={5} sx={{ mb: 1, }}>
  581. <Grid container alignItems={"center"}>
  582. <Grid item xs={12} md={3} lg={3}
  583. sx={{ display: 'flex', alignItems: 'center' }}>
  584. <FormLabel><Typography variant="pnspsFormParagraph">
  585. <FormattedMessage id="paymentMethod" />:
  586. </Typography></FormLabel>
  587. </Grid>
  588. <Grid item xs={12} md={9} lg={9}>
  589. <FormControl variant="outlined" fullWidth disabled>
  590. <OutlinedInput
  591. size="small"
  592. value={currentApplicationDetailData.paymentMethod!=null?intl.formatMessage({ id: utils.getPaymentMethod(currentApplicationDetailData.paymentMethod)}):""}
  593. id='paymentMethod'
  594. sx={{
  595. "& .MuiInputBase-input.Mui-disabled": {
  596. WebkitTextFillColor: "#000000",
  597. background: "#f8f8f8",
  598. },
  599. }}
  600. />
  601. </FormControl>
  602. </Grid>
  603. </Grid>
  604. </Grid>
  605. :
  606. <></>
  607. }
  608. </Grid>
  609. <Grid container direction="row" justifyContent="space-between"
  610. alignItems="center">
  611. <Grid item xs={12} sm={12} md={11} lg={11} mt={1}>
  612. <Grid container alignItems={"center"}>
  613. <Grid item xs={12} sm={12} md={12} lg={12}>
  614. <Grid container direction="row">
  615. <Grid item xs={12} sm={12} md={2.5} lg={1.6}
  616. sx={{ display: 'flex', alignItems: 'center' }}>
  617. <FormLabel><Typography variant="pnspsFormParagraph">
  618. <FormattedMessage id="draftFile" />:
  619. </Typography></FormLabel>
  620. </Grid>
  621. <Grid item xs={12} sm={12} md={9} lg={9} >
  622. <Grid container direction="row" alignItems="center" justifyContent="flex-start">
  623. <Grid item xs={12} sm={12} md={12} lg={12} sx={{ wordBreak: 'break-word', }}>
  624. <Typography
  625. id='fileName'
  626. variant="pnspsFormParagraph"
  627. sx={{ width: '100%' }}
  628. >
  629. {fileDetail?.filename}
  630. </Typography>
  631. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  632. <Button
  633. sx={{
  634. ml: 3,
  635. backgroundColor: '#0C489E',
  636. color: '#FFFFFF',
  637. '&:hover': { backgroundColor: '#093A7A' },
  638. }}
  639. variant="contained"
  640. onClick={onDownloadClick()}
  641. aria-label={intl.formatMessage({ id: 'download' })}
  642. title={intl.formatMessage({ id: 'download' })}
  643. disabled={!fileDetail?.filename||onDownload}
  644. startIcon={<DownloadIcon sx={{ alignItems: "center" }} />}
  645. >
  646. <FormattedMessage id="download" />
  647. </Button>
  648. </ThemeProvider>
  649. </Grid>
  650. </Grid>
  651. </Grid>
  652. </Grid>
  653. </Grid>
  654. </Grid>
  655. </Grid>
  656. </Grid>
  657. {isORGLoggedIn() ?
  658. <Grid item xs={12} md={9} lg={6} sx={{ mb: 1, paddingTop: 2 }}>
  659. <Grid container alignItems={"center"}>
  660. <Grid item xs={12} md={3} lg={3}
  661. sx={{ display: 'flex', alignItems: 'center' }}>
  662. <FormLabel><Typography variant="pnspsFormParagraph"><FormattedMessage id="careOf" />:</Typography></FormLabel>
  663. </Grid>
  664. <Grid item xs={12} md={9} lg={9}>
  665. <FormControl variant="outlined" sx={{ width: '100%' }} disabled>
  666. <OutlinedInput
  667. size="small"
  668. id="careOf"
  669. value={currentApplicationDetailData.careOf}
  670. inputProps={{ 'aria-label': intl.formatMessage({ id: 'careOf' }) }}
  671. sx={{
  672. "& .MuiInputBase-input.Mui-disabled": {
  673. WebkitTextFillColor: "#000000",
  674. background: "#f8f8f8",
  675. },
  676. }}
  677. />
  678. </FormControl>
  679. </Grid>
  680. </Grid>
  681. </Grid> : null
  682. }
  683. <Grid item xs={12} md={9} lg={6} sx={{ mb: 1, paddingTop: 2 }}>
  684. <Grid container alignItems={"center"}>
  685. <Grid item xs={12} md={3} lg={3}
  686. sx={{ display: 'flex', alignItems: 'center' }}>
  687. <FormLabel><Typography variant="pnspsFormParagraph">
  688. <FormattedMessage id="extraMark" />:
  689. </Typography></FormLabel>
  690. </Grid>
  691. <Grid item xs={12} md={9} lg={9}>
  692. <FormControl variant="outlined" sx={{ width: '100%' }} disabled>
  693. <OutlinedInput
  694. size="small"
  695. value={currentApplicationDetailData.remarks}
  696. sx={{
  697. "& .MuiInputBase-input.Mui-disabled": {
  698. WebkitTextFillColor: "#000000",
  699. background: "#f8f8f8",
  700. },
  701. }}
  702. />
  703. </FormControl>
  704. </Grid>
  705. </Grid>
  706. </Grid>
  707. </Grid>
  708. </Grid>
  709. <div>
  710. <Dialog
  711. open={isPopUp}
  712. onClose={() => setIsPopUp(false)}
  713. PaperProps={{
  714. sx: {
  715. minWidth: '40vw',
  716. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' },
  717. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' }
  718. }
  719. }}
  720. >
  721. <DialogTitle>
  722. <Typography variant="h3" >
  723. <FormattedMessage id="payConfirm" />
  724. </Typography>
  725. </DialogTitle>
  726. <DialogContent style={{ display: 'flex', }}>
  727. <Stack direction="column" justifyContent="space-between">
  728. <Typography variant="h4">
  729. <FormattedMessage id="totalAmount" /> ($): {FormatUtils.currencyFormat(fee)}
  730. </Typography>
  731. </Stack>
  732. </DialogContent>
  733. <DialogActions>
  734. <Button
  735. onClick={() => setIsPopUp(false)}
  736. aria-label={intl.formatMessage({ id: 'close' })}
  737. >
  738. <Typography variant="pnspsFormParagraph">
  739. <FormattedMessage id="close" />
  740. </Typography></Button>
  741. <Button
  742. onClick={() => doPayment()}
  743. aria-label={intl.formatMessage({ id: 'confirm' })}
  744. >
  745. <Typography variant="pnspsFormParagraph">
  746. <FormattedMessage id="confirm" />
  747. </Typography></Button>
  748. </DialogActions>
  749. </Dialog>
  750. </div>
  751. <div>
  752. <Dialog
  753. open={errorPopUp}
  754. onClose={() => setErrorPopUp(false)}
  755. PaperProps={{
  756. sx: {
  757. minWidth: '40vw',
  758. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  759. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  760. }
  761. }}
  762. >
  763. <DialogTitle></DialogTitle>
  764. <Typography variant="h2" style={{ padding: '16px' }}><FormattedMessage id="MSG.actionFail" /></Typography>
  765. <DialogContent style={{ display: 'flex', }}>
  766. <Stack direction="column" justifyContent="space-between">
  767. {
  768. errorText
  769. }
  770. </Stack>
  771. </DialogContent>
  772. <DialogActions>
  773. <Button
  774. onClick={() => setErrorPopUp(false)}
  775. aria-label={intl.formatMessage({ id: 'close' })}
  776. >
  777. <Typography variant="pnspsFormParagraph">
  778. <FormattedMessage id="close" />
  779. </Typography></Button>
  780. </DialogActions>
  781. </Dialog>
  782. </div>
  783. <div>
  784. <Dialog
  785. open={paymentHoldedErr}
  786. onClose={() => setPaymentHoldedErr(false)}
  787. PaperProps={{
  788. sx: {
  789. minWidth: '40vw',
  790. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  791. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  792. }
  793. }}
  794. >
  795. <DialogTitle></DialogTitle>
  796. <Typography variant="h4" style={{ paddingLeft: '24px' }}><FormattedMessage id="MSG.actionFail" /></Typography>
  797. <DialogContent style={{ display: 'flex', }}>
  798. <Stack direction="column" justifyContent="space-between">
  799. <div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: 'MSG.paymentHolded' }, { appNo: paymentHoldedErrText }) }} />
  800. </Stack>
  801. </DialogContent>
  802. <DialogActions>
  803. <Button onClick={() => setPaymentHoldedErr(false)} aria-label={intl.formatMessage({ id: 'close' })}>
  804. <Typography variant="h5">
  805. <FormattedMessage id="close" />
  806. </Typography></Button>
  807. </DialogActions>
  808. </Dialog>
  809. </div>
  810. </form>
  811. </MainCard >
  812. );
  813. };
  814. export default ApplicationDetailCard;