|
@@ -1,21 +1,28 @@
|
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, getTaOrgIssue, exportTaIssue, exportTaOrgIssue } from '@/service/taissue';
|
6
|
|
-import { getTdLocType } from '@/service/tdloctype';
|
7
|
|
-import { getSysOrg } from '@/service/sysorg';
|
8
|
|
-import { queryDict } from '@/utils/request';
|
9
|
|
-import { processEnum, processStatus } from '@/utils/biz';
|
10
|
|
-import useBool from '@/utils/hooks/useBool';
|
11
|
|
-import useOrgResponsible from '@/utils/hooks/useOrgResponsible';
|
12
|
|
-import dayjs from 'dayjs';
|
|
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 {
|
|
6
|
+ getTaIssue,
|
|
7
|
+ getTaOrgIssue,
|
|
8
|
+ exportTaIssue,
|
|
9
|
+ exportTaOrgIssue,
|
|
10
|
+} from "@/service/taissue";
|
|
11
|
+import { getTdLocType } from "@/service/tdloctype";
|
|
12
|
+import { getSysOrg } from "@/service/sysorg";
|
|
13
|
+import { queryDict } from "@/utils/request";
|
|
14
|
+import { processEnum, processStatus } from "@/utils/biz";
|
|
15
|
+import useBool from "@/utils/hooks/useBool";
|
|
16
|
+import useOrgResponsible from "@/utils/hooks/useOrgResponsible";
|
|
17
|
+import dayjs from "dayjs";
|
13
|
18
|
|
14
|
|
-const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
|
15
|
|
-const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
|
16
|
|
-
|
17
|
|
-const yestoday = dayjs().subtract(1, 'day').format('YYYY-MM-DD');
|
|
19
|
+const queryOrg = queryDict(getSysOrg, { labelKey: "name", valueKey: "orgId" });
|
|
20
|
+const queryLocType = queryDict(getTdLocType, {
|
|
21
|
+ labelKey: "name",
|
|
22
|
+ valueKey: "typeId",
|
|
23
|
+});
|
18
|
24
|
|
|
25
|
+const yestoday = dayjs().subtract(1, "day").format("YYYY-MM-DD");
|
19
|
26
|
export default (props) => {
|
20
|
27
|
const [loading, startLoading, stopLoading] = useBool();
|
21
|
28
|
const navigate = useNavigate();
|
|
@@ -27,7 +34,7 @@ export default (props) => {
|
27
|
34
|
isResponsible ? getTaOrgIssue : getTaIssue,
|
28
|
35
|
isResponsible ? { orgId: org?.orgId } : { all: true },
|
29
|
36
|
isResponsible ? exportTaOrgIssue : exportTaIssue,
|
30
|
|
- ]
|
|
37
|
+ ];
|
31
|
38
|
}, [isResponsible, org]);
|
32
|
39
|
|
33
|
40
|
const columns = [
|
|
@@ -35,16 +42,44 @@ export default (props) => {
|
35
|
42
|
title: "问题单号",
|
36
|
43
|
dataIndex: "issueId",
|
37
|
44
|
},
|
|
45
|
+ {
|
|
46
|
+ title: "创建时间",
|
|
47
|
+ dataIndex: "createdAt",
|
|
48
|
+ valueType: "dateRange",
|
|
49
|
+ hideInTable: true,
|
|
50
|
+ search: {
|
|
51
|
+ transform: (value) => {
|
|
52
|
+ return {
|
|
53
|
+ createDateStart: value[0],
|
|
54
|
+ createDateEnd: value[1],
|
|
55
|
+ };
|
|
56
|
+ },
|
|
57
|
+ },
|
|
58
|
+ },
|
|
59
|
+ {
|
|
60
|
+ title: "办结时间",
|
|
61
|
+ dataIndex: "createdAts",
|
|
62
|
+ valueType: "dateRange",
|
|
63
|
+ hideInTable: true,
|
|
64
|
+ search: {
|
|
65
|
+ transform: (value) => {
|
|
66
|
+ return {
|
|
67
|
+ endDateStart: value[0],
|
|
68
|
+ endDateEnd: value[1],
|
|
69
|
+ };
|
|
70
|
+ },
|
|
71
|
+ },
|
|
72
|
+ },
|
38
|
73
|
{
|
39
|
74
|
title: "上报日期",
|
40
|
75
|
dataIndex: "createDate",
|
41
|
|
- valueType: 'date',
|
|
76
|
+ valueType: "date",
|
42
|
77
|
hideInSearch: true,
|
43
|
78
|
},
|
44
|
79
|
{
|
45
|
80
|
title: "点位",
|
46
|
81
|
dataIndex: "locId",
|
47
|
|
- valueType: 'select',
|
|
82
|
+ valueType: "select",
|
48
|
83
|
request: queryLocType,
|
49
|
84
|
},
|
50
|
85
|
{
|
|
@@ -61,23 +96,26 @@ export default (props) => {
|
61
|
96
|
{
|
62
|
97
|
title: "责任单位",
|
63
|
98
|
dataIndex: "orgId",
|
64
|
|
- valueType: 'select',
|
|
99
|
+ valueType: "select",
|
65
|
100
|
request: queryOrg,
|
66
|
101
|
hideInSearch: isResponsible,
|
67
|
102
|
},
|
68
|
103
|
{
|
69
|
104
|
title: "流程状态",
|
70
|
105
|
dataIndex: "bizStatus",
|
71
|
|
- valueType: 'select',
|
|
106
|
+ valueType: "select",
|
72
|
107
|
valueEnum: processEnum,
|
73
|
108
|
render: (_, row) => {
|
74
|
|
- if (row.processNode != '03' && yestoday > row.expireDate) {
|
|
109
|
+ console.log(row)
|
|
110
|
+ if (row.processNode != "03" && yestoday > row.expireDate) {
|
75
|
111
|
return <Badge status="error" text="已逾期" />;
|
|
112
|
+ } else if(row.processNode=="03"&& yestoday > row.expireDate){
|
|
113
|
+ return <Badge status="warning" text="延期办结" />;
|
76
|
114
|
} else {
|
77
|
|
- const st = processStatus.filter(x => x.value == row.processNode)[0];
|
|
115
|
+ const st = processStatus.filter((x) => x.value == row.processNode)[0];
|
78
|
116
|
return <Badge status={st?.badge} text={st?.label} />;
|
79
|
117
|
}
|
80
|
|
- }
|
|
118
|
+ },
|
81
|
119
|
},
|
82
|
120
|
{
|
83
|
121
|
title: "截止日期",
|
|
@@ -88,25 +126,27 @@ export default (props) => {
|
88
|
126
|
title: "上报人",
|
89
|
127
|
dataIndex: "userName",
|
90
|
128
|
hideInSearch: true,
|
91
|
|
- }
|
|
129
|
+ },
|
92
|
130
|
];
|
93
|
131
|
|
94
|
132
|
const onExport = () => {
|
95
|
133
|
startLoading();
|
96
|
|
- exportFn(paramsRef.current).then(() => {
|
97
|
|
- stopLoading();
|
98
|
|
- }).catch(() => {
|
99
|
|
- stopLoading();
|
100
|
|
- });
|
101
|
|
- }
|
|
134
|
+ exportFn(paramsRef.current)
|
|
135
|
+ .then(() => {
|
|
136
|
+ stopLoading();
|
|
137
|
+ })
|
|
138
|
+ .catch(() => {
|
|
139
|
+ stopLoading();
|
|
140
|
+ });
|
|
141
|
+ };
|
102
|
142
|
|
103
|
143
|
const beforeSearchSubmit = (params) => {
|
104
|
144
|
paramsRef.current = {
|
105
|
|
- ...params || {},
|
|
145
|
+ ...(params || {}),
|
106
|
146
|
all: true,
|
107
|
147
|
};
|
108
|
148
|
return params;
|
109
|
|
- }
|
|
149
|
+ };
|
110
|
150
|
|
111
|
151
|
return (
|
112
|
152
|
<List
|
|
@@ -116,20 +156,19 @@ export default (props) => {
|
116
|
156
|
params={params}
|
117
|
157
|
beforeSearchSubmit={beforeSearchSubmit}
|
118
|
158
|
optionRender={(_, row) => [
|
119
|
|
- <Button key="detail" type="link" onClick={() => navigate(`/issue/detail?id=${row.issueId}`)}>详情</Button>
|
|
159
|
+ <Button
|
|
160
|
+ key="detail"
|
|
161
|
+ type="link"
|
|
162
|
+ onClick={() => navigate(`/issue/detail?id=${row.issueId}`)}
|
|
163
|
+ >
|
|
164
|
+ 详情
|
|
165
|
+ </Button>,
|
120
|
166
|
]}
|
121
|
167
|
toolBarRender={() => [
|
122
|
|
- (
|
123
|
|
- <Button
|
124
|
|
- key="1"
|
125
|
|
- type="primary"
|
126
|
|
- loading={loading}
|
127
|
|
- onClick={onExport}
|
128
|
|
- >
|
129
|
|
- 导出
|
130
|
|
- </Button>
|
131
|
|
- )
|
|
168
|
+ <Button key="1" type="primary" loading={loading} onClick={onExport}>
|
|
169
|
+ 导出
|
|
170
|
+ </Button>,
|
132
|
171
|
]}
|
133
|
172
|
/>
|
134
|
|
- )
|
135
|
|
-}
|
|
173
|
+ );
|
|
174
|
+};
|