選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ApplicationDetailCard.js 44 KiB

2年前
2年前
2年前
1年前
2年前
2年前
2年前
2年前
1年前
2年前
1年前
2年前
1年前
1年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
1年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
1年前
2年前
2年前
1年前
1年前
1年前
1年前
1年前
1年前
2年前
2年前
2年前
2年前
2年前
2年前
1年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
1年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
2年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. // material-ui
  2. import {
  3. FormControl,
  4. Button,
  5. Grid,
  6. Typography, FormLabel,
  7. TextField,
  8. OutlinedInput,
  9. Stack,
  10. Dialog, DialogTitle, DialogContent, DialogActions, InputAdornment,
  11. } from '@mui/material';
  12. import {isGranted, delBugMode } from "auth/utils";
  13. const MainCard = Loadable(lazy(() => import('components/MainCard')));
  14. import { useForm } from "react-hook-form";
  15. import {
  16. useEffect,
  17. useState,
  18. lazy
  19. } from "react";
  20. import Loadable from 'components/Loadable';
  21. const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
  22. import * as HttpUtils from "utils/HttpUtils"
  23. import * as DateUtils from "utils/DateUtils"
  24. import {CHECK_CREATE_PROOF,UPDATE_GLDREMARKS } from "utils/ApiPathConst"
  25. import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
  26. import DoneIcon from '@mui/icons-material/Done';
  27. import CloseIcon from '@mui/icons-material/Close';
  28. import EditNoteIcon from '@mui/icons-material/EditNote';
  29. import DownloadIcon from '@mui/icons-material/Download';
  30. import ReplayIcon from '@mui/icons-material/Replay';
  31. import { notifyDownloadSuccess } from 'utils/CommonFunction';
  32. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  33. const ApplicationDetailCard = (
  34. { applicationDetailData,
  35. setStatus,
  36. setUploadStatus
  37. }
  38. ) => {
  39. const [currentApplicationDetailData, setCurrentApplicationDetailData] = useState({});
  40. const [companyName, setCompanyName] = useState({});
  41. const [verified, setVerified] = useState(null);
  42. const [fileDetail, setfileDetail] = useState({});
  43. const [onReady, setOnReady] = useState(false);
  44. const { register,handleSubmit } = useForm()
  45. const [isWarningPopUp, setIsWarningPopUp] = useState(false);
  46. const [warningText, setWarningText] = useState("");
  47. const [remarksPopUp, setRemarksPopUp] = useState(false);
  48. useEffect(() => {
  49. //if user data from parent are not null
  50. // console.log(applicationDetailData)
  51. if (Object.keys(applicationDetailData).length > 0) {
  52. loadApplicationDetail()
  53. }
  54. }, [applicationDetailData]);
  55. useEffect(() => {
  56. //if state data are ready and assign to different field
  57. // console.log(currentApplicationDetailData)
  58. if (Object.keys(currentApplicationDetailData).length > 0) {
  59. setOnReady(true);
  60. }
  61. }, [currentApplicationDetailData]);
  62. const loadApplicationDetail = () => {
  63. setCurrentApplicationDetailData(applicationDetailData.data);
  64. setCompanyName(applicationDetailData.companyName);
  65. setVerified(applicationDetailData.userData.verifiedBy ? true : false)
  66. setfileDetail(applicationDetailData.fileDetail);
  67. // setReload(false)
  68. }
  69. const onDownloadClick = () => () => {
  70. HttpUtils.fileDownload({
  71. fileId: fileDetail?.id,
  72. skey: fileDetail?.skey,
  73. filename: fileDetail?.filename,
  74. });
  75. notifyDownloadSuccess()
  76. setUploadStatus(true)
  77. };
  78. const reSubmitClick = () => () => {
  79. setStatus("resubmit")
  80. };
  81. const notAcceptedClick = () => () => {
  82. setStatus("notAccepted")
  83. };
  84. const setCompleteDisable = () => {
  85. if (delBugMode) return false;
  86. return (new Date()).getTime() < DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate).getTime();
  87. }
  88. const complatedClick = () => () => {
  89. let issueDate = DateUtils.convertToDate(applicationDetailData.gazetteIssueDetail.issueDate);
  90. let current = new Date();
  91. if (delBugMode) {
  92. setStatus("complete")
  93. } else if (current.getTime() >= issueDate.getTime()) {
  94. setStatus("complete")
  95. }
  96. };
  97. const withdrawnClick = () => () => {
  98. setStatus("withdraw")
  99. };
  100. const doPublish = () => () => {
  101. setStatus("publish")
  102. }
  103. const revokeClick = () => () => {
  104. setStatus("revoke")
  105. };
  106. const onProofClick = () => {
  107. if (applicationDetailData.data.groupNo) {
  108. HttpUtils.get({
  109. url: CHECK_CREATE_PROOF + "/" + currentApplicationDetailData.id,
  110. onSuccess: function (responeData) {
  111. if (responeData.success == true) {
  112. window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer");
  113. window.addEventListener("focus", onFocus)
  114. } else {
  115. let msg = responeData.msg;
  116. if (msg === "haveActiveProof") {
  117. msg = "Action Failed: There is already a pending payment and proofreading record for client review."
  118. } else if (msg === "haveProofed") {
  119. msg = "Action Failed: Already proofed."
  120. }
  121. setWarningText(msg);
  122. setIsWarningPopUp(true);
  123. }
  124. }
  125. });
  126. } else {
  127. setWarningText("Please generate Gazette Code before Create Proof.");
  128. setIsWarningPopUp(true);
  129. }
  130. }
  131. const onFocus = () => {
  132. location.reload();
  133. window.removeEventListener("focus", onFocus)
  134. }
  135. const onSubmit = (data) => {
  136. // console.log(data)
  137. const gldRemarks = data.makeRemarks
  138. if (gldRemarks!=null&&gldRemarks!=currentApplicationDetailData.gldRemarks){
  139. HttpUtils.post({
  140. url: UPDATE_GLDREMARKS + "/" + currentApplicationDetailData.id,
  141. params: {
  142. gldRemarks: gldRemarks
  143. },
  144. onSuccess: function () {
  145. location.reload();
  146. },
  147. onError: (error) => {
  148. alert(error)
  149. }
  150. });
  151. }else{
  152. setRemarksPopUp(false)
  153. }
  154. };
  155. return (
  156. !onReady ?
  157. <LoadingComponent />
  158. :
  159. <MainCard elevation={0}
  160. border={false}
  161. content={false}
  162. >
  163. {verified && currentApplicationDetailData.status !== "notAccepted" ?
  164. <Grid container spacing={4} direction="row">
  165. <Grid item xs={12} md={4} >
  166. <Stack
  167. direction="row"
  168. justifyContent="flex-start"
  169. alignItems="center"
  170. spacing={2}
  171. mb={2}
  172. >
  173. {currentApplicationDetailData.status === "reviewed" && isGranted("MAINTAIN_PROOF") ?
  174. <Button
  175. // size="large"
  176. variant="contained"
  177. onClick={() => { onProofClick() }}
  178. sx={{
  179. textTransform: 'capitalize',
  180. alignItems: 'end'
  181. }}>
  182. <EditNoteIcon />
  183. <Typography ml={1} variant="h5"> Create Proof</Typography>
  184. </Button> :
  185. null
  186. }
  187. </Stack>
  188. </Grid>
  189. <Grid item xs={12} md={8} >
  190. <Stack
  191. direction="row"
  192. justifyContent="flex-start"
  193. alignItems="center"
  194. spacing={2}
  195. mb={2}
  196. >
  197. {currentApplicationDetailData.status === "submitted" || currentApplicationDetailData.status == "reviewed" ?
  198. <>
  199. <Button
  200. // size="large"
  201. variant="contained"
  202. onClick={reSubmitClick()}
  203. color="orange"
  204. >
  205. <ReplayIcon />
  206. <Typography ml={1} variant="h5"> Re-Submit</Typography>
  207. </Button>
  208. <Button
  209. // size="large"
  210. variant="contained"
  211. onClick={notAcceptedClick()}
  212. color="error"
  213. sx={{
  214. textTransform: 'capitalize',
  215. alignItems: 'end',
  216. }}>
  217. <CloseIcon />
  218. <Typography ml={1} variant="h5">Not Accept</Typography>
  219. </Button>
  220. </> :
  221. (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 1) ?
  222. <>
  223. <Button
  224. // size="large"
  225. variant="contained"
  226. onClick={doPublish()}
  227. disabled={setCompleteDisable()}
  228. sx={{
  229. textTransform: 'capitalize',
  230. alignItems: 'end',
  231. backgroundColor: '#52b202'
  232. }}>
  233. <DoneIcon />
  234. <Typography ml={1} variant="h5">Publish</Typography>
  235. </Button>
  236. <Button
  237. // size="large"
  238. variant="contained"
  239. onClick={withdrawnClick()}
  240. sx={{
  241. textTransform: 'capitalize',
  242. alignItems: 'end',
  243. backgroundColor: '#ffa733'
  244. }}>
  245. <CloseIcon />
  246. <Typography ml={1} variant="h5">Withdraw</Typography>
  247. </Button>
  248. </>
  249. :
  250. (currentApplicationDetailData.status == "confirmed" && currentApplicationDetailData.creditor == 0) ?
  251. <>
  252. <Button
  253. // size="large"
  254. variant="contained"
  255. onClick={withdrawnClick()}
  256. sx={{
  257. textTransform: 'capitalize',
  258. alignItems: 'end',
  259. backgroundColor: '#ffa733'
  260. }}>
  261. <CloseIcon />
  262. <Typography ml={1} variant="h5">Withdraw</Typography>
  263. </Button>
  264. </>
  265. :
  266. (
  267. (currentApplicationDetailData.status == "paid" && currentApplicationDetailData.creditor == 0) ?
  268. <>
  269. <Button
  270. // size="large"
  271. variant="contained"
  272. onClick={revokeClick()}
  273. disabled={currentApplicationDetailData.paymentMethod=="online"||currentApplicationDetailData.paymentMethod==null}
  274. sx={{
  275. textTransform: 'capitalize',
  276. alignItems: 'end',
  277. backgroundColor: '#ffa733'
  278. }}>
  279. <ReplayIcon />
  280. <Typography ml={1} variant="h5">Revoke Payment</Typography>
  281. </Button>
  282. <Button
  283. // size="large"
  284. variant="contained"
  285. onClick={complatedClick()}
  286. disabled={setCompleteDisable()}
  287. sx={{
  288. textTransform: 'capitalize',
  289. alignItems: 'end',
  290. backgroundColor: '#52b202'
  291. }}>
  292. <DoneIcon />
  293. <Typography ml={1} variant="h5">Publish</Typography>
  294. </Button>
  295. <Button
  296. // size="large"
  297. variant="contained"
  298. onClick={withdrawnClick()}
  299. sx={{
  300. textTransform: 'capitalize',
  301. alignItems: 'end',
  302. backgroundColor: '#ffa733'
  303. }}>
  304. <CloseIcon />
  305. <Typography ml={1} variant="h5">Withdraw</Typography>
  306. </Button>
  307. </> : null
  308. )
  309. }
  310. </Stack>
  311. </Grid>
  312. </Grid> : null
  313. }
  314. <Typography variant="h4" xs={12} md={12} sx={{ mb: 2, borderBottom: "1px solid black" }}>
  315. Application Details
  316. </Typography>
  317. <form>
  318. <Grid container direction="column">
  319. <Grid item xs={12} md={12}>
  320. <Grid container direction="row" justifyContent="flex-start"
  321. alignItems="center">
  322. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  323. <Grid container alignItems={"center"}>
  324. <Grid item xs={12} md={4} lg={4}
  325. sx={{ display: 'flex', alignItems: 'center' }}>
  326. <FormLabel><Typography variant="h5">Application No:</Typography></FormLabel>
  327. </Grid>
  328. <Grid item xs={12} md={8} lg={8}>
  329. <FormControl variant="outlined" fullWidth disabled >
  330. <OutlinedInput
  331. fullWidth
  332. size="small"
  333. {...register("appNo",
  334. {
  335. value: currentApplicationDetailData.appNo,
  336. })}
  337. id='appNo'
  338. sx={{
  339. "& .MuiInputBase-input.Mui-disabled": {
  340. WebkitTextFillColor: "#000000",
  341. background: "#f8f8f8",
  342. },
  343. }}
  344. />
  345. </FormControl>
  346. </Grid>
  347. </Grid>
  348. </Grid>
  349. <Grid item xs={12} sm={12} md={5.5} lg={5} sx={{ mb: 1 , ml: { md: 1, lg: 3 } }}>
  350. <Grid container alignItems={"center"}>
  351. <Grid item xs={12} md={4} lg={4}
  352. sx={{ display: 'flex', alignItems: 'center' }}>
  353. <FormLabel><Typography variant="h5">Status:</Typography></FormLabel>
  354. </Grid>
  355. <Grid item xs={12} md={8} lg={8}>
  356. <FormControl variant="outlined">
  357. {StatusUtils.getStatusByTextEng(currentApplicationDetailData.status, currentApplicationDetailData.creditor)}
  358. </FormControl>
  359. </Grid>
  360. </Grid>
  361. {
  362. currentApplicationDetailData.reason ?
  363. <Grid item xs={12} md={12} lg={12}>
  364. <Grid container alignItems={"center"} direction="row" >
  365. <Grid item xs={12} md={4} lg={4}>
  366. <FormLabel><Typography variant="h5">Reason:</Typography></FormLabel>
  367. </Grid>
  368. <Grid item xs={12} md={8} lg={8}>
  369. <FormLabel>
  370. <Typography id='reason' variant="pnspsFormParagraph">
  371. {currentApplicationDetailData.reason}
  372. </Typography>
  373. </FormLabel>
  374. </Grid>
  375. </Grid>
  376. </Grid>
  377. : ""
  378. }
  379. </Grid>
  380. </Grid>
  381. <Grid container direction="row" justifyContent="flex-start"
  382. alignItems="center">
  383. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  384. <Grid container alignItems={"center"}>
  385. <Grid item xs={12} md={4} lg={4}
  386. sx={{ display: 'flex', alignItems: 'center' }}>
  387. <FormLabel><Typography variant="h5">Applicant:</Typography></FormLabel>
  388. </Grid>
  389. <Grid item xs={12} md={8} lg={8}>
  390. <FormControl variant="outlined" fullWidth disabled >
  391. {currentApplicationDetailData.orgId === null ?
  392. <OutlinedInput
  393. fullWidth
  394. size="small"
  395. {...register("contactPerson",
  396. {
  397. value: currentApplicationDetailData.contactPerson,
  398. })}
  399. id='contactPerson'
  400. sx={{
  401. "& .MuiInputBase-input.Mui-disabled": {
  402. WebkitTextFillColor: "#000000",
  403. background: "#f8f8f8",
  404. },
  405. }}
  406. /> :
  407. <OutlinedInput
  408. fullWidth
  409. size="small"
  410. {...register("companyName",
  411. {
  412. value: companyName.enCompanyName,
  413. })}
  414. id='companyName'
  415. sx={{
  416. "& .MuiInputBase-input.Mui-disabled": {
  417. WebkitTextFillColor: "#000000",
  418. background: "#f8f8f8",
  419. },
  420. }}
  421. />
  422. }
  423. </FormControl>
  424. </Grid>
  425. </Grid>
  426. </Grid>
  427. <Grid item xs={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: { md: 1, lg: 3 } }}>
  428. <Grid container alignItems={"center"}>
  429. <Grid item xs={12} md={4} lg={4}
  430. sx={{ display: 'flex', alignItems: 'center' }}>
  431. <FormLabel><Typography variant="h5">Contact Phone:</Typography></FormLabel>
  432. </Grid>
  433. <Grid item xs={12} md={8} lg={8}>
  434. <Stack direction="row">
  435. <FormControl variant="outlined" sx={{ width: '25%', minWidth: 100, }} disabled >
  436. <OutlinedInput
  437. size="small"
  438. {...register("contactTelNo.countryCode",
  439. {
  440. value: currentApplicationDetailData.contactTelNo.countryCode,
  441. })}
  442. id='countryCode'
  443. sx={{
  444. "& .MuiInputBase-input.Mui-disabled": {
  445. WebkitTextFillColor: "#000000",
  446. background: "#f8f8f8",
  447. },
  448. mr: 1
  449. }}
  450. inputProps={{
  451. maxLength: 3,
  452. }}
  453. endAdornment={<InputAdornment position="end">-</InputAdornment>}
  454. />
  455. </FormControl>
  456. <FormControl variant="outlined" sx={{ width: '75%' }} disabled >
  457. <OutlinedInput
  458. size="small"
  459. type="tel"
  460. {...register("contactTelNo.phoneNumber",
  461. {
  462. value: currentApplicationDetailData.contactTelNo.phoneNumber,
  463. })}
  464. id='phoneNumber'
  465. sx={{
  466. "& .MuiInputBase-input.Mui-disabled": {
  467. WebkitTextFillColor: "#000000",
  468. background: "#f8f8f8",
  469. },
  470. }}
  471. inputProps={{
  472. maxLength: 11,
  473. }}
  474. />
  475. </FormControl>
  476. </Stack>
  477. </Grid>
  478. </Grid>
  479. </Grid>
  480. </Grid>
  481. <Grid container direction="row" justifyContent="flex-start"
  482. alignItems="center">
  483. <Grid item xs={12} md={6} lg={6} sx={{ mb: 1 }}>
  484. <Grid container alignItems={"center"}>
  485. <Grid item xs={12} md={4} lg={4}
  486. sx={{ display: 'flex', alignItems: 'center' }}>
  487. <FormLabel><Typography variant="h5">Contact Person:</Typography></FormLabel>
  488. </Grid>
  489. <Grid item xs={12} md={8} lg={8}>
  490. <FormControl variant="outlined" fullWidth disabled>
  491. <OutlinedInput
  492. fullWidth
  493. size="small"
  494. {...register("contactPerson",
  495. {
  496. value: currentApplicationDetailData.contactPerson,
  497. })}
  498. id='contactPerson'
  499. sx={{
  500. "& .MuiInputBase-input.Mui-disabled": {
  501. WebkitTextFillColor: "#000000",
  502. background: "#f8f8f8",
  503. },
  504. }}
  505. />
  506. </FormControl>
  507. </Grid>
  508. </Grid>
  509. </Grid>
  510. <Grid item xs={12} md={5.5} lg={5.5} sx={{ mb: 1, ml: { md: 1, lg: 3 } }}>
  511. <Grid container alignItems={"center"}>
  512. <Grid item xs={12} md={4} lg={4}
  513. sx={{ display: 'flex', alignItems: 'center' }}>
  514. <FormLabel><Typography variant="h5">Contact Fax:</Typography></FormLabel>
  515. </Grid>
  516. <Grid item xs={12} md={8} lg={8}>
  517. <Stack direction="row">
  518. <FormControl variant="outlined" sx={{ width: '25%', minWidth: 100, }} disabled>
  519. <OutlinedInput
  520. size="small"
  521. {...register("contactFaxNo.countryCode",
  522. {
  523. value: currentApplicationDetailData.contactFaxNo.countryCode,
  524. })}
  525. id='countryCode'
  526. sx={{
  527. "& .MuiInputBase-input.Mui-disabled": {
  528. WebkitTextFillColor: "#000000",
  529. background: "#f8f8f8",
  530. },
  531. mr: 1,
  532. }}
  533. inputProps={{
  534. maxLength: 3,
  535. type: "tel"
  536. }}
  537. endAdornment={<InputAdornment position="end">-</InputAdornment>}
  538. />
  539. </FormControl>
  540. <FormControl variant="outlined" sx={{ width: '75%' }} disabled>
  541. <OutlinedInput
  542. size="small"
  543. type="tel"
  544. {...register("contactFaxNo.faxNumber",
  545. {
  546. value: currentApplicationDetailData.contactFaxNo.faxNumber,
  547. })}
  548. id='faxNumber'
  549. sx={{
  550. "& .MuiInputBase-input.Mui-disabled": {
  551. WebkitTextFillColor: "#000000",
  552. background: "#f8f8f8",
  553. },
  554. }}
  555. inputProps={{
  556. maxLength: 8,
  557. }}
  558. />
  559. </FormControl>
  560. </Stack>
  561. </Grid>
  562. </Grid>
  563. </Grid>
  564. </Grid>
  565. <Grid container direction="row" justifyContent="flex-start"
  566. alignItems="center">
  567. <Grid item xs={12} md={12} lg={12} mt={1} >
  568. <Grid container alignItems={"center"}>
  569. <Grid item xs={12} md={12} lg={12}>
  570. <Grid container direction="row">
  571. <Grid item xs={12} md={2} lg={2}
  572. sx={{ display: 'flex', alignItems: 'center' }}>
  573. <FormLabel><Typography variant="h5" >Manuscript File:</Typography></FormLabel>
  574. </Grid>
  575. <Grid item xs={12} md={8} lg={8} sx={{ display: 'flex', alignItems: 'center' }}>
  576. <Grid container direction="row" justifyContent="flex-start">
  577. <Grid item xs={10} md={8} lg={8} sx={{ display: 'flex', alignItems: 'center' }}>
  578. <FormControl variant="outlined" fullWidth >
  579. <Typography
  580. // fullWidth
  581. id='fileName'
  582. variant="h5"
  583. sx={{ wordBreak: 'break-word' }}
  584. >
  585. {fileDetail?.filename}
  586. </Typography>
  587. </FormControl>
  588. </Grid>
  589. <Grid item md={2} lg={2}>
  590. <Button
  591. size="small"
  592. variant="contained"
  593. onClick={onDownloadClick()}
  594. disabled={!fileDetail?.filename}
  595. sx={{
  596. textTransform: 'capitalize',
  597. alignItems: 'end',
  598. }}>
  599. <DownloadIcon />
  600. </Button>
  601. </Grid>
  602. </Grid>
  603. </Grid>
  604. </Grid>
  605. </Grid>
  606. </Grid>
  607. </Grid>
  608. </Grid>
  609. <Grid container direction="row" justifyContent="space-start" alignItems="center">
  610. <Grid item xs={12} md={12} lg={12} sx={{ mb: 1, }}>
  611. <Grid container alignItems={"center"}>
  612. <Grid item xs={12} md={2} lg={2}
  613. sx={{ display: 'flex', alignItems: 'center' }}>
  614. <FormLabel><Typography variant="h5">Remarks:</Typography></FormLabel>
  615. </Grid>
  616. <Grid item xs={12} md={10} lg={10}>
  617. <Grid container direction="row" >
  618. <Grid item xs={12} md={9} lg={9} >
  619. <FormControl variant="outlined" fullWidth disabled >
  620. <OutlinedInput
  621. fullWidth
  622. size="small"
  623. {...register("gldRemarks",
  624. {
  625. value: currentApplicationDetailData.gldRemarks,
  626. })}
  627. id='appNo'
  628. sx={{
  629. "& .MuiInputBase-input.Mui-disabled": {
  630. WebkitTextFillColor: "#000000",
  631. background: "#f8f8f8",
  632. },
  633. }}
  634. />
  635. </FormControl>
  636. </Grid>
  637. <Grid item xs={12} ml={1} md={2} lg={2}>
  638. <Button
  639. // size="large"
  640. variant="contained"
  641. onClick={() => setRemarksPopUp(true)}
  642. sx={{
  643. textTransform: 'capitalize',
  644. alignItems: 'end',
  645. }}>
  646. <EditNoteIcon />
  647. <Typography ml={1} variant="h5"> Edit</Typography>
  648. </Button>
  649. </Grid>
  650. </Grid>
  651. </Grid>
  652. </Grid>
  653. </Grid>
  654. </Grid>
  655. </Grid>
  656. </Grid>
  657. </form>
  658. <div>
  659. <Dialog
  660. open={isWarningPopUp}
  661. onClose={() => setIsWarningPopUp(false)}
  662. PaperProps={{
  663. sx: {
  664. minWidth: '40vw',
  665. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  666. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  667. }
  668. }}
  669. >
  670. <DialogTitle><Typography variant="h3">Warning</Typography></DialogTitle>
  671. <DialogContent style={{ display: 'flex', }}>
  672. <Typography variant="h4" style={{ padding: '16px' }}>{warningText}</Typography>
  673. </DialogContent>
  674. <DialogActions>
  675. <Button onClick={() => setIsWarningPopUp(false)}><Typography variant="h5">OK</Typography></Button>
  676. </DialogActions>
  677. </Dialog>
  678. </div>
  679. <div>
  680. <Dialog
  681. open={remarksPopUp}
  682. onClose={() => setRemarksPopUp(false)}
  683. PaperProps={{
  684. sx: {
  685. minWidth: '40vw',
  686. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  687. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  688. }
  689. }}
  690. >
  691. <form onSubmit={handleSubmit(onSubmit)}>
  692. <DialogTitle><Typography variant="h3">Remarks</Typography></DialogTitle>
  693. <DialogContent style={{ display: 'flex', }}>
  694. <Grid container direction="column">
  695. <Grid item sx={{ padding: '16px' }}>
  696. <TextField
  697. fullWidth
  698. {...register("makeRemarks")}
  699. id='makeRemarks'
  700. // label="Remarks"
  701. defaultValue={currentApplicationDetailData.gldRemarks!=null?currentApplicationDetailData.gldRemarks:""}
  702. InputLabelProps={{
  703. shrink: true
  704. }}
  705. />
  706. </Grid>
  707. </Grid>
  708. </DialogContent>
  709. <DialogActions>
  710. <Stack direction="row" justifyContent="space-between">
  711. <Button onClick={() => setRemarksPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
  712. <Button type="submit"><Typography variant="h5">Save</Typography></Button>
  713. {/* <Button onClick={() => markAsCreditor()}><Typography variant="h5">Confirm</Typography></Button> */}
  714. </Stack>
  715. </DialogActions>
  716. </form>
  717. </Dialog>
  718. </div>
  719. </MainCard>
  720. );
  721. };
  722. export default ApplicationDetailCard;