From b42b6be06e1029a4c83c122b6a94c9210f26b9e0 Mon Sep 17 00:00:00 2001 From: zhangyongtian <1181606322@qq.com> Date: Wed, 11 Sep 2024 10:07:26 +0800 Subject: [PATCH] fix: 文件材料修复 --- gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx | 26 +++++++++++++++++--------- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx index 82cf116..3883ce4 100644 --- a/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx +++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx @@ -26,6 +26,7 @@ const [addVisabled, setAddVisabled] = useState(false);//添加当事人弹窗控制 const [fakeData, setFakeData] = useState([]);//当事人信息数据 const [scanFile, setScanFile] = useState(false); + const [ocrText, setOcrText] = useState(''); const [mapView, setMapView] = useState(false); const [visible, setVisible] = useState(false); @@ -49,8 +50,7 @@ }, [fakeData]) useEffect(() => { - console.log(props.partyList); - setFakeData(props.partyList.map(item => { + setFakeData(props.partyList?.map(item => { const fileInfoList = item.fileInfoList let file = [];//身份证明材料、企业登记材料 let file1 = [];//法人、机构身份证明材料、代理人授权委托书 @@ -75,7 +75,7 @@ file, file1 } - })) + }) || []) }, [props.partyList]) //获取当前时间 @@ -102,7 +102,7 @@ const handleConfirm = (scanContent) => { // 处理确认逻辑 - props.formRef.current.setFieldValue('caseDes', scanContent) + props.formRef.current.setFieldValue(ocrText, scanContent) setScanFile(false); console.log(scanContent, 'scanContent') @@ -331,7 +331,7 @@ </Tooltip> <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 style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => { setScanFile(true); setOcrText('caseDes') }}>识别上传材料</div> </div> } field='caseDes' @@ -355,7 +355,7 @@ </Tooltip> */} <div className="must">必填</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 style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={() => { setScanFile(true); setOcrText('caseClaim') }}>识别上传材料</div> </div> } field='caseClaim' @@ -385,14 +385,22 @@ </div> </Row> - </Form> + </Form > <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '8px', marginTop: '20px' }}> <Space size='small'> <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h4>事件材料</h4> </Space> </Col> - <FileTable mainId={props.mainId} /> - + <div style={{ marginBottom: '65px' }}> + <FileTable + mainId={props.mainId} + fileInfoList={props.fileInfoList} + isReview={false} + handleSaveList={(list) => { + props.formRef.current.setFieldValue('fileInfoList', list) + }} + /> + </div> <DocumentScanner visible={scanFile} onConfirm={handleConfirm} -- Gitblit v1.8.0