/*
|
* @Company: hugeInfo
|
* @Author: ldh
|
* @Date: 2022-07-27 17:19:17
|
* @LastEditTime: 2022-12-01 11:10:33
|
* @LastEditors: ldh
|
* @Version: 1.0.0
|
* @Description: 司法确认视窗 - 司法确认申请信息
|
*/
|
import React, { useState, useEffect, useRef } from 'react';
|
import PropTypes from 'prop-types';
|
import { Row, Col, Space, Typography } from 'antd';
|
import * as $$ from '../../../utils/utility';
|
import MyUpload from '../../../components/MyUpload';
|
|
const { Link, Text } = Typography;
|
|
// 司法确认详情接口
|
function getJudicialApplyApi(submitData) {
|
return $$.ax.request({ url: 'judicInfo/getJudicInfo', type: 'get', data: submitData, service: 'mediate' });
|
}
|
|
const ApplyMsg = ({ judicialId }) => {
|
const myUploadRef = useRef();
|
|
// 数据
|
const [data, setData] = useState([]);
|
|
const getFiles = (type) => {
|
return data.applyFileList?.filter((item) => item.ownerType === type)[0]?.fileList || [];
|
};
|
|
//初始化
|
useEffect(() => {
|
async function getJudicialApply() {
|
global.setSpinning(true);
|
const res = await getJudicialApplyApi({ id: judicialId });
|
global.setSpinning(false);
|
if (res.type) {
|
setData(res.data || {});
|
}
|
}
|
getJudicialApply();
|
}, [judicialId]);
|
|
return (
|
<>
|
{/* 为了获取myUploadRef实例调用方法 */}
|
<MyUpload type="diy" showFileList={false} myUploadRef={myUploadRef} />
|
<div className="mediationWindow-modal-main" style={{ paddingBottom: '16px' }}>
|
<Row gutter={[16, 16]}>
|
<Col span={24}>
|
<h5>申请说明</h5>
|
<pre>{data.applyContent || '-'}</pre>
|
</Col>
|
{[
|
{ key: '22_00018-302', title: '调解协议书' },
|
{ key: '22_00018-402', title: '司法确认申请书' },
|
{ key: '22_00018-306', title: '人民调解委员会主持调解的证明' },
|
{ key: '22_00018-409', title: '其他材料' },
|
].map((item, index) => (
|
<Col span={24} key={index}>
|
<h5>{item.title}</h5>
|
<Row gutter={[16, 8]}>
|
{getFiles(item.key).length === 0
|
? $$.MyEmpty({ style: { margin: 0 } })
|
: getFiles(item.key).map((x, t) => (
|
<Col span={12} key={t}>
|
<div className="public-fileCard">
|
<img src={$$.fileType(x.cat)} alt="" />
|
<div className="public-fileCard-main">
|
<Text ellipsis={{ tooltip: x.name }}>{x.name}</Text>
|
<Space size="middle" className="public-fileCard-action">
|
<Link onClick={() => myUploadRef.current.handleOpenFiles(x)}>预览</Link>
|
<Link onClick={() => myUploadRef.current.handleDownloadFiles(x)}>下载</Link>
|
</Space>
|
</div>
|
</div>
|
<div className="public-fileCard-text">
|
<div>上传人:{x.uploaderName || '-'}</div>
|
<div>上传时间:{$$.timeFormat(x.createTime)}</div>
|
</div>
|
</Col>
|
))}
|
</Row>
|
</Col>
|
))}
|
</Row>
|
</div>
|
</>
|
);
|
};
|
|
ApplyMsg.propTypes = {
|
judicialId: PropTypes.string,
|
onStartMediation: PropTypes.func,
|
};
|
|
export default ApplyMsg;
|