魏超 5 years ago
parent
commit
c9ba023fb4

+ 5
- 5
src/pages/house/house/add/HouseBatchAdd.jsx View File

@@ -127,11 +127,11 @@ const columns = [
127 127
     dataIndex: 'price',
128 128
     key: 'price',
129 129
   },
130
-  {
131
-    title: '预选基础热度',
132
-    dataIndex: 'heat',
133
-    key: 'heat',
134
-  },
130
+  // {
131
+  //   title: '预选基础热度',
132
+  //   dataIndex: 'heat',
133
+  //   key: 'heat',
134
+  // },
135 135
   {
136 136
     title: '发布状态',
137 137
     dataIndex: 'status',

+ 38
- 34
src/pages/house/house/edit/components/house.jsx View File

@@ -143,30 +143,34 @@ function House(props) {
143 143
       key: 'houseId',
144 144
     },
145 145
     {
146
-      title: '期/区',
147
-      dataIndex: 'termName',
148
-      key: 'termName',
149
-    },
150
-    {
151
-      title: '楼栋',
152
-      dataIndex: 'blockName',
153
-      key: 'blockName',
154
-    },
155
-    {
156
-      title: '单元',
157
-      dataIndex: 'unitName',
158
-      key: 'unitName',
159
-    },
160
-    {
161
-      title: '层',
162
-      dataIndex: 'floorName',
163
-      key: 'floorName',
164
-    },
165
-    {
166
-      title: '房号',
167
-      dataIndex: 'roomName',
168
-      key: 'roomName',
146
+      title: '房源',
147
+      render:  (x, row) => <><span>{row.termName}/{row.blockName}/{row.blockName}/{row.unitName}/{row.floorName}/{row.roomName}</span></>,
169 148
     },
149
+    // {
150
+    //   title: '期/区',
151
+    //   dataIndex: 'termName',
152
+    //   key: 'termName',
153
+    // },
154
+    // {
155
+    //   title: '楼栋',
156
+    //   dataIndex: 'blockName',
157
+    //   key: 'blockName',
158
+    // },
159
+    // {
160
+    //   title: '单元',
161
+    //   dataIndex: 'unitName',
162
+    //   key: 'unitName',
163
+    // },
164
+    // {
165
+    //   title: '层',
166
+    //   dataIndex: 'floorName',
167
+    //   key: 'floorName',
168
+    // },
169
+    // {
170
+    //   title: '房号',
171
+    //   dataIndex: 'roomName',
172
+    //   key: 'roomName',
173
+    // },
170 174
     {
171 175
       title: '价格(万元)',
172 176
       dataIndex: 'price',
@@ -177,17 +181,17 @@ function House(props) {
177 181
       dataIndex: 'apartmentName',
178 182
       key: 'apartmentName',
179 183
     },
180
-    {
181
-      title: '预选基础热度',
182
-      dataIndex: 'heat',
183
-      key: 'heat',
184
-    },
185
-    {
186
-      title: '预选实际热度',
187
-      dataIndex: 'realHeat',
188
-      key: 'realHeat',
189
-      render:  (x, row) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => showEdi({type: "preselection",houseId: row.houseId})}>{row.realHeat}</span></>,
190
-    },
184
+    // {
185
+    //   title: '预选基础热度',
186
+    //   dataIndex: 'heat',
187
+    //   key: 'heat',
188
+    // },
189
+    // {
190
+    //   title: '预选实际热度',
191
+    //   dataIndex: 'realHeat',
192
+    //   key: 'realHeat',
193
+    //   render:  (x, row) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={() => showEdi({type: "preselection",houseId: row.houseId})}>{row.realHeat}</span></>,
194
+    // },
191 195
     {
192 196
       title: '发布状态',
193 197
       dataIndex: 'status',

+ 2
- 2
src/pages/house/house/edit/components/houseAdd.jsx View File

@@ -156,7 +156,7 @@ function HouseAdd(props) {
156 156
           ],
157 157
         })(<Input placeholder="填写房源总价"/>)}万元
158 158
         </Form.Item>
