浏览代码

apartment

xujing 5 年前
父节点
当前提交
6185e9a47f
共有 1 个文件被更改,包括 36 次插入4 次删除
  1. 36
    4
      src/onlineSelling/pages/records/index.js

+ 36
- 4
src/onlineSelling/pages/records/index.js 查看文件

3
 import HouseCard from '../../components/HouseCard'
3
 import HouseCard from '../../components/HouseCard'
4
 import RaiseCard from '../../components/RaiseCard'
4
 import RaiseCard from '../../components/RaiseCard'
5
 import { getItemList } from '@/services/item'
5
 import { getItemList } from '@/services/item'
6
-import { queryPreselectionRecord, queryRaiseRecord, querySalesList } from '@/services/project'
6
+import { queryPreselectionRecord, queryRaiseRecord, querySalesList, queryApartmentType } from '@/services/project'
7
 import { connect } from '@tarojs/redux'
7
 import { connect } from '@tarojs/redux'
8
 import ready from '@/utils/ready'
8
 import ready from '@/utils/ready'
9
 import Blank from '../../components/Blank'
9
 import Blank from '../../components/Blank'
37
     saleBatch: '',
37
     saleBatch: '',
38
     salesBatchId: '',
38
     salesBatchId: '',
39
 
39
 
40
+    apartmentList: [],
41
+    apartmentValue: '',
42
+    apartmentId: '',
43
+
40
     lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
44
     lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
41
     lockStatusValue: '',
45
     lockStatusValue: '',
42
     houseLockingStatus: '',
46
     houseLockingStatus: '',
184
       saleBatch: salesList[e.detail.value].salesBatchName,
188
       saleBatch: salesList[e.detail.value].salesBatchName,
185
       salesBatchId: salesList[e.detail.value].salesBatchId,
189
       salesBatchId: salesList[e.detail.value].salesBatchId,
186
 
190
 
191
+    }, () => {
192
+      if (this.state.salesBatchId) {
193
+        console.log('hhhhhhhhhhhhhh')
194
+        this.loadAparamentType(this.state.salesBatchId)
195
+      } else {
196
+        console.log('hjjjjjjjjjjjhhhh')
197
+        this.setState({
198
+          apartmentList: [{ apartmentName: '请选择', apartmentId: '' }]
199
+        })
200
+      }
201
+    })
202
+  }
203
+  loadAparamentType(salesBatchId) {
204
+    queryApartmentType({ salesBatchId: salesBatchId }).then(res => {
205
+      res.unshift({ apartmentName: '请选择', apartmentId: '' })
206
+      this.setState({
207
+        apartmentList: res || []
208
+      })
187
     })
209
     })
188
   }
210
   }
189
   handleApartmentChange = e => {
211
   handleApartmentChange = e => {
190
 
212
 
213
+    const { apartmentList } = this.state
214
+
191
     this.setState({
215
     this.setState({
192
-      status: selector[e.detail.value].buildingTypeName
216
+      apartmentValue: apartmentList[e.detail.value].apartmentName,
217
+      apartmentId: apartmentList[e.detail.value].apartmentId,
193
     })
218
     })
219
+
194
   }
220
   }
195
   handleLockStatusChange = e => {
221
   handleLockStatusChange = e => {
196
     const { lockStatus } = this.state
222
     const { lockStatus } = this.state
216
       buildingId: '',
242
       buildingId: '',
217
       saleBatch: '',
243
       saleBatch: '',
218
       salesBatchId: '',
244
       salesBatchId: '',
245
+      apartmentValue: '',
246
+      apartmentId: '',
219
       lockStatusValue: '',
247
       lockStatusValue: '',
220
       houseLockingStatus: '',
248
       houseLockingStatus: '',
221
       lockCustomerValue: '',
249
       lockCustomerValue: '',
235
       screenVisible: false
263
       screenVisible: false
236
     })
264
     })
237
     const { userInfo: { person: { personId } } } = this.props
265
     const { userInfo: { person: { personId } } } = this.props
238
-    const { buildingId, salesBatchId, houseLockingStatus, customerLocked } = this.state
266
+    const { buildingId, salesBatchId, houseLockingStatus, apartmentId, customerLocked } = this.state
239
 
267
 
240
     if (this.state.current == '0') {
268
     if (this.state.current == '0') {
241
 
269
 
245
         pageSize: 999,
273
         pageSize: 999,
246
         buildingId,
274
         buildingId,
247
         salesBatchId,
275
         salesBatchId,
276
+        apartmentId,
248
         houseLockingStatus,
277
         houseLockingStatus,
249
         customerLocked
278
         customerLocked
250
       }
279
       }
267
   }
296
   }
268
 
297
 
269
   renderPreselectScreen() {
298
   renderPreselectScreen() {
270
-    const { current, buildingValue, buildingList, saleBatch, salesList, lockCustomerValue, lockCustomer, lockStatusValue, lockStatus } = this.state
299
+    const { current, buildingValue, buildingList, saleBatch, salesList, apartmentList, apartmentValue, lockCustomerValue, lockCustomer, lockStatusValue, lockStatus } = this.state
271
 
300
 
272
     const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
301
     const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
273
 
302
 
276
       <View className="base-con">
305
       <View className="base-con">
277
         <PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
306
         <PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
278
         <PickerComponent title="选择销售批次" selector={salesList} keyValue={"salesBatchName"} currentValue={saleBatch || ''} handleChange={this.handleSaleBatchChange} />
307
         <PickerComponent title="选择销售批次" selector={salesList} keyValue={"salesBatchName"} currentValue={saleBatch || ''} handleChange={this.handleSaleBatchChange} />
308
+        {current == '0' && <PickerComponent title="选择户型" selector={apartmentList} keyValue={"apartmentName"} currentValue={apartmentValue || ''} handleChange={this.handleApartmentChange} />}
279
         <PickerComponent title="锁定状态" selector={lockStatus} keyValue={"value"} currentValue={lockStatusValue || ''} handleChange={this.handleLockStatusChange} />
309
         <PickerComponent title="锁定状态" selector={lockStatus} keyValue={"value"} currentValue={lockStatusValue || ''} handleChange={this.handleLockStatusChange} />
280
         {current == '0' && <PickerComponent title="锁定客户" keyValue={"value"} selector={lockCustomer} currentValue={lockCustomerValue || ''} handleChange={this.handleCustomerChange} />}
310
         {current == '0' && <PickerComponent title="锁定客户" keyValue={"value"} selector={lockCustomer} currentValue={lockCustomerValue || ''} handleChange={this.handleCustomerChange} />}
281
 
311
 
307
       buildingId: '',
337
       buildingId: '',
308
       saleBatch: '',
338
       saleBatch: '',
309
       salesBatchId: '',
339
       salesBatchId: '',
340
+      apartmentValue: '',
341
+      apartmentId: '',
310
       lockStatusValue: '',
342
       lockStatusValue: '',
311
       houseLockingStatus: '',
343
       houseLockingStatus: '',
312
       lockCustomerValue: '',
344
       lockCustomerValue: '',