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;
|