159
-        <Form.Item label="预选基础热度">
159
+        {/* <Form.Item label="预选基础热度">
160 160
         {getFieldDecorator('heat', {
161 161
           rules: [
162 162
             {
@@ -166,7 +166,7 @@ function HouseAdd(props) {
166 166
             },
167 167
           ],
168 168
         })(<Input placeholder="填写基础预选热度,建议为0"/>)}
169
-        </Form.Item>
169
+        </Form.Item> */}
170 170
         <Form.Item label="户型" help="户型不存在时,请到楼盘详情中查看是否存在户型,不存在时请新增户型。">
171 171
         {getFieldDecorator('apartmentId')(<ApartmentSelect buildingId={props.buildingId} />)}
172 172
         </Form.Item>

+ 7
- 8
src/pages/house/preSelect/add/index.jsx View File

@@ -5,8 +5,7 @@ import XForm, { FieldTypes } from '../../../../components/XForm';
5 5
 import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import styles from '../../../style/GoodsList.less';
8
-import SelectCity from '../../../../components/SelectButton/CitySelect'
9
-import BuildSelect from '../../../../components/SelectButton/BuildSelect'
8
+import BuildSelect from '../../raise/edit/components/BuildSelect/BuildSelect'
10 9
 import ImageUpload from '../../../../components/XForm/ImageUpload'
11 10
 import apis from '../../../../services/apis';
12 11
 import request from '../../../../utils/request';
@@ -75,15 +74,15 @@ const header = props => {
75 74
   return (
76 75
     <>
77 76
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
78
-        <Form.Item label="销售批次">
79
-          {getFieldDecorator('salesBatchId', {
80
-            rules: [{ required: true, message: '请输入销售批次名' }],
81
-          })(<SalesBatch type='true'/>)}
82
-        </Form.Item>
83 77
         <Form.Item label="销售楼盘">
84 78
           {getFieldDecorator('buildingId', {
85 79
             rules: [{ required: true, message: ' 请输入销售楼盘' }],
86
-          })(<BuildSelect />)}
80
+          })(<BuildSelect type='false' salesBatchId={props.form.getFieldValue('salesBatchId')}/>)}
81
+        </Form.Item>
82
+        <Form.Item label="销售批次">
83
+          {getFieldDecorator('salesBatchId', {
84
+            rules: [{ required: true, message: '请输入销售批次名' }],
85
+          })(<SalesBatch type='true' buildingId={props.form.getFieldValue('buildingId')}/>)}
87 86
         </Form.Item>
88 87
         <Form.Item label="预选开始时间">  
