forked from gzzfw/frontEnd/gzDyh

dminyi
2024-09-03 173b3d0069802ded2d61f2d0154874585176f096
gz-customerSystem/src/views/register/handleFeedback/component/handle.jsx
@@ -1,7 +1,7 @@
import React, { useState, useRef, useEffect } from 'react';
import { Col, Space, Row, Tooltip, Button } from 'antd';
import { Col, Space, Row, Tooltip } from 'antd';
import { register, fold, down, empty, link } from '@/assets/images';
import { Form, Input, Tabs, Typography, Empty } from '@arco-design/web-react';
import { Form, Input, Tabs, Typography, Empty, Upload, Button, Modal } from '@arco-design/web-react';
import { question1, } from '@/assets/images';
import ProgressStep from '@/components/ProgressStep/VisitStep';
import SelectObjModal from '@/components/SelectObjModal/selectPerson';
@@ -9,6 +9,10 @@
import { scan } from '@/assets/images/icon'
import DocumentScanner from './FileUpLoad'
import * as $$ from '@/utils/utility';
import {
  IconLink,
} from '@arco-design/web-react/icon';
import CaseResult from './CaseResult'
const InputSearch = Input.Search;
@@ -72,12 +76,20 @@
  },
];
function getByIdRoleApi(id) {
  return $$.ax.request({ url: 'ctUser/getByIdRole?id=' + id, type: 'get', service: 'cust' });
}
const Handle = () => {
  const [selectedTab, setSelectedTab] = useState('1'); // 默认选中第一个 tab
  const [wantUser, setWantUser] = useState({});
  // const [scanFile, setScanFile] = useState(false);
  const [formView, setFormView] = useState(false);
  const [personView, setPersonView] = useState(false);
  const [data, setData] = useState({})
  const [caseResult, SetCaseResult] = useState(false);
  const tabs = [
    { index: '1', label: '承办部门' },
@@ -85,7 +97,6 @@
  ];
  const [isModalVisible, setIsModalVisible] = useState(false);
  const formRef = useRef(null);
@@ -177,20 +188,36 @@
  const [scannerVisible, setScannerVisible] = useState(false);
  const handleConfirm = (text) => {
    console.log('识别完成:', text);
  const handleConfirm = () => {
    // 处理确认逻辑
    setScannerVisible(false);
  };
  const handleCancel = () => {
    // 处理取消逻辑
    setScannerVisible(false);
  };
  const openScanner = () => {
    setScannerVisible(true);
    formRef.current?.resetFields();
    formRef.current?.setFieldsValue({});
  };
  const onCancel = () => {
    setScannerVisible(false);
  };
  const getByIdRole = async () => {
    const res = await getByIdRoleApi('2105180249501982')
    if (res.type) {
      let data = res.data
      setData(data)
    }
  }
  useEffect(() => {
    getByIdRole()
  }, [])
@@ -214,7 +241,7 @@
              <div><div className="title-text">经办人:</div></div>
              <div style={{ display: 'flex' }}>
                <div>王一顺</div>
                <img src={register} alt='' style={{ width: '14px', height: '14px', marginLeft: '8px', marginTop: '4px' }} />
                <img onClick={() => setPersonView(!personView)} src={register} alt='' style={{ width: '14px', height: '14px', marginLeft: '8px', marginTop: '4px' }} />
              </div>
            </Col>
            <Col span={8} style={{ display: 'flex' }}>
@@ -309,39 +336,68 @@
                    description='暂无数据'
                  />
                }
                <div className='Form'>
                  <Col span={24} style={{ marginBottom: '8px' }}>
                    <Space size='small'>
                      <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>添加办理记录</h5>
                {formView &&
                  <div className='Form'>
                    <Col span={24} style={{ marginBottom: '8px' }}>
                      <Space size='small'>
                        <div className='MediationInfo-subTitle' style={{ marginTop: '-9px' }}></div><h5>添加办理记录</h5>
                      </Space>
                    </Col>
                    <Col span={24}>
                      <FormItem
                        label={<div style={{ display: 'flex' }}>
                          办理意见
                          <img src={scan} alt="" style={{ marginRight: '-2px', marginLeft: '8px' }} />
                          <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={openScanner}>识别材料</div>
                        </div>
                        }
                        field='caseDes'
                        rules={[{ message: '请填写事项概况', required: true }]}
                      >
                        <Input.TextArea
                          maxLength={200}
                          showWordLimit
                          rows={5}
                          placeholder='请完整描述事项概况,应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过'
                          wrapperStyle={{ width: '100%' }}
                        />
                      </FormItem>
                    </Col>
                    <Col span={24}>
                      <FormItem
                        label={<div style={{ display: 'flex' }}>
                          办理附件
                        </div>
                        }
                        field='caseDes'
                        rules={[{ message: '请填写事项概况', required: true }]}
                      >
                        <Upload
                          drag
                          multiple
                          accept='image/*'
                          action='/'
                          onDrop={(e) => {
                          }}
                          tip='支持png、jpg、pdf格式的图片上传,每次上传大小不超过10M'
                          showUploadList={{
                            fileIcon: <IconLink style={{ color: '#1D2129' }} />,
                          }}
                        />
                      </FormItem>
                    </Col>
                    <Space size='middle'>
                      <Button type='primary'>保存</Button>
                      <Button type='secondary'>取消添加</Button>
                    </Space>
                  </Col>
                  <Col span={24}>
                    <FormItem
                      label={<div style={{ display: 'flex' }}>
                        办理意见
                        <img src={scan} alt="" style={{ marginRight: '-2px', marginLeft: '8px' }} />
                        <div style={{ marginLeft: '8px', color: '#1A6FB8', fontSize: '14px', cursor: 'pointer' }} onClick={openScanner}>识别材料</div>
                      </div>
                      }
                      field='caseDes'
                      rules={[{ message: '请填写事项概况', required: true }]}
                    >
                      <Input.TextArea
                        maxLength={2000}
                        showWordLimit
                        rows={5}
                        placeholder='请完整描述事项概况,应具备5要素:发生时间+发生地点+人物情况+事项起因+事项经过'
                        wrapperStyle={{ width: '100%' }}
                      />
                    </FormItem>
                  </Col>
                  </div>
                </div>
                }
              </Col>
            </Form>
            <Space style={{ marginTop: '38px', position: 'absolute', bottom: '4px' }}>
              <Button type="primary" style={{ backgroundColor: '#1A6FB8' }}>添加办理记录</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} >结案申请</Button>
            <Space style={{ marginTop: '38px', bottom: '4px' }}>
              <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={() => setFormView(!formView)}>添加办理记录</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={() => SetCaseResult(!caseResult)}>结案申请</Button>
              <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }}>联合处置申请</Button>
              <Button type='secondary'>返回上级页面</Button>
            </Space>
