forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-09-13 899e81654c9389785d58f9dbdf2ea7d2b2bc9082
gz-customerSystem/src/views/register/eventFlow/component/Examine.jsx
@@ -5,6 +5,7 @@
import ArcoUpload from '@/components/ArcoUpload';
import { Scrollbars } from "react-custom-scrollbars";
import * as $$ from '@/utils/utility';
import { getOffset, getSize } from '@/utils/utility';
const RadioGroup = Radio.Group;
const FormItem = Form.Item;
@@ -21,18 +22,16 @@
  return $$.ax.request({ url: url, type: 'post', service: 'mediate', data });
}
function getId() {
  return $$.ax.request({ url: `caseUtils/getNewTimeId`, type: 'get', service: 'utils' });
}
function delFile(id) {
  return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } });
}
export default function Examine(props) {
  const formRef = useRef();
  const scrollRef = useRef(null);
  const [infoData, setInfoData] = useState({});
  const [id, setId] = useState();
  const [height, setHeight] = useState(500);
  const mainFlag = props.type == 'htsh' ? 'return' : 'appear'
  const options = [
    {
@@ -51,16 +50,25 @@
  useEffect(() => {
    getInfoData()
    getAppId()
  }, [props.type])
  //获取id
  const getAppId = async () => {
    const res = await getId()
    if (res.type) {
      setId(res.data)
  useEffect(() => {
    onWindowResize()
    window.addEventListener("resize", onWindowResize);
    // 返回一个函数,该函数会在组件卸载前执行
    return () => {
      // 组件销毁时执行
      window.removeEventListener("resize", onWindowResize);
    };
  }, [])
  const onWindowResize = () => {
    let offsetTop = 0;
    if (scrollRef.current.container) {
      offsetTop = getOffset(scrollRef.current.container).top;
    }
  }
    setHeight(getSize().windowH - offsetTop - 74)
  };
  //回显数据
  const getInfoData = async () => {
@@ -69,6 +77,7 @@
    })
    if (res.type) {
      setInfoData(res.data || {})
      setId(res.data.id)
    }
  }
@@ -125,12 +134,12 @@
                      {resIndex !== res.fileList.length - 1 && <>,</>}
                    </a>
                  })
                })}
                }) || '-'}
              </div>
            </Col>
            <Col span={24}>
              <div><div className="title-text">申请时间</div></div>
              <div>{infoData[mainFlag + 'Time'] || '-'}</div>
              <div>{$$.myTimeFormat(infoData[mainFlag + 'Time'], 'YYYY-MM-DD HH:mm') || '-'}</div>
            </Col>
            <Col span={24}>
              <div><div className="title-text">申请人</div></div>
@@ -143,7 +152,7 @@
          </Row>
        </div>
        <div className='whiteBox' style={{ marginTop: '8px' }}>
          <Scrollbars style={{ height: 'calc(100vh - 577px)' }} autoHide>
          <Scrollbars style={{ height: height + 'px' }} autoHide ref={scrollRef}>
            <Space size='small'>
              <div className='MediationInfo-subTitle' style={{ marginTop: '-8px' }}></div><h5>审核</h5>
            </Space>
@@ -186,7 +195,7 @@
                      options={options}
                      onChange={(value) => {
                        const obj = options.find(item => item.value === value)
                        formRef.current.setFieldValue('audit_content', obj.label)
                        formRef.current.setFieldValue('auditContent', obj.label)
                      }}
                    >
                    </RadioGroup>
@@ -195,7 +204,7 @@
                <Col span={24}>
                  <FormItem
                    label=' '
                    field='audit_content'
                    field='auditContent'
                    rules={[{ required: true, message: '理由不能为空' }]}
                  >
                    <TextArea