|
@@ -15,30 +15,61 @@ function header(props) {
|
15
|
15
|
* @returns
|
16
|
16
|
*/
|
17
|
17
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
18
|
|
- const [data, setData] = useState([{ visitRecords: [] }])
|
|
18
|
+ const [data, setData] = useState([{ }])
|
|
19
|
+ const [tableData, setTableDataData] = useState([{ }])
|
19
|
20
|
const [dataConsultant, setDataonsultant] = useState({})
|
20
|
21
|
const [intentionData, setIntentionData] = useState([])
|
21
|
22
|
|
22
|
23
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
23
|
24
|
useEffect(() => {
|
24
|
25
|
getById()
|
|
26
|
+ toLoadIntention()
|
25
|
27
|
}, [])
|
26
|
28
|
|
|
29
|
+ function toLoadIntention() {
|
|
30
|
+ const arr = []
|
|
31
|
+ // 意向值
|
|
32
|
+ for (let i = 0; i < intentionData.length; i++) {
|
|
33
|
+ const a = [].concat(
|
|
34
|
+ intentionData.concat([{
|
|
35
|
+ key: i,
|
|
36
|
+ name: `Edward King ${i}`,
|
|
37
|
+ age: 32,
|
|
38
|
+ address: `London, Park Lane no. ${i}`,
|
|
39
|
+ }]),
|
|
40
|
+ )
|
|
41
|
+ arr.push(a)
|
|
42
|
+ }
|
|
43
|
+ setIntentionData(arr)
|
|
44
|
+ }
|
|
45
|
+
|
27
|
46
|
// 查询
|
|
47
|
+ const { id } = props.location.query;
|
28
|
48
|
function getById(params) {
|
29
|
|
- const { id } = props.location.query;
|
30
|
49
|
if (id === '' || id === undefined) {
|
31
|
50
|
return
|
32
|
51
|
}
|
33
|
|
-
|
34
|
|
- request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
|
|
52
|
+ // eslint-disable-next-line max-len
|
|
53
|
+ request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params, pageNumber: 1, pageSize: 10 } }).then(res => {
|
35
|
54
|
setData(res)
|
|
55
|
+ if (res.visitRecords) {
|
|
56
|
+ setTableDataData(res.visitRecords)
|
|
57
|
+ }
|
36
|
58
|
setDataonsultant(res.geoInfo)
|
|
59
|
+ setIntentionData(res.intentions)
|
37
|
60
|
})
|
38
|
61
|
}
|
39
|
62
|
// 分页
|
40
|
|
- const changePageNum = pageNumber => {
|
41
|
|
- // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
|
|
63
|
+function onChange(number) {
|
|
64
|
+ if (id === '' || id === undefined) {
|
|
65
|
+ return
|
|
66
|
+ }
|
|
67
|
+ // eslint-disable-next-line max-len
|
|
68
|
+ request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { pageNumber: number, pageSize: 10 } }).then(res => {
|
|
69
|
+ setData(res)
|
|
70
|
+ setTableDataData(res.visitRecords)
|
|
71
|
+ setDataonsultant(res.geoInfo)
|
|
72
|
+ })
|
42
|
73
|
}
|
43
|
74
|
const columns = [
|
44
|
75
|
{
|
|
@@ -67,28 +98,17 @@ function header(props) {
|
67
|
98
|
{
|
68
|
99
|
title: 'Name',
|
69
|
100
|
dataIndex: 'name',
|
70
|
|
- width: 150,
|
71
|
|
- render: (_, record) => <span>香颂半岛</span>,
|
|
101
|
+ render: (_, record) => <span width={500}>{record.buildingName}</span>,
|
72
|
102
|
},
|
73
|
103
|
{
|
74
|
104
|
title: 'Address',
|
75
|
105
|
dataIndex: 'address',
|
76
|
|
- render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
|
|
106
|
+ render: (_, record) => <span style={{ marginLeft: '-50%' }}>{record.intention}</span>,
|
77
|
107
|
},
|
78
|
108
|
];
|
79
|
|
-
|
80
|
|
-for (let i = 0; i < 100; i++) {
|
81
|
|
- intentionData.push({
|
82
|
|
- key: i,
|
83
|
|
- name: `Edward King ${i}`,
|
84
|
|
- age: 32,
|
85
|
|
- address: `London, Park Lane no. ${i}`,
|
86
|
|
- });
|
87
|
|
-}
|
88
|
109
|
return (
|
89
|
110
|
<>
|
90
|
111
|
<div className={styles.cardBox}>
|
91
|
|
- {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
|
92
|
112
|
<div className={styles.rightBox}>
|
93
|
113
|
<p className={styles.tit}>客户信息</p>
|
94
|
114
|
<img className={styles.touxiang} src={ data.picture && data.picture } />
|
|
@@ -111,9 +131,9 @@ for (let i = 0; i < 100; i++) {
|
111
|
131
|
</div>
|
112
|
132
|
{/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
|
113
|
133
|
<div className={styles.rightInfo}>
|
114
|
|
- <p className={styles.rightItem}>国家:{ dataConsultant&&dataConsultant.country }</p>
|
115
|
|
- <p className={styles.rightItem}>省份:{ dataConsultant&&dataConsultant.provience }</p>
|
116
|
|
- <p className={styles.rightItem}>城市:{dataConsultant&&dataConsultant.city }</p>
|
|
134
|
+ <p className={styles.rightItem}>国家:{ dataConsultant && dataConsultant.country }</p>
|
|
135
|
+ <p className={styles.rightItem}>省份:{ dataConsultant && dataConsultant.provience }</p>
|
|
136
|
+ <p className={styles.rightItem}>城市:{dataConsultant && dataConsultant.city }</p>
|
117
|
137
|
<p className={styles.rightItem}>来访渠道:活动分享</p>
|
118
|
138
|
{/* <p className={styles.rightItem}>详细信息:</p> */}
|
119
|
139
|
{/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */}
|
|
@@ -126,16 +146,16 @@ for (let i = 0; i < 100; i++) {
|
126
|
146
|
<div className={styles.cardBox}>
|
127
|
147
|
<div className={styles.rightBoxCentre}>
|
128
|
148
|
<p className={styles.tit}>置业顾问信息</p>
|
129
|
|
- <img className={styles.touxiang} src={ data.picture && data.picture } />
|
130
|
|
- <p className={styles.infoItem}>曹玉文</p>
|
|
149
|
+ <img className={styles.touxiangphoto} src={ data.consultant && data.consultant.photo }/>
|
|
150
|
+ <p className={styles.infoItem}>{data.consultant && data.consultant.userName}</p>
|
131
|
151
|
<div className={styles.right}>
|
132
|
152
|
{/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
|
133
|
153
|
<p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p> */}
|
134
|
154
|
<p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
|
135
|
|
- <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
|
|
155
|
+ <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.position }</p>
|
136
|
156
|
</div>
|
137
|
157
|
<div className={styles.left}>
|
138
|
|
- <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
|
|
158
|
+ <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.orgName } </p>
|
139
|
159
|
<p className={styles.infoItem}>
|
140
|
160
|
所属项目:
|
141
|
161
|
{
|
|
@@ -148,18 +168,19 @@ for (let i = 0; i < 100; i++) {
|
148
|
168
|
<div className={styles.leftBoxCentre}>
|
149
|
169
|
<div className={styles.tit}>
|
150
|
170
|
<span>项目名称</span>
|
151
|
|
- <span style={{ marginLeft: '47%' }}>项目名称</span>
|
|
171
|
+ <span style={{ marginLeft: '47%' }}>意向值</span>
|
152
|
172
|
</div>
|
153
|
173
|
{/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
|
154
|
174
|
<div className={styles.infoItem}>
|
155
|
|
- <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
|
|
175
|
+ <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={false} scroll={intentionData && intentionData.length >= 3 ? { y: 240 } : false}/>
|
156
|
176
|
</div>
|
157
|
177
|
</div>
|
158
|
178
|
|
159
|
179
|
</div>
|
160
|
180
|
<div className={styles.recordBox}>
|
161
|
181
|
<p className={styles.tableName}>访问记录</p>
|
162
|
|
- <Table showQuickJumper defaultCurrent={1} dataSource={data.visitRecords} columns={columns} current={50} />
|
|
182
|
+ <Table dataSource={tableData.records} columns={columns} pagination={{ pageSize: 10, total: tableData.total, onChange }} />
|
|
183
|
+ {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
|
163
|
184
|
</div>
|
164
|
185
|
|
165
|
186
|
</>
|