|
|
@@ -6,10 +6,10 @@
|
|
|
import React, { Component } from 'react'
|
|
|
import './formCommon.less'
|
|
|
import { Upload } from 'antd'
|
|
|
-import { isObjNull } from '../../../utils/common/common.util'
|
|
|
+import { getBracketStr, isObjNull } from '../../../utils/common/common.util'
|
|
|
import { Toast } from 'antd-mobile'
|
|
|
import { UploadOutlined } from '@ant-design/icons'
|
|
|
-import BillModel from '../../../model/common/BillModel'
|
|
|
+import BillModel, { billReadOnly } from '../../../model/common/BillModel'
|
|
|
|
|
|
let uploadFail = false
|
|
|
|
|
|
@@ -84,33 +84,36 @@ export default class FormEnclosure extends Component {
|
|
|
action={this.props.baseUrl + '/mobile/uploadAttachs.action'}
|
|
|
listType={'picture'}
|
|
|
multiple={true}
|
|
|
+ disabled={billReadOnly(billModel)}
|
|
|
fileList={billModel.fileList ? billModel.fileList : []}
|
|
|
showUploadList={true}
|
|
|
withCredentials={true}
|
|
|
beforeUpload={this.beforeUpload}
|
|
|
onChange={this.handleChange}
|
|
|
// onPreview={this.handlePreview}
|
|
|
- // onRemove={this.handleRemove}
|
|
|
+ onRemove={this.handleRemove}
|
|
|
// onDownload={() => {}}
|
|
|
// data={''}
|
|
|
method={'post'}
|
|
|
className={'upload-list-inline'}
|
|
|
>
|
|
|
- <div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
- <div
|
|
|
- className={'uploadBtn'}>
|
|
|
- <UploadOutlined
|
|
|
- style={{ color: 'white' }}/>
|
|
|
- <span style={{ fontSize: '12px', marginLeft: '6px' }}>选择文件</span>
|
|
|
+ {
|
|
|
+ billReadOnly(billModel) ||
|
|
|
+ <div style={{ display: 'flex', alignItems: 'center' }}>
|
|
|
+ <div
|
|
|
+ className={'uploadBtn'}>
|
|
|
+ <UploadOutlined
|
|
|
+ style={{ color: 'white' }}/>
|
|
|
+ <span style={{ fontSize: '12px', marginLeft: '6px' }}>选择文件</span>
|
|
|
+ </div>
|
|
|
+ <span className='promptText'>(不能超过100MB)</span>
|
|
|
</div>
|
|
|
- <span className='promptText'>(不能超过100MB)</span>
|
|
|
- </div>
|
|
|
+ }
|
|
|
</Upload>
|
|
|
</div>
|
|
|
}
|
|
|
|
|
|
handleChange = ({ fileList }) => {
|
|
|
- console.log('filelist', fileList)
|
|
|
if (uploadFail) {
|
|
|
return
|
|
|
}
|
|
|
@@ -122,15 +125,18 @@ export default class FormEnclosure extends Component {
|
|
|
if (fileList) {
|
|
|
fileList.forEach((file, index) => {
|
|
|
file.enclosureId = (file.response && file.response.id)
|
|
|
- ? file.response.id
|
|
|
- : ''
|
|
|
+ ? getBracketStr(file.response.id)
|
|
|
+ : file.enclosureId
|
|
|
+ if (file.enclosureId) {
|
|
|
+ value = value + file.enclosureId + ';'
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
billModel.fileList = fileList
|
|
|
this.setState({ billModel })
|
|
|
- // this.props.onTextChange &&
|
|
|
- // this.props.onTextChange(this.props.groupIndex, this.props.childIndex,
|
|
|
- // value)
|
|
|
+ this.props.onTextChange &&
|
|
|
+ this.props.onTextChange(this.props.groupIndex, this.props.childIndex,
|
|
|
+ value)
|
|
|
}
|
|
|
}
|
|
|
|