forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-09-06 e978022eaa03c076b18c851a7c0852402e80fd1c
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
import React, { useState, useRef } from 'react';
import { Form, Input, Tabs, Typography, Button, Modal, Select } from '@arco-design/web-react';
import { Col, Space, Row, Tooltip } from 'antd';
import ArcoUpload from '@/components/ArcoUpload';
import * as $$ from '@/utils/utility';
import { question1, } from '@/assets/images';
 
const FormItem = Form.Item;
const Option = Select.Option;
const appUrl = $$.appUrl;
 
function delFile(id) {
  return $$.ax.request({ url: `fileInfo/deleteFileById`, type: 'get', service: 'sys', data: { id } });
}
 
 
const UniteHandle = ({ id, visible, handleOnCancel }) => {
  const formRef = useRef();
  const [supervising, setSupervising] = useState(false);
  const [fileVisible, setFileVisible] = useState(false);
 
  const options = [
    { value: '1', label: '一' }, { value: '2', label: '二' }, { value: '3', label: '三' }
  ];
 
 
 
 
  //删除文件
  const handleDelFile = async (id) => {
    const res = await delFile(id)
    if (res.type) {
      $$.infoSuccess({ content: '删除成功!' });
    }
  }
 
  const handleSupervising = () => {
    setSupervising(!supervising)
  }
 
 
  return (
    <>
      <Modal visible={visible} onCancel={handleOnCancel} title='联合处置申请' centered footer={null}>
        <Form
          ref={formRef}
          layout='vertical'
          requiredSymbol={false}
          scrollToFirstError={true}
          initialValues={{
            suggestion: ''
          }}//默认值
        >
          <Row>
            <Col span={24}>
              <FormItem
                label={<div style={{ display: 'flex' }}><div>添加配合部门</div><div style={{ color: '#86909C' }}>(可多选)</div></div>}
                field=''
              >
                <Select
                  mode='multiple'
                  placeholder='请选择督办部门'
                  style={{}}
                  allowClear
                >
                  {options.map((option) => (
                    <Option key={option.value} value={option.value} onChange={(v) => console.log(v, 'vvvvvv')}>
                      {option.label}
                    </Option>
                  ))}
                </Select>
              </FormItem>
            </Col>
            <Col span={24}>
              <FormItem
                field='suggestion'
                label={(<div style={{ display: 'flex' }}>添加理由<div className="must">必填</div></div>)}
              >
                <Input.TextArea
                  rows={5}
                  wrapperStyle={{ width: '700px' }}
                  value='在事项办理过程中:因[......业务]涉及白云区新市街司法所因[......业务]涉及白云区新市街劳监大队特申请将上述部门列为配合部门,请审批'
                />
              </FormItem>
            </Col>
            <Col span={24}>
              <FormItem
                label={
                  <div>
                    附件材料
                    <Tooltip onClick={() => setFileVisible(true)}>
                      <img src={question1} alt="" style={{ width: '13px', height: '13px', margin: '-3px 4px 0px 4px' }} />
                    </Tooltip>
                  </div>
                }
                field='caseDes'
                rules={[{ message: '请填写事项概况', required: true }]}
              >
                <ArcoUpload
                  params={{
                    action: `${appUrl.fileUrl}/${appUrl.sys}/api/web/fileInfo/upload?mainId='24083010062110001'&&ownerId=${id}&ownerType=22_00018-508`,
                  }}
                  field='file1'
                  // handleChangeFile={handleChangeFile}
                  label=''
                  // editData={props.editData}
                  handleDelFile={handleDelFile}
                />
              </FormItem>
            </Col>
            <Button type='primary' style={{ marginTop: '-16px' }} onClick={() => handleSupervising()}>提交申请</Button>
          </Row>
        </Form>
      </Modal>
    </>
  )
}
 
export default UniteHandle;