|
@@ -7,6 +7,7 @@ import moment from 'moment';
|
7
|
7
|
import styles from '../../style/GoodsList.less';
|
8
|
8
|
import SelectCity from '../../../components/SelectButton/CitySelect'
|
9
|
9
|
import BuildSelect from '../../../components/SelectButton/BuildSelect'
|
|
10
|
+import ImageUpload from '../../../components/XForm/ImageUpload'
|
10
|
11
|
import apis from '../../../services/apis';
|
11
|
12
|
import request from '../../../utils/request';
|
12
|
13
|
import AuthButton from '@/components/AuthButton';
|
|
@@ -15,6 +16,8 @@ const { Option } = Select;
|
15
|
16
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
16
|
17
|
|
17
|
18
|
|
|
19
|
+
|
|
20
|
+
|
18
|
21
|
const header = props => {
|
19
|
22
|
const { salesBatchId } = props.location.query
|
20
|
23
|
console.log(salesBatchId)
|
|
@@ -26,11 +29,11 @@ const header = props => {
|
26
|
29
|
|
27
|
30
|
// 查询列表
|
28
|
31
|
const getSaleBatchData = (salesBatchId) => {
|
29
|
|
- request({ ...apis.system.taPolicy, urlData: {id: salesBatchId} }).then((data) => {
|
30
|
|
- console.log(data)
|
31
|
|
- setSaleBatchData(data)
|
32
|
|
- })
|
33
|
|
- }
|
|
32
|
+ request({ ...apis.system.taPolicy, urlData: {id: salesBatchId} }).then((data) => {
|
|
33
|
+ console.log(data)
|
|
34
|
+ setSaleBatchData(data)
|
|
35
|
+ })
|
|
36
|
+ }
|
34
|
37
|
}
|
35
|
38
|
|
36
|
39
|
const cancelPage = () =>{
|
|
@@ -38,79 +41,11 @@ const header = props => {
|
38
|
41
|
pathname: '/house/list',
|
39
|
42
|
});
|
40
|
43
|
}
|
41
|
|
- const fields = [
|
42
|
|
- {
|
43
|
|
- label: '销售批次名',
|
44
|
|
- name: 'salesBatchName',
|
45
|
|
- type: FieldTypes.Text,
|
46
|
|
- value: saleBatchData.salesBatchName,
|
47
|
|
- rules: [
|
48
|
|
- {
|
49
|
|
- required: true,
|
50
|
|
- message: '销售批次名',
|
51
|
|
- },
|
52
|
|
- ],
|
53
|
|
- },
|
54
|
|
- {
|
55
|
|
- label: '销售楼盘',
|
56
|
|
- name: 'buildingId',
|
57
|
|
- render: <BuildSelect />,
|
58
|
|
- value: saleBatchData.buildingId,
|
59
|
|
- rules: [
|
60
|
|
- {
|
61
|
|
- required: true,
|
62
|
|
- message: '请选择销售楼盘',
|
63
|
|
- },
|
64
|
|
- ],
|
65
|
|
- },
|
66
|
|
- {
|
67
|
|
- label: '备注',
|
68
|
|
- name: 'remark',
|
69
|
|
- type: FieldTypes.Text,
|
70
|
|
- value: saleBatchData.remark,
|
71
|
|
- },
|
72
|
|
- {
|
73
|
|
- label: '发布状态',
|
74
|
|
- name: 'status',
|
75
|
|
- type: FieldTypes.Select,
|
76
|
|
- dict: [{label:"否",value:0},{label:"是",value:1}],
|
77
|
|
- value: saleBatchData.status != null ? saleBatchData.status : 1,
|
78
|
|
- rules: [
|
79
|
|
- {
|
80
|
|
- required: true,
|
81
|
|
- message: '请选择发布状态',
|
82
|
|
- },
|
83
|
|
- ],
|
84
|
|
- },
|
85
|
|
- {
|
86
|
|
- label: '预选时间',
|
87
|
|
- name: 'preSelectTime',
|
88
|
|
- type: FieldTypes.RangePicker,
|
89
|
|
- value: saleBatchData.preselectionStartTime != null ? [moment(saleBatchData.preselectionStartTime, 'YYYY-MM-DD HH:mm:ss'), moment(saleBatchData.preselectionEndTime, 'YYYY-MM-DD HH:mm')] : null,
|
90
|
|
- props: { showTime: { format: 'HH:mm:ss' }},
|
91
|
|
- rules: [
|
92
|
|
- { required: true, message: '请选择预选时间' },
|
93
|
|
- ],
|
94
|
|
- },
|
95
|
|
- {
|
96
|
|
- label: '分栋鸟瞰图',
|
97
|
|
- name: 'aerialViewImg',
|
98
|
|
- type: FieldTypes.ImageUploader,
|
99
|
|
- value: saleBatchData.aerialViewImg,
|
100
|
|
- help: '建议图片尺寸:220*176px,比例5:4,格式:jpg,文件小于300KB。分栋鸟瞰图会显示在楼盘详情页面。用户点击进入查看全部发布房源。可以适当在图中添加引导语。',
|
101
|
|
- rules: [
|
102
|
|
- {
|
103
|
|
- required: true,
|
104
|
|
- message: '请选择分栋鸟瞰图',
|
105
|
|
- },
|
106
|
|
- ],
|
107
|
|
- },
|
108
|
|
- ]
|
109
|
|
-
|
110
|
|
- const handleSubmit = values => {
|
111
|
|
- console.log('submit data --->', values)
|
112
|
|
-
|
113
|
|
- let {preSelectTime, ...submitValue} = values
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+ function handleSubmit (e) {
|
|
47
|
+ props.form.validateFields((err, values) => {
|
|
48
|
+ let {preSelectTime, ...submitValue} = values
|
114
|
49
|
if(null != preSelectTime && preSelectTime.length > 0){
|
115
|
50
|
const [preselectionStartTime, preselectionEndTime] = preSelectTime
|
116
|
51
|
submitValue.preselectionStartTime = moment(preselectionStartTime).format('YYYY-MM-DD HH:mm:ss');
|
|
@@ -127,12 +62,64 @@ const header = props => {
|
127
|
62
|
}).catch((err) => {
|
128
|
63
|
message.info(err.msg || err.message)
|
129
|
64
|
})
|
130
|
|
- }
|
131
|
|
-
|
|
65
|
+ });
|
|
66
|
+ }
|
|
67
|
+
|
|
68
|
+ const { getFieldDecorator } = props.form;
|
132
|
69
|
|
133
|
70
|
return (
|
134
|
|
- <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
|
135
|
|
- );
|
|
71
|
+ <>
|
|
72
|
+ <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
|
|
73
|
+ <Form.Item label="销售批次名">
|
|
74
|
+ {getFieldDecorator('salesBatchName', {
|
|
75
|
+ rules: [{ required: true, message: '请输入销售批次名' }],
|
|
76
|
+ })(<Input maxLength={20} />)}
|
|
77
|
+ </Form.Item>
|
|
78
|
+ <Form.Item label="销售楼盘">
|
|
79
|
+ {getFieldDecorator('buildingId', {
|
|
80
|
+ rules: [{ required: true, message: ' 请输入销售楼盘' }],
|
|
81
|
+ })(<BuildSelect />)}
|
|
82
|
+ </Form.Item>
|
|
83
|
+ <Form.Item label="备注">
|
|
84
|
+ {getFieldDecorator('remark')
|
|
85
|
+ (<Input maxLength={20}/>)}
|
|
86
|
+ </Form.Item>
|
|
87
|
+ <Form.Item label="发布状态">
|
|
88
|
+ {getFieldDecorator('status', {
|
|
89
|
+ rules: [{ required: true, message: '请选择发布状态' }],
|
|
90
|
+ })(<Select placeholder="发布状态" style={{ width: '300px' }}>
|
|
91
|
+ <Option value="0">否</Option>
|
|
92
|
+ <Option value="1">是</Option>
|
|
93
|
+ </Select>)}
|
|
94
|
+ </Form.Item>
|
|
95
|
+ <Form.Item label="预选时间">
|
|
96
|
+ {getFieldDecorator('preSelectTime', {
|
|
97
|
+ rules: [
|
|
98
|
+ {
|
|
99
|
+ required: true,
|
|
100
|
+ message: '请选择预选时间',
|
|
101
|
+ },
|
|
102
|
+ ],
|
|
103
|
+ })(<RangePicker style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
|
|
104
|
+ </Form.Item>
|
|
105
|
+ <Form.Item label="分栋鸟瞰图" help="建议尺寸:690*388px,比例16::9,格式:jpg,文件小于300KB。分栋鸟瞰图会显示在楼盘详情页面。用户点击进入查看全部发布房源。可以适当在图中添加引导语。">
|
|
106
|
+ {getFieldDecorator('aerialViewImg', {
|
|
107
|
+ rules: [{ required: true, message: '请上传分栋鸟瞰图' }],
|
|
108
|
+ })(
|
|
109
|
+ <ImageUpload />,
|
|
110
|
+ )}
|
|
111
|
+ </Form.Item>
|
|
112
|
+ <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
|
|
113
|
+ <Button type="primary" htmlType="submit"style={{marginRight:'20px'}}>
|
|
114
|
+ 下一步
|
|
115
|
+ </Button>
|
|
116
|
+ <Button onClick={() => router.go(-1)}>
|
|
117
|
+ 取消
|
|
118
|
+ </Button>
|
|
119
|
+ </Form.Item>
|
|
120
|
+ </Form>
|
|
121
|
+ </>
|
|
122
|
+ )
|
136
|
123
|
}
|
137
|
124
|
|
138
|
125
|
const WrappedHeader = Form.create({ name: 'header' })(header);
|