广州市综治平台前端
liuwh
4 days ago fa5361c6776f01975737fb5630594a9c60924fc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import React, { useRef, useState, useEffect } from 'react'
import { Row, Col, Space } from 'antd';
import { Form, Input, Button, Radio, Message } from '@arco-design/web-react';
import * as $$ from '@/utils/utility';
import { useNavigate } from 'react-router-dom';
 
const RadioGroup = Radio.Group;
const FormItem = Form.Item;
const TextArea = Input.TextArea;
 
function submit(data) {
  return $$.ax.request({ url: `rmtj/batchEndAudit`, type: 'post', service: 'mediate', data });
}
 
 
export default function ReviewExamine(props) {
  const navigate = useNavigate();
  const formRef = useRef();
  const [result, setResult] = useState()
 
  useEffect(() => {
  }, [])
 
 
 
 
  const handleSubmit = () => {
    if (formRef.current) {
      formRef.current.validate(undefined, (errors, values) => {
        if (!errors) {
          const data = formRef.current.getFields()
          requestSubmit({
            applyIdList: props.selectKeys,
            ...data
          })
        }
      })
    }
  }
 
  const requestSubmit = async (data) => {
    const res = await submit(data)
    if (res.type) {
      Message.success({
        content: <div className='myMessageBox'>
          <div className='messageTop'>案件转入中</div>
          <div className='messageBottom'>案件正在转入人民调解系统,这个过程可能需要几分钟,请耐心等待</div>
        </div>,
        showIcon: true,
        className: 'acro-myMessage',
        position: 'bottom',
        duration: 5000,
      })
      props.onCancel()
    }
  }
 
  return (
    <div className='dataSync'>
      <Form
        ref={formRef}
        layout='vertical'
        requiredSymbol={false}
        initialValues={{
          auditResult: '1',
          auditResultName: '同意'
        }}//默认值
        scrollToFirstError
      >
        <Row>
          <Col span={24}>
            <div style={{ color: '#86909C' }}>批量审核数量</div>
            <div style={{ margin: '8px 0 12px 0' }}>{props.selectKeys.length}</div>
          </Col>
          <Col span={24}>
            <FormItem
              label={(<div style={{ display: 'flex' }}>审核结果</div>)}
              field='auditResult'
            >
              <RadioGroup
                direction='vertical'
                options={[
                  {
                    label: '同意',
                    value: '1'
                  },
                  {
                    label: '不同意',
                    value: '2'
                  },
                ]}
                onChange={(value) => {
                  setResult(value)
                  if (value) {
                    const data = $$.options.auditResult.find(item => item.value === value)
                    formRef.current.setFieldValue('auditResultName', data.label)
                  } else {
                    formRef.current.setFieldValue('auditResultName', '')
                  }
                }}
              />
            </FormItem>
          </Col>
          {result === '2' &&
            <>
              <Col span={24}>
                <FormItem
                  label={(<div style={{ display: 'flex' }}>审核意见<div className="must">必填</div></div>)}
                  field='auditContent'
                  rules={[{ required: true, message: '审核意见不能为空' }]}
                >
                  <TextArea
                    autoSize={{ minRows: 4, maxRows: 8 }}
                    placeholder='请填写具体审核意见'
                  />
                </FormItem>
              </Col>
            </>
          }
        </Row>
      </Form>
      <div className='dialogFooter' style={{ margin: 0, background: '#fff' }}>
        <Button
          type="primary"
          className="dialogPrimary"
          onClick={handleSubmit}
        >
          提交
        </Button>
      </div>
    </div>
  )
}