25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

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