import React, { useEffect, useState } from 'react';
|
import { useNavigate, useLocation, useSearchParams } from 'react-router-dom';
|
import { Form, Typography, Space } from 'antd';
|
import { Tooltip } from '@arco-design/web-react';
|
import NewTableSearch from '../../components/NewTableSearch';
|
import TableView from '../../components/TableViewCanSort';
|
import MyTabsNew from '../../components/MyTabsNew';
|
import NewPage from '../../components/NewPage';
|
import * as $$ from '../../utils/utility';
|
import './index.less';
|
// 列表数据
|
function getImportDraftDataApi(submitData) {
|
return $$.ax.request({ url: 'judicInfo/pageCourtAudit', type: 'get', data: submitData, service: 'mediate' });
|
}
|
|
const { Link } = Typography;
|
|
// 两个列表的默认搜索参数
|
const unApplySearch = { page: 1, size: 10, sortColmn: 1, sortType: 2 };
|
const applySearch = { page: 1, size: 10, sortColmn: 2, sortType: 2 };
|
const CourtAuditList = () => {
|
let location = useLocation();
|
|
let navigate = useNavigate();
|
|
const [searchParams] = useSearchParams();
|
|
const [form] = Form.useForm();
|
|
// 搜索 申请渠道,22_00001-1:机构登记,22_00001-2:小程序,22_00001-3:其他渠道
|
const [search, setSearch] = useState(unApplySearch);
|
|
// tabs标签分页
|
const [mediateTab, setMediateTab] = useState('0');
|
|
// 数据
|
const [data, setData] = useState({ tableData: [] });
|
|
//自定义排序
|
function getOrderPara(field, order) {
|
// field, auditTime applyTime
|
// sortColmn 2 审核时间 1 申请时间
|
// sortType 1-升序,2-降序
|
if (field === 'auditTime') {
|
if (order === 'descend') {
|
return { sortColmn: 2, sortType: 2 };
|
}
|
if (order === 'ascend') {
|
return { sortColmn: 2, sortType: 1 };
|
}
|
if (order === 'undefined') {
|
return { sortColmn: 2, sortType: '' };
|
}
|
}
|
if (field === 'applyTime') {
|
if (order === 'descend') {
|
return { sortColmn: 1, sortType: 2 };
|
}
|
if (order === 'ascend') {
|
return { sortColmn: 1, sortType: 1 };
|
}
|
if (order === 'undefined') {
|
return { sortColmn: 1, sortType: '' };
|
}
|
}
|
}
|
|
// 查看,签收跳转
|
function handleJump(record) {
|
$$.setSessionStorage(location.pathname, { search: search });
|
navigate(
|
`/mediate/courtAuditDetail?caseId=${record.caseId}&caseTaskId=${record.caseTaskId}&judicId=${record.id}&back=${location.pathname}&tab=${mediateTab}`
|
);
|
}
|
//审核页面
|
function modifyJump(record) {
|
navigate(
|
`/mediate/courtAuditEdit?caseId=${record.caseId}&caseTaskId=${record.caseTaskId}&judicId=${record.id}&back=${
|
location.pathname
|
}&tab=${mediateTab}&idList=${JSON.stringify(record.idList || [])}`
|
);
|
}
|
|
// 搜索 or 重置
|
function handleSearch(type, data, tab) {
|
// 重置
|
if (type === 'reset') {
|
let defaultSearch = tab === '0' ? unApplySearch : applySearch;
|
form.resetFields();
|
getImportDraftData({ ...defaultSearch, status: tab });
|
return;
|
}
|
// 筛选条件搜索
|
if (type === 'search') {
|
let values = form.getFieldsValue();
|
$$.changeTimNeweFormat(values, 'applyTime', 'applyStart', 'applyEnd');
|
$$.changeTimNeweFormat(values, 'auditTime', 'auditStart', 'auditEnd');
|
$$.searchCascader(values, 'caseType', 1, ['caseType', 'caseType']);
|
getImportDraftData({ page: search.page, size: search.size, sortColmn: search.sortColmn, sortType: search.sortType, ...values, status: tab });
|
}
|
// 翻页、正序倒序
|
if (type === 'sort') {
|
getImportDraftData({ ...data, status: tab });
|
}
|
// 案件详情返回时恢复跳转前查询
|
if (type === 'recovery') {
|
let obj = { ...data };
|
if (obj.applyStart) {
|
obj.applyTime = [obj.applyStart, obj.applyEnd];
|
}
|
if (obj.auditStart) {
|
obj.auditTime = [obj.auditStart, obj.auditEnd];
|
}
|
form.setFieldsValue(obj);
|
getImportDraftData({ ...data, status: tab });
|
return;
|
}
|
}
|
|
// 获取草稿数据
|
async function getImportDraftData(submitData) {
|
global.setSpinning(true);
|
const res = await getImportDraftDataApi(submitData);
|
global.setSpinning(false);
|
if (res.type) {
|
setData({ total: res.data.totalElements, tableData: res.data.content, totalData: res.data?.totalData });
|
setSearch(submitData);
|
}
|
}
|
|
// 初始化
|
useEffect(() => {
|
let returnRouteData = $$.getSessionStorage(location.pathname);
|
if (searchParams.get('isBack') && !!returnRouteData) {
|
searchParams.get('tab') && setMediateTab(searchParams.get('tab'));
|
handleSearch('recovery', returnRouteData.search, searchParams.get('tab'));
|
} else {
|
handleSearch('reset', '', '0');
|
}
|
if (!!returnRouteData) {
|
$$.clearSessionStorage(location.pathname);
|
}
|
}, []);
|
|
const columns = [
|
{
|
title: '申请时间',
|
width: 120,
|
dataIndex: 'applyTime',
|
defaultSortOrder: 'descend',
|
order: 'ascend',
|
sorter: { compare: (a, b) => {} },
|
render: (text) => <span>{$$.dateFormat(text)}</span>,
|
},
|
{ title: '申请部门', dataIndex: 'applyUnitName' },
|
{ title: '申请理由', dataIndex: 'applyContent' },
|
{ title: '纠纷类型', width: 150, dataIndex: 'caseTypeName' },
|
{
|
title: '申请方',
|
width: 130,
|
dataIndex: 'plaintiffs',
|
render: (text) => (
|
<span>
|
{' '}
|
<Tooltip content={text}>{$$.ellipsis(text, 7)}</Tooltip>
|
</span>
|
),
|
},
|
|
{
|
title: '被申请方',
|
width: 130,
|
dataIndex: 'defendants',
|
render: (text) => (
|
<span>
|
{' '}
|
<Tooltip content={text}>{$$.ellipsis(text, 7)}</Tooltip>
|
</span>
|
),
|
},
|
{
|
title: '承办部门',
|
width: 130,
|
dataIndex: 'mediateUnitName',
|
render: (text) => (
|
<span>
|
{' '}
|
<Tooltip content={text}>{$$.ellipsis(text, 7)}</Tooltip>
|
</span>
|
),
|
},
|
{ title: '经办人', width: 100, dataIndex: 'mediator' },
|
{
|
title: '操作',
|
dataIndex: 'action',
|
width: 90,
|
render: (_, record) => {
|
return (
|
<Space size="middle">
|
<Link onClick={() => modifyJump(record)}>审核</Link>
|
</Space>
|
);
|
},
|
},
|
];
|
|
const appliedColumns = [
|
{
|
title: '审核时间',
|
width: 120,
|
dataIndex: 'auditTime',
|
defaultSortOrder: 'descend',
|
order: 'ascend',
|
sorter: { compare: (a, b) => {} },
|
render: (text) => <span>{$$.dateFormat(text)}</span>,
|
},
|
{ title: '审核人', width: 100, dataIndex: 'mediateUnitName' },
|
{
|
title: '审核结果',
|
dataIndex: 'judicAudit',
|
render: (text) => (
|
<span className={text === '24_00004-1' ? 'public-success' : text === '24_00004-2' ? 'public-danger' : ''}>
|
{text === '24_00004-1' ? '同意' : text === '24_00004-2' ? '不同意' : '-'}
|
</span>
|
),
|
},
|
{ title: '司法确认案号', dataIndex: 'judicNo' },
|
{
|
title: '申请时间',
|
width: 120,
|
dataIndex: 'applyTime',
|
order: 'ascend',
|
sorter: { compare: (a, b) => {} },
|
render: (text) => <span>{$$.dateFormat(text)}</span>,
|
},
|
{ title: '申请部门', width: 100, dataIndex: 'applyUnitName' },
|
{ title: '纠纷类型', dataIndex: 'caseTypeName' },
|
{
|
title: '申请方',
|
width: 130,
|
dataIndex: 'plaintiffs',
|
render: (text) => (
|
<span>
|
{' '}
|
<Tooltip content={text}>{$$.ellipsis(text, 7)}</Tooltip>
|
</span>
|
),
|
},
|
{
|
title: '被申请方',
|
width: 130,
|
dataIndex: 'defendants',
|
render: (text) => (
|
<span>
|
{' '}
|
<Tooltip content={text}>{$$.ellipsis(text, 7)}</Tooltip>
|
</span>
|
),
|
},
|
{
|
title: '承办部门',
|
width: 130,
|
dataIndex: 'mediateUnitName',
|
render: (text) => (
|
<span>
|
{' '}
|
<Tooltip content={text}>{$$.ellipsis(text, 7)}</Tooltip>
|
</span>
|
),
|
},
|
{ title: '经办人', width: 100, dataIndex: 'mediator' },
|
{
|
title: '操作',
|
dataIndex: 'action',
|
width: 90,
|
render: (_, record) => {
|
return (
|
<Space size="middle">
|
<Link onClick={() => handleJump(record)}>详情</Link>
|
</Space>
|
);
|
},
|
},
|
];
|
|
return (
|
<NewPage pageHead={{ breadcrumbData: [{ title: '工作台' }, { title: '法院审查' }], title: '法院审查' }}>
|
<div className="comprehensive">
|
<div className="myMediation-search">
|
<NewTableSearch
|
exportButtonShow={false}
|
headTitle={'查询条件'}
|
labelLength={4}
|
rowNum={2}
|
form={form}
|
itemData={[
|
{ type: 'RangePicker', name: 'auditTime', label: '审核时间', shortcutsPlacementLeft: true, shortcuts: $$.shortcutsList(), span: 8 },
|
{
|
type: 'Select',
|
name: 'judicAudit',
|
label: '审核结果',
|
placeholder: '请选择',
|
span: 8,
|
selectdata: [
|
{ label: '同意', value: '24_00004-1' },
|
{ label: '不同意', value: '24_00004-2' },
|
],
|
},
|
{ type: 'Input', name: 'judicNo', label: '司法确认案号', placeholder: '请填写' },
|
{ type: 'RangePicker', name: 'applyTime', label: '申请时间', shortcutsPlacementLeft: true, shortcuts: $$.shortcutsList(), span: 8 },
|
{ type: 'Input', name: 'plaintiffs', label: '申请方', placeholder: '请填写' },
|
{ type: 'Input', name: 'defendants', label: '被申请方', placeholder: '请填写' },
|
]}
|
handleReset={() => handleSearch('reset', '', mediateTab)}
|
handleSearch={() => handleSearch('search', '', mediateTab)}
|
/>
|
</div>
|
<div className="pageTabs" style={{ borderBottom: '1px solid #e5e6eb' }}>
|
<MyTabsNew
|
tabs={[
|
{ key: '0', label: `待审核(${$$.showMoreNum(data.totalData?.unApplyNum || 0)})` },
|
{ key: '1', label: `已审核(${$$.showMoreNum(data.totalData?.applyNum || 0)})` },
|
]}
|
activeKey={mediateTab}
|
onChange={(activeKey) => {
|
setMediateTab(activeKey);
|
handleSearch('sort', activeKey === '0' ? unApplySearch : applySearch, activeKey);
|
}}
|
/>
|
</div>
|
<div style={{ margin: '6px 0' }}></div>
|
<div style={{ flex: '1', marginBottom: '16px' }} className="pageTable">
|
{/* 待审核 */}
|
{mediateTab === '0' && (
|
<TableView
|
showHeader
|
title="查询结果"
|
columns={columns}
|
dataSource={data.tableData}
|
onChange={(pagination, filters, sorter) => {
|
handleSearch(
|
'sort',
|
{ page: pagination.current, size: pagination.pageSize, ...getOrderPara(sorter.field, sorter.order) },
|
mediateTab
|
);
|
}}
|
pagination={{
|
current: search.page,
|
pageSize: search.size,
|
total: data.total,
|
}}
|
/>
|
)}
|
{/* 已审核 */}
|
{mediateTab === '1' && (
|
<TableView
|
showHeader
|
title="查询结果"
|
columns={appliedColumns}
|
dataSource={data.tableData}
|
onChange={(pagination, filters, sorter) => {
|
handleSearch(
|
'sort',
|
{ page: pagination.current, size: pagination.pageSize, ...getOrderPara(sorter.field, sorter.order) },
|
mediateTab
|
);
|
}}
|
pagination={{
|
current: search.page,
|
pageSize: search.size,
|
total: data.total,
|
}}
|
/>
|
)}
|
</div>
|
</div>
|
</NewPage>
|
);
|
};
|
|
export default CourtAuditList;
|