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

723 行
50 KiB

  1. // material-ui
  2. import {
  3. Dialog, DialogTitle, DialogContent, DialogActions,
  4. Typography,
  5. Grid,
  6. Stack,
  7. TextField,
  8. FormLabel,
  9. Button,
  10. Checkbox,
  11. RadioGroup, Radio,
  12. FormControlLabel
  13. } from '@mui/material';
  14. import * as UrlUtils from "utils/ApiPathConst";
  15. import * as HttpUtils from "utils/HttpUtils";
  16. import FileList from "components/FileList"
  17. import MainCard from "components/MainCard";
  18. import * as React from "react";
  19. import * as yup from 'yup';
  20. import { useParams } from "react-router-dom";
  21. import { useFormik } from 'formik';
  22. import { useNavigate } from "react-router-dom";
  23. import * as DateUtils from "utils/DateUtils"
  24. import Loadable from 'components/Loadable';
  25. import { notifyActionSuccess } from 'utils/CommonFunction';
  26. import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
  27. import { ThemeProvider } from "@emotion/react";
  28. import { FormattedMessage, useIntl } from "react-intl";
  29. import {
  30. isDummyLoggedIn,
  31. checkIsOnlyOnlinePaymentByIssueDate
  32. } from "utils/Utils"
  33. const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable')));
  34. //import * as ProofStatus from "utils/statusUtils/ProofStatus";
  35. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  36. const FormPanel = ({ formData }) => {
  37. const intl = useIntl();
  38. const { locale } = intl;
  39. const [data, setData] = React.useState({});
  40. const [paymentMethod, set_paymentMethod] = React.useState("");
  41. const [attachments, setAttachments] = React.useState([]);
  42. const [actionValue, setActionValue] = React.useState(true);
  43. const [warningTitle, setWarningTitle] = React.useState("");
  44. const [isWarningPopUp, setIsWarningPopUp] = React.useState(false);
  45. const [warningText, setWarningText] = React.useState("");
  46. const [isOnlyOnlinePayment, setOnlyOnlinePayment] = React.useState();
  47. const navigate = useNavigate()
  48. const params = useParams();
  49. const dft = locale === 'en' ? "DD MMMM YYYY" : "YYYY年MM月DD日";
  50. const tabelStyle = {
  51. border: "2px solid gray",
  52. borderCollapse: "collapse",
  53. padding: "right"
  54. }
  55. React.useEffect(() => {
  56. if (formData) {
  57. setData(formData);
  58. setOnlyOnlinePayment(checkIsOnlyOnlinePaymentByIssueDate(formData.issueDate))
  59. if (isDummyLoggedIn()) {
  60. set_paymentMethod("demandNote")
  61. } else if (checkIsOnlyOnlinePaymentByIssueDate(formData.issueDate)){
  62. set_paymentMethod("online")
  63. }
  64. }
  65. }, [formData]);
  66. const formik = useFormik({
  67. enableReinitialize: true,
  68. initialValues: data,
  69. validationSchema: yup.object().shape({
  70. vaild: yup.string().max(255, intl.formatMessage({ id: 'requireLoginPassword' })).required(intl.formatMessage({ id: 'requireLoginPassword' })),
  71. }),
  72. onSubmit: values => {
  73. if (isOverTime() && !isDummyLoggedIn()) {
  74. setWarningTitle(intl.formatMessage({ id: "attention" }))
  75. setWarningText(intl.formatMessage({ id: 'MSG.proofOutOfTime' }));
  76. setIsWarningPopUp(true);
  77. return;
  78. }
  79. let pm = paymentMethod;
  80. if (!isDummyLoggedIn()) {
  81. if (actionValue == true && pm == "demandNote") {
  82. pm = isOverDnReviseDeadline() ? "" : pm;
  83. } else if (actionValue == true && pm == "office") {
  84. pm = isOverNpgoReviseDeadline() ? "" : pm;
  85. }
  86. }
  87. if (actionValue == false && isOverReviseDeadline() && !isDummyLoggedIn()) {
  88. setWarningTitle(intl.formatMessage({ id: "attention" }))
  89. setWarningText(intl.formatMessage({ id: 'MSG.overReviseDeadline' }));
  90. setIsWarningPopUp(true);
  91. return;
  92. }
  93. else if (actionValue == true && formData.creditor == false && pm == "") {
  94. setWarningTitle(intl.formatMessage({ id: "attention" }))
  95. setWarningText(intl.formatMessage({ id: 'MSG.plzSelectPaymentMethod' }));
  96. setIsWarningPopUp(true);
  97. return;
  98. }
  99. if (!actionValue) {
  100. if (!attachments || attachments.length <= 0) {
  101. setWarningTitle(intl.formatMessage({ id: "attention" }))
  102. setWarningText(intl.formatMessage({ id: 'requireFile' }));
  103. setIsWarningPopUp(true);
  104. return;
  105. }
  106. }
  107. // console.log(values);
  108. HttpUtils.postWithFiles({
  109. url: UrlUtils.REPLY_PROOF,
  110. params: {
  111. id: data.id,
  112. action: actionValue,
  113. vaild: values.vaild,
  114. paymentMethod: pm
  115. },
  116. files: attachments ? attachments : [],
  117. onSuccess: function (responseData) {
  118. // console.log(responseData)
  119. if (responseData.success === false) {
  120. navigate("/publicNotice/" + responseData.id);
  121. } else {
  122. if (responseData.msg) {
  123. setWarningTitle(intl.formatMessage({ id: "attention" }))
  124. setWarningText(intl.formatMessage({ id: responseData.msg }));
  125. setIsWarningPopUp(true);
  126. return;
  127. }
  128. if (actionValue == true && responseData.id == params.id) {
  129. notifyActionSuccess(intl.formatMessage({ id: "submitted" }))
  130. navigate("/proof/pay/" + params.id);
  131. } else {
  132. navigate("/proof/search");
  133. }
  134. }
  135. },
  136. onFail: function (response) {
  137. setWarningTitle(intl.formatMessage({ id: "attention" }))
  138. setWarningText(intl.formatMessage({ id: 'actionFail' }));
  139. setIsWarningPopUp(true);
  140. console.log(response);
  141. },
  142. onError: function (error) {
  143. setWarningTitle(intl.formatMessage({ id: "attention" }))
  144. setWarningText(intl.formatMessage({ id: 'actionFail' }));
  145. setIsWarningPopUp(true);
  146. console.log(error);
  147. }
  148. });
  149. }
  150. });
  151. const readFile = (event) => {
  152. let file = event.target.files[0];
  153. if (file) {
  154. if (!file.name.toLowerCase().substr(file.name.length - 4).includes(".pdf")) {
  155. setWarningTitle(intl.formatMessage({ id: "attention" }))
  156. setWarningText(intl.formatMessage({ id: 'requireValidFileWithPdfFormat' }));
  157. setIsWarningPopUp(true);
  158. document.getElementById("uploadFileBtn").value = "";
  159. return;
  160. }
  161. if (file.size >= (10 * 1024 * 1034)) {
  162. setWarningTitle(intl.formatMessage({ id: "attention" }))
  163. setWarningText(intl.formatMessage({ id: 'fileSizeWarning' }));
  164. setIsWarningPopUp(true);
  165. return;
  166. }
  167. file['id'] = attachments.length;
  168. setAttachments([
  169. ...attachments,
  170. file
  171. ]);
  172. document.getElementById("uploadFileBtn").value = "";
  173. }
  174. }
  175. const isOverTime = () => {
  176. let proofPaymentDeadline = DateUtils.convertToDate(formData?.proofPaymentDeadline);
  177. if (!proofPaymentDeadline) return true;
  178. let current = new Date();
  179. return current.getTime() > proofPaymentDeadline;
  180. }
  181. const isOverReviseDeadline = () => {
  182. // if (paymentMethod == "demandNote") return isOverDnReviseDeadline();
  183. // if (paymentMethod == "office") return isOverNpgoReviseDeadline();
  184. //online payment
  185. let reviseDeadline = DateUtils.convertToDate(formData?.reviseDeadline);
  186. // reviseDeadline?.setTime(reviseDeadline?.getTime() + (14 * 60 * 60 * 1000));// 14:00
  187. if (!reviseDeadline) return true;
  188. let current = new Date();
  189. return current.getTime() > reviseDeadline;
  190. }
  191. const isOverDnReviseDeadline = () => {
  192. let reviseDeadline = DateUtils.convertToDate(formData?.closingDateOff);
  193. reviseDeadline?.setTime(reviseDeadline?.getTime() + (17 * 60 * 60 * 1000));// 17:00
  194. if (!reviseDeadline) return true;
  195. let current = new Date();
  196. return current.getTime() > reviseDeadline;
  197. }
  198. const isOverNpgoReviseDeadline = () => {
  199. let reviseDeadline = DateUtils.convertToDate(formData?.closingDate);
  200. reviseDeadline?.setTime(reviseDeadline?.getTime() + (12 * 60 * 60 * 1000));// 12:00
  201. if (!reviseDeadline) return true;
  202. let current = new Date();
  203. return current.getTime() > reviseDeadline;
  204. }
  205. return (
  206. <MainCard xs={12} sm={12} md={12} lg={12}
  207. border={false}
  208. content={false}>
  209. <Typography variant="h4" sx={{ textAlign: "left", mb: 2, borderBottom: "1px solid black" }}>
  210. <FormattedMessage id="publicNoticePaymentProofComment" />
  211. </Typography>
  212. <form onSubmit={formik.handleSubmit}>
  213. {
  214. formik.values.replyDate ?
  215. <Grid container direction="column" sx={{ paddingLeft: 0, paddingRight: 0 }}>
  216. <Grid item xs={12} sm={12} md={12} lg={8} textAlign="left">
  217. <Typography variant="h5">
  218. <FormattedMessage id="proofReplyDate" /> :&nbsp;
  219. {
  220. locale === 'en' ?
  221. DateUtils.datetimeStr(formik.values.replyDate)
  222. :
  223. DateUtils.datetimeStr_Cht(formik.values.replyDate)
  224. }
  225. </Typography>
  226. </Grid>
  227. <Grid item xs={12} md={12} textAlign="left">
  228. <Typography variant="h5">
  229. <FormattedMessage id="proofReply" /> : {formik.values.action ?
  230. (<span style={{ color: 'green' }}>
  231. <FormattedMessage id="proofErrorFree" />
  232. </span>)
  233. :
  234. (<span style={{ color: 'red' }}>
  235. <FormattedMessage id="proofWithError" />
  236. </span>)}
  237. </Typography>
  238. </Grid>
  239. {/* <Grid item xs={12} md={12} textAlign="left">
  240. <Typography variant="h5">
  241. <FormattedMessage id="proofReply" /> :&nbsp;
  242. <span style={{ color: 'green' }}>
  243. {
  244. locale === 'en' ?
  245. ProofStatus.getStatusText_Eng(formik.values).text
  246. :
  247. ProofStatus.getStatusText_Cht(formik.values).text
  248. }
  249. </span>
  250. </Typography>
  251. </Grid> */}
  252. {
  253. formik.values.action ?
  254. null
  255. :
  256. <Grid item xs={12} md={12} textAlign="left" sx={{ width: '95%', maxWidth: { xs: '70vw', sm: '72vw', md: '75vw', lg: '80vw' } }}>
  257. <FileList
  258. lang="ch"
  259. refId={params.id}
  260. refType={"proofReply"}
  261. dateHideable={true}
  262. disablePagination
  263. disableSelectionOnClick
  264. disableColumnMenu
  265. disableColumnSelector
  266. hideFooter
  267. />
  268. </Grid>
  269. }
  270. </Grid>
  271. :
  272. (
  273. isOverTime() ?
  274. <Grid container direction="column" sx={{ paddingLeft: 0, paddingRight: 0 }} spacing={1}>
  275. <Grid item xs={12} md={12} textAlign="left">
  276. <Typography variant="h5"><FormattedMessage id="MSG.proofOutOfTime" /></Typography>
  277. </Grid>
  278. </Grid>
  279. :
  280. <Grid container direction="column" sx={{ paddingLeft: 0, paddingRight: 0 }} spacing={1}>
  281. <Grid item xs={12} md={12}>
  282. <RadioGroup
  283. aria-labelledby="demo-radio-buttons-group-label"
  284. id="action"
  285. name="action"
  286. defaultValue={true}
  287. onChange={(event) => {
  288. setActionValue(event.target.value === "true" ? true : false);
  289. }}
  290. >
  291. <FormControlLabel value={true} control={<Radio />} label={intl.formatMessage({ id: 'proofErrorFree' })} />
  292. <FormControlLabel value={false} control={<Radio />} label={intl.formatMessage({ id: 'proofWithError' })} />
  293. </RadioGroup>
  294. </Grid>
  295. {
  296. actionValue && formData.creditor == false ?
  297. isDummyLoggedIn() ?
  298. <Grid item xs={12} sx={{ mb: 1, }}>
  299. <table style={tabelStyle}>
  300. <tbody>
  301. <tr style={tabelStyle}>
  302. <th style={tabelStyle} width="50" align="left"></th>
  303. <th style={tabelStyle} width="300" align="left"><FormattedMessage id="paymentMeans" /></th>
  304. <th style={tabelStyle} width="300" align="left"><FormattedMessage id="commentDeadline" /></th>
  305. <th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th>
  306. <th style={tabelStyle} width="400" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th>
  307. </tr>
  308. <tr>
  309. <td style={tabelStyle}>
  310. <Checkbox
  311. checked={paymentMethod == "demandNote"}
  312. onChange={() => {
  313. set_paymentMethod("demandNote")
  314. }}
  315. />
  316. </td>
  317. <td style={tabelStyle}>
  318. <FormattedMessage id="paymentMeans" />: <FormattedMessage id="payDn" />
  319. <br /><a href="#payOnlineDetails" color='#fff' onClick={() => {
  320. setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" }))
  321. setWarningText(
  322. <><FormattedMessage id="paymentMethodMeans" />:
  323. <ul>
  324. <li><FormattedMessage id="atm" /></li>
  325. <li><FormattedMessage id="pps" /></li>
  326. <li><FormattedMessage id="eBank" /></li>
  327. <li><FormattedMessage id="phoneBank" /></li>
  328. <li><FormattedMessage id="eCheque" /></li>
  329. <li><FormattedMessage id="fps" /></li>
  330. <li><FormattedMessage id="hkpo" /></li>
  331. <li><FormattedMessage id="store" /></li>
  332. <li><FormattedMessage id="post" /></li>
  333. </ul>
  334. <Typography variant="h6">
  335. <div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} />
  336. </Typography>
  337. </>
  338. );
  339. setIsWarningPopUp(true);
  340. }}><u><FormattedMessage id="viewDetail" /></u></a>
  341. </td>
  342. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m.</td>
  343. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} 5:00 p.m.</td>
  344. <td style={tabelStyle}>
  345. <FormattedMessage id="payDnRemark" values={{
  346. date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))
  347. }} />
  348. </td>
  349. </tr>
  350. <tr>
  351. <td style={tabelStyle}>
  352. <Checkbox
  353. checked={paymentMethod == "office"}
  354. onChange={() => {
  355. set_paymentMethod("office")
  356. }}
  357. />
  358. </td>
  359. <td style={tabelStyle}>
  360. <FormattedMessage id="payNPGO" />
  361. <br /><a href="#payOnlineDetails" color='#fff' onClick={() => {
  362. setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" }))
  363. setWarningText(
  364. <><FormattedMessage id="paymentMethodMeans" />:
  365. <ul>
  366. <li><FormattedMessage id="cheque" /></li>
  367. <li><FormattedMessage id="drafts" /></li>
  368. <li><FormattedMessage id="cashierOrders" /></li>
  369. <li><FormattedMessage id="cash" /></li>
  370. </ul>
  371. </>
  372. );
  373. setIsWarningPopUp(true);
  374. }}><u><FormattedMessage id="viewDetail" /></u></a>
  375. </td>
  376. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 11:30 a.m.</td>
  377. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} 12:00 p.m.</td>
  378. <td style={tabelStyle}>
  379. <FormattedMessage id="payNPGORemark" values={{
  380. date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))
  381. }} />
  382. </td>
  383. </tr>
  384. </tbody>
  385. </table>
  386. </Grid> :
  387. <>
  388. <Grid item xs={12} sx={{ mb: 1, }}>
  389. <table style={tabelStyle}>
  390. <tbody>
  391. <tr style={tabelStyle}>
  392. <th style={tabelStyle} width="50" align="left"></th>
  393. <th style={tabelStyle} width="300" align="left"><FormattedMessage id="paymentMeans" /></th>
  394. <th style={tabelStyle} width="300" align="left"><FormattedMessage id="commentDeadline" /></th>
  395. <th style={tabelStyle} width="300" align="left"><FormattedMessage id="confirmingDealine" /></th>
  396. <th style={tabelStyle} width="400" align="left"><FormattedMessage id="PaymentCoonpletDealine" /></th>
  397. </tr>
  398. <tr>
  399. <td style={tabelStyle}>
  400. <Checkbox
  401. checked={paymentMethod == "online"}
  402. onChange={() => {
  403. set_paymentMethod("online")
  404. }}
  405. />
  406. </td>
  407. <td style={tabelStyle}>
  408. <FormattedMessage id="payOnline" />
  409. <br /><a href="#payOnlineDetails" color='#fff' onClick={() => {
  410. setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payOnline" }))
  411. setWarningText(
  412. <><FormattedMessage id="paymentMethodMeans" />:
  413. <ul>
  414. <li><FormattedMessage id="fps" /></li>
  415. <li><FormattedMessage id="card" /></li>
  416. <li><FormattedMessage id="pps" /></li>
  417. </ul>
  418. </>
  419. );
  420. setIsWarningPopUp(true);
  421. }}><u><FormattedMessage id="viewDetail" /></u></a>
  422. </td>
  423. <td style={tabelStyle}>{
  424. locale === 'en' ?
  425. `${DateUtils.dateFormat(formData.reviseDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
  426. :
  427. `${DateUtils.dateFormat(formData.reviseDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
  428. }</td>
  429. <td style={tabelStyle}>{
  430. locale === 'en' ?
  431. `${DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
  432. :
  433. `${DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "datetimeFormate" }))?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
  434. }</td>
  435. <td style={tabelStyle}>
  436. <FormattedMessage id="payOnlineRemark" values={{
  437. date: DateUtils.dateFormat(formData.proofPaymentDeadline, dft)
  438. }} />
  439. </td>
  440. </tr>
  441. {!isOnlyOnlinePayment?
  442. <>
  443. <tr>
  444. <td style={tabelStyle}>
  445. {isOverDnReviseDeadline() ?
  446. <></> :
  447. <Checkbox
  448. checked={paymentMethod == "demandNote"}
  449. onChange={() => {
  450. set_paymentMethod("demandNote")
  451. }}
  452. />
  453. }
  454. </td>
  455. <td style={tabelStyle}>
  456. <FormattedMessage id="payDn" />
  457. <br /><a href="#payOnlineDetails" color='#fff' onClick={() => {
  458. setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payDn" }))
  459. setWarningText(
  460. <><FormattedMessage id="paymentMethodMeans" />:
  461. <ul>
  462. <li><FormattedMessage id="atm" /></li>
  463. <li><FormattedMessage id="pps" /></li>
  464. <li><FormattedMessage id="eBank" /></li>
  465. <li><FormattedMessage id="phoneBank" /></li>
  466. <li><FormattedMessage id="eCheque" /></li>
  467. <li><FormattedMessage id="fps" /></li>
  468. <li><FormattedMessage id="hkpo" /></li>
  469. <li><FormattedMessage id="store" /></li>
  470. <li><FormattedMessage id="post" /></li>
  471. </ul>
  472. <Typography variant="h6">
  473. <div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} />
  474. </Typography>
  475. </>
  476. );
  477. setIsWarningPopUp(true);
  478. }}><u><FormattedMessage id="viewDetail" /></u></a>
  479. </td>
  480. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td>
  481. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDateOff, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"5:00 p.m.":"下午5時"}</td>
  482. <td style={tabelStyle}>
  483. <FormattedMessage id="payDnRemark" values={{
  484. date: DateUtils.dateFormat(formData.proofPaymentDeadline, intl.formatMessage({ id: "dateStrFormat" }))
  485. }} />
  486. </td>
  487. </tr>
  488. <tr>
  489. <td style={tabelStyle}>
  490. {
  491. isOverNpgoReviseDeadline() ?
  492. <></> :
  493. <Checkbox
  494. checked={paymentMethod == "office"}
  495. onChange={() => {
  496. set_paymentMethod("office")
  497. }}
  498. />
  499. }
  500. </td>
  501. <td style={tabelStyle}>
  502. <FormattedMessage id="payNPGO" />
  503. <br /><a href="#payOnlineDetails" color='#fff' onClick={() => {
  504. setWarningTitle(intl.formatMessage({ id: "paymentMeans" }) + ": " + intl.formatMessage({ id: "payNPGOPopUpTitle" }))
  505. setWarningText(
  506. <><FormattedMessage id="paymentMethodMeans" />:
  507. <ul>
  508. <li><FormattedMessage id="cheque" /></li>
  509. <li><FormattedMessage id="drafts" /></li>
  510. <li><FormattedMessage id="cashierOrders" /></li>
  511. <li><FormattedMessage id="cash" /></li>
  512. </ul>
  513. </>
  514. );
  515. setIsWarningPopUp(true);
  516. }}><u><FormattedMessage id="viewDetail" /></u></a>
  517. </td>
  518. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"11:30 a.m.":"上午11時30分"}</td>
  519. <td style={tabelStyle}>{DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))} {locale ==='en'?"12:00 p.m.":"下午12時"}</td>
  520. <td style={tabelStyle}>
  521. <FormattedMessage id="payNPGORemark" values={{
  522. date: DateUtils.dateFormat(formData.closingDate, intl.formatMessage({ id: "dateStrFormat" }))
  523. }} />
  524. </td>
  525. </tr>
  526. </>:null
  527. }
  528. </tbody>
  529. </table>
  530. </Grid>
  531. {/* <Grid item xs={12}>
  532. <Typography variant="h6" height="100%" >
  533. <div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofNote" }) }} />
  534. </Typography>
  535. </Grid> */}
  536. <Grid item xs={12}>
  537. <Typography variant="h6" height="100%" >
  538. <div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "proofImportant" }) }} />
  539. </Typography>
  540. </Grid>
  541. </>
  542. :
  543. actionValue ?
  544. <></>
  545. :
  546. <>
  547. {
  548. isOverReviseDeadline() ?
  549. <Grid item xs={12} md={12} textAlign="left">
  550. <Typography variant="h5" style={{ color: "red" }}>
  551. <FormattedMessage id="MSG.overReviseDeadline" />
  552. </Typography>
  553. </Grid>
  554. :
  555. <>
  556. <Grid item xs={12} md={12} textAlign="left">
  557. <Typography variant="h5">
  558. <FormattedMessage id="requiredUploadFix" />:
  559. </Typography>
  560. </Grid>
  561. <Grid item xs={12} md={12} textAlign="left">
  562. <input
  563. id="uploadFileBtn"
  564. name="file"
  565. type="file"
  566. accept=".pdf"
  567. style={{ display: 'none' }}
  568. disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
  569. onChange={(event) => {
  570. readFile(event)
  571. }}
  572. />
  573. <label htmlFor="uploadFileBtn">
  574. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  575. <Button
  576. color="save"
  577. component="span"
  578. variant="contained"
  579. aria-label={intl.formatMessage({ id: 'upload' })}
  580. disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)}
  581. >
  582. <FormattedMessage id="upload" />
  583. </Button>
  584. </ThemeProvider>
  585. </label>
  586. </Grid>
  587. <Grid item xs={12} sm={12} md={12} lg={12} textAlign="left" sx={{ width: '95%', maxWidth: { xs: '70vw', sm: '72vw', md: '75vw', lg: '80vw' } }} >
  588. <UploadFileTable key="uploadTable" recordList={attachments} setRecordList={setAttachments} />
  589. </Grid>
  590. </>
  591. }
  592. </>
  593. }
  594. {
  595. actionValue == false && isOverReviseDeadline() ?
  596. <></>
  597. :
  598. <Grid item xs={12} sm={12} md={12} lg={12}>
  599. <Stack direction="row" alignItems="center">
  600. <FormLabel sx={{ paddingRight: 2, paddingBottom: 3, textAlign: "center" }}>
  601. <Typography variant="h5">
  602. <FormattedMessage id="sign" />:
  603. </Typography>
  604. </FormLabel>
  605. <TextField
  606. fullWidth
  607. type="password"
  608. onChange={formik.handleChange}
  609. name="vaild"
  610. variant="outlined"
  611. error={Boolean(formik.errors["vaild"])}
  612. helperText={formik.errors["vaild"] ? formik.errors["vaild"] : ' '}
  613. placeholder={intl.formatMessage({ id: 'requireLoginPassword' })}
  614. sx={
  615. {
  616. "& .MuiInputBase-input.Mui-disabled": {
  617. WebkitTextFillColor: "#000000",
  618. background: "#f8f8f8",
  619. },
  620. width: '70%'
  621. }
  622. }
  623. />
  624. </Stack>
  625. </Grid>
  626. }
  627. <Grid item xs={12} md={12} textAlign="left">
  628. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  629. <Button
  630. variant="contained"
  631. color="success"
  632. type="submit"
  633. disabled={actionValue == false && isOverReviseDeadline()}
  634. aria-label={intl.formatMessage({ id: 'submitReply' })}
  635. >
  636. <FormattedMessage id="submitReply" />
  637. </Button>
  638. </ThemeProvider>
  639. </Grid>
  640. </Grid>
  641. )
  642. }
  643. </form>
  644. <div>
  645. <Dialog
  646. open={isWarningPopUp}
  647. onClose={() => setIsWarningPopUp(false)}
  648. PaperProps={{
  649. sx: {
  650. minWidth: '40vw',
  651. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  652. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  653. }
  654. }}
  655. >
  656. <DialogTitle>
  657. {warningTitle}
  658. </DialogTitle>
  659. <DialogContent style={{ display: 'flex', }}>
  660. <Typography variant="h5" style={{ padding: '16px' }}>{warningText}</Typography>
  661. </DialogContent>
  662. <DialogActions>
  663. <Button
  664. aria-label={intl.formatMessage({ id: 'close' })}
  665. onClick={() => setIsWarningPopUp(false)}
  666. >
  667. <FormattedMessage id="close" />
  668. </Button>
  669. </DialogActions>
  670. </Dialog>
  671. </div>
  672. </MainCard>
  673. );
  674. };
  675. export default FormPanel;