123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import React from 'react';
  2. import { Button, Badge } from 'antd';
  3. import { useNavigate } from 'react-router-dom';
  4. import List from '@/components/Page/List';
  5. import { getTaIssue } from '@/service/taissue';
  6. import { getTdLocType } from '@/service/tdloctype';
  7. import { getSysOrg } from '@/service/sysorg';
  8. import { queryDict } from '@/utils/request';
  9. const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
  10. const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
  11. const today = (new Date()).toJSON().substring(0, 10);
  12. export default (props) => {
  13. const navigate = useNavigate();
  14. const columns = [
  15. {
  16. title: "上报日期",
  17. dataIndex: "createDate",
  18. valueType: 'date',
  19. hideInSearch: true,
  20. },
  21. {
  22. title: "点位",
  23. dataIndex: "locId",
  24. valueType: 'select',
  25. request: queryLocType,
  26. },
  27. {
  28. title: "位置",
  29. dataIndex: "addr",
  30. hideInSearch: true,
  31. },
  32. {
  33. title: "问题详情",
  34. dataIndex: "content",
  35. hideInSearch: true,
  36. ellipsis: true,
  37. },
  38. {
  39. title: "责任单位",
  40. dataIndex: "orgId",
  41. valueType: 'select',
  42. request: queryOrg,
  43. },
  44. {
  45. title: "流程状态",
  46. dataIndex: "bizStatus",
  47. valueType: 'select',
  48. valueEnum: {
  49. start: {
  50. text: "待交办",
  51. status: "Default",
  52. },
  53. assigned: {
  54. text: "已交办",
  55. status: "Processing",
  56. },
  57. end: {
  58. text: "已办结",
  59. status: "Success",
  60. },
  61. expired: {
  62. text: "已逾期",
  63. status: "Error",
  64. },
  65. reject: {
  66. text: "已打回",
  67. status: "Warning",
  68. },
  69. },
  70. render: (_, row) => {
  71. if (row.processNode == 'end') {
  72. return <Badge status="success" text="已办结" />;
  73. } else {
  74. if (today >= row.expireDate) {
  75. return <Badge status="error" text="已逾期" />;
  76. }
  77. if ('reject' == row.processStatus) {
  78. return <Badge status="warning" text="已打回" />;
  79. }
  80. if (row.processNode == 'assigned') {
  81. return <Badge status="processing" text="已交办" />;
  82. }
  83. return <Badge status="default" text="待交办" />;
  84. }
  85. }
  86. },
  87. {
  88. title: "截止日期",
  89. dataIndex: "expireDate",
  90. hideInSearch: true,
  91. }
  92. ];
  93. return (
  94. <List
  95. rowKey="issueId"
  96. request={getTaIssue}
  97. columns={columns}
  98. optionRender={(_, row) => [
  99. <Button key="detail" type="link" onClick={() => navigate(`/issue/detail?id=${row.issueId}`)}>详情</Button>
  100. ]}
  101. />
  102. )
  103. }