You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

95 rivejä
3.1 KiB

  1. // material-ui
  2. import {useMemo} from 'react';
  3. import {
  4. useMediaQuery
  5. } from '@mui/material';
  6. import {FiDataGrid} from "components/FiDataGrid";
  7. import * as FormatUtils from "utils/FormatUtils"
  8. import * as DateUtils from "utils/DateUtils"
  9. import * as PaymentStatus from "utils/statusUtils/PaymentStatus"
  10. import {useTheme} from "@emotion/react";
  11. import {useIntl} from "react-intl";
  12. import { clickableLink } from 'utils/CommonFunction';
  13. import {GET_PUBLIC_NOTICE_APPLY_DETAIL_PAYMENT } from "utils/ApiPathConst"
  14. // ==============================|| EVENT TABLE ||============================== //
  15. export default function SubmittedTab({ appId, setCount }) {
  16. const theme = useTheme();
  17. const isMdOrLg = useMediaQuery(theme.breakpoints.up('md'));
  18. const intl = useIntl();
  19. const { locale } = intl;
  20. const renderHeaderWithAria = (params) => (
  21. <span aria-label={params.colDef.headerName}>{params.colDef.headerName}</span>
  22. );
  23. const columns = [
  24. {
  25. field: 'actions',
  26. headerName: intl.formatMessage({id: 'payId'}),
  27. width: isMdOrLg ? 'auto' : 160,
  28. flex: isMdOrLg ? 1 : undefined,
  29. cellClassName: 'actions',
  30. renderHeader: renderHeaderWithAria,
  31. renderCell: (params) => {
  32. return clickableLink('/paymentPage/details/' + params.row.id, params.row.transNo);
  33. },
  34. },
  35. {
  36. id: 'transDateTime',
  37. field: 'transDateTime',
  38. headerName: intl.formatMessage({id: 'payDate'}),
  39. width: isMdOrLg ? 'auto' : 160,
  40. flex: isMdOrLg ? 1 : undefined,
  41. renderHeader: renderHeaderWithAria,
  42. valueGetter: (params) => {
  43. return DateUtils.datetimeStr(params.value);
  44. }
  45. },
  46. {
  47. id: 'status',
  48. field: 'status',
  49. headerName: intl.formatMessage({id: 'payStatus'}),
  50. width: isMdOrLg ? 'auto' : 160,
  51. flex: isMdOrLg ? 1 : undefined,
  52. renderHeader: renderHeaderWithAria,
  53. renderCell: (params) => {
  54. return locale === 'en' ? PaymentStatus.getStatus_Eng(params):PaymentStatus.getStatus_Cht(params);
  55. }
  56. },
  57. {
  58. id: 'payAmount',
  59. field: 'payAmount',
  60. headerName: intl.formatMessage({id: 'fee'}),
  61. width: 150,
  62. renderHeader: renderHeaderWithAria,
  63. valueGetter: (params) => {
  64. return (params?.value) ? "$ " + FormatUtils.currencyFormat(params?.value) : "";
  65. }
  66. },
  67. ];
  68. return (
  69. <>
  70. <div style={{ height:'20%', width: '100%' }}>
  71. <FiDataGrid
  72. columns={columns}
  73. customPageSize={10}
  74. doLoad={useMemo(() => ({
  75. url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PAYMENT+"/"+appId,
  76. params: {},
  77. callback: function (responseData) {
  78. setCount(responseData?.count);
  79. }
  80. }), [appId])}
  81. />
  82. </div>
  83. </>
  84. );
  85. }