您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

336 行
18 KiB

  1. // material-ui
  2. import {
  3. FormControl,
  4. Grid,
  5. Typography,
  6. FormLabel,
  7. TextField,
  8. Stack
  9. } from '@mui/material';
  10. import { useFormik } from 'formik';
  11. import * as React from "react";
  12. import * as DateUtils from "utils/DateUtils"
  13. import * as FormatUtils from "utils/FormatUtils"
  14. import { useParams } from "react-router-dom";
  15. import Loadable from 'components/Loadable';
  16. const MainCard = Loadable(React.lazy(() => import('components/MainCard')));
  17. import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
  18. import FileList from "components/FileList"
  19. import { FormattedMessage, useIntl } from "react-intl";
  20. import {
  21. isORGLoggedIn,
  22. } from "utils/Utils";
  23. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  24. const ApplicationDetailCard = ({ formData, }) => {
  25. const params = useParams();
  26. const intl = useIntl();
  27. const { locale } = intl;
  28. const [data, setData] = React.useState({});
  29. //const [proofId, setProofId] = React.useState();
  30. React.useEffect(() => {
  31. if (formData) {
  32. setData(formData);
  33. //setProofId(formData.id);
  34. }
  35. }, [formData]);
  36. const formik = useFormik({
  37. enableReinitialize: true,
  38. initialValues: data,
  39. });
  40. const DisplayField = ({ name, width }) => {
  41. return <TextField
  42. fullWidth
  43. disabled
  44. size="small"
  45. onChange={formik.handleChange}
  46. id={name}
  47. name={name}
  48. value={formik.values[name]}
  49. variant="outlined"
  50. sx={
  51. {
  52. "& .MuiInputBase-input.Mui-disabled": {
  53. WebkitTextFillColor: "#000000",
  54. background: "#f8f8f8",
  55. },
  56. width: width ? width : '100%'
  57. }
  58. }
  59. />;
  60. }
  61. return (
  62. <MainCard elevation={0}
  63. border={false}
  64. content={false}
  65. >
  66. <Typography variant="h4" sx={{ textAlign: "left", mb: 2, borderBottom: "1px solid black" }}>
  67. <FormattedMessage id="publicNoticePaymentProofInfo" />
  68. </Typography>
  69. <form>
  70. <Grid container direction="column">
  71. <Grid item xs={12} md={12} lg={12}>
  72. <Grid container direction="row" justifyContent="space-between"
  73. alignItems="center">
  74. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  75. <Grid container alignItems={"center"}>
  76. <Grid item xs={12} md={3} lg={3}
  77. sx={{ display: 'flex', alignItems: 'center' }}>
  78. <FormLabel><Typography variant="pnspsFormParagraph">
  79. <FormattedMessage id="applicationId" />:
  80. </Typography></FormLabel>
  81. </Grid>
  82. <Grid item xs={12} md={9} lg={9}>
  83. <DisplayField name="appNo" />
  84. </Grid>
  85. </Grid>
  86. </Grid>
  87. <Grid item xs={12} md={5} lg={5} sx={{ mb: 1 }}>
  88. <Grid container alignItems={"left"}>
  89. <Grid item xs={12} md={3} lg={3}
  90. sx={{ display: 'flex', alignItems: 'center' }}>
  91. <FormLabel><Typography variant="pnspsFormParagraph">
  92. <FormattedMessage id="applyStatus" />:
  93. </Typography></FormLabel>
  94. </Grid>
  95. <Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}>
  96. <FormControl variant="outlined">
  97. {StatusUtils.getStatusByTextIntl(data.appStatus, false, intl)}
  98. </FormControl>
  99. </Grid>
  100. </Grid>
  101. </Grid>
  102. </Grid>
  103. <Grid container direction="row" justifyContent="space-between"
  104. alignItems="center">
  105. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  106. <Grid container alignItems={"center"}>
  107. <Grid item xs={12} md={3} lg={3}
  108. sx={{ display: 'flex', alignItems: 'center' }}>
  109. <FormLabel><Typography variant="pnspsFormParagraph">
  110. <FormattedMessage id="applyPerson" />:
  111. </Typography></FormLabel>
  112. </Grid>
  113. <Grid item xs={12} md={9} lg={9}>
  114. <FormControl variant="outlined" fullWidth disabled >
  115. {data.orgId === null ?
  116. <DisplayField name="contactPerson" />
  117. :
  118. <DisplayField name="applicant" />
  119. }
  120. </FormControl>
  121. </Grid>
  122. </Grid>
  123. </Grid>
  124. <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: { xs: 0, sm: 0, md: 1, lg: 1 } }}>
  125. <Grid container alignItems={"center"}>
  126. <Grid item xs={12} md={3} lg={3}
  127. sx={{ display: 'flex', alignItems: 'center' }}>
  128. <FormLabel><Typography variant="pnspsFormParagraph">
  129. <FormattedMessage id="gazetteCount" />:
  130. </Typography></FormLabel>
  131. </Grid>
  132. <Grid item xs={12} md={9} lg={9}>
  133. <DisplayField name="issueNoStr" />
  134. </Grid>
  135. </Grid>
  136. </Grid>
  137. </Grid>
  138. <Grid container direction="row" justifyContent="space-between"
  139. alignItems="center">
  140. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  141. <Grid container alignItems={"center"}>
  142. <Grid item xs={12} md={3} lg={3}
  143. sx={{ display: 'flex', alignItems: 'center' }}>
  144. <FormLabel><Typography variant="pnspsFormParagraph">
  145. <FormattedMessage id="contactPerson" />:
  146. </Typography></FormLabel>
  147. </Grid>
  148. <Grid item xs={12} md={9} lg={9}>
  149. <DisplayField name="contactPerson" />
  150. </Grid>
  151. </Grid>
  152. </Grid>
  153. <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, ml: { xs: 0, sm: 0, md: 1, lg: 1 } }}>
  154. <Grid container alignItems={"center"}>
  155. <Grid item xs={12} md={3} lg={3}
  156. sx={{ display: 'flex', alignItems: 'center' }}>
  157. <FormLabel><Typography variant="pnspsFormParagraph">
  158. <FormattedMessage id="applicationPublishDate" />:
  159. </Typography></FormLabel>
  160. </Grid>
  161. <Grid item xs={12} md={9} lg={9}>
  162. <DisplayField name="issueDateStr" />
  163. </Grid>
  164. </Grid>
  165. </Grid>
  166. </Grid>
  167. {isORGLoggedIn() ?
  168. <>
  169. <Grid container direction="row" justifyContent="space-between"
  170. alignItems="center">
  171. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1, }}>
  172. <Grid container alignItems="left">
  173. <Grid item xs={12} md={3} lg={3}
  174. sx={{ display: 'flex', alignItems: 'center' }}>
  175. <FormLabel><Typography variant="pnspsFormParagraph">
  176. <FormattedMessage id="careOf" />:
  177. </Typography></FormLabel>
  178. </Grid>
  179. <Grid item xs={12} md={9} lg={9}>
  180. <Stack direction="row">
  181. <DisplayField name="careOf" />
  182. </Stack>
  183. </Grid>
  184. </Grid>
  185. </Grid>
  186. </Grid>
  187. </>
  188. :
  189. null
  190. }
  191. <Grid container direction="row" justifyContent="space-between"
  192. alignItems="center">
  193. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1, }}>
  194. <Grid container alignItems="left">
  195. <Grid item xs={12} md={3} lg={3}
  196. sx={{ display: 'flex', alignItems: 'center' }}>
  197. <FormLabel><Typography variant="pnspsFormParagraph">
  198. <FormattedMessage id="myRemarks" />:
  199. </Typography></FormLabel>
  200. </Grid>
  201. <Grid item xs={12} md={9} lg={9}>
  202. <Stack direction="row">
  203. <DisplayField name="appRemarks" />
  204. </Stack>
  205. </Grid>
  206. </Grid>
  207. </Grid>
  208. </Grid>
  209. <Grid container
  210. direction="row"
  211. justifyContent="space-between"
  212. alignItems="center"
  213. width="auto"
  214. >
  215. <Grid item xs={12} sm={12} md={6} lg={6} sx={{ mb: 1 }}>
  216. <Grid container alignItems={"center"}>
  217. <Grid item xs={12} sm={12} md={12} lg={12} sx={{ alignItems: 'center', wordBreak: 'break-word' }}>
  218. <Typography>
  219. <Typography variant="pnspsFormParagraph">
  220. <FormattedMessage id="pleaseCheckReminder" />:
  221. </Typography>
  222. </Typography>
  223. </Grid>
  224. <Grid item xs={12} sm={12} md={12} lg={12} sx={{ width: '95%', maxWidth: { xs: '70vw', sm: '72vw', md: '75vw', lg: '80vw' } }}>
  225. <FileList
  226. lang="ch"
  227. refId={params.id}
  228. refType={"proof"}
  229. dateHideable={true}
  230. disablePagination
  231. disableSelectionOnClick
  232. disableColumnMenu
  233. disableColumnSelector
  234. hideFooter
  235. />
  236. </Grid>
  237. </Grid>
  238. </Grid>
  239. <Grid item xs={12} md={5} lg={5} sx={{ mb: 1, }}>
  240. <Grid container alignItems={"center"}>
  241. {data.creditor == true ?
  242. <>
  243. <Grid item xs={12} md={12} lg={12}
  244. sx={{ display: 'flex', alignItems: 'center' }}>
  245. <Typography variant="h5" display="inline">
  246. <FormattedMessage id="commentDeadline" />:
  247. </Typography>
  248. </Grid>
  249. <Grid item xs={12} md={12} lg={12} sx={{ mb: 4, display: 'flex', alignItems: 'center' }}>
  250. <Typography variant="h5">&emsp;
  251. {locale === 'en' ?
  252. `${intl.formatMessage({ id: 'before' })} ${DateUtils.dateFormat(data?.reviseDeadline, intl.formatMessage({ id: "paymentMethodDatetimeStrFormat" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")} `
  253. :
  254. `${DateUtils.dateFormat(data?.reviseDeadline, intl.formatMessage({ id: "paymentMethodDatetimeStrFormat" }))?.replace("am", "上午")?.replace("pm", "下午")}${intl.formatMessage({ id: 'before' })}`
  255. }
  256. </Typography>
  257. </Grid>
  258. <Grid item xs={12} md={12} lg={12}
  259. sx={{ display: 'flex', alignItems: 'center' }}>
  260. <Typography variant="h5" display="inline">
  261. <FormattedMessage id="paymentDeadline" />:
  262. </Typography>
  263. </Grid>
  264. <Grid item xs={12} md={12} lg={12} sx={{ mb: 4, display: 'flex', alignItems: 'center' }}>
  265. <Typography variant="h5">&emsp;
  266. {locale === 'en' ?
  267. `${intl.formatMessage({ id: 'before' })} ${DateUtils.dateFormat(data?.expiryDate, intl.formatMessage({ id: "paymentMethodDatetimeStrFormat" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")} `
  268. :
  269. `${DateUtils.dateFormat(data?.expiryDate, intl.formatMessage({ id: "paymentMethodDatetimeStrFormat" }))?.replace("am", "上午")?.replace("pm", "下午")}${intl.formatMessage({ id: 'before' })}`
  270. }
  271. </Typography>
  272. </Grid>
  273. </>
  274. :
  275. <></>
  276. }
  277. <Grid item xs={12} sm={3} md={3} lg={3}
  278. sx={{ mb: 1, display: 'flex', alignItems: 'center' }}>
  279. <Typography>
  280. <Typography variant="pnspsFormParagraph">
  281. <FormattedMessage id="payFeeFor" />:
  282. </Typography>
  283. </Typography>
  284. </Grid>
  285. <Grid item xs={12} sm={9} md={9} lg={9} sx={{ mb: 1, display: 'flex', alignItems: 'center' }}>
  286. <Typography variant="h4" style={{ color: "#0049B8", fontWeight: "bold", }}>{FormatUtils.currencyFormat(data.fee)}</Typography>
  287. </Grid>
  288. <Grid item xs={12} md={9} lg={9} sx={{ mb: 4, display: 'flex', alignItems: 'center' }}>
  289. {
  290. formik.values.groupType === "Private Bill"
  291. ?
  292. <Typography>
  293. <Typography variant="pnspsFormParagraph">( {data.noOfPages} {intl.formatMessage({ id: 'page' })} x $6,552 )</Typography>
  294. </Typography>
  295. :
  296. <Typography>
  297. <Typography variant="pnspsFormParagraph">( {data.length} cm x {data.colCount === 2 ?
  298. "$364 " + intl.formatMessage({ id: 'doubleCol' }) :
  299. "$182 " + intl.formatMessage({ id: 'singleCol' })} )
  300. </Typography>
  301. </Typography>
  302. }
  303. </Grid>
  304. </Grid>
  305. </Grid>
  306. </Grid>
  307. </Grid>
  308. </Grid>
  309. </form>
  310. </MainCard>
  311. );
  312. };
  313. export default ApplicationDetailCard;