| | |
| | | * @Author: dminyi 1301963064@qq.com |
| | | * @Date: 2024-09-02 14:49:13 |
| | | * @LastEditors: dminyi 1301963064@qq.com |
| | | * @LastEditTime: 2024-09-08 18:25:54 |
| | | * @LastEditTime: 2024-09-11 11:03:38 |
| | | * @FilePath: \gzDyh\gz-customerSystem\src\views\register\handleFeedback\component\CaseResult.jsx |
| | | * @Description: 结案申请 |
| | | */ |
| | | import React, { useState, useRef } from 'react'; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { Modal, Form, Select, Upload, Input } from '@arco-design/web-react'; |
| | | import { Col, Space, Button, Tooltip, Radio, Row } from 'antd'; |
| | | import DocumentScanner from '../../matterDetail/FileUpLoad' |
| | |
| | | import * as $$ from '@/utils/utility'; |
| | | const appUrl = $$.appUrl; |
| | | |
| | | |
| | | const FormItem = Form.Item; |
| | | const TextArea = Input.TextArea; |
| | | |
| | | |
| | | function windupApplyApi(data) { |
| | | return $$.ax.request({ url: `caseTask/windupApply`, type: 'post', service: 'mediate', data }); |
| | |
| | | |
| | | |
| | | |
| | | const CaseResult = ({ visible = false, handleOnCancel, caseResultId, caseId }) => { |
| | | const CaseResult = ({ visible = false, handleOnCancel, caseResultId, caseId, caseTaskId }) => { |
| | | const formRef = useRef(); |
| | | const navigate = useNavigate(); |
| | | const formRefWrite = useRef(); |
| | | const failRef = useRef(); |
| | | const [selectedTab, setSelectedTab] = useState('1'); // 默认选中第一个 tab |
| | |
| | | const [noHandleReason, setNoHandleReason] = useState(false); |
| | | const [radioValue, setRadioValue] = useState(1); |
| | | const [mode, setMode] = useState(false) |
| | | const [visibleType, setVisibleType] = useState(false) |
| | | |
| | | const tabs = [ |
| | | { index: '1', label: '化解成功' }, |
| | |
| | | setScanFile(false); |
| | | }; |
| | | |
| | | const onChange = (e) => { |
| | | console.log('radio checked', e.target.value); |
| | | setRadioValue(e.target.value); |
| | | }; |
| | | const handleTemplate = (type) => { |
| | | if (type === 1) { |
| | | formRef.current.setFieldValue('windupContent', '鉴于以上协议内容已经双方确认,并认为该协议内容公平合理,能够妥善解决双方的纠纷。建议双方当事人按照协议内容执行,以实现纠纷的最终解决。') |
| | | } else { |
| | | formRef.current.setFieldValue('windupContent', '') |
| | | } |
| | | } |
| | | |
| | | const handleTemplate1 = (type) => { |
| | | if (type === 1) { |
| | | formRef.current.setFieldValue('agreeContent', '根据纠纷化解人员的协调,当事人双方同意如下调解协议:[简要说明协议第一条][简要说明协议第二条][……]本口头调解协议由纠纷化解人员记录,并已告知双方当事人。双方当事人确认无误。') |
| | | } |
| | | } |
| | | |
| | | const handleSubmit = () => { |
| | | if (value === 1) { |
| | |
| | | } |
| | | |
| | | const windupApply = async (submitData) => { |
| | | console.log( |
| | | { |
| | | mediResultName: selectedTab === '1' ? '化解成功' : '化解不成功', |
| | | mediResult: selectedTab === '1' ? '22_00025-1' : '22_00025-2', |
| | | agreeType: selectedTab === '1' ? '24_00003-1' : '24_00003-2', |
| | | agreeTypeName: value === 1 ? '口头协议' : '书面协议', |
| | | caseTaskId: caseTaskId, |
| | | caseId: caseId, |
| | | caseResultId: caseResultId, |
| | | ...submitData |
| | | }, 'windupApplyData' |
| | | ) |
| | | const res = await windupApplyApi({ |
| | | mediResultName: selectedTab === '1' ? '化解成功' : '化解不成功', |
| | | mediResult: selectedTab === '1' ? '22_00025-1' : '22_00025-2', |
| | | agreeType: selectedTab === '1' ? '24_00003-1' : '24_00003-2', |
| | | agreeTypeName: value === 1 ? '口头协议' : '书面协议', |
| | | caseTaskId: caseTaskId, |
| | | caseId: caseId, |
| | | caseResultId: caseResultId, |
| | | ...submitData |
| | | }) |
| | | if (res.type) { |
| | | $$.infoSuccess({ content: '提交成功' }); |
| | | setVisibleType(false) |
| | | handleOnCancel(); |
| | | navigate('/mediate/visit/visitWorkBench') |
| | | } |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <> |
| | | <Modal visible={visibleType || visible} onCancel={handleOnCancel} title='申请结案' centered footer={null} style={{ overflow: 'auto' }}> |
| | | <Modal |
| | | visible={visible} |
| | | onCancel={handleOnCancel} |
| | | title='申请结案' |
| | | centered |
| | | footer={null} |
| | | style={{ overflow: 'auto' }} |
| | | unmountOnExit={true} |
| | | maskClosable={false} |
| | | > |
| | | <div className='caseResult-title'>化解结果</div> |
| | | <div className='caseResult-tabs'> |
| | | {tabs.map((tab) => ( |
| | |
| | | scrollToFirstError={true} |
| | | > |
| | | <Row> |
| | | <Col span={24}> |
| | | <Col span={24} style={{ position: 'relative' }}> |
| | | <FormItem |
| | | label={ |
| | | label={( |
| | | <> |
| | | <div style={{ display: 'flex' }}> |
| | | 协议要点 |
| | | <div className="must" style={{ marginLeft: '4px' }}>必填</div> |
| | | <img src={scan} alt="" style={{ marginRight: '-2px', marginLeft: '8px' }} /> |
| | | <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => setScanFile(true)}>识别材料</div> |
| | | <div className="must">必填</div> |
| | | </div> |
| | | <div className='caseResult-tips'> |
| | | <img src={tip} alt='' style={{ width: '16px', marginRight: '8px' }} /> |
| | | <span>协议要点应尽量简洁,当事人大厅来访或小程序线上反映问题时,可在小程序中查看到填写的协议要点内容</span> |
| | | </div> |
| | | <div className='modeMore'> |
| | | <div className='caseResult-textarea'>公共模板1:调解成功口头协议</div> |
| | | <div style={{ color: '#1A6FB8' }} onClick={() => setMode(!mode)}>更多模板</div> |
| | | <div style={{ position: 'absolute', display: 'flex ', top: '79px', zIndex: 1 }}> |
| | | <div className='myTag' style={{ marginRight: '22px' }} onClick={() => { handleTemplate1(1) }}>公共模板:调解成功口头协议</div> |
| | | </div> |
| | | </> |
| | | } |
| | | )} |
| | | field='agreeContent' |
| | | > |
| | | <Input.TextArea |
| | | rows={5} |
| | | maxLength={{ length: 200, errorOnly: true }} |
| | | showWordLimit |
| | | wrapperStyle={{ width: '100%' }} |
| | | <TextArea |
| | | autoSize={{ minRows: 4, maxRows: 8 }} |
| | | placeholder='请填写' |
| | | style={{ marginTop: '40px' }} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={24} style={{ position: 'relative' }}> |
| | | <div style={{ position: 'absolute', display: 'flex ', top: '28px', zIndex: 1 }}> |
| | | <div className='myTag' style={{ marginRight: '22px' }} onClick={() => { handleTemplate(1) }}>公共模板:化解成功结案意见范本</div> |
| | | <div className='myTag' onClick={() => { handleTemplate(2) }}>个人模板:化解成功结案意见范本(完整版)</div> |
| | | </div> |
| | | <FormItem |
| | | label={(<div style={{ display: 'flex' }}>结案意见<div className="must">必填</div></div>)} |
| | | field='windupContent' |
| | | > |
| | | <TextArea |
| | | autoSize={{ minRows: 4, maxRows: 8 }} |
| | | placeholder='请填写' |
| | | style={{ marginTop: '40px' }} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | |
| | | {/* <Col span={24}> |
| | | <FormItem |
| | | label={ |
| | | <> |
| | |
| | | wrapperStyle={{ width: '100%' }} |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | </Col> */} |
| | | </Row> |
| | | </Form> |
| | | </> |
| | |
| | | action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId=${caseId}&ownerId=${caseResultId}&ownerType=22_00018-302`, |
| | | }} |
| | | field='file' |
| | | label='代理人委托书' |
| | | label='' |
| | | // editData={props.editData} |
| | | ownerType='22_00018-302' |
| | | /> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Col span={24} style={{ position: 'relative' }}> |
| | | <div style={{ position: 'absolute', display: 'flex ', top: '28px', zIndex: 1 }}> |
| | | <div className='myTag' style={{ marginRight: '22px' }} onClick={() => { handleTemplate(1) }}>公共模板:化解成功结案意见范本</div> |
| | | <div className='myTag' onClick={() => { handleTemplate(2) }}>个人模板:化解成功结案意见范本(完整版)</div> |
| | | </div> |
| | | <FormItem |
| | | label={ |
| | | <> |
| | | <div style={{ display: 'flex' }}> |
| | | 结案意见 |
| | | <div className="must" style={{ marginLeft: '4px' }}>必填</div> |
| | | </div> |
| | | <div className='modeMore'> |
| | | <div className='tabs1' > |
| | | {tabs1.map((tab) => ( |
| | | <div |
| | | key={tab.index} |
| | | style={{ |
| | | color: selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(0,0,0,0.45)', |
| | | border: `1px solid ${selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(229,230,235,1)'}`, |
| | | borderRadius: '2px', |
| | | cursor: 'pointer', |
| | | padding: '0px 8px', |
| | | }} |
| | | onClick={() => handleTabChange1(tab.index)} |
| | | > |
| | | {tab.label} |
| | | </div> |
| | | ))} |
| | | </div> |
| | | <div style={{ color: '#1A6FB8' }} onClick={() => setMode(!mode)}>更多模板</div> |
| | | |
| | | </div> |
| | | |
| | | </> |
| | | } |
| | | label={(<div style={{ display: 'flex' }}>结案意见<div className="must">必填</div></div>)} |
| | | field='windupContent' |
| | | rules={[{ message: '请填写事项概况', required: true }]} |
| | | > |
| | | {/* <div className='tabs1' > |
| | | {tabs1.map((tab) => ( |
| | | <div |
| | | key={tab.index} |
| | | style={{ |
| | | color: selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(0,0,0,0.45)', |
| | | border: `1px solid ${selectedTab1 === tab.index ? 'rgba(26,111,184,1)' : 'rgba(229,230,235,1)'}`, |
| | | borderRadius: '2px', |
| | | cursor: 'pointer', |
| | | padding: '0px 8px', |
| | | }} |
| | | onClick={() => handleTabChange1(tab.index)} |
| | | > |
| | | {tab.label} |
| | | </div> |
| | | ))} |
| | | </div> */} |
| | | <Input.TextArea |
| | | rows={5} |
| | | wrapperStyle={{ width: '100%' }} |
| | | value='鉴于以上协议内容已经双方确认,并认为该协议内容公平合理,能够妥善解决双方的纠纷。建议双方当事人按照协议内容执行,以实现纠纷的最终解决。' |
| | | <TextArea |
| | | autoSize={{ minRows: 4, maxRows: 8 }} |
| | | placeholder='请填写' |
| | | style={{ marginTop: '40px' }} |
| | | /> |
| | | </FormItem> |
| | | </Col> |