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.

ProofTab.js 4.2 KiB

hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 2 años
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 2 años
hace 23 horas
hace 2 años
hace 1 mes
hace 2 años
hace 2 años
hace 2 años
hace 2 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // material-ui
  2. import {useMemo} from 'react';
  3. import {
  4. useMediaQuery,
  5. } from '@mui/material';
  6. import {
  7. GridActionsCellItem,
  8. } from "@mui/x-data-grid";
  9. import * as Icon from 'utils/IconUtils';
  10. import * as DateUtils from "utils/DateUtils";
  11. import * as ProofStatus from "utils/statusUtils/ProofStatus";
  12. import {FiDataGrid} from "components/FiDataGrid";
  13. import * as FormatUtils from "utils/FormatUtils"
  14. import * as HttpUtils from "utils/HttpUtils"
  15. import {GET_PUBLIC_NOTICE_APPLY_DETAIL_PROOF,GEN_GAZETTE_PROOF } from "utils/ApiPathConst"
  16. import {useTheme} from "@emotion/react";
  17. import { clickableLink } from 'utils/CommonFunction';
  18. // ==============================|| EVENT TABLE ||============================== //
  19. export default function ProofTab({appId, setCount}) {
  20. const theme = useTheme();
  21. const isMdOrLg = useMediaQuery(theme.breakpoints.up('md'));
  22. const onDownloadClick = (params) => () => {
  23. HttpUtils.fileDownload({
  24. url: GEN_GAZETTE_PROOF+"/"+params?.row?.id,
  25. });
  26. };
  27. const renderHeaderWithAria = (params) => (
  28. <span aria-label={params.colDef.headerName}>{params.colDef.headerName}</span>
  29. );
  30. const columns = [
  31. {
  32. field: 'refNo',
  33. headerName: 'Proof No.',
  34. width: isMdOrLg ? 'auto' : 200,
  35. flex: isMdOrLg ? 1 : undefined,
  36. cellClassName: 'actions',
  37. renderHeader: renderHeaderWithAria,
  38. renderCell: (params) => {
  39. return clickableLink('/proof/reply/' + params.row.id, params.row.refNo);
  40. },
  41. },
  42. {
  43. field: 'status',
  44. headerName: 'Status',
  45. width: isMdOrLg ? 'auto' : 160,
  46. flex: isMdOrLg ? 1 : undefined,
  47. renderHeader: renderHeaderWithAria,
  48. renderCell: (params) => {
  49. return ProofStatus.getStatus_Eng(params);
  50. },
  51. },
  52. {
  53. field: 'created',
  54. headerName: 'Proof Issue Date',
  55. width: isMdOrLg ? 'auto' : 160,
  56. flex: isMdOrLg ? 1 : undefined,
  57. renderHeader: renderHeaderWithAria,
  58. valueGetter: (params) => {
  59. return DateUtils.datetimeStr(params?.value);
  60. }
  61. },
  62. {
  63. field: 'replyDate',
  64. headerName: 'Confirmed/Return Date',
  65. width: isMdOrLg ? 'auto' : 160,
  66. flex: isMdOrLg ? 1 : undefined,
  67. renderHeader: renderHeaderWithAria,
  68. valueGetter: (params) => {
  69. return params?.value?DateUtils.datetimeStr(params?.value):"";
  70. }
  71. },
  72. {
  73. field: 'fee',
  74. headerName: 'Fee',
  75. width: isMdOrLg ? 'auto' : 160,
  76. flex: isMdOrLg ? 1 : undefined,
  77. renderHeader: renderHeaderWithAria,
  78. valueGetter: (params) => {
  79. return (params?.value)?"$ "+FormatUtils.currencyFormat(params?.value):"";
  80. }
  81. },
  82. {
  83. field: 'actions',
  84. type: 'actions',
  85. headerName: 'Proof Slip',
  86. width: 100,
  87. renderHeader: renderHeaderWithAria,
  88. cellClassName: 'actions',
  89. getActions: (params) => {
  90. if(params.row.action == null) return[];
  91. if(params.row.action != true) return[];
  92. return [
  93. <GridActionsCellItem
  94. key="OutSave"
  95. icon={<Icon.Download />}
  96. label="Download"
  97. className="textPrimary"
  98. onClick={onDownloadClick(params)}
  99. color="primary"
  100. />]
  101. },
  102. },
  103. ];
  104. return (
  105. <div style={{height:'20%', width: '98%'}}>
  106. <FiDataGrid
  107. columns={columns}
  108. customPageSize={10}
  109. doLoad={useMemo(() => ({
  110. url: GET_PUBLIC_NOTICE_APPLY_DETAIL_PROOF+"/"+appId,
  111. params: {},
  112. callback: function (responseData) {
  113. setCount(responseData?.count);
  114. }
  115. }), [appId])}
  116. />
  117. </div>
  118. );
  119. }