|
@@ -16,20 +16,16 @@ export default class transactionCustomer extends Taro.Component {
|
16
|
16
|
|
17
|
17
|
|
18
|
18
|
state = {
|
19
|
|
- list: [
|
20
|
|
- { name: '刘丽丽', phone: '15852364821', sex: '1' },
|
21
|
|
- { name: '邓亚平', phone: '13160056061', sex: '2' },
|
22
|
|
- ],
|
23
|
19
|
recordId: undefined, // 埋点ID
|
24
|
20
|
customerList: [],
|
25
|
21
|
inputValue: '',
|
26
|
22
|
screenVisible: false,
|
27
|
|
- statusList: ['全部状态', '认筹', '到访', '签约'],
|
|
23
|
+ statusList: ['全部状态', '报备', '到访', '认筹'],
|
28
|
24
|
statusIndex: -1,
|
29
|
|
- visitDate: '',
|
30
|
|
- visitDate2: '',
|
31
|
|
- reportDate: '',
|
32
|
|
- reportDate2: '',
|
|
25
|
+ startArrivalDate: '',
|
|
26
|
+ endArrivalDate: '',
|
|
27
|
+ startReportDate : '',
|
|
28
|
+ endReportDate: '',
|
33
|
29
|
}
|
34
|
30
|
|
35
|
31
|
componentWillUnmount() {
|
|
@@ -47,10 +43,10 @@ export default class transactionCustomer extends Taro.Component {
|
47
|
43
|
pageNumber: 0,
|
48
|
44
|
pageSize: 9999
|
49
|
45
|
}
|
50
|
|
- queryCustomerList(payload.type,payload).then(res => {
|
|
46
|
+ queryCustomerList(payload.type, payload).then(res => {
|
51
|
47
|
|
52
|
48
|
this.setState({
|
53
|
|
- customerList: res || {}
|
|
49
|
+ customerList: res.records || []
|
54
|
50
|
})
|
55
|
51
|
Taro.hideLoading()
|
56
|
52
|
})
|
|
@@ -66,7 +62,34 @@ export default class transactionCustomer extends Taro.Component {
|
66
|
62
|
// const playload = {
|
67
|
63
|
// inputValue: this.state.inputValue
|
68
|
64
|
// }
|
69
|
|
- console.log(this.state.inputValue, "inputValue")
|
|
65
|
+ this.filterCustomerList();
|
|
66
|
+
|
|
67
|
+ }
|
|
68
|
+ filterCustomerList(){
|
|
69
|
+
|
|
70
|
+ const payload = {
|
|
71
|
+ type: 'follow',
|
|
72
|
+ pageNumber: 0,
|
|
73
|
+ pageSize: 9999,
|
|
74
|
+ status:this.state.statusIndex!=0?this.state.statusIndex:'',
|
|
75
|
+ startArrivalDate:this.state.startArrivalDate,
|
|
76
|
+ endArrivalDate: this.state.endArrivalDate,
|
|
77
|
+ startReportDate : this.state.startReportDate,
|
|
78
|
+ endReportDate: this.state.endReportDate,
|
|
79
|
+ }
|
|
80
|
+ queryCustomerList(payload.type, payload).then(res => {
|
|
81
|
+
|
|
82
|
+ this.setState({
|
|
83
|
+ customerList: res.records || []
|
|
84
|
+ })
|
|
85
|
+ Taro.hideLoading()
|
|
86
|
+ })
|
|
87
|
+ }
|
|
88
|
+ saveBtn() {
|
|
89
|
+ this.filterCustomerList();
|
|
90
|
+ this.setState({
|
|
91
|
+ screenVisible: false,
|
|
92
|
+ })
|
70
|
93
|
}
|
71
|
94
|
screenShow() {
|
72
|
95
|
this.setState({
|
|
@@ -81,41 +104,42 @@ export default class transactionCustomer extends Taro.Component {
|
81
|
104
|
}
|
82
|
105
|
onVisitDateChange = e => {
|
83
|
106
|
this.setState({
|
84
|
|
- visitDate: e.detail.value
|
|
107
|
+ startArrivalDate: e.detail.value
|
85
|
108
|
})
|
86
|
109
|
}
|
87
|
110
|
onVisitDateChange2 = e => {
|
88
|
111
|
this.setState({
|
89
|
|
- visitDate2: e.detail.value
|
|
112
|
+ endArrivalDate: e.detail.value
|
90
|
113
|
})
|
91
|
114
|
}
|
92
|
115
|
onReportDateChange = e => {
|
93
|
116
|
this.setState({
|
94
|
|
- reportDate: e.detail.value
|
|
117
|
+ startReportDate : e.detail.value
|
95
|
118
|
})
|
96
|
119
|
}
|
97
|
120
|
onReportDateChange2 = e => {
|
98
|
121
|
this.setState({
|
99
|
|
- reportDate2: e.detail.value
|
100
|
|
- })
|
101
|
|
- }
|
102
|
|
- saveBtn() {
|
103
|
|
- this.setState({
|
104
|
|
- screenVisible: false,
|
|
122
|
+ endReportDate: e.detail.value
|
105
|
123
|
})
|
106
|
124
|
}
|
|
125
|
+
|
107
|
126
|
cancelBtn() {
|
108
|
127
|
this.setState({
|
109
|
128
|
screenVisible: false,
|
|
129
|
+ statusIndex: -1,
|
|
130
|
+ startArrivalDate: '',
|
|
131
|
+ endArrivalDate: '',
|
|
132
|
+ startReportDate : '',
|
|
133
|
+ endReportDate: '',
|
110
|
134
|
})
|
111
|
135
|
}
|
112
|
|
- toMyCustomer() {
|
|
136
|
+ toMyCustomer(customerId) {
|
113
|
137
|
Taro.navigateTo({
|
114
|
|
- url: `/pages/person/customerAnalysis/myCustomer`
|
|
138
|
+ url: `/pages/person/customerAnalysis/myCustomer?customerId=`+customerId
|
115
|
139
|
})
|
116
|
140
|
}
|
117
|
141
|
renderScreenBox() {
|
118
|
|
- const { statusList, statusIndex, visitDate, visitDate2, reportDate, reportDate2 } = this.state
|
|
142
|
+ const { statusList, statusIndex, startArrivalDate, endArrivalDate, startReportDate , endReportDate } = this.state
|
119
|
143
|
return (
|
120
|
144
|
<View className="mask">
|
121
|
145
|
<View className="content">
|
|
@@ -131,13 +155,13 @@ export default class transactionCustomer extends Taro.Component {
|
131
|
155
|
到访时间:
|
132
|
156
|
<Picker mode='date' onChange={this.onVisitDateChange}>
|
133
|
157
|
<View className='picker'>
|
134
|
|
- {visitDate}
|
135
|
|
- {!visitDate && <Text className="placeholder">起始时间</Text>}
|
|
158
|
+ {startArrivalDate}
|
|
159
|
+ {!startArrivalDate && <Text className="placeholder">起始时间</Text>}
|
136
|
160
|
</View>
|
137
|
161
|
</Picker>-<Picker mode='date' onChange={this.onVisitDateChange2}>
|
138
|
162
|
<View className='picker'>
|
139
|
|
- {visitDate2}
|
140
|
|
- {!visitDate2 && <Text className="placeholder">结束时间</Text>}
|
|
163
|
+ {endArrivalDate}
|
|
164
|
+ {!endArrivalDate && <Text className="placeholder">结束时间</Text>}
|
141
|
165
|
</View>
|
142
|
166
|
</Picker>
|
143
|
167
|
</View>
|
|
@@ -145,13 +169,13 @@ export default class transactionCustomer extends Taro.Component {
|
145
|
169
|
报备时间:
|
146
|
170
|
<Picker mode='date' onChange={this.onReportDateChange}>
|
147
|
171
|
<View className='picker'>
|
148
|
|
- {reportDate}
|
149
|
|
- {!reportDate && <Text className="placeholder">起始时间</Text>}
|
|
172
|
+ {startReportDate }
|
|
173
|
+ {!startReportDate && <Text className="placeholder">起始时间</Text>}
|
150
|
174
|
</View>
|
151
|
175
|
</Picker>-<Picker mode='date' onChange={this.onReportDateChange2}>
|
152
|
176
|
<View className='picker'>
|
153
|
|
- {reportDate2}
|
154
|
|
- {!reportDate2 && <Text className="placeholder">结束时间</Text>}
|
|
177
|
+ {endReportDate}
|
|
178
|
+ {!endReportDate && <Text className="placeholder">结束时间</Text>}
|
155
|
179
|
</View>
|
156
|
180
|
</Picker>
|
157
|
181
|
</View>
|
|
@@ -171,7 +195,7 @@ export default class transactionCustomer extends Taro.Component {
|
171
|
195
|
}
|
172
|
196
|
|
173
|
197
|
render() {
|
174
|
|
- const { list, screenVisible } = this.state
|
|
198
|
+ const { customerList, screenVisible } = this.state
|
175
|
199
|
|
176
|
200
|
return (
|
177
|
201
|
<View>
|
|
@@ -185,9 +209,14 @@ export default class transactionCustomer extends Taro.Component {
|
185
|
209
|
</View>
|
186
|
210
|
<View style="padding:10px">
|
187
|
211
|
{
|
188
|
|
- list.map((item, index) => (
|
189
|
|
- <View class="item" key={index + 'list'} onClick={this.toMyCustomer}>
|
190
|
|
- <Image src={require('@assets/default-avatar.png')} className='img'></Image>
|
|
212
|
+ !customerList.length &&
|
|
213
|
+ <View style="margin:50px auto;text-align:center;font-size:14px;color:#888">暂无跟进客户~</View>
|
|
214
|
+ }
|
|
215
|
+ {
|
|
216
|
+ customerList.length &&
|
|
217
|
+ customerList.map((item, index) => (
|
|
218
|
+ <View class="item" key={index + 'customerList'} onClick={this.toMyCustomer.bind(this,item.customerId)}>
|
|
219
|
+ <Image src={item.picture || require('@assets/default-avatar.png')} className='img'></Image>
|
191
|
220
|
<View className="name">
|
192
|
221
|
{item.name}
|
193
|
222
|
{
|