@@ -409,11 +465,35 @@
        <DocumentScanner
          visible={scannerVisible}
          onCancel={onCancel}
          onConfirm={handleConfirm}
          formRef={formRef}
          onCancel={handleCancel}
        />
      </div >
        <Modal visible={personView} onCancel={() => setPersonView(false)} title='工作人员信息' centered footer={null}>
          <table border="1" align="center" cellpadding="5" className="table">
            <tr>
              <th bgcolor="#F7F8FA" className="table-title" width="120">姓名</th>
              <td width='380'><div style={{ display: 'flex' }}><div>{data.trueName}</div></div></td>
              <th bgcolor="#F7F8FA" className="table-title" width="120">登录账号</th>
              <td width='380'>{data.acc}</td>
            </tr>
            <tr>
              <th bgcolor="#F7F8FA" className="table-title">手机号码</th>
              <td>{data.mobile}</td>
              <th bgcolor="#F7F8FA" className="table-title">工作电话</th>
              <td>020-83002020</td>
            </tr>
            <tr>
              <th bgcolor="#F7F8FA" className="table-title">所属部门</th>
              <td>{data.deptName}</td>
              <th bgcolor="#F7F8FA" className="table-title">职务</th>
              <td>主任</td>
            </tr>
          </table>
        </Modal>
        <CaseResult visible={caseResult} handleOnCancel={() => SetCaseResult(false)} />
      </div>
    </>
  )