|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useEffect, useState } from 'react'
|
2
|
|
-import { Button, Radio, Icon, Form, Input, Row, Col, Modal, notification, Checkbox, InputNumber } from 'antd';
|
|
2
|
+import { Button, Radio, Icon, Form, Input, Row, Col, Modal, notification, Checkbox, Select, InputNumber } from 'antd';
|
3
|
3
|
import { render } from 'react-dom';
|
4
|
4
|
import request from '../../../../../utils/request';
|
5
|
5
|
import apis from '../../../../../services/apis';
|
|
@@ -28,11 +28,11 @@ class TypeForm extends React.Component {
|
28
|
28
|
}
|
29
|
29
|
|
30
|
30
|
onChange(e, name) {
|
31
|
|
- // console.log(e.target.value)
|
|
31
|
+ // console.log(e)
|
32
|
32
|
this.props.form.validateFieldsAndScroll((err, values) => {
|
33
|
33
|
if (!err) {
|
34
|
34
|
// console.log('Received values of form: ', values);
|
35
|
|
- const currentValue = e.target.value
|
|
35
|
+ const currentValue = name === 'marketStatus' ? e : e.target.value
|
36
|
36
|
if (currentValue === '') {
|
37
|
37
|
values[name] = null
|
38
|
38
|
} else {
|
|
@@ -54,7 +54,7 @@ class TypeForm extends React.Component {
|
54
|
54
|
const { getFieldDecorator } = this.props.form;
|
55
|
55
|
|
56
|
56
|
// this.props.form.setFieldsValue(this.props.type)
|
57
|
|
- console.log(this.props.type)
|
|
57
|
+ // console.log(this.props.type,"33333333")
|
58
|
58
|
return (
|
59
|
59
|
<>
|
60
|
60
|
<Col span={11} style={{
|
|
@@ -66,16 +66,34 @@ class TypeForm extends React.Component {
|
66
|
66
|
|
67
|
67
|
<p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''} <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
|
68
|
68
|
|
69
|
|
- <Form {...formItemLayout} style={{ padding: '10px 0px 10px 10px' }}>
|
|
69
|
+ <Form {...formItemLayout} style={{ padding: '5px 0px 5px 5px' }}>
|
70
|
70
|
<Form.Item label="类型编号" style={{ display: 'none' }}>
|
71
|
71
|
{getFieldDecorator('buildingTypeId')(<Input disabled />)}
|
72
|
72
|
</Form.Item>
|
73
|
73
|
<Form.Item label="状态" style={{ display: 'none' }}>
|
74
|
74
|
{getFieldDecorator('status')(<Input disabled />)}
|
75
|
75
|
</Form.Item>
|
76
|
|
- <Form.Item label="价格">
|
77
|
|
- {getFieldDecorator('price')(<Input placeholder="元/㎡" maxLength="9" onChange={e => this.onChange(e, 'price')} />)}
|
|
76
|
+ <Form.Item label="价格类型">
|
|
77
|
+ {getFieldDecorator('priceType')(
|
|
78
|
+ <Radio.Group onChange={e => this.onChange(e, 'priceType')} >
|
|
79
|
+ <Radio value="average">均价</Radio>
|
|
80
|
+ <Radio value="total">总价</Radio>
|
|
81
|
+ </Radio.Group>
|
|
82
|
+ )}
|
|
83
|
+ </Form.Item>
|
|
84
|
+ <Form.Item label="价格区间" help='最高价与最低价一致时,只展示一个'>
|
|
85
|
+ {getFieldDecorator('startPrice')(<Input placeholder="最低价" style={{width: '60px'}} maxLength="9" onChange={e => this.onChange(e, 'startPrice')} />)} --
|
|
86
|
+ {getFieldDecorator('endPrice')(<Input placeholder="最高价" style={{width: '60px'}} maxLength="9" onChange={e => this.onChange(e, 'endPrice')} />)}{this.props.type.priceType === "average" ? "元/㎡" : "万元/套"}
|
78
|
87
|
</Form.Item>
|
|
88
|
+ <Form.Item label="销售状态" >
|
|
89
|
+ {getFieldDecorator('marketStatus')(
|
|
90
|
+ <Select placeholder="销售状态" onChange={e => this.onChange(e, 'marketStatus')} >
|
|
91
|
+ <Option value="待售">待售</Option>
|
|
92
|
+ <Option value="在售">在售</Option>
|
|
93
|
+ <Option value="售罄">售罄</Option>
|
|
94
|
+ </Select>,
|
|
95
|
+ )}
|
|
96
|
+ </Form.Item>
|
79
|
97
|
<Form.Item label="装修标准">
|
80
|
98
|
{getFieldDecorator('decoration')(<Input onChange={e => this.onChange(e, 'decoration')} />)}
|
81
|
99
|
</Form.Item>
|
|
@@ -136,7 +154,7 @@ class ProjectTypeBody extends React.Component {
|
136
|
154
|
const { projectType } = this.state
|
137
|
155
|
const buildingType = projectType.filter(item => checked.includes(`${item.buildingTypeId}`))
|
138
|
156
|
|
139
|
|
- const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, price: null, decoration: null, rightsYear: null, status: '1' }))
|
|
157
|
+ const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, startPrice: null,endPrice: null,priceType: "average", decoration: null, rightsYear: null, status: '1' }))
|
140
|
158
|
const updateProjectDate = this.updateProjectType(tempDate)
|
141
|
159
|
console.log('updateProjectDate: ', updateProjectDate)
|
142
|
160
|
this.setState({ data: updateProjectDate })
|