forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-10 4e3b493f07b4bc7f325a4b8ebc91704ec8e902a9
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);
@@ -47,6 +48,35 @@
      props.formRef.current.setFieldValue('fakeData', fakeData)
    }
  }, [fakeData])
  useEffect(() => {
    setFakeData(props.partyList?.map(item => {
      const fileInfoList = item.fileInfoList
      let file = [];//身份证明材料、企业登记材料
      let file1 = [];//法人、机构身份证明材料、代理人授权委托书
      if (fileInfoList && fileInfoList.length != 0) {
        fileInfoList.forEach(item => {
          if (item.ownerType == '22_00018-202' || item.ownerType == '22_00018-203') {
            file.push({
              name: item.fileList[0].trueName,
              uid: item.fileList[0].id,
            })
          }
          if (item.ownerType == '22_00018-204' || item.ownerType == '22_00018-207') {
            file1.push({
              name: item.fileList[0].trueName,
              uid: item.fileList[0].id,
            })
          }
        })
      }
      return {
        ...item,
        file,
        file1
      }
    }) || [])
  }, [props.partyList])
  //获取当前时间
  const getFormattedDateTime = () => {
@@ -72,7 +102,7 @@
  const handleConfirm = (scanContent) => {
    // 处理确认逻辑
    props.formRef.current.setFieldValue('caseDes', scanContent)
    props.formRef.current.setFieldValue(ocrText, scanContent)
    setScanFile(false);
    console.log(scanContent, 'scanContent')
@@ -85,7 +115,7 @@
  //添加当事人
  const handleAddParty = (value, isEdit) => {
    console.log(value, isEdit);
    console.log(value);
    if (isEdit) {
      //编辑
      const newList = fakeData.map(item => {
@@ -301,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'
@@ -325,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'
@@ -355,13 +385,13 @@
          </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}/>
      <FileTable mainId={props.mainId} fileInfoList={props.fileInfoList} isReview={false} />
      <DocumentScanner
        visible={scanFile}