/*
|
* @Company: hugeInfo
|
* @Author: lwh
|
* @Date: 2022-03-23 09:35:07
|
* @LastEditTime: 2022-07-22 15:35:38
|
* @LastEditors: ldh
|
* @Version: 1.0.0
|
* @Description: 预审异常
|
*/
|
|
import React, { useState, useEffect } from 'react';
|
import * as $$ from '../../../utils/utility';
|
import { Form, Typography } from 'antd';
|
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';
|
import Page from '../../../components/Page/index';
|
import TableView from '../../../components/TableView';
|
import TableSearch from '../../../components/TableSearch';
|
import MyTabs from '../../../components/MyTabs';
|
|
//预审异常列表
|
function getMyMediationDataApi(submitData) {
|
return $$.ax.request({ url: 'caseInquiry/pageQuery', type: 'get', data: submitData, service: 'disp' });
|
}
|
|
const MediateAbnormal = () => {
|
const [form] = Form.useForm();
|
|
const navigate = useNavigate();
|
|
const location = useLocation();
|
|
const [searchParams] = useSearchParams();
|
|
// 搜索
|
const [search, setSearch] = useState({ page: 1, size: 10 });
|
|
// 数据
|
const [data, setData] = useState({ tableData: [] });
|
|
// 搜索 or 重置
|
function handleSearch(type, data) {
|
if (type === 'recovery') {
|
// 详情返回时恢复跳转前查询
|
let obj = Object.assign({}, data.search);
|
form.setFieldsValue(obj);
|
getMyMediationData(obj, data.tableActive);
|
return;
|
}
|
if (type === 'search') {
|
let values = form.getFieldsValue();
|
getMyMediationData({ ...search, ...values, page: 1 });
|
return;
|
}
|
if (type === 'reset') {
|
form.resetFields();
|
getMyMediationData({ page: 1, size: 10 });
|
}
|
}
|
|
// 查看,处理跳转
|
function handleJump(caseId, id) {
|
$$.setSessionStorage(location.pathname, {
|
search: { ...search },
|
title: '处理',
|
subtitle: '处理被预审规则拦截的矛盾纠纷案件',
|
breadcrumbData: [{ title: '预审异常', url: location.pathname }, { title: '处理' }],
|
pageFrom: 'mediateAbnormal',
|
isNotTabs: true,
|
});
|
navigate(`/mediate/caseDetail?caseId=${caseId}&dispId=${id}&back=${location.pathname}`);
|
}
|
|
// 初始化
|
useEffect(() => {
|
let returnRouteData = $$.getSessionStorage(location.pathname);
|
if (searchParams.get('isBack') && !!returnRouteData) {
|
handleSearch('recovery', returnRouteData);
|
} else {
|
handleSearch('reset');
|
}
|
if (!!returnRouteData) {
|
$$.clearSessionStorage(location.pathname);
|
}
|
}, []);
|
|
// 获取数据
|
async function getMyMediationData(submitData, tableActive) {
|
global.setSpinning(true);
|
const res = await getMyMediationDataApi(submitData);
|
global.setSpinning(false);
|
if (res.type) {
|
setSearch(submitData);
|
setData({ total: res.data?.totalElements, tableData: res.data?.content || [], tableActive });
|
}
|
}
|
|
const columns = () => {
|
const otherColumns = true
|
? [{ title: '异常原因', dataIndex: 'errorReason' }]
|
: [
|
{ title: '处理意见', dataIndex: 'handleIdeaName' },
|
{ title: '处理时间', dataIndex: 'xxx2' },
|
{ title: '处理人', dataIndex: 'xxx3' },
|
];
|
const columnsData = [
|
{ title: '申请渠道', dataIndex: 'canalName' },
|
{ title: '纠纷类型', dataIndex: 'caseTypeName' },
|
{ title: '申请人', dataIndex: 'plaintiffs' },
|
{ title: '被申请人', dataIndex: 'defendants' },
|
{ title: '纠纷发生地', dataIndex: 'addr' },
|
{ title: '调解类型', dataIndex: 'mediTypeName' },
|
{ title: '拦截时间', dataIndex: 'xxx1' },
|
...otherColumns,
|
{
|
title: '操作',
|
dataIndex: 'action',
|
width: 50,
|
render: (_, record) => {
|
return <Typography.Link onClick={() => handleJump(record.caseId, record.id)}>{true ? '处理' : '查看'}</Typography.Link>;
|
},
|
},
|
];
|
return columnsData;
|
};
|
|
return (
|
<Page pageHead={{ title: '预审异常', subtitle: '在矛盾纠纷案件进入调度中心前被预审规则拦截的案件列表' }}>
|
<div className="mediateList">
|
<div className="pageSearch">
|
<TableSearch
|
form={form}
|
itemData={[
|
{ type: 'Input', name: 'plaintiffs', label: '申请人' },
|
{ type: 'Input', name: 'defendants', label: '被申请人' },
|
{ type: 'RangePicker', name: 'xxx1', label: '拦截时间' },
|
{
|
type: 'Select',
|
name: 'caseType',
|
label: '纠纷类型',
|
selectdata: $$.caseOptions.caseCause,
|
},
|
{ type: 'Input', name: 'addr', label: '纠纷发生地' },
|
{ type: 'RangePicker', name: 'xxx1', label: '处理时间' },
|
]}
|
handleReset={() => handleSearch('reset')}
|
handleSearch={() => handleSearch('search')}
|
/>
|
</div>
|
<div className="pageTabs">
|
<MyTabs
|
tabs={[
|
{ key: '1', label: `未处理()` },
|
{ key: '2', label: `已处理()` },
|
]}
|
activeKey={'1'}
|
/>
|
</div>
|
<div className="pageTable">
|
<TableView
|
showHeader
|
title="查询结果"
|
columns={columns()}
|
dataSource={data.tableData}
|
pagination={{
|
current: search.page,
|
pageSize: search.size,
|
total: data.total,
|
onChange: (page, pageSize) => getMyMediationData({ ...search, page, size: pageSize }),
|
}}
|
rowClassName={(record, index) => (record.id === data.tableActive ? 'tableRowActive' : '')}
|
/>
|
</div>
|
</div>
|
</Page>
|
);
|
};
|
|
export default MediateAbnormal;
|