You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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