|
@@ -4,9 +4,61 @@ import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import '../../userMangagement.less';
|
|
|
import {orderType} from '../../../../dataDic.js';
|
|
|
-import {splitUrl,getOrderType,getOrderStage,getOrderState,getTransactionProject,getPaymentState,getOrderChannel,getApprovedState,getLock,getPaymentMethod,getTransactionChannel} from '../../../../tools.js';
|
|
|
+import {splitUrl,getOrderType,getOrderStage,getOrderState,getTransactionProject,getPaymentState,getOrderChannel,getApprovedState,getLock,getPaymentMethod,getTransactionChannel,beforeUploadFile} from '../../../../tools.js';
|
|
|
const Option = AutoComplete.Option;
|
|
|
-
|
|
|
+//图片组件
|
|
|
+const PicturesWall = React.createClass({
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ previewVisible: false,
|
|
|
+ previewImage: '',
|
|
|
+ fileList: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCancel() {
|
|
|
+ this.setState({ previewVisible: false })
|
|
|
+ },
|
|
|
+ handlePreview(file) {
|
|
|
+ this.setState({
|
|
|
+ previewImage: file.url || file.thumbUrl,
|
|
|
+ previewVisible: true,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleChange(info) {
|
|
|
+ let fileList = info.fileList;
|
|
|
+ this.setState({ fileList });
|
|
|
+ this.props.fileList(fileList);
|
|
|
+ },
|
|
|
+ componentWillReceiveProps(nextProps) {
|
|
|
+ this.state.fileList = nextProps.pictureUrl;
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ const { previewVisible, previewImage, fileList } = this.state;
|
|
|
+ const uploadButton = (
|
|
|
+ <div>
|
|
|
+ <Icon type="plus" />
|
|
|
+ <div className="ant-upload-text">点击上传</div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ return (
|
|
|
+ <div style={{display:"inline-block"}}>
|
|
|
+ <Upload
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ action={globalConfig.context + "/api/admin/order/uploadOrderImg"}
|
|
|
+ data={{ 'sign': '' }}
|
|
|
+ listType="picture-card"
|
|
|
+ fileList={fileList}
|
|
|
+ onPreview={this.handlePreview}
|
|
|
+ onChange={this.handleChange} >
|
|
|
+ {fileList.length >= 5 ? null : uploadButton}
|
|
|
+ </Upload>
|
|
|
+ <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
|
|
|
+ <img alt="example" style={{ width: '100%' }} src={previewImage} />
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
+});
|
|
|
const NewService = Form.create()(React.createClass({
|
|
|
loadData(record) {
|
|
|
this.state.data = [];
|
|
@@ -823,26 +875,29 @@ const NewService = Form.create()(React.createClass({
|
|
|
<span>{orderDetaiel.contractNo}</span>
|
|
|
</FormItem>
|
|
|
<div className="clearfix">
|
|
|
- <FormItem
|
|
|
+ <FormItem
|
|
|
labelCol={{ span: 4 }}
|
|
|
wrapperCol={{ span: 18 }}
|
|
|
label="合同扫描件" >
|
|
|
- <Upload className="demandDetailShow-upload"
|
|
|
- listType="customer_sys_file"
|
|
|
- fileList={this.state.orgCodeUrl}
|
|
|
- onPreview={(file) => {
|
|
|
- this.setState({
|
|
|
- previewImage: file.url || file.thumbUrl,
|
|
|
- previewVisible: true,
|
|
|
- });
|
|
|
- }} >
|
|
|
- </Upload>
|
|
|
- <Modal maskClosable={false} footer={null}
|
|
|
- visible={this.state.previewVisible}
|
|
|
- onCancel={() => { this.setState({ previewVisible: false }) }}>
|
|
|
- <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
|
|
|
- </Modal>
|
|
|
- </FormItem>
|
|
|
+ <div className="clearfix">
|
|
|
+ <Upload className="demandDetailShow-upload"
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ listType="picture-card"
|
|
|
+ fileList={this.state.orgCodeUrl}
|
|
|
+ onPreview={(file) => {
|
|
|
+ this.setState({
|
|
|
+ previewImage: file.url || file.thumbUrl,
|
|
|
+ previewVisible: true,
|
|
|
+ });
|
|
|
+ }} >
|
|
|
+ </Upload>
|
|
|
+ <Modal maskClosable={false} footer={null}
|
|
|
+ visible={this.state.previewVisible}
|
|
|
+ onCancel={() => { this.setState({ previewVisible: false }) }}>
|
|
|
+ <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+ </FormItem>
|
|
|
</div>
|
|
|
<div className='clearfix'>
|
|
|
<FormItem
|