/*
|
* @Company: hugeInfo
|
* @Author: ldh
|
* @Date: 2022-03-23 11:16:55
|
* @LastEditTime: 2023-12-11 10:10:02
|
* @LastEditors: dminyi 1301963064@qq.com
|
* @Version: 1.0.0
|
* @Description: 调解结束-反馈调解结果
|
*/
|
import React, { useState, useEffect, useRef } from 'react';
|
import { useSearchParams, useNavigate } from 'react-router-dom';
|
import { Row, Col, Space, Select, Input, Button, Typography, Radio, Checkbox, Tooltip } from 'antd';
|
import { PlusOutlined, CloseCircleFilled } from '@ant-design/icons';
|
import * as $$ from '../../../utils/utility';
|
import MyUpload from '../../../components/MyUpload';
|
|
const { Option } = Select;
|
|
const { TextArea } = Input;
|
|
const { Link } = Typography;
|
|
// 获取调解结果数据
|
function getDataApi(submitData) {
|
return $$.ax.request({ url: `caseInfo/pcWindowMeetUsers?caseId=${submitData}`, type: 'get', service: 'mediate' });
|
}
|
|
|
// 调解结果反馈
|
function resultFeedbackApi(submitData) {
|
return $$.ax.request({ url: 'caseInfo/pcWindowInMediResult', type: 'post', data: submitData, service: 'mediate' });
|
}
|
|
//全局修改
|
function globalUpdateApi(submitData) {
|
return $$.ax.request({ url: 'caseInfo/globalUpdate', type: 'post', data: submitData, service: 'mediate' });
|
}
|
|
|
|
|
|
const ResultFeedback = ({ caseId, taskId, disputeData, showResultButton }) => {
|
const myUploadRef = useRef();
|
|
const [searchParams] = useSearchParams();
|
|
let navigate = useNavigate();
|
|
const back = searchParams.get('back');
|
|
// form数据
|
const [formData, setFormData] = useState({});
|
|
// 申请人,被申请人,其他人数据
|
const [data, setData] = useState({});
|
|
function handleChangeInput(key, value) {
|
if (key === 'mediResult') {
|
formData.mediResult = value[0];
|
formData.mediResultName = value[1];
|
if (value[0] === '22_00025-2') {
|
formData.mediFalse = $$.options.mediFalseCause[0].value;
|
formData.mediFalseName = $$.options.mediFalseCause[0].label;
|
}
|
} else if (key === 'mediFalse') {
|
formData.mediFalse = value[0];
|
formData.mediFalseName = value[1];
|
} else if (key === 'fulfilSitu') {
|
formData.fulfilSitu = value[0];
|
formData.fulfilSituName = value[1];
|
} else {
|
formData[key] = value;
|
}
|
setFormData({ ...formData });
|
}
|
|
// 文件展示
|
function handleChangeFile(file) {
|
$$.modalInfo({
|
content: '确定删除该文书吗?',
|
onOk: () => {
|
myUploadRef.current.handleDeleteFiles(file.id).then((res) => {
|
if (res) getData();
|
});
|
},
|
});
|
}
|
|
// 获取参与人数据
|
async function getData() {
|
global.setSpinning(true);
|
const res = await getDataApi(caseId);
|
global.setSpinning(false);
|
if (res.type) {
|
let resData = res.data || {};
|
setData(resData);
|
}
|
}
|
|
// 调解结果反馈
|
async function resultFeedback() {
|
let submitData = { ...formData, caseId, taskId };
|
console.log('submitData', submitData);
|
console.log('data', data);
|
if (submitData.mediResult === '22_00025-2') {
|
delete submitData.fulfilSitu;
|
delete submitData.fulfilSituName;
|
delete submitData.agreeContent;
|
if (submitData.civilStatus === '1') {
|
delete submitData.civilNo;
|
}
|
delete submitData.mediateBookNo;
|
delete submitData.mediateNo;
|
} else {
|
delete submitData.mediFalse;
|
delete submitData.mediFalseName;
|
delete submitData.civilStatus;
|
delete submitData.civilNo;
|
}
|
if (data.meetUserList?.length == 0 || !data.meetUserList) {
|
return $$.info({ type: 'warning', content: '您没有预约记录,暂时无法提交' })
|
}
|
submitData.meetUserList = data.meetUserList?.map((x) => {
|
return { id: x.id, signStatus: x.signStatus };
|
});
|
global.setSpinning(true);
|
const res = await resultFeedbackApi(submitData);
|
global.setSpinning(false);
|
if (res.type) {
|
navigate(`/mediate/myAdjust/mediationWindowSuccess?caseId=${caseId}`)
|
}
|
}
|
|
useEffect(() => {
|
setFormData({
|
mediResult: $$.options.mediResult[0].value,
|
mediResultName: $$.options.mediResult[0].label,
|
fulfilSitu: disputeData?.fulfilSitu || $$.options.fulfilSitu[1].value,
|
fulfilSituName: disputeData?.fulfilSituName || $$.options.fulfilSitu[1].label,
|
civilStatus: '1',
|
agreeContent: disputeData?.agreeContent,
|
mediateBookNo: disputeData?.mediateBookNo,
|
mediateNo: disputeData?.mediateNo,
|
handleContent: disputeData?.handleContent,
|
});
|
//xxx-==='已归档'&& getData();
|
getData();
|
// globalUpdateApi(formData);
|
}, []);
|
|
|
console.log ("formData",formData)
|
return (
|
<>
|
<div className="mediationWindow-modal-main">
|
<Row gutter={[16, 16]}>
|
<Col span={24}>
|
<h5>调解结果</h5>
|
<Radio.Group value={formData.mediResult} onChange={(e) => handleChangeInput('mediResult', [e.target.value, e.target.label])}>
|
<Space direction="vertical">
|
{$$.options.mediResult.map((x) => (
|
<Radio value={x.value} key={x.value} label={x.label}>
|
{x.label}
|
</Radio>
|
))}
|
</Space>
|
</Radio.Group>
|
</Col>
|
{formData.mediResult === '22_00025-2' ? (
|
<>
|
<Col span={24}>
|
<h5>调解不成功原因</h5>
|
<Radio.Group value={formData.mediFalse} onChange={(e) => handleChangeInput('mediFalse', [e.target.value, e.target.label])}>
|
<Space direction="vertical">
|
{$$.options.mediFalseCause.map((x) => (
|
<Radio value={x.value} key={x.value} label={x.label}>
|
{x.label}
|
</Radio>
|
))}
|
</Space>
|
</Radio.Group>
|
</Col>
|
{
|
formData.mediFalse === '22_00019-9' &&
|
<Col span={24}>
|
<TextArea
|
value={formData.mediFalseContent}
|
placeholder="输入调解不成功的具体原因"
|
allowClear
|
rows={2}
|
onChange={(e) => handleChangeInput('mediFalseContent', e.target.value)}
|
/>
|
</Col>
|
}
|
<Col span={24}>
|
<h5>是否转诉讼案件</h5>
|
<Radio.Group value={formData.civilStatus} onChange={(e) => handleChangeInput('civilStatus', e.target.value)}>
|
<Space direction="vertical">
|
<Radio value={'1'}>否,未转诉讼</Radio>
|
<Radio value={'2'}>是,转诉讼</Radio>
|
</Space>
|
</Radio.Group>
|
</Col>
|
{formData.civilStatus === '2' && (
|
<Col span={24}>
|
<h5>诉讼案号</h5>
|
<Input
|
value={formData.civilNo}
|
onChange={(e) => handleChangeInput('civilNo', e.target.value)}
|
placeholder="输入审判业务系统的立案号(如有)"
|
allowClear
|
style={{ width: '354px' }}
|
/>
|
</Col>
|
)}
|
</>
|
) : (
|
<>
|
<Col span={24}>
|
<h5>履行情况</h5>
|
<Select
|
value={formData.fulfilSitu}
|
onChange={(value, options) => handleChangeInput('fulfilSitu', [value, options.label])}
|
style={{ width: '354px' }}
|
>
|
{$$.options.fulfilSitu.map((x) => (
|
<Option value={x.value} key={x.value} label={x.label}>
|
{x.label}
|
</Option>
|
))}
|
</Select>
|
</Col>
|
<Col span={24}>
|
<h5>达成的调解协议</h5>
|
<TextArea
|
value={formData.agreeContent}
|
onChange={(e) => handleChangeInput('agreeContent', e.target.value)}
|
placeholder="输入双方申请人达成的调解协议内容"
|
allowClear
|
rows={4}
|
/>
|
</Col>
|
<Col span={24}>
|
<h5>协议文书</h5>
|
<Row gutter={[24, 16]}>
|
{data.resultFileList
|
?.filter((item) => item.ownerType === '22_00018-302')[0]
|
?.fileList.map((x, t) => (
|
<Col span={12} key={t}>
|
<div className="public-fileCard">
|
<img src={$$.fileType(x.cat)} alt="" />
|
<div className="public-fileCard-main">
|
<Typography.Text ellipsis={{ tooltip: x.name }}>{x.name}</Typography.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 className="public-fileCard-del" onClick={() => handleChangeFile(x)}>
|
<CloseCircleFilled />
|
</div>
|
</div>
|
<div className="public-fileCard-text">
|
<div>制作人:{x.uploaderName || '-'}</div>
|
<div>制作时间:{$$.timeFormat(x.createTime)}</div>
|
</div>
|
</Col>
|
))}
|
<Col span={12}>
|
<MyUpload
|
type="diy"
|
fileId={caseId}
|
fileType="22_00018-302"
|
fileList={data.resultFileList?.filter((item) => item.ownerType === '22_00018-302')[0]?.fileList || []}
|
showFileList={false}
|
myUploadRef={myUploadRef}
|
handleChangeFile={(type) => {
|
if (type === 'success') getData();
|
}}
|
>
|
<Tooltip title="点击上传">
|
<div className="mediationWindow-document-plus">
|
<PlusOutlined style={{ fontSize: '24px', color: 'rgba(0,0,0,0.5)' }} />
|
</div>
|
</Tooltip>
|
</MyUpload>
|
</Col>
|
</Row>
|
</Col>
|
<Col span={24}>
|
<h5>诉前调书号</h5>
|
<Input
|
value={formData.mediateBookNo}
|
onChange={(e) => handleChangeInput('mediateBookNo', e.target.value)}
|
placeholder="输入审判业务系统的诉前调书号(如有)"
|
allowClear
|
style={{ width: '354px' }}
|
/>
|
</Col>
|
<Col span={24}>
|
<h5>诉前调解案号</h5>
|
<Input
|
value={formData.mediateNo}
|
onChange={(e) => handleChangeInput('mediateNo', e.target.value)}
|
placeholder="输入审判业务系统的诉前调解案号(如有)"
|
allowClear
|
style={{ width: '354px' }}
|
/>
|
</Col>
|
</>
|
)}
|
<Col span={24}>
|
<h5>人员参与情况(打勾代表参与调解)</h5>
|
<Space direction="vertical">
|
{!data.meetUserList?.length && $$.MyEmpty()}
|
{data.meetUserList?.map((x, t) => (
|
<Checkbox
|
key={t}
|
checked={x.signStatus === '2' ? true : false}
|
onChange={(e) => {
|
data.meetUserList[t].signStatus = e.target.checked ? '2' : '1';
|
setData({ ...data });
|
}}
|
>
|
{x.userName}
|
</Checkbox>
|
))}
|
</Space>
|
</Col>
|
<Col span={24}>
|
<h5>调解备注</h5>
|
<TextArea
|
value={formData.handleContent}
|
placeholder="简要对调解过程进行总结"
|
allowClear
|
rows={2}
|
onChange={(e) => handleChangeInput('handleContent', e.target.value)}
|
/>
|
</Col>
|
{/* TODO:暂无 */}
|
<Col span={24}>
|
<h5>上传附件</h5>
|
<MyUpload fileId={caseId} fileType="22_00018-305" fileList={data.sceneFileList || []} />
|
</Col>
|
</Row>
|
</div>
|
<div className="mediationWindow-modal-footer">
|
{!showResultButton &&
|
<Space size="large">
|
<Button
|
type="primary"
|
onClick={() => {
|
$$.modalInfo({
|
title: '调解结果提交确认',
|
content: <span>确定提交本案的调解结果为<span className="public-color">{formData.mediResultName}</span>吗?</span>,
|
okText: '确定提交',
|
cancelText: '我再想想',
|
onOk: () => resultFeedback(),
|
});
|
}}
|
>
|
提交结果
|
</Button>
|
</Space>
|
|
}
|
</div>
|
</>
|
);
|
};
|
|
export default ResultFeedback;
|