|
@@ -2,7 +2,8 @@ import Taro, { Component } from '@tarojs/taro'
|
2
|
2
|
import { View, ScrollView, Block } from '@tarojs/components'
|
3
|
3
|
import HouseCard from '../../components/HouseCard'
|
4
|
4
|
import RaiseCard from '../../components/RaiseCard'
|
5
|
|
-import { queryPreselectionRecord } from '@/services/project'
|
|
5
|
+import { getItemList } from '@/services/item'
|
|
6
|
+import { queryPreselectionRecord, queryRaiseRecord, querySalesList } from '@/services/project'
|
6
|
7
|
import { connect } from '@tarojs/redux'
|
7
|
8
|
import ready from '@/utils/ready'
|
8
|
9
|
import Blank from '../../components/Blank'
|
|
@@ -12,7 +13,7 @@ import PickerComponent from '../../components/Picker'
|
12
|
13
|
import './index.scss'
|
13
|
14
|
|
14
|
15
|
@connect(
|
15
|
|
- ({ user }) => ({ ...user })
|
|
16
|
+ ({ user, city }) => ({ ...user, ...city })
|
16
|
17
|
)
|
17
|
18
|
|
18
|
19
|
export default class Records extends Component {
|
|
@@ -21,12 +22,28 @@ export default class Records extends Component {
|
21
|
22
|
}
|
22
|
23
|
|
23
|
24
|
state = {
|
24
|
|
- recordList: [],
|
|
25
|
+
|
25
|
26
|
current: 0,
|
|
27
|
+ recordList: [],
|
26
|
28
|
noRecord: false,
|
27
|
|
- building: '',
|
|
29
|
+ raiseList: [],
|
|
30
|
+ noRaiseRecord: false,
|
|
31
|
+ screenVisible: false,
|
|
32
|
+ buildingList: [],
|
|
33
|
+ buildingValue: '',
|
|
34
|
+ buildingId: '',
|
|
35
|
+
|
|
36
|
+ salesList: [],
|
28
|
37
|
saleBatch: '',
|
29
|
|
- status: '',
|
|
38
|
+ salesBatchId: '',
|
|
39
|
+
|
|
40
|
+ lockStatus: [{ value: '不限', code: '' }, { value: '未锁定', code: 'unlocked' }, { value: '已锁定', code: 'locked' }],
|
|
41
|
+ lockStatusValue: '',
|
|
42
|
+ houseLockingStatus: '',
|
|
43
|
+
|
|
44
|
+ lockCustomer: [{ value: '不限', code: '' }, { value: '我自己', code: 'mine' }, { value: '其他人', code: 'other' }],
|
|
45
|
+ lockCustomerValue: '',
|
|
46
|
+ customerLocked: '',
|
30
|
47
|
}
|
31
|
48
|
componentDidShow() {
|
32
|
49
|
ready.queue(() => {
|
|
@@ -34,31 +51,61 @@ export default class Records extends Component {
|
34
|
51
|
const { userInfo: { person: { personId } } } = this.props
|
35
|
52
|
const params = {
|
36
|
53
|
personId,
|
37
|
|
- pageNum: 1,
|
|
54
|
+ pageNumber: 1,
|
38
|
55
|
pageSize: 999,
|
39
|
56
|
}
|
40
|
|
- queryPreselectionRecord(params).then(res => {
|
41
|
|
- const list = res.records
|
|
57
|
+ this.getPreselection(params)
|
|
58
|
+ this.getRaise(params)
|
|
59
|
+ querySalesList().then(res => {
|
|
60
|
+ res.unshift({ salesBatchName: '请选择', salesBatchId: '' })
|
|
61
|
+ this.setState({
|
|
62
|
+ salesList: res || [],
|
|
63
|
+
|
|
64
|
+ })
|
|
65
|
+ })
|
|
66
|
+ this.loadBuildingList()
|
|
67
|
+ })
|
|
68
|
+ }
|
|
69
|
+ getPreselection(params) {
|
|
70
|
+ queryPreselectionRecord(params).then(res => {
|
|
71
|
+ const list = res.records
|
|
72
|
+ this.setState({
|
|
73
|
+ recordList: list.filter(item => item.status == '1') || [],
|
|
74
|
+
|
|
75
|
+ }, () => {
|
42
|
76
|
this.setState({
|
43
|
|
- recordList: list.filter(item => item.status == '1') || [],
|
|
77
|
+ noRecord: this.state.recordList.length > 0 ? false : true
|
|
78
|
+ })
|
|
79
|
+ })
|
|
80
|
+ })
|
|
81
|
+ }
|
|
82
|
+ getRaise(params) {
|
|
83
|
+ queryRaiseRecord(params).then(res => {
|
|
84
|
+ this.setState({
|
|
85
|
+ raiseList: res.records || [],
|
44
|
86
|
|
45
|
|
- }, () => {
|
46
|
|
- this.setState({
|
47
|
|
- noRecord: this.state.recordList.length > 0 ? false : true
|
48
|
|
- })
|
|
87
|
+ }, () => {
|
|
88
|
+ this.setState({
|
|
89
|
+ noRaiseRecord: this.state.raiseList.length > 0 ? false : true
|
49
|
90
|
})
|
50
|
91
|
})
|
51
|
92
|
})
|
52
|
93
|
}
|
53
|
|
- // toHouseDetail(item) {
|
54
|
|
- // if (item.housingStatus == '0' || item.saleBatchStatus == '0') {
|
55
|
|
- // Taro.showToast({ title: '当前销售批次或该房源已被取消发布', icon: 'none', duration: 2000 })
|
56
|
|
- // } else {
|
57
|
|
- // Taro.navigateTo({
|
58
|
|
- // url: `/onlineSelling/pages/detail/index?id=${item.houseId}`
|
59
|
|
- // })
|
60
|
|
- // }
|
61
|
|
- // }
|
|
94
|
+ loadBuildingList() {
|
|
95
|
+ const params = {
|
|
96
|
+ pageNumber: 1,
|
|
97
|
+ pageSize: 50,
|
|
98
|
+ cityId: this.props.curCity.id || ''
|
|
99
|
+ }
|
|
100
|
+ getItemList(params).then(res => {
|
|
101
|
+ res.records.unshift({ buildingName: '请选择', buildingId: '' })
|
|
102
|
+ this.setState({
|
|
103
|
+ buildingList: res.records,
|
|
104
|
+ })
|
|
105
|
+ })
|
|
106
|
+
|
|
107
|
+ }
|
|
108
|
+
|
62
|
109
|
CheckboxChange = (e) => {
|
63
|
110
|
e.stopPropagation()
|
64
|
111
|
console.log('checkbox发生change事件,携带value值为:', e)
|
|
@@ -73,20 +120,20 @@ export default class Records extends Component {
|
73
|
120
|
{
|
74
|
121
|
noRecord ? <Blank style="margin:14vh 0 32vh 0" tips="暂无预选记录" /> :
|
75
|
122
|
<View>
|
76
|
|
- {
|
77
|
|
- recordList.map((item) => {
|
78
|
|
- return (
|
79
|
|
- <Label class="checkbox" >
|
80
|
|
- <Checkbox value={item.houseId} checked={item.checked} >
|
81
|
|
- <View className="carditem" key={item.preselectionRecordId} >
|
82
|
|
-
|
83
|
|
- <HouseCard summary={item} />
|
84
|
|
- </View>
|
85
|
|
- </Checkbox>
|
86
|
|
- </Label>
|
87
|
|
- )
|
88
|
|
- })
|
89
|
|
- }
|
|
123
|
+ {
|
|
124
|
+ recordList.map((item) => {
|
|
125
|
+ return (
|
|
126
|
+ <Label class="checkbox" >
|
|
127
|
+ <Checkbox value={item.houseId} checked={item.checked} >
|
|
128
|
+ <View className="carditem" key={item.preselectionRecordId} >
|
|
129
|
+
|
|
130
|
+ <HouseCard summary={item} />
|
|
131
|
+ </View>
|
|
132
|
+ </Checkbox>
|
|
133
|
+ </Label>
|
|
134
|
+ )
|
|
135
|
+ })
|
|
136
|
+ }
|
90
|
137
|
</View>
|
91
|
138
|
}
|
92
|
139
|
</CheckboxGroup>
|
|
@@ -99,15 +146,15 @@ export default class Records extends Component {
|
99
|
146
|
)
|
100
|
147
|
}
|
101
|
148
|
renderRaise() {
|
102
|
|
- const { recordList, noRecord } = this.state
|
|
149
|
+ const { raiseList, noRaiseRecord } = this.state
|
103
|
150
|
return (
|
104
|
151
|
<Block>
|
105
|
152
|
|
106
|
153
|
{
|
107
|
|
- noRecord ? <Blank style="margin:14vh 0 32vh 0" tips="暂无认筹记录" /> :
|
|
154
|
+ noRaiseRecord ? <Blank style="margin:14vh 0 32vh 0" tips="暂无认筹记录" /> :
|
108
|
155
|
<ScrollView scrollY>
|
109
|
156
|
{
|
110
|
|
- recordList.map(item => (
|
|
157
|
+ raiseList.map(item => (
|
111
|
158
|
<View key={item.preselectionRecordId} >
|
112
|
159
|
<RaiseCard summary={item} />
|
113
|
160
|
</View>
|
|
@@ -122,76 +169,121 @@ export default class Records extends Component {
|
122
|
169
|
</Block>
|
123
|
170
|
)
|
124
|
171
|
}
|
125
|
|
- onSexChange = e => {
|
126
|
|
- let building = e.detail.value == '0' ? '1' : e.detail.value == '1' ? '2' : ''
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+ handleBuildingChange = e => {
|
|
175
|
+ const { buildingList } = this.state
|
127
|
176
|
this.setState({
|
128
|
|
- building,
|
|
177
|
+ buildingValue: buildingList[e.detail.value].buildingName,
|
|
178
|
+ buildingId: buildingList[e.detail.value].buildingId,
|
129
|
179
|
})
|
130
|
180
|
}
|
131
|
181
|
handleSaleBatchChange = e => {
|
132
|
|
- const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
|
|
182
|
+ const { salesList } = this.state
|
133
|
183
|
this.setState({
|
134
|
|
- saleBatch: selector[e.detail.value].buildingTypeName
|
|
184
|
+ saleBatch: salesList[e.detail.value].salesBatchName,
|
|
185
|
+ salesBatchId: salesList[e.detail.value].salesBatchId,
|
|
186
|
+
|
135
|
187
|
})
|
136
|
188
|
}
|
137
|
|
- handleStatusChange = e => {
|
|
189
|
+ handleApartmentChange = e => {
|
138
|
190
|
|
139
|
|
- let status = e.detail.value == '0' ? '1' : e.detail.value == '1' ? '2' : ''
|
140
|
191
|
this.setState({
|
141
|
|
- status,
|
|
192
|
+ status: selector[e.detail.value].buildingTypeName
|
142
|
193
|
})
|
143
|
194
|
}
|
144
|
|
- renderRaiseScreen() {
|
145
|
|
- const { building, saleBatch, status } = this.state
|
146
|
|
- const sexSelector = ['男', '女']
|
147
|
|
- const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
|
148
|
|
- return (
|
149
|
|
-
|
150
|
|
- <View className="base-con">
|
151
|
|
- <PickerComponent title="选择楼盘" selector={sexSelector} currentValue={building == '1' ? '男' : building == '2' ? '女' : ' '} handleChange={this.onSexChange} />
|
152
|
|
- <PickerComponent title="选择销售批次" selector={selector} key={"buildingTypeName"} currentValue={saleBatch || ' '} handleChange={this.handleSaleBatchChange} />
|
153
|
|
- <PickerComponent title="锁定状态" selector={selector} key={"buildingTypeName"} currentValue={status || ' '} handleChange={this.handleStatusChange} />
|
154
|
|
- <View className="bottom-btn">
|
155
|
|
- <View className="save" onClick={this.baseSaveBtn}>
|
156
|
|
- 筛选
|
157
|
|
- </View>
|
158
|
|
- <View className="cancel" onClick={this.baseCancelBtn}>
|
159
|
|
- 不限
|
160
|
|
- </View>
|
161
|
|
- </View>
|
162
|
|
- </View>
|
163
|
|
- )
|
|
195
|
+ handleLockStatusChange = e => {
|
|
196
|
+ const { lockStatus } = this.state
|
|
197
|
+ this.setState({
|
|
198
|
+ lockStatusValue: lockStatus[e.detail.value].value,
|
|
199
|
+ houseLockingStatus: lockStatus[e.detail.value].code,
|
|
200
|
+ })
|
|
201
|
+ }
|
|
202
|
+ handleCustomerChange = e => {
|
|
203
|
+ const { lockCustomer } = this.state
|
|
204
|
+ this.setState({
|
|
205
|
+ lockCustomerValue: lockCustomer[e.detail.value].value,
|
|
206
|
+ customerLocked: lockCustomer[e.detail.value].code,
|
|
207
|
+ })
|
164
|
208
|
}
|
165
|
209
|
|
166
|
|
- handleSaleBatchChange = e => {
|
167
|
|
- const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
|
|
210
|
+
|
|
211
|
+ unlimitedBtn() {
|
|
212
|
+
|
168
|
213
|
this.setState({
|
169
|
|
- saleBatch: selector[e.detail.value].buildingTypeName
|
|
214
|
+ screenVisible: false,
|
|
215
|
+ buildingValue: '',
|
|
216
|
+ buildingId: '',
|
|
217
|
+ saleBatch: '',
|
|
218
|
+ salesBatchId: '',
|
|
219
|
+ lockStatusValue: '',
|
|
220
|
+ houseLockingStatus: '',
|
|
221
|
+ lockCustomerValue: '',
|
|
222
|
+ customerLocked: '',
|
170
|
223
|
})
|
|
224
|
+ const { userInfo: { person: { personId } } } = this.props
|
|
225
|
+ const params = {
|
|
226
|
+ personId,
|
|
227
|
+ pageNumber: 1,
|
|
228
|
+ pageSize: 999,
|
|
229
|
+ }
|
|
230
|
+ this.getPreselection(params)
|
|
231
|
+ this.getRaise(params)
|
171
|
232
|
}
|
172
|
|
- handleApartmentChange = e => {
|
173
|
|
- const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
|
|
233
|
+ ScreenBtn() {
|
174
|
234
|
this.setState({
|
175
|
|
- status: selector[e.detail.value].buildingTypeName
|
|
235
|
+ screenVisible: false
|
176
|
236
|
})
|
|
237
|
+ const { userInfo: { person: { personId } } } = this.props
|
|
238
|
+ const { buildingId, salesBatchId, houseLockingStatus, customerLocked } = this.state
|
|
239
|
+
|
|
240
|
+ if (this.state.current == '0') {
|
|
241
|
+
|
|
242
|
+ const params = {
|
|
243
|
+ personId,
|
|
244
|
+ pageNumber: 1,
|
|
245
|
+ pageSize: 999,
|
|
246
|
+ buildingId,
|
|
247
|
+ salesBatchId,
|
|
248
|
+ houseLockingStatus,
|
|
249
|
+ customerLocked
|
|
250
|
+ }
|
|
251
|
+ this.getPreselection(params)
|
|
252
|
+ } else {
|
|
253
|
+
|
|
254
|
+ const params = {
|
|
255
|
+ personId,
|
|
256
|
+ pageNumber: 1,
|
|
257
|
+ pageSize: 999,
|
|
258
|
+ buildingId,
|
|
259
|
+ salesBatchId,
|
|
260
|
+ houseLockingStatus,
|
|
261
|
+
|
|
262
|
+ }
|
|
263
|
+ this.getRaise(params)
|
|
264
|
+ }
|
|
265
|
+
|
|
266
|
+
|
177
|
267
|
}
|
178
|
268
|
|
179
|
269
|
renderPreselectScreen() {
|
180
|
|
- const { building, saleBatch, status } = this.state
|
|
270
|
+ const { current, buildingValue, buildingList, saleBatch, salesList, lockCustomerValue, lockCustomer, lockStatusValue, lockStatus } = this.state
|
181
|
271
|
|
182
|
272
|
const selector = [{ buildingTypeName: '楼盘1' }, { buildingTypeName: '楼盘2' }, { buildingTypeName: '楼盘3' }, { buildingTypeName: '楼盘4' }]
|
|
273
|
+
|
183
|
274
|
return (
|
184
|
275
|
|
185
|
276
|
<View className="base-con">
|
186
|
|
- <PickerComponent title="选择楼盘" selector={selector} currentValue={status || ''} handleChange={this.handleApartmentChange} />
|
187
|
|
- <PickerComponent title="选择销售批次" selector={selector} currentValue={status || ''} handleChange={this.handleApartmentChange} />
|
188
|
|
- <PickerComponent title="选择户型" selector={selector} currentValue={status || ''} handleChange={this.handleApartmentChange} />
|
|
277
|
+ <PickerComponent title="选择楼盘" selector={buildingList} keyValue={"buildingName"} currentValue={buildingValue || ''} handleChange={this.handleBuildingChange} />
|
|
278
|
+ <PickerComponent title="选择销售批次" selector={salesList} keyValue={"salesBatchName"} currentValue={saleBatch || ''} handleChange={this.handleSaleBatchChange} />
|
|
279
|
+ <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} />}
|
189
|
281
|
|
190
|
282
|
<View className="bottom-btn">
|
191
|
|
- <View className="save" onClick={this.baseSaveBtn}>
|
|
283
|
+ <View className="save" onClick={this.ScreenBtn}>
|
192
|
284
|
筛选
|
193
|
285
|
</View>
|
194
|
|
- <View className="cancel" onClick={this.baseCancelBtn}>
|
|
286
|
+ <View className="cancel" onClick={this.unlimitedBtn}>
|
195
|
287
|
不限
|
196
|
288
|
</View>
|
197
|
289
|
</View>
|
|
@@ -202,10 +294,25 @@ export default class Records extends Component {
|
202
|
294
|
|
203
|
295
|
handleScreenClick() {
|
204
|
296
|
|
|
297
|
+
|
|
298
|
+ this.setState({
|
|
299
|
+ screenVisible: true
|
|
300
|
+ })
|
|
301
|
+
|
205
|
302
|
}
|
206
|
303
|
handleCondition(value) {
|
207
|
304
|
this.setState({
|
208
|
|
- current: value
|
|
305
|
+ current: value,
|
|
306
|
+ buildingValue: '',
|
|
307
|
+ buildingId: '',
|
|
308
|
+ saleBatch: '',
|
|
309
|
+ salesBatchId: '',
|
|
310
|
+ lockStatusValue: '',
|
|
311
|
+ houseLockingStatus: '',
|
|
312
|
+ lockCustomerValue: '',
|
|
313
|
+ customerLocked: '',
|
|
314
|
+
|
|
315
|
+
|
209
|
316
|
})
|
210
|
317
|
}
|
211
|
318
|
renderBar() {
|
|
@@ -233,13 +340,11 @@ export default class Records extends Component {
|
233
|
340
|
}
|
234
|
341
|
render() {
|
235
|
342
|
|
236
|
|
-
|
|
343
|
+ const { screenVisible } = this.state
|
237
|
344
|
return (
|
238
|
345
|
<View className="records" >
|
239
|
|
- {this.renderBar()}
|
240
|
|
- {/* {this.renderRaiseScreen()} */}
|
241
|
|
- {/* {this.renderPreselectScreen()} */}
|
242
|
|
-
|
|
346
|
+ {!screenVisible && this.renderBar()}
|
|
347
|
+ {screenVisible && this.renderPreselectScreen()}
|
243
|
348
|
|
244
|
349
|
</View >
|
245
|
350
|
)
|