dengyinhuan
1 year ago
2 changed files with 97 additions and 1 deletions
@ -0,0 +1,94 @@ |
|||
import React, { useState, useEffect } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { Form, Input, Select, DatePicker, InputNumber, Button, Modal } from 'antd'; |
|||
import { unitList } from '../containers/assess' |
|||
import { getAssess, delAssess, editAssess } from '../actions/assess'; |
|||
import moment from 'moment'; |
|||
import { getRoadadministration,addRoadadministration,delRoadadministration,modifyRoadadministration } from '../actions/luzheng'; |
|||
import Uploads from "../../../../components/Upload/index" |
|||
const { Option } = Select; |
|||
|
|||
const AssessModal = ({ editData, check, visible, onCancel, dispatch }) => { |
|||
const [form] = Form.useForm(); |
|||
|
|||
return ( |
|||
<Modal |
|||
title="路政信息" |
|||
open={visible} |
|||
visible={visible} |
|||
cancelButtonProps={{ |
|||
disabled: check, |
|||
}} |
|||
onOk={() => { |
|||
if (check) { |
|||
return onCancel() |
|||
} |
|||
form.validateFields().then(values => { |
|||
dispatch(editAssess({ |
|||
...values, |
|||
month: moment(values.month).format('YYYY-MM-DD'), |
|||
assessId: editData ? editData.id : undefined |
|||
})).then(res => { |
|||
if (res.success) { |
|||
onCancel() |
|||
} |
|||
}) |
|||
}) |
|||
}} |
|||
onCancel={() => { |
|||
onCancel() |
|||
}} |
|||
> |
|||
<Form |
|||
form={form} |
|||
initialValues={editData ? { |
|||
...editData, |
|||
month: moment(editData.month), |
|||
} : {}} |
|||
disabled={check} |
|||
labelCol={{ |
|||
span: 6, |
|||
}} |
|||
wrapperCol={{ |
|||
span: 18, |
|||
}} |
|||
> |
|||
<Form.Item name="enforcementdate" label="执法日期" rules={[{ required: true, message: '请填写' }]}> |
|||
{/* <Select> |
|||
{ |
|||
unitList.map(item => ( |
|||
<Option value={item} key={item} /> |
|||
)) |
|||
} |
|||
</Select> */} |
|||
<DatePicker/> |
|||
</Form.Item> |
|||
|
|||
<Form.Item name="roadname" label="执法道路" rules={[{ required: true, message: '请填写' }]}> |
|||
<Input/> |
|||
</Form.Item> |
|||
|
|||
<Form.Item name="enforcementreslt" label="执法成果" rules={[{ required: true, message: '请填写' }]}> |
|||
<Input/> |
|||
</Form.Item> |
|||
|
|||
<Form.Item name="picfile" label="执法图片"> |
|||
<Uploads |
|||
maxFilesNum={1} |
|||
fileTypes={['mp4']} |
|||
maxFileSize={200} |
|||
/> |
|||
</Form.Item> |
|||
</Form> |
|||
</Modal> |
|||
); |
|||
}; |
|||
|
|||
function mapStateToProps (state) { |
|||
const { auth, assess } = state |
|||
return { |
|||
user: auth.user, |
|||
assess: assess.data || [] |
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(AssessModal); |
Loading…
Reference in new issue