/*
|
* @Company: hugeInfo
|
* @Author: xzx
|
* @Date: 2022-04-19 11:27:07
|
* @LastEditors: lwh
|
* @LastEditTime: 2023-07-13 14:32:50
|
* @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 MyTabs from '../../../components/MyTabs';
|
import publicDataStatus from '../../../status/publicData';
|
|
const { Link } = Typography;
|
|
// 司法确认列表接口api
|
function getMyConfirmationDataApi(submitData) {
|
return $$.ax.request({ url: 'judicTask/pageMyTask', type: 'get', data: submitData, service: 'mediate' });
|
}
|
|
const MyConfirmation = () => {
|
const [form] = Form.useForm();
|
|
let location = useLocation();
|
|
let navigate = useNavigate();
|
|
// 搜索
|
const [search, setSearch] = useState({ page: 1, size: 10, pageType: '0', joinRole: '1' });
|
|
// 数据
|
const [data, setData] = useState({ tableData: [] });
|
|
// 调解组织select框数据
|
const [adjustOrgData, setAdjustOrgData] = useState([]);
|
|
// 表头
|
const columns = () => {
|
return [
|
{ title: '司法确认案号', dataIndex: 'judicNo' },
|
{ title: '司法确认进度', dataIndex: 'processName' },
|
...(search.pageType === '2'
|
? [
|
{
|
title: '司法确认结果',
|
dataIndex: 'judicResult',
|
render: (text, record) => (
|
<span className={`public-tag public-tag-${text === '22_00028-1' ? 'tagGreen' : 'tagRed'}`}>{record.judicResultName}</span>
|
),
|
},
|
]
|
: []),
|
{ title: '申请人', dataIndex: 'plaintiffs' },
|
{ title: '被申请人', dataIndex: 'defendants' },
|
{ title: '纠纷发生地', dataIndex: 'addr' },
|
{ title: '纠纷类型', dataIndex: 'caseTypeName' },
|
{ title: '申请时间', dataIndex: 'applyTime' },
|
{ title: '调解成功时间', dataIndex: 'mediEndTime' },
|
{ title: '调解组织', dataIndex: 'mediateUnitName' },
|
...(search.joinRole === '2' ? [{ title: '承办法官', dataIndex: 'judgeName' }] : []),
|
{ title: '助理/书记员', dataIndex: 'assistName' },
|
{
|
title: '操作',
|
dataIndex: 'action',
|
width: 50,
|
render: (_, record) => {
|
let type = 'check';
|
if (search.joinRole === '1' && (search.pageType === '0' || search.pageType === '1')) {
|
type = 'handle';
|
}
|
if (search.joinRole === '2' && (search.pageType === '0' || search.pageType === '1')) {
|
type = 'feedback';
|
}
|
if (search.joinRole === '2' && search.pageType === '2' && record.feedbackStatus === '1') {
|
type = 'feedback';
|
}
|
return <Link onClick={() => handleJump(type, record)}>{type === 'check' ? '查看' : '处理'}</Link>;
|
},
|
},
|
];
|
};
|
|
// 跳转页面
|
function handleJump(type, info) {
|
if (type === 'feedback') {
|
// 协助反馈
|
$$.setSessionStorage(location.pathname, {
|
search,
|
breadcrumbData: [{ title: '我的司法确认', url: '/mediate/myConfirmation' }, { title: '我协助的' }],
|
title: info.judicNo,
|
tableActive: info.id,
|
tabs: [{ label: '司法确认', key: 'feedBack' }],
|
pageFrom: 'myConfirmationFeedBack',
|
});
|
navigate(`/mediate/caseDetail?caseId=${info.caseId}&judicialId=${info.judicId}&back=${location.pathname}`);
|
}
|
if (type === 'check') {
|
// 查看
|
$$.setSessionStorage(location.pathname, {
|
search,
|
breadcrumbData: [{ title: '我的司法确认', url: '/mediate/myConfirmation' }, { title: '详情' }],
|
title: info.judicNo,
|
pageFrom: 'myConfirmation',
|
tableActive: info.id,
|
});
|
navigate(`/mediate/caseDetail?caseId=${info.caseId}&judicialId=${info.judicId}&back=${location.pathname}`);
|
}
|
if (type === 'handle') {
|
// 司法确认
|
if (info.serieStatus === '2') {
|
// 系列案
|
$$.setSessionStorage(location.pathname, {
|
search,
|
breadcrumbData: [{ title: '我的司法确认', url: '/mediate/myConfirmation' }, { title: '我负责的' }],
|
title: info.judicNo,
|
tableActive: info.id,
|
tabs: [{ label: '司法确认', key: 'caseFolderFeedBack' }],
|
pageFrom: 'myConfirmationCaseFolderFeedBack',
|
});
|
navigate(`/mediate/caseDetail?caseId=${info.caseId}&judicialId=${info.judicId}&taskId=${info.id}&back=${location.pathname}`);
|
} else {
|
// 非系列案
|
$$.setSessionStorage(location.pathname, {
|
search,
|
tableActive: info.id,
|
});
|
navigate(
|
`/mediate/myConfirmation/judicialWindow?caseId=${info.caseId}&judicialId=${info.judicId}&taskId=${info.id}&back=${location.pathname}`
|
);
|
}
|
}
|
}
|
|
// 页码修改
|
function handleChangePage(page, pageSize) {
|
getMyConfirmationData({ ...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');
|
$$.changeTimeFormat(paramsObj, 'mediEndTime', 'mediEndTimeStart', 'mediEndTimeEnd');
|
if (paramsObj.judicResult) {
|
paramsObj.pageType = '2';
|
}
|
}
|
if (type === 'reset') {
|
paramsObj = { page: 1, size: 10, pageType: '0', joinRole: '1' };
|
form.resetFields();
|
form.setFieldsValue({ joinRole: '1' });
|
}
|
if (type === 'recurrent') {
|
paramsObj = { ...search, ...session.search };
|
let copyObj = { ...paramsObj };
|
if (copyObj.applyStart) {
|
copyObj.applyTime = [$$.myMoment(copyObj.applyStart), $$.myMoment(copyObj.applyEnd)];
|
}
|
if (copyObj.mediEndTimeStart) {
|
copyObj.mediEndTime = [$$.myMoment(copyObj.mediEndTimeStart), $$.myMoment(copyObj.mediEndTimeEnd)];
|
}
|
form.setFieldsValue(copyObj);
|
}
|
getMyConfirmationData(paramsObj, session?.tableActive);
|
}
|
|
// 获取数据
|
async function getMyConfirmationData(submitData, tableActive) {
|
global.setSpinning(true);
|
const res = await getMyConfirmationDataApi(submitData);
|
global.setSpinning(false);
|
if (res.type) {
|
setSearch(submitData);
|
setData({
|
total: res.data?.dtoPage?.totalElements,
|
tableData: res.data?.dtoPage?.content || [],
|
tableActive,
|
countDks: res.data.countDks,
|
countJxz: res.data.countJxz,
|
countYjs: res.data.countYjs,
|
});
|
}
|
}
|
|
// 初始化
|
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);
|
}
|
}, []);
|
|
const dks = (search.pageType === '0' ? data.total : data.countDks) || 0;
|
|
const jxz = (search.pageType === '1' ? data.total : data.countJxz) || 0;
|
|
const yjs = (search.pageType === '2' ? data.total : data.countYjs) || 0;
|
|
return (
|
<Page pageHead={{ title: '我的司法确认', subtitle: '个人名下司法确认案件列表' }}>
|
<div className="myConfirmation">
|
<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: 'Input', name: 'addr', label: '纠纷发生地' },
|
{
|
type: 'Select',
|
name: 'joinRole',
|
allowClear: false,
|
label: '参与角色',
|
selectdata: [
|
{ label: '我负责的', value: '1' },
|
{ label: '我协助的', value: '2' },
|
],
|
},
|
{ type: 'RangePicker', name: 'mediEndTime', label: '调解成功时间' },
|
{ type: 'Select', name: 'judicResult', label: '司法确认结果', selectdata: $$.options.judicResult },
|
{ type: 'TreeSelect', name: 'applyUnitId', label: '调解组织', treedata: adjustOrgData },
|
]}
|
handleReset={() => handleSearch('reset')}
|
handleSearch={() => handleSearch('search')}
|
/>
|
</div>
|
<div className="pageTabs">
|
<MyTabs
|
tabs={[
|
{ key: '0', label: `待开始(${$$.showMoreNum(dks)})` },
|
{ key: '1', label: `进行中(${$$.showMoreNum(jxz)})` },
|
{ key: '2', label: `已结束(${$$.showMoreNum(yjs)})` },
|
]}
|
activeKey={search.pageType}
|
onChange={(activeKey) => getMyConfirmationData({ ...search, page: 1, size: 10, pageType: activeKey })}
|
/>
|
</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.id === data.tableActive ? 'tableRowActive' : '')}
|
/>
|
</div>
|
</div>
|
</Page>
|
);
|
};
|
|
export default MyConfirmation;
|