Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

676 wiersze
34 KiB

  1. // material-ui
  2. import {
  3. Grid, Button, Checkbox, FormControlLabel, Typography,
  4. Dialog, DialogTitle, DialogContent, DialogActions,
  5. FormHelperText, TextField, CircularProgress,
  6. } from '@mui/material';
  7. // import { FormControlLabel } from '@material-ui/core';
  8. import MainCard from "components/MainCard";
  9. import * as React from "react";
  10. import { useFormik } from 'formik';
  11. import { useForm } from "react-hook-form";
  12. import * as yup from 'yup';
  13. import { useEffect, useState, lazy } from "react";
  14. import * as DateUtils from 'utils/DateUtils';
  15. import * as HttpUtils from 'utils/HttpUtils';
  16. import * as UrlUtils from "utils/ApiPathConst";
  17. import {checkMarkAsCreditClient} from 'utils/Utils';
  18. import * as FieldUtils from "utils/FieldUtils";
  19. import * as ComboData from "utils/ComboData";
  20. const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
  21. import Loadable from 'components/Loadable';
  22. import { notifySaveSuccess } from 'utils/CommonFunction';
  23. import { useIntl } from "react-intl";
  24. import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
  25. import { ThemeProvider } from "@emotion/react";
  26. import { isGrantedAny } from "auth/utils";
  27. import { DatePicker } from "@mui/x-date-pickers/DatePicker";
  28. import dayjs from "dayjs";
  29. import { DemoItem } from "@mui/x-date-pickers/internals/demo";
  30. import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
  31. import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
  32. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  33. const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
  34. const intl = useIntl();
  35. const [creditorConfirmPopUp, setCreditorConfirmPopUp] = React.useState(false);
  36. const [nonCreditorConfirmPopUp, setNonCreditorConfirmPopUp] = React.useState(false);
  37. const [afterSendPopUp, setAfterSendPopUp] = React.useState(false);
  38. const [currentUserData, setCurrentUserData] = useState({});
  39. const [overduePublicNotice, setOverduePublicNotice] = useState(0);
  40. const [editMode, setEditMode] = useState(false);
  41. const [createMode, setCreateMode] = useState(false);
  42. const [onReady, setOnReady] = useState(false);
  43. const [errorMsg, setErrorMsg] = useState("");
  44. const [minDate] = React.useState(new Date().setDate(new Date().getDate() + 1));
  45. const [fromDate, setFromDate] = React.useState(null);
  46. const [currentFromDate, setCurrentFromDate] = React.useState(null);
  47. const [fromDateValue, setFromDateValue] = React.useState(null);
  48. const { register, handleSubmit, reset } = useForm()
  49. React.useEffect(() => {
  50. setFromDateValue(fromDate);
  51. }, [fromDate]);
  52. useEffect(() => {
  53. //if state data are ready and assign to different field
  54. // console.log(currentApplicationDetailData)
  55. if (Object.keys(currentUserData).length > 0) {
  56. // console.log(currentUserData)
  57. if (DateUtils.dateValue(currentUserData.brExpiryDate) > DateUtils.dateValue(minDate)) {
  58. setFromDate(currentUserData.brExpiryDate);
  59. } else {
  60. setCurrentFromDate(currentUserData.brExpiryDate);
  61. // setErrorMsg("Please select a date after today.")
  62. }
  63. setOnReady(true);
  64. }
  65. }, [currentUserData]);
  66. function displayErrorMsg(errorMsg) {
  67. return <Typography variant="errorMessage1">{errorMsg}</Typography>
  68. }
  69. function getMaxErrStr(num, fieldname) {
  70. return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: fieldname ? intl.formatMessage({ id: fieldname }) + ": " : "" }));
  71. }
  72. function getRequiredErrStr(fieldname) {
  73. return displayErrorMsg(intl.formatMessage({ id: 'require' }, { fieldname: fieldname ? intl.formatMessage({ id: fieldname }) : "" }));
  74. }
  75. const formik = useFormik({
  76. enableReinitialize: true,
  77. initialValues: currentUserData,
  78. validationSchema: yup.object().shape({
  79. enCompanyName: yup.string().max(255, getMaxErrStr(255)).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireEnglishName' }))),
  80. chCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' }))).nullable(),
  81. orgShortName: yup.string().max(24, getMaxErrStr(24)).required(getRequiredErrStr("orgShortName")),
  82. addressLine1: yup.string().max(40, getMaxErrStr(40)).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))),
  83. addressLine2: yup.string().max(40, getMaxErrStr(40)),
  84. addressLine3: yup.string().max(40, getMaxErrStr(40)),
  85. contactPerson: yup.string().max(60, getMaxErrStr(60)).required(getRequiredErrStr("contactPerson")),
  86. fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))).nullable(),
  87. tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))),
  88. phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requiredValidNumber' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))),
  89. faxNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'require8Number' }))).nullable(),
  90. brExpiryDate: yup.string().min(8).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }))),
  91. brNo: yup.string().required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertNumber' }))).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInValidBusinessRegCertNumber' }))), function (value) {
  92. var brNo_pattern = /[0-9]{8}/
  93. if (value !== undefined) {
  94. if (value.match(brNo_pattern)) {
  95. return true
  96. } else {
  97. return false
  98. }
  99. }
  100. }),
  101. }),
  102. onSubmit: (values) => {
  103. if (values.country == null) {
  104. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' }))
  105. return;
  106. }
  107. if (values.country.type == "hongKong" && values.district == null) {
  108. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' }))
  109. return;
  110. }
  111. if (fromDateValue == null) {
  112. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }))
  113. return;
  114. }
  115. const sentDateFrom = DateUtils.dateValue(fromDateValue);
  116. return new Promise((resolve, reject) => {
  117. HttpUtils.post({
  118. url: UrlUtils.POST_ORG_SAVE_PATH,
  119. params: {
  120. id: id > 0 ? id : null,
  121. enCompanyName: values.enCompanyName,
  122. chCompanyName: values.chCompanyName,
  123. orgShortName: values.orgShortName === "N/A" ? "" : values.orgShortName,
  124. brNo: values.brNo,
  125. brExpiryDate: sentDateFrom,
  126. enCompanyNameTemp: values.enCompanyNameTemp,
  127. chCompanyNameTemp: values.chCompanyNameTemp,
  128. brExpiryDateTemp: values.brExpiryDateTemp,
  129. contactPerson: values.contactPerson,
  130. contactTel: {
  131. countryCode: values.tel_countryCode,
  132. phoneNumber: values.phoneNumber
  133. },
  134. faxNo: {
  135. countryCode: values.fax_countryCode,
  136. faxNumber: values.faxNumber
  137. },
  138. addressTemp: {
  139. country: values.country.type,
  140. district: values.district?.type,
  141. addressLine1: values.addressLine1,
  142. addressLine2: values.addressLine2,
  143. addressLine3: values.addressLine3,
  144. },
  145. creditor: values.creditor,
  146. },
  147. onSuccess: function () {
  148. notifySaveSuccess()
  149. loadDataFun();
  150. setEditMode(false);
  151. resolve();
  152. },
  153. onFail: () => reject(),
  154. onError: () => reject(),
  155. });
  156. });
  157. }
  158. });
  159. useEffect(() => {
  160. setEditModeFun(editMode);
  161. }, [editMode]);
  162. useEffect(() => {
  163. if (Object.keys(userData).length > 0) {
  164. setCreateMode(id <= 0);
  165. setEditMode(id <= 0);
  166. setCurrentUserData(userData);
  167. }
  168. }, [userData]);
  169. // useEffect(() => {
  170. // if (Object.keys(userData).length > 0) {
  171. // if(userData.creditor === undefined||userData.creditor === null){
  172. // userData.creditor = false
  173. // }
  174. // setCurrentUserData(userData);
  175. // }
  176. // }, []);
  177. const onEditClick = () => {
  178. setEditMode(true);
  179. };
  180. const onSubmit = (data) => {
  181. let sentOrgShortName = "";
  182. if (data.orgShortName != null && data.orgShortName != "" && data.orgShortName != "N/A") {
  183. sentOrgShortName = data.orgShortName
  184. if (sentOrgShortName.length <= 24) {
  185. const temp = {
  186. orgShortName: sentOrgShortName,
  187. };
  188. markAsCreditor(temp);
  189. } else {
  190. alert("Organisation Short Name must not exceed 24 characters.")
  191. }
  192. } else {
  193. alert("Please enter Organisation Short Name for Demand Note.")
  194. }
  195. };
  196. function resetForm() {
  197. reset();
  198. }
  199. const markAsCreditor = (temp) => {
  200. setCreditorConfirmPopUp(false);
  201. HttpUtils.post({
  202. url: UrlUtils.GET_ORG_MARK_AS_CREDITOR + "/" + id,
  203. params: temp,
  204. onSuccess: () => {
  205. resetForm();
  206. loadDataFun();
  207. }
  208. });
  209. }
  210. const markAsNonCreditor = () => {
  211. setNonCreditorConfirmPopUp(false);
  212. HttpUtils.post({
  213. url: UrlUtils.GET_ORG_MARK_AS_NON_CREDITOR + "/" + id,
  214. onSuccess: () => {
  215. loadDataFun();
  216. }
  217. });
  218. }
  219. const sendDn_Overdue = () => {
  220. setNonCreditorConfirmPopUp(false);
  221. HttpUtils.post({
  222. url: UrlUtils.GET_SEND_OVERDUE_CREDITOR_LIST + "/" + id,
  223. onSuccess: (responseData) => {
  224. setOverduePublicNotice(responseData.overduePublicNotice);
  225. setAfterSendPopUp(true);
  226. }
  227. });
  228. }
  229. return (
  230. <MainCard elevation={0}
  231. border={false}
  232. content={false}
  233. >
  234. <form onSubmit={formik.handleSubmit} style={{ padding: 24 }}>
  235. {/*top*/}
  236. {isGrantedAny("MAINTAIN_ORG") ?
  237. <Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center">
  238. <Grid container maxWidth justifyContent="flex-start">
  239. {editMode ?
  240. <>
  241. {createMode ?
  242. <>
  243. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  244. <Grid item sx={{ ml: 0, mr: 3 }}>
  245. <Button
  246. variant="contained"
  247. type="submit"
  248. color="success"
  249. disabled={formik.isSubmitting}
  250. startIcon={formik.isSubmitting ? <CircularProgress color="inherit" size={18} /> : null}
  251. >
  252. Create
  253. </Button>
  254. </Grid>
  255. </ThemeProvider>
  256. </> :
  257. <>
  258. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  259. <Grid item sx={{ ml: 0, mr: 3 }}>
  260. <Button
  261. variant="contained"
  262. onClick={loadDataFun}
  263. color="cancel"
  264. >
  265. Reset & Back
  266. </Button>
  267. </Grid>
  268. <Grid item sx={{ ml: 3, mr: 3 }}>
  269. <Button
  270. variant="contained"
  271. type="submit"
  272. color="success"
  273. disabled={formik.isSubmitting}
  274. startIcon={formik.isSubmitting ? <CircularProgress color="inherit" size={18} /> : null}
  275. >
  276. Save
  277. </Button>
  278. </Grid>
  279. </ThemeProvider>
  280. </>
  281. }
  282. </>
  283. :
  284. <>
  285. <Grid item sx={{ ml: 0, mr: 3 }}>
  286. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  287. <Button
  288. variant="contained"
  289. onClick={onEditClick}
  290. color="success"
  291. >
  292. Edit
  293. </Button>
  294. </ThemeProvider>
  295. </Grid>
  296. {
  297. currentUserData.creditor ?
  298. !checkMarkAsCreditClient()?
  299. <Grid item sx={{ ml: 3, mr: 3 }}>
  300. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  301. <Button
  302. variant="contained"
  303. color="error"
  304. onClick={() => setNonCreditorConfirmPopUp(true)}
  305. >
  306. Mark as Non-Credit Client
  307. </Button>
  308. </ThemeProvider>
  309. </Grid>:null
  310. :
  311. <>
  312. {!checkMarkAsCreditClient()?
  313. <Grid item sx={{ ml: 3, mr: 3 }}>
  314. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  315. <Button
  316. variant="contained"
  317. color="orange"
  318. onClick={() => setCreditorConfirmPopUp(true)}
  319. >
  320. Mark as Credit Client
  321. </Button>
  322. </ThemeProvider>
  323. </Grid>:null
  324. }
  325. { isGrantedAny("MAINTAIN_DEMANDNOTE")?
  326. <Grid item sx={{ ml: 3, mr: 3 }}>
  327. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  328. <Button
  329. variant="contained"
  330. color="primary"
  331. onClick={() => sendDn_Overdue(true)}
  332. >
  333. Generate O&#47;S DN List
  334. </Button>
  335. </ThemeProvider>
  336. </Grid> : null
  337. }
  338. </>
  339. }
  340. </>
  341. }
  342. </Grid>
  343. </Grid>
  344. : <></>
  345. }
  346. {/*top*/}
  347. {!onReady ?
  348. <LoadingComponent />
  349. :
  350. <Grid container spacing={1}>
  351. <Grid item xs={12}>
  352. <Typography variant="h4" sx={{ mb: 2, mr: 3, borderBottom: "1px solid black" }}>
  353. Organisation Details
  354. </Typography>
  355. </Grid>
  356. <Grid item xs={12}>
  357. <FormHelperText error id="helper-text-address1-signup">
  358. <Typography variant="errorMessage1">
  359. {errorMsg}
  360. </Typography>
  361. </FormHelperText>
  362. </Grid>
  363. <Grid item xs={12} lg={4} >
  364. {FieldUtils.getTextField({
  365. label: FieldUtils.notNullFieldLabel("BR No.:"),
  366. valueName: "brNo",
  367. disabled: (!editMode && !createMode),
  368. form: formik
  369. })}
  370. </Grid>
  371. {!checkMarkAsCreditClient()?
  372. <Grid item xs={12} lg={4} >
  373. <FormControlLabel
  374. control={<Checkbox checked={formik.values.creditor} />}
  375. label="is Credit Client"
  376. name="creditor"
  377. onChange={() => {
  378. formik.setFieldValue("creditor", !formik.values.creditor);
  379. }}
  380. disabled={true}
  381. //disabled={!editMode && !createMode}
  382. />
  383. </Grid>:null
  384. }
  385. <Grid item xs={12} lg={4} ></Grid>
  386. <Grid item xs={12} lg={4} >
  387. {FieldUtils.getTextField({
  388. label: FieldUtils.notNullFieldLabel("Name (Eng):"),
  389. valueName: "enCompanyName",
  390. disabled: (!editMode && !createMode),
  391. form: formik
  392. })}
  393. </Grid>
  394. <Grid item xs={12} lg={4} >
  395. {FieldUtils.getTextField({
  396. label: "Name (Ch):",
  397. valueName: "chCompanyName",
  398. disabled: (!editMode && !createMode),
  399. form: formik
  400. })}
  401. </Grid>
  402. <Grid item xs={12} lg={4} >
  403. <Grid container alignItems={"center"}>
  404. <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
  405. <Typography variant="pnspsFormParagraphBold">{FieldUtils.notNullFieldLabel("Expiry Date:")}</Typography>
  406. </Grid>
  407. <Grid item xs={12} md={6} lg={6}>
  408. {(!editMode && !createMode) ?
  409. <TextField
  410. fullWidth
  411. id="currentExDate"
  412. // error={(fromDate===null)}
  413. // type="date"
  414. name="currentExDate"
  415. value={fromDate != null ? DateUtils.dateStr(fromDate) : DateUtils.dateStr(currentFromDate)}
  416. disabled={true}
  417. /> :
  418. <LocalizationProvider dateAdapter={AdapterDayjs} localeText={DateUtils.getPickerLocaleText(intl.locale)}>
  419. <DemoItem components={['DatePicker']}>
  420. <DatePicker
  421. id="brExpiryDate"
  422. name="brExpiryDate"
  423. // error={fromDate===null}
  424. slotProps={{
  425. field: { readOnly: true, },
  426. // textField: {
  427. // helperText:fromDate == null ? intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }):""
  428. // },
  429. }}
  430. format="DD/MM/YYYY"
  431. // label={"Submit Date (From)"}
  432. value={fromDate == null ? null : dayjs(fromDate)}
  433. minDate={minDate == null ? null : dayjs(minDate)}
  434. disabled={(!editMode && !createMode)}
  435. onChange={(newValue) => {
  436. // console.log(newValue)
  437. // setErrorMsg("")
  438. if (DateUtils.dateValue(newValue) > DateUtils.dateValue(new Date())) {
  439. setFromDate(newValue);
  440. } else {
  441. // setErrorMsg("Please select a date after today.")
  442. }
  443. }}
  444. />
  445. </DemoItem >
  446. </LocalizationProvider>
  447. }
  448. </Grid>
  449. {
  450. fromDate == null ?
  451. (!editMode && !createMode) ?
  452. // <FormHelperText error id="helper-text-date">
  453. // Please select a date after today.
  454. // </FormHelperText>
  455. null
  456. :
  457. <FormHelperText error id="helper-text-date">
  458. {intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' })}
  459. </FormHelperText>
  460. :
  461. null
  462. }
  463. </Grid>
  464. </Grid>
  465. <Grid item xs={12} lg={4} >
  466. {FieldUtils.getTextField({
  467. label: FieldUtils.notNullFieldLabel("Contact Person:"),
  468. valueName: "contactPerson",
  469. disabled: (!editMode && !createMode),
  470. form: formik
  471. })}
  472. </Grid>
  473. <Grid item xs={12} lg={4} >
  474. {FieldUtils.getPhoneField({
  475. label: FieldUtils.notNullFieldLabel("Contact Tel:"),
  476. valueName: {
  477. code: "tel_countryCode",
  478. num: "phoneNumber"
  479. },
  480. disabled: (!editMode && !createMode),
  481. form: formik
  482. })}
  483. </Grid>
  484. <Grid item xs={12} lg={4} >
  485. {FieldUtils.getPhoneField({
  486. label: "Fax No:",
  487. valueName: {
  488. code: "fax_countryCode",
  489. num: "faxNumber"
  490. },
  491. disabled: (!editMode && !createMode),
  492. form: formik
  493. })}
  494. </Grid>
  495. {
  496. currentUserData.creditor ?
  497. <Grid item xs={12} lg={4} >
  498. {FieldUtils.getTextField({
  499. label: FieldUtils.notNullFieldLabel("Org. Short Name:"),
  500. valueName: "orgShortName",
  501. disabled: (!editMode && !createMode),
  502. form: formik
  503. })}
  504. </Grid>
  505. :
  506. null
  507. }
  508. <Grid item xs={12} lg={12} >
  509. {FieldUtils.getAddressField({
  510. label: FieldUtils.notNullFieldLabel("Address:"),
  511. valueName: ["addressLine1", "addressLine2", "addressLine3"],
  512. disabled: (!editMode && !createMode),
  513. form: formik
  514. })}
  515. </Grid>
  516. <Grid item xs={12} lg={12} >
  517. {FieldUtils.getProfileComboField({
  518. label: "",
  519. valueName: "district",
  520. disabled: (!editMode && !createMode),
  521. dataList: ComboData.district,
  522. getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
  523. form: formik
  524. })}
  525. </Grid>
  526. <Grid item xs={12} lg={12} >
  527. {FieldUtils.getProfileComboField({
  528. label: "",
  529. valueName: "country",
  530. disabled: true,
  531. dataList: ComboData.country,
  532. getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
  533. form: formik
  534. })}
  535. </Grid>
  536. <Grid item lg={12} ></Grid>
  537. </Grid>
  538. }
  539. </form>
  540. <div>
  541. <Dialog
  542. open={creditorConfirmPopUp}
  543. onClose={() => setCreditorConfirmPopUp(false)}
  544. PaperProps={{
  545. sx: {
  546. minWidth: '40vw',
  547. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  548. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  549. }
  550. }}
  551. >
  552. <form onSubmit={handleSubmit(onSubmit)}>
  553. <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
  554. <DialogContent style={{ display: 'flex', }}>
  555. <Grid container direction="column">
  556. <Grid item>
  557. <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Credit Client?</Typography>
  558. </Grid>
  559. <Grid item>
  560. <Typography variant="h6" style={{ padding: '16px' }}>Please Enter Organisation Short Name for Credit Client (Used for Demand Note)</Typography>
  561. </Grid>
  562. <Grid item sx={{ padding: '16px' }}>
  563. <TextField
  564. fullWidth
  565. {...register("orgShortName")}
  566. id='orgShortName'
  567. label="Organisation Short Name"
  568. defaultValue={currentUserData.orgShortName != "N/A" ? currentUserData.orgShortName : ""}
  569. InputLabelProps={{
  570. shrink: true
  571. }}
  572. />
  573. </Grid>
  574. </Grid>
  575. </DialogContent>
  576. <DialogActions>
  577. <Button onClick={() => setCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
  578. <Button type="submit"><Typography variant="h5">Confirm</Typography></Button>
  579. {/* <Button onClick={() => markAsCreditor()}><Typography variant="h5">Confirm</Typography></Button> */}
  580. </DialogActions>
  581. </form>
  582. </Dialog>
  583. </div>
  584. <div>
  585. <Dialog
  586. open={nonCreditorConfirmPopUp}
  587. onClose={() => setNonCreditorConfirmPopUp(false)}
  588. PaperProps={{
  589. sx: {
  590. minWidth: '40vw',
  591. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  592. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  593. }
  594. }}
  595. >
  596. <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
  597. <DialogContent style={{ display: 'flex', }}>
  598. <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Credit Client?</Typography>
  599. </DialogContent>
  600. <DialogActions>
  601. <Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
  602. <Button onClick={() => markAsNonCreditor()}><Typography variant="h5">Confirm</Typography></Button>
  603. </DialogActions>
  604. </Dialog>
  605. </div>
  606. <div>
  607. <Dialog
  608. open={afterSendPopUp}
  609. onClose={() => setAfterSendPopUp(false)}
  610. PaperProps={{
  611. sx: {
  612. minWidth: '40vw',
  613. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  614. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  615. }
  616. }}
  617. >
  618. <DialogTitle><Typography variant="h3">Info</Typography></DialogTitle>
  619. <DialogContent style={{ display: 'flex', }}>
  620. <Typography variant="h4" style={{ padding: '16px' }}>Overdue Public Notice count: {overduePublicNotice}</Typography>
  621. </DialogContent>
  622. <DialogActions>
  623. <Button onClick={() => setAfterSendPopUp(false)}><Typography variant="h5">OK</Typography></Button>
  624. </DialogActions>
  625. </Dialog>
  626. </div>
  627. </MainCard>
  628. );
  629. };
  630. export default OrganizationCard;