import React, {Component} from 'react'
|
import { fromJS } from 'immutable'
|
import { Button, Modal } from 'antd'
|
|
import './index.scss'
|
|
class ResetAttach extends Component {
|
state = {
|
visible: false,
|
list: ''
|
}
|
|
submit = () => {
|
this.setState({remark: '', visible: false})
|
this.props.onChange()
|
}
|
|
trigger = () => {
|
const { attachlist } = this.props
|
|
this.setState({visible: true, list: fromJS(attachlist).toJS()})
|
}
|
|
render() {
|
const { visible } = this.state
|
|
return (
|
<>
|
<Button type="link" onClick={this.trigger}>附件</Button>
|
<Modal
|
title="添加附件"
|
wrapClassName="voucher-attach-wrap"
|
visible={visible}
|
width={700}
|
maskClosable={false}
|
onOk={this.submit}
|
onCancel={() => { this.setState({ visible: false })}}
|
cancelText=""
|
destroyOnClose
|
>
|
<Button type="link" className="attach-type-btn" onClick={this.trigger}>上传新文件</Button>
|
<Button type="link" className="attach-type-btn" onClick={this.trigger}>从会计电子档案选择</Button>
|
<div className="attach-selected-list">
|
|
|
</div>
|
</Modal>
|
</>
|
)
|
}
|
}
|
|
export default ResetAttach
|