|
@@ -4,6 +4,7 @@ import moment from 'moment';
|
4
|
4
|
import request from '../../../utils/request';
|
5
|
5
|
import apis from '../../../services/apis';
|
6
|
6
|
import Styles from './style.less';
|
|
7
|
+import router from 'umi/router';
|
7
|
8
|
|
8
|
9
|
import Attribution from './components/attribution'
|
9
|
10
|
import IntegralRecord from './components/integralRecord'
|
|
@@ -27,7 +28,7 @@ function body(props) {
|
27
|
28
|
const [dataSource, setDataSource] = useState({ records: [] })
|
28
|
29
|
|
29
|
30
|
// 默认私客
|
30
|
|
- // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
31
|
+ // eslint-disable-next-line react-hooks/rules-of-hooks
|
31
|
32
|
const [customerType, setCustomerType] = useState('private')
|
32
|
33
|
|
33
|
34
|
// 调整归属 ============ start
|
|
@@ -95,7 +96,7 @@ function body(props) {
|
95
|
96
|
// 分页
|
96
|
97
|
function onChange(pageNum) {
|
97
|
98
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
98
|
|
- getList({ pageNumber: pageNum, pageSize: 10, customerType })
|
|
99
|
+ getList({ pageNumber: pageNum, pageSize: 10, customerType })
|
99
|
100
|
}
|
100
|
101
|
|
101
|
102
|
// 私客/公客切换
|
|
@@ -127,20 +128,25 @@ function body(props) {
|
127
|
128
|
setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
|
128
|
129
|
setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
|
129
|
130
|
}
|
|
131
|
+ function toCustomerDateil() {
|
|
132
|
+ router.push({
|
|
133
|
+ pathname: '/customer/customerlist/customerDetail',
|
|
134
|
+ });
|
|
135
|
+ }
|
130
|
136
|
|
131
|
137
|
const columns = [
|
132
|
138
|
{
|
133
|
139
|
title: '头像',
|
134
|
140
|
dataIndex: 'picture',
|
135
|
141
|
key: 'picture',
|
136
|
|
- render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl } size={64} icon="user" />,
|
|
142
|
+ render: (_, record) => <Avatar shape="square" src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
|
137
|
143
|
},
|
138
|
144
|
{
|
139
|
145
|
title: '姓名',
|
140
|
146
|
dataIndex: 'name',
|
141
|
147
|
key: 'name',
|
142
|
148
|
// eslint-disable-next-line no-nested-ternary
|
143
|
|
- render: (_, record) => <><sapn>{ customerType === 'private' ? record.name : record.nickname }</sapn></>,
|
|
149
|
+ render: (_, record) => <><sapn>{customerType === 'private' ? record.name : record.nickname}</sapn></>,
|
144
|
150
|
},
|
145
|
151
|
{
|
146
|
152
|
title: '电话',
|
|
@@ -152,7 +158,7 @@ function body(props) {
|
152
|
158
|
dataIndex: 'sex',
|
153
|
159
|
key: 'sex',
|
154
|
160
|
// eslint-disable-next-line no-nested-ternary
|
155
|
|
- render: (_, record) => <><sapn>{ record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知' }</sapn></>,
|
|
161
|
+ render: (_, record) => <><sapn>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</sapn></>,
|
156
|
162
|
},
|
157
|
163
|
{
|
158
|
164
|
title: '置业顾问',
|
|
@@ -161,9 +167,9 @@ function body(props) {
|
161
|
167
|
// eslint-disable-next-line no-nested-ternary
|
162
|
168
|
render: (_, record) => (
|
163
|
169
|
<>
|
164
|
|
- <sapn>{ record.consultantName }</sapn>
|
165
|
|
- <br/>
|
166
|
|
- <sapn>{ record.consultTel }</sapn>
|
|
170
|
+ <sapn>{record.consultantName}</sapn>
|
|
171
|
+ <br />
|
|
172
|
+ <sapn>{record.consultTel}</sapn>
|
167
|
173
|
</>
|
168
|
174
|
),
|
169
|
175
|
},
|
|
@@ -171,8 +177,8 @@ function body(props) {
|
171
|
177
|
title: '客户状态',
|
172
|
178
|
dataIndex: 'reportRecommendStatus',
|
173
|
179
|
key: 'reportRecommendStatus',
|
174
|
|
- // eslint-disable-next-line no-nested-ternary
|
175
|
|
- render: (_, record) => <><sapn>{ record.reportRecommendStatus === 0 ? '为报备' : record.reportRecommendStatus === 1 ? '报备' : record.reportRecommendStatus === 2 ? '推荐' : '' }</sapn></>,
|
|
180
|
+ // eslint-disable-next-line no-nested-ternary
|
|
181
|
+ render: (_, record) => <><sapn>{record.reportRecommendStatus === 0 ? '为报备' : record.reportRecommendStatus === 1 ? '报备' : record.reportRecommendStatus === 2 ? '推荐' : ''}</sapn></>,
|
176
|
182
|
},
|
177
|
183
|
{
|
178
|
184
|
title: '操作',
|
|
@@ -181,13 +187,13 @@ function body(props) {
|
181
|
187
|
// eslint-disable-next-line no-nested-ternary
|
182
|
188
|
render: (_, record) => (
|
183
|
189
|
<>
|
184
|
|
- <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showStatus(record)}>变更状态</Button>
|
|
190
|
+ <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
|
185
|
191
|
|
186
|
|
- <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showGM(record)}>调整归属</Button>
|
187
|
|
- <br/>
|
188
|
|
- <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">查看详情</Button>
|
|
192
|
+ <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
|
|
193
|
+ <br />
|
|
194
|
+ <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={toCustomerDateil}>查看详情</Button>
|
189
|
195
|
|
190
|
|
- <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={ () => showRecord(record) }>积分记录</Button>
|
|
196
|
+ <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
|
191
|
197
|
</>
|
192
|
198
|
),
|
193
|
199
|
},
|
|
@@ -245,22 +251,22 @@ function body(props) {
|
245
|
251
|
</Form.Item>
|
246
|
252
|
</Form>
|
247
|
253
|
|
248
|
|
- <div style={{ marginTop: '20px', marginBottom: '20px' }}>
|
|
254
|
+ <div style={{ marginTop: '20px', marginBottom: '20px' }}>
|
249
|
255
|
<Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
|
250
|
|
- <Radio.Button value="private">私客</Radio.Button>
|
251
|
|
- <Radio.Button value="public">公客</Radio.Button>
|
|
256
|
+ <Radio.Button value="private">私客</Radio.Button>
|
|
257
|
+ <Radio.Button value="public">公客</Radio.Button>
|
252
|
258
|
</Radio.Group>
|
253
|
|
- </div>
|
|
259
|
+ </div>
|
254
|
260
|
<Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
|
255
|
261
|
|
256
|
|
- {/* 调整归属 */}
|
257
|
|
- <Attribution visibleData={gVisibleData} />
|
|
262
|
+ {/* 调整归属 */}
|
|
263
|
+ <Attribution visibleData={gVisibleData} />
|
258
|
264
|
|
259
|
|
- {/* 积分记录 */}
|
260
|
|
- <IntegralRecord visibleData={recordVisibleData} />
|
|
265
|
+ {/* 积分记录 */}
|
|
266
|
+ <IntegralRecord visibleData={recordVisibleData} />
|
261
|
267
|
|
262
|
|
- {/* 变更状态 */}
|
263
|
|
- <ChangeStatus visibleData={statusVisibleData} />
|
|
268
|
+ {/* 变更状态 */}
|
|
269
|
+ <ChangeStatus visibleData={statusVisibleData} />
|
264
|
270
|
</>
|
265
|
271
|
);
|
266
|
272
|
}
|