/*
|
* @Company: hugeInfo
|
* @Author: xzx
|
* @Date: 2022-04-19 11:27:07
|
* @LastEditors: ldh
|
* @LastEditTime: 2022-12-01 10:02:47
|
* @Version: 1.0.0
|
* @Description: 司法确认总览
|
*/
|
import React, { useEffect, useState } from 'react';
|
import Page from '../../../components/Page/index';
|
import { Form, Typography } from 'antd';
|
import * as $$ from '../../../utils/utility';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
import TableView from '../../../components/TableView';
|
import TableSearch from '../../../components/TableSearch';
|
import publicDataStatus from '../../../status/publicData';
|
|
const { Link } = Typography;
|
|
// 获取司法确认总览
|
function getJudicialOverviewDataApi(submitData) {
|
return $$.ax.request({ url: 'judicInfo/pageJudicTotal', type: 'get', data: submitData, service: 'mediate' });
|
}
|
|
const JudicialOverview = () => {
|
const [form] = Form.useForm();
|
|
const location = useLocation();
|
|
const navigate = useNavigate();
|
|
// 搜索
|
const [search, setSearch] = useState({ page: 1, size: 10 });
|
|
// 数据
|
const [data, setData] = useState({ tableData: [] });
|
|
// 调解组织select框数据
|
const [adjustOrgData, setAdjustOrgData] = useState([]);
|
|
// 表头
|
const columns = [
|
{ title: '司法确认案号', dataIndex: 'judicNo' },
|
{ title: '申请时间', dataIndex: 'applyTime' },
|
{ title: '司法确认进度', dataIndex: 'processName' },
|
{
|
title: '司法确认结果',
|
dataIndex: 'judicResult',
|
render: (text, record) =>
|
!text ? (
|
'-'
|
) : (
|
<div className={`public-tag public-tag-${text === '22_00028-1' ? 'tagGreen' : 'tagRed'}`}>{record.judicResultName}</div>
|
),
|
},
|
{ title: '司法确认结束时间', dataIndex: 'judicEndTime' },
|
{ title: '承办法官', dataIndex: 'judgeName' },
|
{ title: '助理/书记员', dataIndex: 'assistName' },
|
{ title: '申请人', dataIndex: 'plaintiffs' },
|
{ title: '被申请人', dataIndex: 'defendants' },
|
{ title: '纠纷发生地', dataIndex: 'addr' },
|
{ title: '纠纷类型', dataIndex: 'caseTypeName' },
|
{ title: '调解组织', dataIndex: 'mediateUnitName' },
|
{
|
title: '操作',
|
dataIndex: 'action',
|
width: 50,
|
render: (_, record) => <Link onClick={() => handleJump(record)}>查看</Link>,
|
},
|
];
|
|
// 反馈跳转
|
function handleJump(info) {
|
$$.setSessionStorage(location.pathname, {
|
search,
|
breadcrumbData: [{ title: '司法确认总览', url: '/mediate/overview' }, { title: '详情' }],
|
title: '详情',
|
pageFrom: 'judicialOverview',
|
tableActive: info.judicId,
|
});
|
navigate(`/mediate/caseDetail?caseId=${info.caseId}&judicialId=${info.judicId}&back=${location.pathname}`);
|
}
|
|
// 页码修改
|
function handleChangePage(page, pageSize) {
|
getJudicialOverviewData({ ...search, page, size: pageSize });
|
}
|
|
// 搜索 or 重置 待优化
|
function handleSearch(type, session) {
|
let paramsObj = {};
|
if (type === 'search') {
|
paramsObj = { ...search, ...form.getFieldsValue(), page: 1 };
|
$$.changeTimeFormat(paramsObj, 'applyTime', 'applyStart', 'applyEnd');
|
}
|
if (type === 'reset') {
|
form.resetFields();
|
paramsObj = { page: 1, size: 10 };
|
}
|
if (type === 'recurrent') {
|
paramsObj = { ...search, ...session.search };
|
let copyObj = { ...paramsObj };
|
if (copyObj.applyStart) {
|
copyObj.applyTime = [$$.myMoment(copyObj.applyStart), $$.myMoment(copyObj.applyEnd)];
|
}
|
form.setFieldsValue(copyObj);
|
}
|
getJudicialOverviewData(paramsObj, session?.tableActive);
|
}
|
|
// 获取数据
|
async function getJudicialOverviewData(submitData, tableActive) {
|
global.setSpinning(true);
|
const res = await getJudicialOverviewDataApi(submitData);
|
global.setSpinning(false);
|
if (res.type) {
|
setSearch(submitData);
|
setData({ total: res.data?.totalElements, tableData: res.data?.content || [], tableActive });
|
}
|
}
|
|
// 初始化
|
useEffect(() => {
|
publicDataStatus.getUnitData((data) => setAdjustOrgData(data));
|
let values = $$.getSessionStorage(location.pathname);
|
if ($$.getQueryString('isBack') && !!values) {
|
handleSearch('recurrent', values);
|
} else {
|
handleSearch('reset');
|
}
|
if (!!values) {
|
$$.clearSessionStorage(location.pathname);
|
}
|
}, []);
|
|
return (
|
<Page pageHead={{ title: '司法确认总览', subtitle: '查看账号下全部的司法确认案件' }}>
|
<div className="judicialOverview">
|
<div className="pageSearch">
|
<TableSearch
|
labelLength={6}
|
form={form}
|
itemData={[
|
{ type: 'Input', name: 'plaintiffs', label: '申请人' },
|
{ type: 'Input', name: 'defendants', label: '被申请人' },
|
{ type: 'RangePicker', name: 'applyTime', label: '申请时间' },
|
{ type: 'Input', name: 'judicNo', label: '司法确认案号' },
|
{ type: 'Select', name: 'process', label: '司法确认进度', selectdata: $$.options.judicProcess },
|
{ type: 'Select', name: 'judicResult', label: '司法确认结果', selectdata: $$.options.judicResult },
|
{ type: 'Input', name: 'mediateJudicNo', label: '诉前调确号', placeholder: '输入查询诉前调确号' },
|
{ type: 'Input', name: 'addr', label: '纠纷发生地' },
|
{ type: 'TreeSelect', name: 'applyUnitId', label: '调解组织', treedata: adjustOrgData },
|
{ type: 'Input', name: 'caseNo', label: '调解案号' },
|
{ type: 'Select', name: 'caseType', label: '纠纷类型', selectdata: $$.caseOptions.caseCause },
|
{ type: 'Input', name: 'judgeName', label: '承办法官', placeholder: '查询承办法官姓名' },
|
]}
|
handleReset={() => handleSearch('reset')}
|
handleSearch={() => handleSearch('search')}
|
/>
|
</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) => handleChangePage(page, pageSize),
|
}}
|
rowClassName={(record) => (record.judicId === data.tableActive ? 'tableRowActive' : '')}
|
rowKey="judicId"
|
/>
|
</div>
|
</div>
|
</Page>
|
);
|
};
|
|
export default JudicialOverview;
|