董国庆
2025-05-23 63ecd83a0f17442cb1ce3b497f4c7932fda4177f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
import { buildProTableDataSource } from '@/utils/antdUtils';
import { PageContainer, ProTable } from '@ant-design/pro-components';
import { Button, Space } from 'antd';
import { useRef } from 'react';
import { Access, useAccess, history } from 'umi';
import moment from 'moment';
import { getList } from './service';
import { exportExcell, downLoad } from '@/utils/utils';
 
const Account = () => {
    const actionRef = useRef();
    const access = useAccess();
    const formRef = useRef();
 
    const columns = [
        {
            title: '录入人',
            dataIndex: 'reportUserName',
        },
        {
            title: '录入联系方式',
            dataIndex: 'reportUserPhone',
        },
        {
            title: '群众姓名',
            dataIndex: 'name',
        },
        {
            title: '群众联系方式',
            dataIndex: 'contactNumber',
        },
        {
            title: '发生时间',
            dataIndex: 'time',
            valueType: 'dateRange',
            render: (text, record) => {
                return record.time ? moment(record.time).format('YYYY-MM-DD') : '';
            }
        },
        {
            title: '问题类型',
            dataIndex: 'problemType',
        },
        {
            title: '状态',
            dataIndex: 'status',
            valueEnum: {
                0: '正在办理',
                1: '延期办理',
                2: '超时办理',
                3: '已办结',
                4: '上报待审核',
            },
            render: (text, record) => {
                return Number(record.status) == 0 ? '正在办理' : record.status == 1 ? '延期办理' : record.status == 2 ? '超时办理' : record.status == 3 ? '已办结' : record.status == 4 ? '上报待审核' : '已办结';
            }
        },
        {
            title: '评价',
            hideInSearch: true,
            dataIndex: 'rate',
            render: (text, record) => {
                return ['不满意', '一般', '满意', '非常满意'][record.rate] || '-';
            }
        },
        {
            title: '操作',
            hideInSearch: true,
            render: (text, record) => {
                return (
                    <Space>
                        {
                            <Access accessible={access['/complaint/detail']}>
                                <Button
                                    type="link"
                                    onClick={() => {
                                        history.push('/appeal-management/detail?id=' + record.id)
                                    }}
                                >
                                    查看详情
                                </Button>
                            </Access>
                        }
                        {
                            <Access accessible={access['/complaint/community-problem-export']}>
                                <Button
                                    type="link"
                                    onClick={() => {
                                        downLoad(`/api/huacheng-sangeshenbian/complaint/download-file/${record.id}/1`, '社区问题单导出.docx');
                                    }}
                                >
                                    社区问题单导出
                                </Button>
                            </Access>
                        }
                        {
                            <Access accessible={access['/complaint/problem-handle-export']}>
                                <Button
                                    type="link"
                                    onClick={() => {
                                        downLoad(`/api/huacheng-sangeshenbian/complaint/download-file/${record.id}/2`, '问题处理单导出.docx');
                                    }}
                                >
                                    问题处理单导出
                                </Button>
                            </Access>
                        }
                        {
                            <Access accessible={access['/complaint/notice-export']}>
                                <Button
                                    type="link"
                                    onClick={() => {
                                        downLoad(`/api/huacheng-sangeshenbian/complaint/download-file/${record.id}/3`, '协调通知单导出.docx');
                                    }}
                                >
                                    协调通知单导出
                                </Button>
                            </Access>
                        }
                    </Space>
                );
            },
        },
    ];
    return (
        <div>
            <PageContainer header={{
                breadcrumb: {},
            }}
                title={'诉求管理'}
            >
                <ProTable
                    rowKey="id"
                    actionRef={actionRef}
                    columns={columns}
                    formRef={formRef}
                    request={async (params) => {
 
                        if (params.time && params.time.length > 0) {
                            params.startTime = moment(params.time[0]).format('YYYY-MM-DD HH:mm:ss');
                            params.endTime = moment(params.time[1]).format('YYYY-MM-DD 23:59:59');
                            delete params.time
                        } else {
                            delete params.startTime
                            delete params.endTime
                        }
 
 
                        return buildProTableDataSource(getList, params);
                    }}
                    search={{ labelWidth: 'auto' }}
                    toolBarRender={(action, selectRows) => [
                        <Space>
                            <Access accessible={access['/complaint/export']}>
                                <Button
                                    type="primary"
                                    onClick={() => {
                                        const params = {
                                            ...formRef.current.getFieldsValue(),
                                        };
                                        exportExcell('诉求管理.xlsx', params, '/api/huacheng-sangeshenbian/complaint/export');
                                    }}
                                >
                                    导出
                                </Button>
                            </Access>
                        </Space>
                    ]}
                />
            </PageContainer>
        </div>
    );
};
 
export default Account;