|
@@ -3,7 +3,7 @@ import { View, ScrollView, Block } from '@tarojs/components'
|
3
|
3
|
import HouseCard from '../../components/HouseCard'
|
4
|
4
|
import RaiseCard from '../../components/RaiseCard'
|
5
|
5
|
import { getItemList } from '@/services/item'
|
6
|
|
-import { queryPreselectionRecord, queryRaiseRecord, querySalesList } from '@/services/project'
|
|
6
|
+import { queryPreselectionRecord, queryRaiseRecord, querySalesList, queryApartmentType } from '@/services/project'
|
7
|
7
|
import { connect } from '@tarojs/redux'
|
8
|
8
|
import ready from '@/utils/ready'
|
9
|
9
|
import Blank from '../../components/Blank'
|
|
@@ -37,6 +37,10 @@ export default class Records extends Component {
|
37
|
37
|
saleBatch: '',
|
38
|
38
|
salesBatchId: '',
|
39
|
39
|
|
|
40
|
+ apartmentList: [],
|
|
41
|
+ apartmentValue: '',
|
|
42
|
+ apartmentId: '',
|
|
43
|
+
|
40
|
44
|
lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
|
41
|
45
|
lockStatusValue: '',
|
42
|
46
|
houseLockingStatus: '',
|
|
@@ -184,13 +188,35 @@ export default class Records extends Component {
|
184
|
188
|
saleBatch: salesList[e.detail.value].salesBatchName,
|
185
|
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
|
211
|
handleApartmentChange = e => {
|
190
|
212
|
|
|
213
|
+ const { apartmentList } = this.state
|
|
214
|
+
|
191
|
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
|
221
|
handleLockStatusChange = e => {
|
196
|
222
|
const { lockStatus } = this.state
|
|
@@ -216,6 +242,8 @@ export default class Records extends Component {
|
216
|
242
|
buildingId: '',
|
217
|
243
|
saleBatch: '',
|
218
|
244
|
salesBatchId: '',
|
|
245
|
+ apartmentValue: '',
|
|
246
|
+ apartmentId: '',
|
219
|
247
|
lockStatusValue: '',
|
220
|
248
|
houseLockingStatus: '',
|
221
|
249
|
lockCustomerValue: '',
|
|
@@ -235,7 +263,7 @@ export default class Records extends Component {
|
235
|
263
|
screenVisible: false
|
236
|
264
|
})
|
237
|
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
|
268
|
if (this.state.current == '0') {
|
241
|
269
|
|
|
@@ -245,6 +273,7 @@ export default class Records extends Component {
|
245
|
273
|
pageSize: 999,
|
246
|
274
|
buildingId,
|
247
|
275
|
salesBatchId,
|
|
276
|
+ apartmentId,
|
248
|
277
|
houseLockingStatus,
|
249
|
278
|
customerLocked
|
250
|
279
|
}
|
|
@@ -267,7 +296,7 @@ export default class Records extends Component {
|
267
|
296
|
}
|
268
|
297
|
|
269
|
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
|
301
|
const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
|
273
|
302
|
|
|
@@ -276,6 +305,7 @@ export default class Records extends Component {
|
276
|
305
|
<View className="base-con">
|
277
|
306
|
<PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
|
278
|
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
|
309
|
<PickerComponent title="锁定状态" selector={lockStatus} keyValue={"value"} currentValue={lockStatusValue || ''} handleChange={this.handleLockStatusChange} />
|
280
|
310
|
{current == '0' && <PickerComponent title="锁定客户" keyValue={"value"} selector={lockCustomer} currentValue={lockCustomerValue || ''} handleChange={this.handleCustomerChange} />}
|
281
|
311
|
|
|
@@ -307,6 +337,8 @@ export default class Records extends Component {
|
307
|
337
|
buildingId: '',
|
308
|
338
|
saleBatch: '',
|
309
|
339
|
salesBatchId: '',
|
|
340
|
+ apartmentValue: '',
|
|
341
|
+ apartmentId: '',
|
310
|
342
|
lockStatusValue: '',
|
311
|
343
|
houseLockingStatus: '',
|
312
|
344
|
lockCustomerValue: '',
|