No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

199 líneas
10 KiB

  1. // material-ui
  2. import {
  3. FormControl,
  4. Button,
  5. Grid,
  6. Typography, FormLabel,
  7. } from '@mui/material';
  8. import * as React from "react";
  9. import Loadable from 'components/Loadable';
  10. const MainCard = Loadable(React.lazy(() => import('components/MainCard')));
  11. import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
  12. import * as HttpUtils from "utils/HttpUtils";
  13. import DownloadIcon from '@mui/icons-material/Download';
  14. import { notifyActionError } from 'utils/CommonFunction';
  15. import { useIntl } from 'react-intl';
  16. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  17. const ApplicationDetailCard = ({ data }) => {
  18. const intl = useIntl();
  19. const [appDetail, setAppDetails] = React.useState({});
  20. React.useEffect(() => {
  21. if (Object.keys(data).length > 0) {
  22. setAppDetails(data);
  23. }
  24. }, [data]);
  25. const onDownloadClick = () => () => {
  26. HttpUtils.fileDownload({
  27. fileId: appDetail.appFileId,
  28. skey: appDetail.appSkey,
  29. filename: appDetail.appFilename,
  30. onResponse: function () {},
  31. onError: function () {
  32. notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
  33. }
  34. });
  35. };
  36. return (
  37. <MainCard elevation={0}
  38. border={false}
  39. content={false}
  40. >
  41. <Typography variant="h4" xs={12} md={12} sx={{ mb: 2, borderBottom: "1px solid black" }}>
  42. Application Details
  43. </Typography>
  44. <Grid container direction="column">
  45. <Grid item xs={12} md={12}>
  46. <Grid container direction="row" justifyContent="space-between" alignItems="center">
  47. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  48. <Grid container alignItems={"center"}>
  49. <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
  50. <FormLabel><Typography variant="h5">Application No:</Typography></FormLabel>
  51. </Grid>
  52. <Grid item xs={12} md={9} lg={9}>
  53. <Typography variant="h5">
  54. {appDetail.appNo}
  55. </Typography>
  56. </Grid>
  57. </Grid>
  58. </Grid>
  59. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  60. <Grid container alignItems={"center"}>
  61. <Grid item xs={12} md={3} lg={3}
  62. sx={{ display: 'flex', alignItems: 'center' }}>
  63. <FormLabel><Typography variant="h5">Status:</Typography></FormLabel>
  64. </Grid>
  65. <Grid item xs={12} md={9} lg={9}>
  66. <FormControl variant="outlined">
  67. {StatusUtils.getStatusByTextEng(appDetail.appStatus)}
  68. </FormControl>
  69. </Grid>
  70. </Grid>
  71. </Grid>
  72. </Grid>
  73. <Grid container direction="row" justifyContent="space-between" 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="h5">Applicant:</Typography></FormLabel>
  79. </Grid>
  80. <Grid item xs={12} md={9} lg={9}>
  81. <FormControl variant="outlined" fullWidth disabled >
  82. <Typography variant="h5">
  83. {appDetail.orgId === null ?
  84. appDetail.contactPerson : appDetail.enCompanyName
  85. }
  86. </Typography>
  87. </FormControl>
  88. </Grid>
  89. </Grid>
  90. </Grid>
  91. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1}}>
  92. <Grid container alignItems={"center"}>
  93. <Grid item xs={12} md={4} lg={4}
  94. sx={{ display: 'flex', alignItems: 'center' }}>
  95. <FormLabel><Typography variant="h5">Contact Phone:</Typography></FormLabel>
  96. </Grid>
  97. <Grid item xs={12} md={8} lg={8}>
  98. <Typography variant="h5">
  99. {appDetail.contactTelNo ? appDetail.contactTelNo.countryCode + " " + appDetail.contactTelNo.phoneNumber : ""}
  100. </Typography>
  101. </Grid>
  102. </Grid>
  103. </Grid>
  104. </Grid>
  105. <Grid container direction="row" justifyContent="space-between" alignItems="center">
  106. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  107. <Grid container alignItems={"center"}>
  108. <Grid item xs={12} md={3} lg={3}
  109. sx={{ display: 'flex', alignItems: 'center' }}>
  110. <FormLabel><Typography variant="h5">Contact Person:</Typography></FormLabel>
  111. </Grid>
  112. <Grid item xs={12} md={9} lg={9}>
  113. <Typography variant="h5">
  114. {appDetail.contactPerson}
  115. </Typography>
  116. </Grid>
  117. </Grid>
  118. </Grid>
  119. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1}}>
  120. <Grid container alignItems={"center"}>
  121. <Grid item xs={12} md={4} lg={4}
  122. sx={{ display: 'flex', alignItems: 'center' }}>
  123. <FormLabel><Typography variant="h5">Contact Fax:</Typography></FormLabel>
  124. </Grid>
  125. <Grid item xs={12} md={8} lg={8}>
  126. <Typography variant="h5">
  127. {appDetail.contactFaxNo ? appDetail.contactFaxNo.countryCode + " " + appDetail.contactFaxNo.faxNumber : ""}
  128. </Typography>
  129. </Grid>
  130. </Grid>
  131. </Grid>
  132. </Grid>
  133. <Grid container direction="row" justifyContent="space-between"
  134. alignItems="center">
  135. <Grid item xs={12} md={6} lg={6} mt={1} mb={2}>
  136. <Grid container alignItems={"center"}>
  137. <Grid item xs={12} md={12} lg={12}>
  138. <Grid container direction="row">
  139. <Grid item xs={12} md={3} lg={3}
  140. sx={{ display: 'flex', alignItems: 'center' }}>
  141. <FormLabel><Typography variant="h5">Manuscript File:</Typography></FormLabel>
  142. </Grid>
  143. <Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}>
  144. <Grid container direction="row" justifyContent="flex-start">
  145. <Grid item xs={12} md={5} lg={5} sx={{ display: 'flex', alignItems: 'center' }}>
  146. <FormControl variant="outlined" fullWidth >
  147. <Typography
  148. // fullWidth
  149. id='fileName'
  150. variant="h5"
  151. sx={{ wordBreak: 'break-word' }}
  152. >
  153. {appDetail.appFilename}
  154. </Typography>
  155. </FormControl>
  156. </Grid>
  157. <Grid item md={2} lg={2}>
  158. <Button
  159. size="small"
  160. variant="contained"
  161. onClick={onDownloadClick()}
  162. sx={{
  163. textTransform: 'capitalize',
  164. alignItems: 'end',
  165. }}>
  166. <DownloadIcon />
  167. </Button>
  168. </Grid>
  169. </Grid>
  170. </Grid>
  171. </Grid>
  172. </Grid>
  173. </Grid>
  174. </Grid>
  175. </Grid>
  176. </Grid>
  177. </Grid>
  178. </MainCard>
  179. );
  180. };
  181. export default ApplicationDetailCard;