| | |
| | | docSubmit = () => { |
| | | const { selectDocs, list } = this.state |
| | | |
| | | |
| | | if (selectDocs.length > 0 && list.length > 0) { |
| | | let _list = fromJS(list).toJS() |
| | | let err = '' |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { disabled } = this.props |
| | | const { visible, upVisible, docVisible, files, list, documents, loading } = this.state |
| | | |
| | | return ( |
| | |
| | | title="添加附件" |
| | | wrapClassName="voucher-attach-wrap" |
| | | visible={visible} |
| | | width={700} |
| | | width={'62vw'} |
| | | maskClosable={false} |
| | | onOk={this.submit} |
| | | onCancel={() => { this.setState({ visible: false })}} |
| | |
| | | destroyOnClose |
| | | > |
| | | {loading ? <Spin /> : null} |
| | | <Button type="link" className="attach-type-btn" disabled={loading} onClick={() => this.setState({upVisible: true})}>上传新文件</Button> |
| | | <Button type="link" className="attach-type-btn" disabled={loading} onClick={() => this.setState({docVisible: true, selectDocs: []})}>从会计电子档案选择</Button> |
| | | <Button type="link" className="attach-type-btn" disabled={loading || disabled} onClick={() => this.setState({upVisible: true})}>上传新文件</Button> |
| | | <Button type="link" className="attach-type-btn" disabled={loading || disabled} onClick={() => this.setState({docVisible: true, selectDocs: []})}>从会计电子档案选择</Button> |
| | | <div className="attach-selected-list"> |
| | | {list.map(item => { |
| | | return <div className="attach-item" key={item.id}> |
| | | <img src={item.icon} alt=""/> |
| | | <div className="attach-msg"> |
| | | <div>{item.attachments_title}</div> |
| | | <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_url}</div> |
| | | {/* <div>{item.attachments_title}</div> */} |
| | | <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_title}</div> |
| | | </div> |
| | | <div> |
| | | <DeleteOutlined onClick={() => this.deleteFile(item.id)}/> |
| | | {!disabled ? <DeleteOutlined onClick={() => this.deleteFile(item.id)}/> : null} |
| | | </div> |
| | | </div> |
| | | })} |
| | |
| | | title="添加附件" |
| | | wrapClassName="voucher-attach-add-wrap" |
| | | visible={upVisible} |
| | | width={700} |
| | | width={'62vw'} |
| | | maskClosable={false} |
| | | onOk={this.upSubmit} |
| | | onCancel={() => { this.setState({ upVisible: false })}} |
| | |
| | | title="电子档案" |
| | | wrapClassName="voucher-attach-document-wrap" |
| | | visible={docVisible} |
| | | width={700} |
| | | width={'62vw'} |
| | | maskClosable={false} |
| | | onOk={this.docSubmit} |
| | | onCancel={() => { this.setState({ docVisible: false, selectDocs: [] })}} |
| | | destroyOnClose |
| | | > |
| | | {docVisible ? <Documents documents={documents} onChange={(vals) => this.setState({selectDocs: vals})}/> : null} |
| | | {docVisible ? <Documents documents={documents} list={list} onChange={(vals) => this.setState({selectDocs: vals})}/> : null} |
| | | </Modal> |
| | | </> |
| | | ) |