89 88
           {getFieldDecorator('preselectionStartTime', {

+ 3
- 2
src/pages/house/preSelect/edit/components/SalesBatch/SalesBatch.jsx View File

@@ -23,13 +23,14 @@ const SalesBatch = props => {
23 23
   const [data, setData] = useState([])
24 24
   const [value, setValue] = useState([])
25 25
   const disabledType = props.type;
26
+  const buildingId = props.buildingId
26 27
   useEffect(() => {
27 28
     getSalesBatchList();
28
-  }, [props.value])
29
+  }, [props.buildingId])
29 30
 
30 31
 
31 32
   const getSalesBatchList = e => {
32
-    request({ ...apis.house.salesBatchList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
33
+    request({ ...apis.house.salesBatchList, params: { pageNum: 1, pageSize: 999, buildingId: buildingId } }).then(data => {
33 34
         setData(data)
34 35
         checkValue(data)
35 36
         // 默认选中第一个

+ 5
- 4
src/pages/house/raise/add/index.jsx View File

@@ -6,7 +6,8 @@ import router from 'umi/router';
6 6
 import moment from 'moment';
7 7
 import styles from '../../../style/GoodsList.less';
8 8
 import SelectCity from '../../../../components/SelectButton/CitySelect'
9
-import BuildSelect from '../../../../components/SelectButton/BuildSelect'
9
+// import BuildSelect from '../../../../components/SelectButton/BuildSelect'
10
+import BuildSelect from '../edit/components/BuildSelect/BuildSelect';
10 11
 import ImageUpload from '../../../../components/XForm/ImageUpload'
11 12
 import apis from '../../../../services/apis';
12 13
 import request from '../../../../utils/request';
@@ -114,13 +115,13 @@ const header = props => {
114 115
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
115 116
         <Form.Item label="销售楼盘">
116 117
           {getFieldDecorator('buildingId', {
117
-            rules: [{ required: true, message: ' 请输入销售楼盘' }],
118
-          })(<BuildSelect />)}
118
+            rules: [{ required: true, message: ' 请输入销售楼盘' }], 
119
+          })(<BuildSelect type='false' salesBatchId={props.form.getFieldValue('salesBatchId')}/>)}
119 120
         </Form.Item>
120 121
         <Form.Item label="销售批次" help="销售批次请在房源管理中新增">
121 122
           {getFieldDecorator('salesBatchId', {
122 123
             rules: [{ required: true, message: ' 请输入销售批次' }], onChange: onChangeValue
123
-          })(<SalesBatch type='true' />)}
124
+          })(<SalesBatch type='true' buildingId={props.form.getFieldValue('buildingId')}/>)}
124 125
         </Form.Item>
125 126
         <Form.Item label="认筹开始时间">
126 127
         {getFieldDecorator('raiseStartTime', {

+ 16
- 4
src/pages/house/raise/edit/components/BuildSelect/BuildSelect.jsx View File

@@ -22,17 +22,29 @@ function usePrevious(props) {
22 22
 const BuildingSelect = props => {
23 23
   const [data, setData] = useState([])
24 24
   const [value, setValue] = useState([])
25
+  const type = props.type
26
+  const salesBatchId = props.salesBatchId
27
+
25 28
   useEffect(() => {
26 29
     getBuildList();
27
-  }, [props.value])
30
+  }, [props.salesBatchId])
28 31
 
29 32
 
30 33
   const getBuildList = e => {
31
-    request({ ...apis.building.buildingSelect, params: { pageNum: 1, pageSize: 999 } }).then(data => {
34
+    if (salesBatchId && salesBatchId != 'undefine'){
35
+      request({ ...apis.house.buildingIdBySalesBatchId, urlData:{id: salesBatchId}, params: { pageNum: 1, pageSize: 999 } }).then(data => {
36
+        setData(data)
37
+        checkValue(data)
38
+        // 默认选中第一个
39
+      })
40
+    }
41
+    else{
42
+      request({ ...apis.building.buildingSelect, params: { pageNum: 1, pageSize: 999 } }).then(data => {
32 43
         setData(data)
33 44
         checkValue(data)
34 45
         // 默认选中第一个
35
-    })
46
+      })
47
+    }
36 48
   }
37 49
 
38 50
 
@@ -47,7 +59,7 @@ const BuildingSelect = props => {
47 59
 
48 60
   return (
49 61
       <Select
50
-      disabled
62
+      disabled={type == 'false'?false:true}
51 63
       showSearch
52 64
       value={props.value}
53 65
       style={{ width: '300px' }}

+ 2
- 1
src/pages/house/raise/edit/components/base.jsx View File

@@ -76,7 +76,8 @@ const Base = props => {
76 76
           message.info("请填写线下缴费说明");
77 77
           return;
78 78
         }
79
-        if (values.payDescriptionOffline == '' || values.payDescriptionOffline == null || values.payDescriptionOnline == '' || values.payDescriptionOnline == null){
79
+        if ((values.payType == 'onLine' && (values.payDescriptionOnline == '' || values.payDescriptionOnline == null)) ||
80
+            (values.payType == 'offLine' && (values.payDescriptionOffline == '' || values.payDescriptionOffline == null))){
80 81
           message.info("请填写缴费说明");
81 82
           return;
82 83
         }

+ 5
- 0
src/services/apis.js View File

@@ -1351,6 +1351,11 @@ export default {
1351 1351
     method: 'POST',
1352 1352
     action: 'admin.taRaise.post',
1353 1353
   },
1354
+  buildingIdBySalesBatchId: {
1355
+    url: `${prefix}/taSalesBatch/getBuildingById/:id`,
1356
+    method: 'GET',
1357
+    action: 'admin.taRaise.get',
1358
+  },
1354 1359
  },
1355 1360
  taliveActivity: {
1356 1361
   taLiveShare:{