zlisen 3 years ago
parent
commit
68aaaafcea

+ 1
- 0
package.json View File

58
     "omit.js": "^1.0.2",
58
     "omit.js": "^1.0.2",
59
     "package.json": "^2.0.1",
59
     "package.json": "^2.0.1",
60
     "path-to-regexp": "2.4.0",
60
     "path-to-regexp": "2.4.0",
61
+    "pinyin": "^2.10.2",
61
     "qs": "^6.9.0",
62
     "qs": "^6.9.0",
62
     "react": "^16.8.6",
63
     "react": "^16.8.6",
63
     "react-copy-to-clipboard": "^5.0.1",
64
     "react-copy-to-clipboard": "^5.0.1",

+ 2
- 2
src/components/Poster/Form.jsx View File

86
           rules: [{ required: true, message: '请楼盘海报图' }],
86
           rules: [{ required: true, message: '请楼盘海报图' }],
87
       })(<ImageUpload onChange={handleImageChange} />)}
87
       })(<ImageUpload onChange={handleImageChange} />)}
88
       </Form.Item>
88
       </Form.Item>
89
-      <Form.Item label="海报标题">
89
+      {/* <Form.Item label="海报标题">
90
       {getFieldDecorator('posterTitle')(<Input />)}
90
       {getFieldDecorator('posterTitle')(<Input />)}
91
       </Form.Item>
91
       </Form.Item>
92
       <Form.Item label="海报描述">
92
       <Form.Item label="海报描述">
95
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
95
       <Form.Item label=" " colon={false} style={{marginTop: '2em'}}>
96
         <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
96
         <Button loading={loading} style={{marginLeft: '4em'}} type="primary" htmlType="submit">保存</Button>
97
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
97
         {/* <Button style={{marginLeft: '2em'}} onClick={props.onCancel}>取消</Button> */}
98
-      </Form.Item>
98
+       {/* </Form.Item> */}
99
     </Form>
99
     </Form>
100
   )
100
   )
101
 }
101
 }

+ 50
- 24
src/pages/activity/SignupActivity/detail.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Tabs, Select, Card, Radio, DatePicker, message, Upload } from 'antd';
2
+import { Form, Input, Button, Icon, Select, Card, Radio, DatePicker, message, Upload } from 'antd';
3
 
3
 
4
 import apis from '@/services/apis';
4
 import apis from '@/services/apis';
5
 import moment from 'moment';
5
 import moment from 'moment';
17
 import Share from '@/components/Share';
17
 import Share from '@/components/Share';
18
 import Poster from '@/components/Poster';
18
 import Poster from '@/components/Poster';
19
 
19
 
20
-const { TabPane } = Tabs
20
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
21
+const { TextArea } = Input;
21
 
22
 
22
 const formItemLayout = {
23
 const formItemLayout = {
23
-  labelCol: { span: 4 },
24
-  wrapperCol: { span: 18 },
24
+  labelCol: { span: 6 },
25
+  wrapperCol: { span: 14 },
25
 };
26
 };
26
 
27
 
27
 const cancelPage = () => {
28
 const cancelPage = () => {
109
   const { getFieldDecorator } = props.form;
110
   const { getFieldDecorator } = props.form;
110
   return (
111
   return (
111
     <>
112
     <>
112
-      <Form {...formItemLayout} onSubmit={handleSubmit} style={{maxWidth: '1000px'}}>
113
+      <Form {...formItemLayout} onSubmit={handleSubmit}>
113
         <Form.Item label="所属项目">
114
         <Form.Item label="所属项目">
114
           {getFieldDecorator('buildingId', {
115
           {getFieldDecorator('buildingId', {
115
             initialValue: detailData.buildingId,
116
             initialValue: detailData.buildingId,
121
             ],
122
             ],
122
           })(<BuildSelect disabled />)}
123
           })(<BuildSelect disabled />)}
123
         </Form.Item>
124
         </Form.Item>
124
-        <Form.Item label="活动封面图">
125
+        <Form.Item label="活动封面图1">
125
           <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
126
           <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
126
         </Form.Item>
127
         </Form.Item>
127
         {/* <Form.Item label="活动封面图2">
128
         {/* <Form.Item label="活动封面图2">
133
         <Form.Item label="活动标题">
134
         <Form.Item label="活动标题">
134
           <span>{detailData.title}</span>
135
           <span>{detailData.title}</span>
135
         </Form.Item>
136
         </Form.Item>
136
-        <Form.Item label="副标题">
137
+        {/* <Form.Item label="副标题">
137
           <span>{detailData.halfTitle}</span>
138
           <span>{detailData.halfTitle}</span>
138
-        </Form.Item>
139
+        </Form.Item> */}
139
         <Form.Item label="活动时间">
140
         <Form.Item label="活动时间">
140
           <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
141
           <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
141
             detailData.endDate,
142
             detailData.endDate,
147
         <Form.Item label="活动人数">
148
         <Form.Item label="活动人数">
148
           <span>{detailData.personNum}</span>
149
           <span>{detailData.personNum}</span>
149
         </Form.Item>
150
         </Form.Item>
150
-        <Form.Item label="阅读量">
151
+        {/* <Form.Item label="阅读量">
151
           <span>{detailData.pvNum}</span>
152
           <span>{detailData.pvNum}</span>
152
         </Form.Item>
153
         </Form.Item>
153
         <Form.Item label="转发量">
154
         <Form.Item label="转发量">
158
         </Form.Item>
159
         </Form.Item>
159
         <Form.Item label="最大报名人数">
160
         <Form.Item label="最大报名人数">
160
           <span>{detailData.maxEnlistByPerson}</span>
161
           <span>{detailData.maxEnlistByPerson}</span>
161
-        </Form.Item>
162
+        </Form.Item> */}
162
         <Form.Item label="活动详情">
163
         <Form.Item label="活动详情">
163
           <div
164
           <div
164
             style={{ maxHeight: '500px', overflowY: 'auto' }}
165
             style={{ maxHeight: '500px', overflowY: 'auto' }}
185
             </span>
186
             </span>
186
           )}
187
           )}
187
         </AuthButton>
188
         </AuthButton>
188
-        {/* <AuthButton name="admin.dymic.qrcode" noRight={null}>
189
+        <AuthButton name="admin.dymic.qrcode" noRight={null}>
189
           {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
190
           {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
190
             <span
191
             <span
191
               style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
192
               style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
194
               {<Button>下载二维码</Button>}
195
               {<Button>下载二维码</Button>}
195
             </span>
196
             </span>
196
           )}
197
           )}
197
-        </AuthButton> */}
198
+        </AuthButton>
198
         <Button onClick={() => cancelPage()}>取消</Button>
199
         <Button onClick={() => cancelPage()}>取消</Button>
199
       </div>
200
       </div>
200
     </>
201
     </>
210
  * @returns
211
  * @returns
211
  */
212
  */
212
 const Edit = props => {
213
 const Edit = props => {
214
+  const [tab, changeTab] = useState('basic');
213
   const { dynamicId } = props.location.query;
215
   const { dynamicId } = props.location.query;
214
   const [detailData, setDetailData] = useState(false);
216
   const [detailData, setDetailData] = useState(false);
215
 
217
 
230
   }, []);
232
   }, []);
231
 
233
 
232
   const target = { id: dynamicId, type: 'activity' };
234
   const target = { id: dynamicId, type: 'activity' };
233
-
234
   return (
235
   return (
235
     <Card>
236
     <Card>
236
-      <Tabs defaultActiveKey="1">
237
-        <TabPane tab="基础信息" key="1">
238
-          <Basic dynamicId={dynamicId} detailData={detailData} />
239
-        </TabPane>
240
-        {/* <TabPane tab="海报图片" key="2">
241
-          <Poster target={target} />
242
-        </TabPane>
243
-        <TabPane tab="分享设置" key="3">
244
-          <Share target={target} />
245
-        </TabPane> */}
246
-      </Tabs>
237
+      <div>
238
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
239
+          <Radio.Button value="basic">基本信息</Radio.Button>
240
+          {/* <Radio.Button value="poster">海报图片</Radio.Button>
241
+          <Radio.Button value="share">分享设置</Radio.Button> */}
242
+        </Radio.Group>
243
+      </div>
244
+      <div>
245
+        {tab === 'basic' && <Basic dynamicId={dynamicId} detailData={detailData} />}
246
+
247
+        {tab === 'poster' && <Poster target={target} />}
248
+        {tab === 'share' && <Share target={target} />}
249
+      </div>
250
+      {/* <div style={{ textAlign: 'center' }}>
251
+        <AuthButton name="admin.SignList.get" noRight={null}>
252
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
253
+            <span
254
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
255
+              onClick={getSignList.bind(this, detailData.dynamicId)}
256
+            >
257
+              <Button>报名记录</Button>
258
+            </span>
259
+          )}
260
+        </AuthButton>
261
+        <AuthButton name="admin.dymic.qrcode" noRight={null}>
262
+          {(detailData.activityStatus === 0 || detailData.activityStatus === 2) && (
263
+            <span
264
+              style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }}
265
+              onClick={newQrcode.bind(this, detailData)}
266
+            >
267
+              {<Button>下载二维码</Button>}
268
+            </span>
269
+          )}
270
+        </AuthButton>
271
+        <Button onClick={() => cancelPage()}>取消</Button>
272
+      </div> */}
247
     </Card>
273
     </Card>
248
   );
274
   );
249
 };
275
 };

+ 2
- 2
src/pages/activity/SignupActivity/registrationRecord.jsx View File

186
 
186
 
187
       <div style={{ textAlign: 'right', margin: '6px 0 10px 0' }}>
187
       <div style={{ textAlign: 'right', margin: '6px 0 10px 0' }}>
188
         {' '}
188
         {' '}
189
-        <Button
189
+        {/* <Button
190
           name="admin.activityDynamicEnlist.export.get"
190
           name="admin.activityDynamicEnlist.export.get"
191
           noRight={null}
191
           noRight={null}
192
           type="primary"
192
           type="primary"
193
           onClick={exportHelp}
193
           onClick={exportHelp}
194
         >
194
         >
195
           导出
195
           导出
196
-        </Button>
196
+        </Button> */}
197
       </div>
197
       </div>
198
       <Table
198
       <Table
199
         dataSource={data.list.data}
199
         dataSource={data.list.data}

+ 9
- 6
src/pages/activity/groupRoomActivity/detail.jsx View File

125
         <Form.Item label="活动封面图1">
125
         <Form.Item label="活动封面图1">
126
           <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
126
           <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
127
         </Form.Item>
127
         </Form.Item>
128
-        <Form.Item label="活动封面图2">
128
+        {/* <Form.Item label="活动封面图2">
129
           <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
129
           <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
130
-        </Form.Item>
130
+        </Form.Item> */}
131
         <Form.Item label="活动详情主图">
131
         <Form.Item label="活动详情主图">
132
           <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
132
           <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
133
         </Form.Item>
133
         </Form.Item>
134
         <Form.Item label="活动标题">
134
         <Form.Item label="活动标题">
135
           <span>{detailData.title}</span>
135
           <span>{detailData.title}</span>
136
         </Form.Item>
136
         </Form.Item>
137
-        <Form.Item label="副标题">
137
+        {/* <Form.Item label="副标题">
138
           <span>{detailData.halfTitle}</span>
138
           <span>{detailData.halfTitle}</span>
139
-        </Form.Item>
139
+        </Form.Item> */}
140
         <Form.Item label="活动时间">
140
         <Form.Item label="活动时间">
141
           <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
141
           <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
142
             detailData.endDate,
142
             detailData.endDate,
148
         <Form.Item label="活动人数">
148
         <Form.Item label="活动人数">
149
           <span>{detailData.personNum}</span>
149
           <span>{detailData.personNum}</span>
150
         </Form.Item>
150
         </Form.Item>
151
-        <Form.Item label="阅读量">
151
+        <Form.Item label="团房价">
152
+          <span>{detailData.groupBuyPrice}</span>
153
+        </Form.Item>
154
+        {/* <Form.Item label="阅读量">
152
           <span>{detailData.pvNum}</span>
155
           <span>{detailData.pvNum}</span>
153
         </Form.Item>
156
         </Form.Item>
154
         <Form.Item label="转发量">
157
         <Form.Item label="转发量">
159
         </Form.Item>
162
         </Form.Item>
160
         <Form.Item label="最大报名人数">
163
         <Form.Item label="最大报名人数">
161
           <span>{detailData.maxEnlistByPerson}</span>
164
           <span>{detailData.maxEnlistByPerson}</span>
162
-        </Form.Item>
165
+        </Form.Item> */}
163
         <Form.Item label="活动详情">
166
         <Form.Item label="活动详情">
164
           <div
167
           <div
165
             style={{ maxHeight: '500px', overflowY: 'auto' }}
168
             style={{ maxHeight: '500px', overflowY: 'auto' }}

+ 2
- 2
src/pages/activity/groupRoomActivity/registrationRecord.jsx View File

195
           导出
195
           导出
196
         </Button>
196
         </Button>
197
       </div>
197
       </div>
198
-      <Table
198
+      {/* <Table
199
         dataSource={data.list.data}
199
         dataSource={data.list.data}
200
         columns={columns}
200
         columns={columns}
201
         pagination={{ total: data.total, onChange: changePageNum }}
201
         pagination={{ total: data.total, onChange: changePageNum }}
202
         loading={loading}
202
         loading={loading}
203
         rowKey="activity"
203
         rowKey="activity"
204
-      />
204
+      /> */}
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
205
       {/* <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
206
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
207
       </div> */}
207
       </div> */}

+ 6
- 6
src/pages/activity/lookHouseActivity/detail.jsx View File

125
         <Form.Item label="活动封面图1">
125
         <Form.Item label="活动封面图1">
126
           <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
126
           <img src={getImgURL(detailData.listImgUrl)} height="210px" width="375px" />
127
         </Form.Item>
127
         </Form.Item>
128
-        <Form.Item label="活动封面图2">
128
+        {/* <Form.Item label="活动封面图2">
129
           <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
129
           <img src={getImgURL(detailData.bannerListImg)} height="125px" width="375px" />
130
-        </Form.Item>
130
+        </Form.Item> */}
131
         <Form.Item label="活动详情主图">
131
         <Form.Item label="活动详情主图">
132
           <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
132
           <img src={getImgURL(detailData.imgUrl)} height="300px" width="375px" />
133
         </Form.Item>
133
         </Form.Item>
134
         <Form.Item label="活动标题">
134
         <Form.Item label="活动标题">
135
           <span>{detailData.title}</span>
135
           <span>{detailData.title}</span>
136
         </Form.Item>
136
         </Form.Item>
137
-        <Form.Item label="副标题">
137
+        {/* <Form.Item label="副标题">
138
           <span>{detailData.halfTitle}</span>
138
           <span>{detailData.halfTitle}</span>
139
-        </Form.Item>
139
+        </Form.Item> */}
140
         <Form.Item label="活动时间">
140
         <Form.Item label="活动时间">
141
           <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
141
           <span>{`${moment(detailData.startDate).format('YYYY-MM-DD HH:mm')} —— ${moment(
142
             detailData.endDate,
142
             detailData.endDate,
148
         <Form.Item label="活动人数">
148
         <Form.Item label="活动人数">
149
           <span>{detailData.personNum}</span>
149
           <span>{detailData.personNum}</span>
150
         </Form.Item>
150
         </Form.Item>
151
-        <Form.Item label="阅读量">
151
+        {/* <Form.Item label="阅读量">
152
           <span>{detailData.pvNum}</span>
152
           <span>{detailData.pvNum}</span>
153
         </Form.Item>
153
         </Form.Item>
154
         <Form.Item label="转发量">
154
         <Form.Item label="转发量">
159
         </Form.Item>
159
         </Form.Item>
160
         <Form.Item label="最大报名人数">
160
         <Form.Item label="最大报名人数">
161
           <span>{detailData.maxEnlistByPerson}</span>
161
           <span>{detailData.maxEnlistByPerson}</span>
162
-        </Form.Item>
162
+        </Form.Item> */}
163
         <Form.Item label="活动详情">
163
         <Form.Item label="活动详情">
164
           <div
164
           <div
165
             style={{ maxHeight: '500px', overflowY: 'auto' }}
165
             style={{ maxHeight: '500px', overflowY: 'auto' }}

+ 2
- 2
src/pages/activity/lookHouseActivity/registrationRecord.jsx View File

186
 
186
 
187
       <div style={{ textAlign: 'right', margin: '6px 0 10px 0' }}>
187
       <div style={{ textAlign: 'right', margin: '6px 0 10px 0' }}>
188
         {' '}
188
         {' '}
189
-        <Button
189
+        {/* <Button
190
           name="admin.activityDynamicEnlist.export.get"
190
           name="admin.activityDynamicEnlist.export.get"
191
           noRight={null}
191
           noRight={null}
192
           type="primary"
192
           type="primary"
193
           onClick={exportHelp}
193
           onClick={exportHelp}
194
         >
194
         >
195
           导出
195
           导出
196
-        </Button>
196
+        </Button> */}
197
       </div>
197
       </div>
198
       <Table
198
       <Table
199
         dataSource={data.list.data}
199
         dataSource={data.list.data}

+ 89
- 64
src/pages/building/Developers/Edit.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Button, Card, Form,  notification,message } from 'antd';
2
+import { Input, Button, Card, Form, notification, message } from 'antd';
3
 import router from 'umi/router';
3
 import router from 'umi/router';
4
 // import Styles from './style.less';
4
 // import Styles from './style.less';
5
 import ImageUploader from '../../../components/XForm/ImageUpload';
5
 import ImageUploader from '../../../components/XForm/ImageUpload';
6
 import request from '../../../utils/request';
6
 import request from '../../../utils/request';
7
 import apis from '../../../services/apis';
7
 import apis from '../../../services/apis';
8
 import { fetch } from '@/utils/request';
8
 import { fetch } from '@/utils/request';
9
-
10
-
11
-  const formItemLayout = {
12
-    labelCol: {
13
-      xs: { span: 24 },
14
-      sm: { span: 8 },
9
+import pinyin from 'pinyin';
10
+
11
+const formItemLayout = {
12
+  labelCol: {
13
+    xs: { span: 24 },
14
+    sm: { span: 8 },
15
+  },
16
+  wrapperCol: {
17
+    xs: { span: 24 },
18
+    sm: { span: 16 },
19
+  },
20
+};
21
+const tailFormItemLayout = {
22
+  wrapperCol: {
23
+    xs: {
24
+      span: 24,
25
+      offset: 0,
15
     },
26
     },
16
-    wrapperCol: {
17
-      xs: { span: 24 },
18
-      sm: { span: 16 },
19
-    },
20
-  };
21
-  const tailFormItemLayout = {
22
-    wrapperCol: {
23
-      xs: {
24
-        span: 24,
25
-        offset: 0,
26
-      },
27
-      sm: {
28
-        span: 16,
29
-        offset: 8,
30
-      },
27
+    sm: {
28
+      span: 16,
29
+      offset: 8,
31
     },
30
     },
32
-  };
31
+  },
32
+};
33
 
33
 
34
 function Edit(props) {
34
 function Edit(props) {
35
-  const { getFieldDecorator } = props.form;
35
+  const { getFieldDecorator, getFieldValue, setFieldsValue } = props.form;
36
   const { form, history } = props;
36
   const { form, history } = props;
37
   const updateBrandData = fetch(apis.brand.alterBrand);
37
   const updateBrandData = fetch(apis.brand.alterBrand);
38
-  const saveBrandData=fetch(apis.brand.addBrand);
38
+  const saveBrandData = fetch(apis.brand.addBrand);
39
   const goBack = () => router.goBack(-1);
39
   const goBack = () => router.goBack(-1);
40
-  const {validateFields}=form;
41
-
40
+  const { validateFields } = form;
42
 
41
 
43
   // eslint-disable-next-line react-hooks/rules-of-hooks
42
   // eslint-disable-next-line react-hooks/rules-of-hooks
44
   let data = {};
43
   let data = {};
45
   const { brandId } = props.location.query;
44
   const { brandId } = props.location.query;
46
 
45
 
47
-
48
-  useEffect(()=>{
46
+  useEffect(() => {
47
+    console.log(
48
+      pinyin('地点', {
49
+        style: pinyin.STYLE_FIRST_LETTER,
50
+        heteronym: true,
51
+      })[0][0],'1111111111111111'
52
+    );
49
     if (brandId) {
53
     if (brandId) {
50
-      getById({brandId})
54
+      getById({ brandId });
51
     }
55
     }
52
-  },[brandId])
56
+  }, [brandId]);
53
 
57
 
54
-
55
-//增+改
58
+  //增+改
56
   function handleSubmit(e) {
59
   function handleSubmit(e) {
57
     e.preventDefault();
60
     e.preventDefault();
58
     validateFields((err, values) => {
61
     validateFields((err, values) => {
65
           data: {
68
           data: {
66
             ...values,
69
             ...values,
67
           },
70
           },
68
-          urlData: { id: brandId }
69
-        }).then(() => {
70
-          // setLoading(false);
71
-          message.success('数据更新成功');
72
-          goBack()
73
-        }).catch((err) => {
74
-          // setLoading(false);//loading消失
75
-          message.error(err.message || err);
71
+          urlData: { id: brandId },
76
         })
72
         })
73
+          .then(() => {
74
+            // setLoading(false);
75
+            message.success('数据更新成功');
76
+            goBack();
77
+          })
78
+          .catch(err => {
79
+            // setLoading(false);//loading消失
80
+            message.error(err.message || err);
81
+          });
77
       } else {
82
       } else {
78
-        saveBrandData({ data: values }).then(() => {
79
-          // setLoading(false);
80
-          message.success('数据保存成功');
81
-          goBack()
82
-        }).catch((err) => {
83
-          // setLoading(false);//loading消失
84
-          message.error(err.message || err);
85
-        })
83
+        saveBrandData({ data: values })
84
+          .then(() => {
85
+            // setLoading(false);
86
+            message.success('数据保存成功');
87
+            goBack();
88
+          })
89
+          .catch(err => {
90
+            // setLoading(false);//loading消失
91
+            message.error(err.message || err);
92
+          });
86
       }
93
       }
87
     });
94
     });
88
-
89
-
90
-
91
   }
95
   }
92
   // 获取详情信息
96
   // 获取详情信息
93
   function getById(res) {
97
   function getById(res) {
103
     });
107
     });
104
   };
108
   };
105
 
109
 
106
-
107
-//修改
110
+  //修改
108
   // function submitData(dataSources) {
111
   // function submitData(dataSources) {
109
   //   if (id !== '') {
112
   //   if (id !== '') {
110
   //     // 修改
113
   //     // 修改
136
   return (
139
   return (
137
     <Card>
140
     <Card>
138
       <Form {...formItemLayout} onSubmit={handleSubmit}>
141
       <Form {...formItemLayout} onSubmit={handleSubmit}>
139
-      <Form.Item label="开发商名称">
142
+        <Form.Item label="开发商名称">
140
           {getFieldDecorator('brandName', {
143
           {getFieldDecorator('brandName', {
141
             rules: [
144
             rules: [
142
               {
145
               {
144
                 message: '请输入开发商名称!',
147
                 message: '请输入开发商名称!',
145
               },
148
               },
146
             ],
149
             ],
147
-          })(<Input style={{width:200}}/>)}
150
+          })(
151
+            <Input
152
+              onChange={e =>{
153
+              //   console.log(e,'333333333')
154
+              // const item =  
155
+              //   console.log(item,'333333333')
156
+              if(!e.target.value) return
157
+                setFieldsValue({
158
+                  indexLetter: pinyin(e.target.value, {
159
+                    style: pinyin.STYLE_FIRST_LETTER,
160
+                    heteronym: true,
161
+                  })[0][0]
162
+                })
163
+              }
164
+                
165
+              }
166
+              style={{ width: 200 }}
167
+            />,
168
+          )}
148
         </Form.Item>
169
         </Form.Item>
149
         <Form.Item label="开发商索引">
170
         <Form.Item label="开发商索引">
150
           {getFieldDecorator('indexLetter', {
171
           {getFieldDecorator('indexLetter', {
172
+            // value={}
151
             rules: [{ required: true, message: '请输入开发商索引' }],
173
             rules: [{ required: true, message: '请输入开发商索引' }],
152
-          })(<Input style={{width:200}}/>)}
174
+          })(<Input style={{ width: 200 }}  disabled/>)}
153
         </Form.Item>
175
         </Form.Item>
154
         <Form.Item label="品牌logo">
176
         <Form.Item label="品牌logo">
155
           {getFieldDecorator('brandLogo', {
177
           {getFieldDecorator('brandLogo', {
156
             rules: [{ required: true, message: '请上传品牌logo' }],
178
             rules: [{ required: true, message: '请上传品牌logo' }],
157
-        })(<ImageUploader />)}
179
+          })(<ImageUploader />)}
158
         </Form.Item>
180
         </Form.Item>
159
-        <Form.Item label="品牌宣传图" help="建议尺寸:750*750,比例1:1" >
160
-          {getFieldDecorator('brandImg', { 
181
+        <Form.Item label="品牌宣传图" help="建议尺寸:750*750,比例1:1">
182
+          {getFieldDecorator('brandImg', {
161
             rules: [{ required: true, message: '请上传品牌宣传图' }],
183
             rules: [{ required: true, message: '请上传品牌宣传图' }],
162
-        })(<ImageUploader />)}
184
+          })(<ImageUploader />)}
163
         </Form.Item>
185
         </Form.Item>
164
         <Form.Item label="开发商简介">
186
         <Form.Item label="开发商简介">
165
           {getFieldDecorator('brandRemark', {
187
           {getFieldDecorator('brandRemark', {
166
             rules: [{ required: true, message: '请输入开发商简介' }],
188
             rules: [{ required: true, message: '请输入开发商简介' }],
167
-          })(<Input.TextArea style={{width:400}} placeholder="120字内的简介"/>)}
189
+          })(<Input.TextArea style={{ width: 400 }} placeholder="120字内的简介" />)}
168
         </Form.Item>
190
         </Form.Item>
169
-       
170
-        <Form.Item  {...tailFormItemLayout} style={{ display: 'flex', justifyContent: 'space-between' }}>
191
+
192
+        <Form.Item
193
+          {...tailFormItemLayout}
194
+          style={{ display: 'flex', justifyContent: 'space-between' }}
195
+        >
171
           <Button type="primary" htmlType="submit" style={{ margin: '0' }}>
196
           <Button type="primary" htmlType="submit" style={{ margin: '0' }}>
172
             确定
197
             确定
173
           </Button>
198
           </Button>

+ 20
- 33
src/pages/carouselFigure/customImg/edit.jsx View File

6
 import apis from '../../../services/apis';
6
 import apis from '../../../services/apis';
7
 import request from '../../../utils/request';
7
 import request from '../../../utils/request';
8
 
8
 
9
-let activityVisible = true;
10
 let helpTips = '';
9
 let helpTips = '';
11
 
10
 
12
-const setExtraData = data => {
13
-  activityVisible = data.imgType === 'index';
14
-};
15
 
11
 
16
-const handleFormValueChange = (props, changedValues, allValues) => {
17
-  setExtraData(allValues);
18
-};
12
+// const handleFormValueChange = (props, changedValues, allValues) => {
13
+//   setExtraData(allValues);
14
+// };
19
 
15
 
20
-const XForm = createForm({ onValuesChange: handleFormValueChange });
16
+const XForm = createForm();
21
 
17
 
22
 const header = props => {
18
 const header = props => {
23
   const {
19
   const {
31
   const imgId = props.location.query.imgId;
27
   const imgId = props.location.query.imgId;
32
   const imgType = props.location.query.imgType;
28
   const imgType = props.location.query.imgType;
33
 
29
 
34
-  const [data, setData] = useState(
35
-    imgType === 'index'
36
-      ? {
37
-          imgUrl:
38
-            'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg',
39
-          imgType: 'index',
40
-          imgDesc: '小程序首页分享配图',
41
-          imgDocument: currentUser.orgName + ' 精准获客平台',
42
-        }
43
-      : {
44
-          imgUrl: 'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png',
45
-          imgType: 'indexNews',
46
-        },
30
+  const [data, setData] = useState({}
31
+    // imgType === 'index'
32
+    //   ? {
33
+    //       imgUrl:
34
+    //         'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg',
35
+    //       imgType: 'index',
36
+    //       imgDesc: '小程序首页分享配图',
37
+    //       imgDocument: currentUser.orgName + ' 精准获客平台',
38
+    //     }
39
+    //   : {
40
+    //       imgUrl: 'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png',
41
+    //       imgType: 'indexNews',
42
+    //     },
47
   );
43
   );
48
 
44
 
49
   if (imgId) {
45
   if (imgId) {
54
     // 查询列表
50
     // 查询列表
55
     const getData = imgId => {
51
     const getData = imgId => {
56
       request({ ...apis.carsuseFigure.getCustomImg, urlData: { id: imgId } }).then(data => {
52
       request({ ...apis.carsuseFigure.getCustomImg, urlData: { id: imgId } }).then(data => {
57
-        console.log(data);
58
-        if (data.imgType === 'index') {
59
-          activityVisible = true;
60
-          helpTips = '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享';
61
-        } else {
62
-          activityVisible = false;
63
-          helpTips = '建议尺寸:80*80px,比例1:1,格式:jpg,用于:首页资讯logo';
64
-        }
53
+
65
         setData(data);
54
         setData(data);
66
       });
55
       });
67
     };
56
     };
73
       name: 'imgUrl',
62
       name: 'imgUrl',
74
       type: FieldTypes.ImageUploader,
63
       type: FieldTypes.ImageUploader,
75
       value: data.imgUrl,
64
       value: data.imgUrl,
76
-      help: helpTips,
65
+      help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享',
77
       rules: [{ required: true, message: '请选择图片' }],
66
       rules: [{ required: true, message: '请选择图片' }],
78
     },
67
     },
79
     {
68
     {
124
   };
113
   };
125
 
114
 
126
   const cancelPage = () => {
115
   const cancelPage = () => {
127
-    router.push({
128
-      pathname: '/carouselFigure/customImg/list',
129
-    });
116
+    router.go('-1')
130
   };
117
   };
131
 
118
 
132
   return (
119
   return (

+ 1
- 0
src/pages/carouselFigure/editAdvertising.jsx View File

379
       if (!isHaveActive && !val.targetId) {
379
       if (!isHaveActive && !val.targetId) {
380
         val.contentType = '';
380
         val.contentType = '';
381
       }
381
       }
382
+      val.showPosition='index'
382
       if (contentId) {
383
       if (contentId) {
383
         request({
384
         request({
384
           ...apis.carsuseFigure.updataExtendContent,
385
           ...apis.carsuseFigure.updataExtendContent,

+ 16
- 3
src/pages/channel/Channel/List/index.jsx View File

69
     });
69
     });
70
   }
70
   }
71
 
71
 
72
+ const  onDelete =()=> {
73
+
74
+ }
75
+
72
   const searchFields = [
76
   const searchFields = [
73
     {
77
     {
74
       name: 'channelId',
78
       name: 'channelId',
127
       key: 'recommendCount',
131
       key: 'recommendCount',
128
       align: 'center',
132
       align: 'center',
129
     },
133
     },
134
+    // {
135
+    //   title: '邀请经纪人',
136
+    //   dataIndex: 'customerNum',
137
+    //   key: 'customerNum',
138
+    //   align: 'center',
139
+    // },
130
     {
140
     {
131
-      title: '邀请经纪人',
132
-      dataIndex: 'customerNum',
133
-      key: 'customerNum',
141
+      title: '操作',
142
+      dataIndex: 'edit',
143
+      key: 'edit',
134
       align: 'center',
144
       align: 'center',
145
+      render: (text, record) =>  <Button type='link' onClick={onDelete}>删除</Button>
146
+
147
+
135
     },
148
     },
136
   ];
149
   ];
137
 
150
 

+ 248
- 120
src/pages/channel/independentList/index.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, notification, Modal } from 'antd';
2
+import {
3
+  Form,
4
+  Icon,
5
+  Input,
6
+  Button,
7
+  DatePicker,
8
+  Select,
9
+  Card,
10
+  Row,
11
+  Col,
12
+  Pagination,
13
+  Alert,
14
+  Table,
15
+  Avatar,
16
+  notification,
17
+  Modal,
18
+  message,
19
+} from 'antd';
3
 import moment from 'moment';
20
 import moment from 'moment';
4
 import request from '../../../utils/request';
21
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
22
 import apis from '../../../services/apis';
20
     this.state = {
37
     this.state = {
21
       dataSource: { records: [] },
38
       dataSource: { records: [] },
22
       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
39
       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
23
-    }
40
+    };
24
   }
41
   }
25
 
42
 
26
   // 挂载之后
43
   // 挂载之后
27
   componentDidMount() {
44
   componentDidMount() {
28
-    this.getList({ pageNumber: 1, pageSize: 5 })
45
+    this.getList({ pageNumber: 1, pageSize: 5 });
29
   }
46
   }
30
 
47
 
31
   componentDidUpdate(preProps, preState) {
48
   componentDidUpdate(preProps, preState) {
32
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
49
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
33
-      this.getList({ pageNumber: 1, pageSize: 5 })
50
+      this.getList({ pageNumber: 1, pageSize: 5 });
34
       this.setState({ visibleData: this.props.visibleData });
51
       this.setState({ visibleData: this.props.visibleData });
35
     }
52
     }
36
   }
53
   }
38
   // 弹框确定按钮
55
   // 弹框确定按钮
39
   // eslint-disable-next-line react/sort-comp
56
   // eslint-disable-next-line react/sort-comp
40
   handleOk() {
57
   handleOk() {
41
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
58
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } });
42
   }
59
   }
43
 
60
 
44
   // 弹框取消按钮
61
   // 弹框取消按钮
45
   handleCancel() {
62
   handleCancel() {
46
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
47
-    this.props.onCancel()
63
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } });
64
+    this.props.onCancel();
48
   }
65
   }
49
 
66
 
50
   getList(params) {
67
   getList(params) {
51
     // eslint-disable-next-line no-console
68
     // eslint-disable-next-line no-console
52
-    console.log('this.state.visibleData', this.state.visibleData)
53
-    const { customerId } = this.state.visibleData
69
+    console.log('this.state.visibleData', this.state.visibleData);
70
+    const { customerId } = this.state.visibleData;
54
     if (customerId === '' || customerId === undefined) {
71
     if (customerId === '' || customerId === undefined) {
55
-      return
72
+      return;
56
     }
73
     }
57
     // 网路请求
74
     // 网路请求
58
     // 网路请求
75
     // 网路请求
59
-    request({ ...apis.customer.recommend, urlData: { id: customerId }, params: { ...params } }).then(res => {
60
-      this.setState({ dataSource: res })
61
-    }).catch(err => {
62
-      // eslint-disable-next-line no-unused-expressions
63
-      <Alert
64
-        style={{
65
-          marginBottom: 24,
66
-        }}
67
-        message={err}
68
-        type="error"
69
-        showIcon
70
-      />
71
-    })
76
+    request({ ...apis.customer.recommend, urlData: { id: customerId }, params: { ...params } })
77
+      .then(res => {
78
+        this.setState({ dataSource: res });
79
+      })
80
+      .catch(err => {
81
+        // eslint-disable-next-line no-unused-expressions
82
+        <Alert
83
+          style={{
84
+            marginBottom: 24,
85
+          }}
86
+          message={err}
87
+          type="error"
88
+          showIcon
89
+        />;
90
+      });
72
   }
91
   }
73
 
92
 
74
   // 分页
93
   // 分页
75
   onChange(pageNum) {
94
   onChange(pageNum) {
76
-
77
-    this.getList({ pageNumber: pageNum, pageSize: 5, })
78
-
95
+    this.getList({ pageNumber: pageNum, pageSize: 5 });
79
   }
96
   }
80
 
97
 
81
   render() {
98
   render() {
83
       {
100
       {
84
         title: '头像',
101
         title: '头像',
85
         // eslint-disable-next-line jsx-a11y/alt-text
102
         // eslint-disable-next-line jsx-a11y/alt-text
86
-        render: (text, record) => <Avatar shape="square" src={record.picture} size={64} icon="user" />,
103
+        render: (text, record) => (
104
+          <Avatar shape="square" src={record.picture} size={64} icon="user" />
105
+        ),
87
         // render: (text, records) => <img src={records.picture} width={50} height={50} />,
106
         // render: (text, records) => <img src={records.picture} width={50} height={50} />,
88
       },
107
       },
89
       {
108
       {
112
         title: '推荐时间',
131
         title: '推荐时间',
113
         dataIndex: 'createDate',
132
         dataIndex: 'createDate',
114
         key: 'createDate',
133
         key: 'createDate',
115
-        render: (_, record) => <><span>{record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
134
+        render: (_, record) => (
135
+          <>
136
+            <span>
137
+              {record.createDate && moment(record.createDate).format('YYYY-MM-DD HH:mm:ss')}
138
+            </span>
139
+          </>
140
+        ),
116
       },
141
       },
117
       {
142
       {
118
         title: '状态',
143
         title: '状态',
119
         // eslint-disable-next-line consistent-return
144
         // eslint-disable-next-line consistent-return
120
         render: (text, records) => {
145
         render: (text, records) => {
121
-          console.log("retrun", records)
146
+          console.log('retrun', records);
122
           //     if (records.status === 1) { return '报备' }
147
           //     if (records.status === 1) { return '报备' }
123
           // if (records.status === 2) { return '推荐' }
148
           // if (records.status === 2) { return '推荐' }
124
           // if (records.status === 3) { return '认购' }
149
           // if (records.status === 3) { return '认购' }
134
           // if (records.verifyStatus === 2) { return '审核同意' }
159
           // if (records.verifyStatus === 2) { return '审核同意' }
135
           // if (records.verifyStatus === 3) { return '签约' }
160
           // if (records.verifyStatus === 3) { return '签约' }
136
           if (records.status === 1) {
161
           if (records.status === 1) {
137
-            if (records.verifyStatus === 0) { return '待审核' }
138
-            if (records.verifyStatus === 1) { return '报备' }
162
+            if (records.verifyStatus === 0) {
163
+              return '待审核';
164
+            }
165
+            if (records.verifyStatus === 1) {
166
+              return '报备';
167
+            }
139
             // if (records.reportRecommendStatus === 1) { return '报备' }
168
             // if (records.reportRecommendStatus === 1) { return '报备' }
140
             // if (records.reportRecommendStatus === 2) { return '推荐' }}
169
             // if (records.reportRecommendStatus === 2) { return '推荐' }}
141
-            if (records.verifyStatus === 2) { return '审核驳回' }
142
-           }
143
-          if (records.status === 2) { return '到访' }
144
-          if (records.status === 3) { return '认购' }
145
-          if (records.status === 4) { return '签约' }
170
+            if (records.verifyStatus === 2) {
171
+              return '审核驳回';
172
+            }
173
+          }
174
+          if (records.status === 2) {
175
+            return '到访';
176
+          }
177
+          if (records.status === 3) {
178
+            return '认购';
179
+          }
180
+          if (records.status === 4) {
181
+            return '签约';
182
+          }
146
           // reportRecommendStatus
183
           // reportRecommendStatus
147
         },
184
         },
148
       },
185
       },
149
-    ]
186
+    ];
150
     return (
187
     return (
151
       <>
188
       <>
152
         <Modal
189
         <Modal
156
           footer={null}
193
           footer={null}
157
           visible={this.state.visibleData.visible}
194
           visible={this.state.visibleData.visible}
158
           // onOk={() => this.handleOk()}
195
           // onOk={() => this.handleOk()}
159
-          onCancel={(e) => this.handleCancel(e)}
196
+          onCancel={e => this.handleCancel(e)}
160
         >
197
         >
161
-          <Table rowKey="independentList" dataSource={this.state.dataSource.records} columns={columns} pagination={{ current: this.state.dataSource.current, pageSize: this.state.dataSource.size, total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
198
+          <Table
199
+            rowKey="independentList"
200
+            dataSource={this.state.dataSource.records}
201
+            columns={columns}
202
+            pagination={{
203
+              current: this.state.dataSource.current,
204
+              pageSize: this.state.dataSource.size,
205
+              total: this.state.dataSource.total,
206
+              onChange: e => this.onChange(e),
207
+            }}
208
+          />
162
         </Modal>
209
         </Modal>
163
       </>
210
       </>
164
     );
211
     );
175
     this.state = {
222
     this.state = {
176
       dataSource: { records: [] },
223
       dataSource: { records: [] },
177
       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
224
       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
178
-    }
225
+    };
179
   }
226
   }
180
 
227
 
181
   // 挂载之后
228
   // 挂载之后
182
-  componentDidMount() {
183
-
184
-  }
229
+  componentDidMount() {}
185
 
230
 
186
   componentDidUpdate(preProps, preState) {
231
   componentDidUpdate(preProps, preState) {
187
-    const { customerId } = this.props.visibleData
232
+    const { customerId } = this.props.visibleData;
188
 
233
 
189
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
234
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
190
-      this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
235
+      this.getList({ id: customerId, pageNumber: 1, pageSize: 5 });
191
       this.setState({ visibleData: this.props.visibleData });
236
       this.setState({ visibleData: this.props.visibleData });
192
     }
237
     }
193
   }
238
   }
195
   // 弹框确定按钮
240
   // 弹框确定按钮
196
   // eslint-disable-next-line react/sort-comp
241
   // eslint-disable-next-line react/sort-comp
197
   handleOk() {
242
   handleOk() {
198
-    this.setState({ dataSource: { records: [] } })
199
-    this.props.onCancel()
243
+    this.setState({ dataSource: { records: [] } });
244
+    this.props.onCancel();
200
   }
245
   }
201
 
246
 
202
   // 弹框取消按钮
247
   // 弹框取消按钮
203
   handleCancel() {
248
   handleCancel() {
204
-    console.log('345')
205
-    this.setState({ dataSource: { records: [] } })
206
-    this.props.onCancel()
249
+    console.log('345');
250
+    this.setState({ dataSource: { records: [] } });
251
+    this.props.onCancel();
207
   }
252
   }
208
 
253
 
209
   getList(params) {
254
   getList(params) {
210
-    const { id } = params
211
-    console.log(id)
255
+    const { id } = params;
256
+    console.log(id);
212
     if (id === '' || id === undefined) {
257
     if (id === '' || id === undefined) {
213
-      return
258
+      return;
214
     }
259
     }
215
-    request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
216
-      this.setState({ dataSource: res })
217
-    }).catch(err => {
218
-      // eslint-disable-next-line no-unused-expressions
219
-
220
-    })
260
+    request({ ...apis.customer.InviteClientsList, params: { ...params } })
261
+      .then(res => {
262
+        this.setState({ dataSource: res });
263
+      })
264
+      .catch(err => {
265
+        // eslint-disable-next-line no-unused-expressions
266
+      });
221
   }
267
   }
222
 
268
 
223
   // 分页
269
   // 分页
224
   onChange(pageNum) {
270
   onChange(pageNum) {
225
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
271
+    this.getList({ pageNumber: pageNum, pageSize: 5 });
226
   }
272
   }
227
 
273
 
228
   render() {
274
   render() {
239
         dataIndex: 'nickname',
285
         dataIndex: 'nickname',
240
         key: 'nickname',
286
         key: 'nickname',
241
         align: 'center',
287
         align: 'center',
242
-        render: (row) => <><span>{console.log(row, 'row')}{row.name || row.nickname}</span></>,
288
+        render: row => (
289
+          <>
290
+            <span>
291
+              {console.log(row, 'row')}
292
+              {row.name || row.nickname}
293
+            </span>
294
+          </>
295
+        ),
243
       },
296
       },
244
       {
297
       {
245
         title: '电话',
298
         title: '电话',
254
         align: 'center',
307
         align: 'center',
255
         render: (text, list) => <span>{list.sex === 1 ? '男' : '女'}</span>,
308
         render: (text, list) => <span>{list.sex === 1 ? '男' : '女'}</span>,
256
       },
309
       },
257
-    ]
310
+    ];
258
     return (
311
     return (
259
       <>
312
       <>
260
         <Modal
313
         <Modal
264
           footer={null}
317
           footer={null}
265
           visible={this.state.visibleData.visible}
318
           visible={this.state.visibleData.visible}
266
           // onOk={() => this.handleOk()}
319
           // onOk={() => this.handleOk()}
267
-          onCancel={(e) => this.handleCancel(e)}
320
+          onCancel={e => this.handleCancel(e)}
268
         >
321
         >
269
-          <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
322
+          <Table
323
+            rowKey="independent"
324
+            dataSource={this.state.dataSource.records}
325
+            columns={columns}
326
+            pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }}
327
+          />
270
         </Modal>
328
         </Modal>
271
       </>
329
       </>
272
     );
330
     );
280
  * @returns
338
  * @returns
281
  */
339
  */
282
 function body(props) {
340
 function body(props) {
283
-  const { getFieldDecorator, getFieldsValue } = props.form
341
+  const { getFieldDecorator, getFieldsValue } = props.form;
284
 
342
 
285
   // eslint-disable-next-line react-hooks/rules-of-hooks
343
   // eslint-disable-next-line react-hooks/rules-of-hooks
286
-  const [dataSource, setDataSource] = useState({ records: [] })
344
+  const [dataSource, setDataSource] = useState({ records: [] });
287
 
345
 
288
   // eslint-disable-next-line react-hooks/rules-of-hooks
346
   // eslint-disable-next-line react-hooks/rules-of-hooks
289
   useEffect(() => {
347
   useEffect(() => {
290
-    getList({ pageNumber: 1, pageSize: 10 })
291
-  }, [])
292
-
348
+    getList({ pageNumber: 1, pageSize: 10 });
349
+  }, []);
293
 
350
 
294
   function openNotificationWithIcon(type, message) {
351
   function openNotificationWithIcon(type, message) {
295
     notification[type]({
352
     notification[type]({
296
       message,
353
       message,
297
-      description:
298
-        '',
354
+      description: '',
299
     });
355
     });
300
   }
356
   }
301
 
357
 
302
   function getList(params) {
358
   function getList(params) {
303
     // 网路请求
359
     // 网路请求
304
-    request({ ...apis.customer.agents, params: { ...params } }).then(res => {
305
-      setDataSource(res)
306
-    }).catch(err => {
307
-      openNotificationWithIcon('error', err)
308
-    })
360
+    request({ ...apis.customer.agents, params: { ...params } })
361
+      .then(res => {
362
+        setDataSource(res);
363
+      })
364
+      .catch(err => {
365
+        openNotificationWithIcon('error', err);
366
+      });
309
   }
367
   }
310
 
368
 
311
   // 提交事件
369
   // 提交事件
313
     e.preventDefault();
371
     e.preventDefault();
314
     props.form.validateFields((err, values) => {
372
     props.form.validateFields((err, values) => {
315
       if (!err) {
373
       if (!err) {
316
-        getList({ pageNum: 1, pageSize: 10, ...values })
374
+        getList({ pageNum: 1, pageSize: 10, ...values });
317
       }
375
       }
318
     });
376
     });
319
   }
377
   }
320
   // eslint-disable-next-line react-hooks/rules-of-hooks
378
   // eslint-disable-next-line react-hooks/rules-of-hooks
321
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
379
+  const [gVisibleData, setGVisibleData] = useState({
380
+    visible: false,
381
+    customerId: '',
382
+    realtyConsultant: '',
383
+  });
322
   // eslint-disable-next-line react-hooks/rules-of-hooks
384
   // eslint-disable-next-line react-hooks/rules-of-hooks
323
-  const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
385
+  const [gInviteData, setGInviteData] = useState({
386
+    visible: false,
387
+    customerId: '',
388
+    realtyConsultant: '',
389
+  });
324
   // Change 事件
390
   // Change 事件
325
   function handleSelectChange(e) {
391
   function handleSelectChange(e) {
326
     // eslint-disable-next-line no-console
392
     // eslint-disable-next-line no-console
327
-    console.log(e)
393
+    console.log(e);
328
   }
394
   }
329
   function gM(row) {
395
   function gM(row) {
330
-    setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
396
+    setGVisibleData({
397
+      visible: true,
398
+      customerId: row.personId,
399
+      realtyConsultant: row.realtyConsultant,
400
+    });
331
 
401
 
332
-    setGInviteData({ visible: false })
402
+    setGInviteData({ visible: false });
333
   }
403
   }
334
 
404
 
335
   function Invite(row) {
405
   function Invite(row) {
336
-    setGInviteData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
406
+    setGInviteData({
407
+      visible: true,
408
+      customerId: row.personId,
409
+      realtyConsultant: row.realtyConsultant,
410
+    });
337
 
411
 
338
-    setGVisibleData({ visible: false })
412
+    setGVisibleData({ visible: false });
339
   }
413
   }
340
 
414
 
341
   // 分页
415
   // 分页
342
   function onChange(pageNum) {
416
   function onChange(pageNum) {
343
     // eslint-disable-next-line react-hooks/rules-of-hooks
417
     // eslint-disable-next-line react-hooks/rules-of-hooks
344
-    getList({ pageNumber: pageNum, pageSize: 10 })
418
+    getList({ pageNum: pageNum, pageSize: 10 });
345
   }
419
   }
346
 
420
 
347
   /**
421
   /**
348
-    * 重置搜索
349
-    */
422
+   * 重置搜索
423
+   */
350
   function handleReset() {
424
   function handleReset() {
351
     props.form.resetFields();
425
     props.form.resetFields();
352
-    getList({ pageNumber: 1, pageSize: 10 })
426
+    getList({ pageNumber: 1, pageSize: 10 });
353
   }
427
   }
354
 
428
 
355
   function toAudit(cuurentId) {
429
   function toAudit(cuurentId) {
358
       query: {
432
       query: {
359
         id: cuurentId,
433
         id: cuurentId,
360
       },
434
       },
361
-    })
435
+    });
362
   }
436
   }
363
 
437
 
364
   function exportIndependen() {
438
   function exportIndependen() {
365
-    const fieldsValue = getFieldsValue()
366
-    console.log('fieldsValue', fieldsValue)
367
-    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob', params: { ...fieldsValue } })
439
+    const fieldsValue = getFieldsValue();
440
+    console.log('fieldsValue', fieldsValue);
441
+    request({
442
+      ...apis.customer.customerRecommendAgentsExport,
443
+      responseType: 'blob',
444
+      params: { ...fieldsValue },
445
+    })
368
       .then(response => {
446
       .then(response => {
369
-        download(response)
370
-      }).catch(error => {
371
-
447
+        download(response);
448
+      })
449
+      .catch(error => {});
450
+  }
451
+  function onDelete(row) {
452
+    const fieldsValue = getFieldsValue();
453
+    request({ ...apis.customer.deleteChannelPerson, urlData: { id: row.personId } })
454
+      .then(response => {
455
+        message.info('删除成功');
456
+        getList({ pageNum: pageNum, pageSize: 10, ...fieldsValue });
372
       })
457
       })
458
+      .catch(error => {});
373
   }
459
   }
374
 
460
 
375
   function download(data) {
461
   function download(data) {
376
     if (!data) {
462
     if (!data) {
377
-      return
463
+      return;
378
     }
464
     }
379
-    const url = window.URL.createObjectURL(new Blob([data]))
380
-    const link = document.createElement('a')
381
-    link.style.display = 'none'
382
-    link.href = url
383
-    link.setAttribute('download', '经纪人.xlsx')
384
-    document.body.append(link)
385
-    link.click()
465
+    const url = window.URL.createObjectURL(new Blob([data]));
466
+    const link = document.createElement('a');
467
+    link.style.display = 'none';
468
+    link.href = url;
469
+    link.setAttribute('download', '经纪人.xlsx');
470
+    document.body.append(link);
471
+    link.click();
386
   }
472
   }
387
 
473
 
388
   const columns = [
474
   const columns = [
396
       title: '姓名',
482
       title: '姓名',
397
       dataIndex: 'nickname',
483
       dataIndex: 'nickname',
398
       key: 'nickname',
484
       key: 'nickname',
399
-      render: (_, record) => <><span>{record.name || record.nickname}</span></>,
485
+      render: (_, record) => (
486
+        <>
487
+          <span>{record.name || record.nickname}</span>
488
+        </>
489
+      ),
400
     },
490
     },
401
     {
491
     {
402
       title: '电话',
492
       title: '电话',
408
       dataIndex: 'gender',
498
       dataIndex: 'gender',
409
       key: 'gender',
499
       key: 'gender',
410
       // eslint-disable-next-line no-nested-ternary
500
       // eslint-disable-next-line no-nested-ternary
411
-      render: (_, record) => <><span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span></>,
501
+      render: (_, record) => (
502
+        <>
503
+          <span>{record.gender === '1' ? '男' : record.gender === '2' ? '女' : '未知'}</span>
504
+        </>
505
+      ),
412
     },
506
     },
413
     {
507
     {
414
       title: '类型',
508
       title: '类型',
415
       dataIndex: 'personType',
509
       dataIndex: 'personType',
416
       key: 'personType',
510
       key: 'personType',
417
-      render: (_, record) => <><span>{record.personType === 'channel agent' ? '专业经纪人' : '专业经纪人'}</span></>,
511
+      render: (_, record) => (
512
+        <>
513
+          <span>{record.personType === 'channel agent' ? '专业经纪人' : '专业经纪人'}</span>
514
+        </>
515
+      ),
418
     },
516
     },
419
     {
517
     {
420
       title: '所属渠道',
518
       title: '所属渠道',
421
       dataIndex: 'channelName',
519
       dataIndex: 'channelName',
422
       key: 'channelName',
520
       key: 'channelName',
423
-      render: (_, record) => <><span>{record.channelName}</span></>,
521
+      render: (_, record) => (
522
+        <>
523
+          <span>{record.channelName}</span>
524
+        </>
525
+      ),
424
     },
526
     },
425
     {
527
     {
426
       title: '操作',
528
       title: '操作',
435
                 <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
537
                 <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => Invite(record)}>邀请经纪人</a>
436
               </AuthButton> */}
538
               </AuthButton> */}
437
               {/* &nbsp;&nbsp;&nbsp;&nbsp; */}
539
               {/* &nbsp;&nbsp;&nbsp;&nbsp; */}
438
-              <AuthButton name="admin.customer.recommend.id.get" noRight={null}>
439
-                <a style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</a>
440
-              </AuthButton>
540
+              {/* <AuthButton name="admin.customer.recommend.id.get" noRight={null}> */}
541
+              <Button type="link" onClick={() => gM(record)}>
542
+                推荐客户
543
+              </Button>
544
+              {/* </AuthButton> */}
545
+              {/* <AuthButton name="admin.customer.recommend.id.get" noRight={null}> */}
546
+              <Button type="link" onClick={() => onDelete(record)}>
547
+                删除
548
+              </Button>
549
+              {/* </AuthButton> */}
441
             </>
550
             </>
442
           }
551
           }
443
         </>
552
         </>
444
       ),
553
       ),
445
     },
554
     },
446
-  ]
555
+  ];
447
 
556
 
448
   // <div>
557
   // <div>
449
   //         <span className={channels.selectName}>渠道名称</span>
558
   //         <span className={channels.selectName}>渠道名称</span>
459
 
568
 
460
   return (
569
   return (
461
     <Card>
570
     <Card>
462
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
571
+      <Form
572
+        layout="inline"
573
+        onSubmit={e => handleSubmit(e, props)}
574
+        style={{ display: 'flex', alignItems: 'center' }}
575
+      >
463
         <Form.Item>
576
         <Form.Item>
464
           {getFieldDecorator('channelId')(
577
           {getFieldDecorator('channelId')(
465
-            <ChannelSelect />
578
+            <ChannelSelect />,
466
             //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
579
             //   <Select defaultValue="渠道名称" style={{ width: 180 }} onChange={handleChange}>
467
             //   <option value="">全部</option>
580
             //   <option value="">全部</option>
468
             //   {data.channelNmae.map(Item =>
581
             //   {data.channelNmae.map(Item =>
488
             />,
601
             />,
489
           )}
602
           )}
490
         </Form.Item>
603
         </Form.Item>
491
-        <Form.Item style={{ position: 'absolute', right: '38px' }} >
604
+        <Form.Item style={{ position: 'absolute', right: '38px' }}>
492
           <AuthButton name="admin.major.search" noRight={null}>
605
           <AuthButton name="admin.major.search" noRight={null}>
493
-            <Button type="primary" htmlType="submit" >
606
+            <Button type="primary" htmlType="submit">
494
               搜索
607
               搜索
495
             </Button>
608
             </Button>
496
           </AuthButton>
609
           </AuthButton>
500
         </Form.Item>
613
         </Form.Item>
501
       </Form>
614
       </Form>
502
       <AuthButton name="admin.major.import" noRight={null}>
615
       <AuthButton name="admin.major.import" noRight={null}>
503
-        <Button type="primary" onClick={() => exportIndependen()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
616
+        <Button
617
+          type="primary"
618
+          onClick={() => exportIndependen()}
619
+          style={{ float: 'right', margin: '20px 0', zIndex: 1 }}
620
+        >
504
           导出
621
           导出
505
         </Button>
622
         </Button>
506
       </AuthButton>
623
       </AuthButton>
507
-      <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
624
+      <Table
625
+        rowKey="personId"
626
+        dataSource={dataSource.records}
627
+        columns={columns}
628
+        pagination={{ total: dataSource.total, onChange }}
629
+      />
508
       {/* 推荐客户 */}
630
       {/* 推荐客户 */}
509
-      <ModalTable visibleData={gVisibleData} onCancel={() => setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })}/>
631
+      <ModalTable
632
+        visibleData={gVisibleData}
633
+        onCancel={() => setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })}
634
+      />
510
 
635
 
511
       {/* 邀请经纪人 */}
636
       {/* 邀请经纪人 */}
512
-      <InviteTable visibleData={gInviteData} onCancel={() => setGInviteData({ visible: false, customerId: '', realtyConsultant: '' })} />
637
+      <InviteTable
638
+        visibleData={gInviteData}
639
+        onCancel={() => setGInviteData({ visible: false, customerId: '', realtyConsultant: '' })}
640
+      />
513
     </Card>
641
     </Card>
514
   );
642
   );
515
 }
643
 }
516
 const WrappedBody = Form.create({ name: 'body' })(body);
644
 const WrappedBody = Form.create({ name: 'body' })(body);
517
 
645
 
518
-export default WrappedBody
646
+export default WrappedBody;

+ 45
- 40
src/pages/customer/Customer/PrivateCustomer/CustomerDetail.jsx View File

54
     }
54
     }
55
     // eslint-disable-next-line max-len
55
     // eslint-disable-next-line max-len
56
     request({
56
     request({
57
-      ...apis.customer.CustomerRecommendGet,
57
+      ...apis.customer.customerInfo,
58
       urlData: { id },
58
       urlData: { id },
59
-      params: { ...params, pageNumber: 1, pageSize: 10 },
59
+      // params: { ...params, pageNumber: 1, pageSize: 10 },
60
     }).then(res => {
60
     }).then(res => {
61
       setData(res);
61
       setData(res);
62
-      if (res.visitRecords) {
63
-        setTableDataData(res.visitRecords);
64
-      }
65
-      setDataonsultant(res.geoInfo);
66
-      setIntentionData(res.intentions);
62
+      // if (res.visitRecords) {
63
+      //   setTableDataData(res.visitRecords);
64
+      // }
65
+      // setDataonsultant(res.geoInfo);
66
+      // setIntentionData(res.intentions);
67
     });
67
     });
68
   }
68
   }
69
   // 分页
69
   // 分页
85
 
85
 
86
   function changBuilding(buildingId) {
86
   function changBuilding(buildingId) {
87
     setBuildingIdData(buildingId);
87
     setBuildingIdData(buildingId);
88
-    getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId });
88
+    // getById({ pageNumber: 1, pageSize: 10, buildingId: buildingId });
89
   }
89
   }
90
 
90
 
91
   const columns = [
91
   const columns = [
132
       render: (_, record) => <span>{record.intention}</span>,
132
       render: (_, record) => <span>{record.intention}</span>,
133
     },
133
     },
134
   ];
134
   ];
135
+ const  {customerInfo={},taRecommendCustomer={},realtyConsultantPerson={},taUser={},taBuildingList=[],personIntentions=[],personVisitRecords=[]} = data
136
+ const records =buildingIdValue?personVisitRecords?.filter(x=>x.buildingId===buildingIdValue):personVisitRecords
137
+
135
   return (
138
   return (
136
     <>
139
     <>
137
       <div style={{ textAlign: 'right', marginBottom: '16px' }}>
140
       <div style={{ textAlign: 'right', marginBottom: '16px' }}>
145
           <p className={styles.tit}>客户信息</p>
148
           <p className={styles.tit}>客户信息</p>
146
           <div className={styles.flexBox}>
149
           <div className={styles.flexBox}>
147
             <div>
150
             <div>
148
-              <img className={styles.touxiang} src={data.picture && data.picture} />
151
+              <img className={styles.touxiang} src={data.avatarurl} />
149
             </div>
152
             </div>
150
             <div className={styles.right}>
153
             <div className={styles.right}>
151
 
154
 
152
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>用户名称:</span><span>{data.name}</span></p>
153
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>手机号码:</span><span>{data.phone}</span></p>
154
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭住址:</span><span>{data.name}</span></p>
155
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>访问次数:</span><span>{data.name}</span></p>
155
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>用户名称:</span><span>{customerInfo?.name||taRecommendCustomer?.name||'--'}</span></p>
156
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>手机号码:</span><span>{customerInfo?.phone||taRecommendCustomer.phone||'--'}</span></p>
157
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭住址:</span><span>{customerInfo?.homeAddress||'--'}</span></p>
158
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>访问次数:</span><span>{data.visitTimes||'--'}</span></p>
156
 
159
 
157
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>年龄段:</span><span>{data.name}</span></p>
158
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭年收入:</span><span>{data.name}</span></p>
159
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有房产数:</span><span>{data.name}</span></p>
160
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>预计购房时间:</span><span>{data.name}</span></p>
160
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>年龄段:</span><span>{customerInfo?.age||'--'}</span></p>
161
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭年收入:</span><span>{customerInfo?.householdIncome||'--'}</span></p>
162
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有房产数:</span><span>{customerInfo?.houseNumber||'--'}</span></p>
163
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>预计购房时间:</span><span>{customerInfo?.estimatedPurchaseTime||'--'}</span></p>
161
 
164
 
162
         
165
         
163
 
166
 
165
             <div className={styles.Centered}>
168
             <div className={styles.Centered}>
166
 
169
 
167
                 
170
                 
168
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>昵称:</span><span>{data.name}</span></p>
169
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>性别:</span><span>{data.phone}</span></p>
170
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>工作住址:</span><span>{data.name}</span></p>
171
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>来源渠道:</span><span>{data.name}</span></p>
171
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>昵称:</span><span>{customerInfo?.nickname||'--'}</span></p>
172
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>性别:</span><span>{customerInfo?.sex||'--'}</span></p>
173
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>工作住址:</span><span>{customerInfo?.firmAddress||'--'}</span></p>
174
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>来源渠道:</span><span>{data.channelName||'--'}</span></p>
172
 
175
 
173
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>职业:</span><span>{data.name}</span></p>
174
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭成员数:</span><span>{data.name}</span></p>
175
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有车辆数:</span><span>{data.name}</span></p>
176
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>购房动机:</span><span>{data.name}</span></p>
176
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>职业:</span><span>{customerInfo?.career||'--'}</span></p>
177
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭成员数:</span><span>{customerInfo?.familyNumber||'--'}</span></p>
178
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有车辆数:</span><span>{customerInfo?.carNumber||'--'}</span></p>
179
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>购房动机:</span><span>{customerInfo?.motivation||'--'}</span></p>
177
 
180
 
178
 
181
 
179
             </div>
182
             </div>
180
             <div className={styles.rightCentered}>
183
             <div className={styles.rightCentered}>
181
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户资讯重点:</span><span>{data.name}</span></p>
182
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户抗性分析:</span><span>{data.name}</span></p>
183
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>对项目认可点:</span><span>{data.name}</span></p>
184
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>备注:</span><span>{data.name}</span></p>
184
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户资讯重点:</span><span>{customerInfo?.consultation||'--'}</span></p>
185
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户抗性分析:</span><span>{customerInfo?.resistanceAnalysis||'--'}</span></p>
186
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>对项目认可点:</span><span>{customerInfo?.approval||'--'}</span></p>
187
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>备注:</span><span>{customerInfo?.remark||'--'}</span></p>
185
 
188
 
186
          
189
          
187
       
190
       
196
         <div className={styles.rightBoxCentre}>
199
         <div className={styles.rightBoxCentre}>
197
           <p className={styles.tit}>置业顾问信息</p>
200
           <p className={styles.tit}>置业顾问信息</p>
198
           <div>
201
           <div>
199
-            <img className={styles.touxiangphoto} src={data.consultant && data.consultant.photo} />
202
+            <img className={styles.touxiangphoto} src={realtyConsultantPerson?.avatarurl} />
200
          
203
          
201
           </div>
204
           </div>
202
           <div className={styles.rightphone}>
205
           <div className={styles.rightphone}>
203
-          <p className={styles.infoItem}>{data.consultant && data.consultant.userName}</p>
204
-          <p className={styles.infoItem}>号码:{data.consultant && data.consultant.phone} </p>
206
+          <p className={styles.infoItem}>{taUser?.userName}</p>
207
+          <p className={styles.infoItem}>号码:{taUser?.phone} </p>
205
       
208
       
206
           </div>
209
           </div>
207
           <div className={styles.left}>
210
           <div className={styles.left}>
208
-          <p className={styles.infoItem}>部门:{data.consultant && data.consultant.orgName} </p>
209
-          <p className={styles.infoItem}>岗位:{data.consultant && data.consultant.orgName} </p>
210
-          <p className={styles.infoItem}>公司:{data.consultant && data.consultant.orgName} </p>
211
+          <p className={styles.infoItem}>部门:{taUser?.department} </p>
212
+          <p className={styles.infoItem}>岗位:{taUser?.position} </p>
213
+          <p className={styles.infoItem}>公司:{taUser?.orgName} </p>
211
            
214
            
212
             <p className={styles.infoItem}>
215
             <p className={styles.infoItem}>
213
               所属项目:
216
               所属项目:
214
-              {data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)}
217
+              {taBuildingList?.map((item, _) => <span>{item.buildingName} </span>)}
215
             </p>
218
             </p>
216
           </div>
219
           </div>
217
         </div>
220
         </div>
227
             bordered={false}
230
             bordered={false}
228
             columnWidth={10}
231
             columnWidth={10}
229
             columns={intention}
232
             columns={intention}
230
-            dataSource={intentionData}
233
+            dataSource={personIntentions}
231
             pagination={false}
234
             pagination={false}
232
-            scroll={intentionData && intentionData.length >= 3 ? { y: 240 } : false}
235
+            key='personId'
236
+            scroll={personIntentions?.length >= 3 ? { y: 240 } : false}
233
             width={500}
237
             width={500}
234
           />
238
           />
235
           {/* </div> */}
239
           {/* </div> */}
239
         <p className={styles.tableName}>访问记录</p>
243
         <p className={styles.tableName}>访问记录</p>
240
         <BuildSelect onChange={changBuilding} value={buildingIdValue} />
244
         <BuildSelect onChange={changBuilding} value={buildingIdValue} />
241
         <Table
245
         <Table
242
-          dataSource={tableData.records}
246
+          dataSource={records}
243
           columns={columns}
247
           columns={columns}
248
+          key='recordId'
244
           style={{ marginTop: '15px' }}
249
           style={{ marginTop: '15px' }}
245
-          pagination={{ pageSize: 10, total: tableData.total, onChange }}
250
+          pagination={{ pageSize: 10, total: records.length }}
246
         />
251
         />
247
         {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
252
         {/* <Pagination showQuickJumper defaultCurrent={1} total={data.records} onChange={e => changePageNum(e)} current={data.visitRecords.total}/> */}
248
       </div>
253
       </div>

+ 43
- 35
src/pages/customer/Customer/PublicCustomer/publicCustomerDetail.jsx View File

58
       return;
58
       return;
59
     }
59
     }
60
 
60
 
61
-    request({ ...apis.customer.cecommendPublic, urlData: { id }, params: { ...params } }).then(
61
+    request({ ...apis.customer.customerInfo, urlData: { id }, params: { ...params } }).then(
62
       res => {
62
       res => {
63
-        setTableDataData(res.visitRecords);
63
+        // setTableDataData(res.visitRecords);
64
         setData(res);
64
         setData(res);
65
-        setDataonsultant(res.geoInfo);
66
-        setIntentionData(res.intentions);
65
+        // setDataonsultant(res.geoInfo);
66
+        // setIntentionData(res.intentions);
67
       },
67
       },
68
     );
68
     );
69
   }
69
   }
133
       render: (_, record) => <span>{record.intention}</span>,
133
       render: (_, record) => <span>{record.intention}</span>,
134
     },
134
     },
135
   ];
135
   ];
136
+
137
+  const  {customerInfo={},taRecommendCustomer={},realtyConsultantPerson={},taBuildingList=[],personIntentions=[],personVisitRecords=[]} = data
138
+ const records =buildingIdValue?personVisitRecords?.filter(x=>x.buildingId===buildingIdValue):personVisitRecords
136
   return (
139
   return (
137
     <>
140
     <>
138
       <div style={{ textAlign: 'right', marginBottom: '16px' }}>
141
       <div style={{ textAlign: 'right', marginBottom: '16px' }}>
145
         <div >
148
         <div >
146
           <p className={styles.tit}>客户信息</p>
149
           <p className={styles.tit}>客户信息</p>
147
           <div className={styles.flexBox}>
150
           <div className={styles.flexBox}>
148
-            <div>
149
-              <img className={styles.touxiang} src={data.picture && data.picture} />
151
+          <div>
152
+              <img className={styles.touxiang} src={data.avatarurl} />
150
             </div>
153
             </div>
151
             <div className={styles.right}>
154
             <div className={styles.right}>
152
 
155
 
153
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>用户名称:</span><span>{data.name}</span></p>
154
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>手机号码:</span><span>{data.phone}</span></p>
155
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭住址:</span><span>{data.name}</span></p>
156
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>访问次数:</span><span>{data.name}</span></p>
156
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>用户名称:</span><span>{customerInfo?.name||taRecommendCustomer?.name||'--'}</span></p>
157
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>手机号码:</span><span>{customerInfo?.phone||taRecommendCustomer.phone||'--'}</span></p>
158
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭住址:</span><span>{customerInfo?.homeAddress||'--'}</span></p>
159
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>访问次数:</span><span>{data.visitTimes||'--'}</span></p>
157
 
160
 
158
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>年龄段:</span><span>{data.name}</span></p>
159
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭年收入:</span><span>{data.name}</span></p>
160
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有房产数:</span><span>{data.name}</span></p>
161
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>预计购房时间:</span><span>{data.name}</span></p>
161
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>年龄段:</span><span>{customerInfo?.age||'--'}</span></p>
162
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭年收入:</span><span>{customerInfo?.householdIncome||'--'}</span></p>
163
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有房产数:</span><span>{customerInfo?.houseNumber||'--'}</span></p>
164
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>预计购房时间:</span><span>{customerInfo?.estimatedPurchaseTime||'--'}</span></p>
162
 
165
 
163
         
166
         
164
 
167
 
166
             <div className={styles.Centered}>
169
             <div className={styles.Centered}>
167
 
170
 
168
                 
171
                 
169
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>昵称:</span><span>{data.name}</span></p>
170
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>性别:</span><span>{data.phone}</span></p>
171
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>工作住址:</span><span>{data.name}</span></p>
172
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>来源渠道:</span><span>{data.name}</span></p>
172
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>昵称:</span><span>{customerInfo?.nickname||'--'}</span></p>
173
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>性别:</span><span>{customerInfo?.sex||'--'}</span></p>
174
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>工作住址:</span><span>{customerInfo?.firmAddress||'--'}</span></p>
175
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>来源渠道:</span><span>{data.channelName||'--'}</span></p>
173
 
176
 
174
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>职业:</span><span>{data.name}</span></p>
175
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭成员数:</span><span>{data.name}</span></p>
176
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有车辆数:</span><span>{data.name}</span></p>
177
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>购房动机:</span><span>{data.name}</span></p>
177
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>职业:</span><span>{customerInfo?.career||'--'}</span></p>
178
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>家庭成员数:</span><span>{customerInfo?.familyNumber||'--'}</span></p>
179
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>已有车辆数:</span><span>{customerInfo?.carNumber||'--'}</span></p>
180
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>购房动机:</span><span>{customerInfo?.motivation||'--'}</span></p>
178
 
181
 
179
 
182
 
180
             </div>
183
             </div>
181
             <div className={styles.rightCentered}>
184
             <div className={styles.rightCentered}>
182
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户资讯重点:</span><span>{data.name}</span></p>
183
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户抗性分析:</span><span>{data.name}</span></p>
184
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>对项目认可点:</span><span>{data.name}</span></p>
185
-              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>备注:</span><span>{data.name}</span></p>
186
-      
187
-              </div>
185
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户资讯重点:</span><span>{customerInfo?.consultation||'--'}</span></p>
186
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>客户抗性分析:</span><span>{customerInfo?.resistanceAnalysis||'--'}</span></p>
187
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>对项目认可点:</span><span>{customerInfo?.approval||'--'}</span></p>
188
+              <p className={styles.rightItem}><span style={{width:'20%',minWidth:"100px"}}>备注:</span><span>{customerInfo?.remark||'--'}</span></p>
189
+
188
          
190
          
189
       
191
       
192
+            </div>
193
+      
194
+      
190
            
195
            
191
         </div>
196
         </div>
192
       </div>
197
       </div>
196
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
201
           {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
197
           <div className={publicStyle.infoItem}>
202
           <div className={publicStyle.infoItem}>
198
             <Table
203
             <Table
199
-              columnWidth={10}
200
-              columns={intention}
201
-              dataSource={intentionData}
202
-              pagination={false}
203
-              scroll={intentionData.length >= 3 ? { y: 240 } : false}
204
+             bordered={false}
205
+             columnWidth={10}
206
+             columns={intention}
207
+             dataSource={personIntentions}
208
+             pagination={false}
209
+             key='personId'
210
+             scroll={personIntentions?.length >= 3 ? { y: 240 } : false}
211
+    
204
             />
212
             />
205
           </div>
213
           </div>
206
         </div>
214
         </div>
209
         <p className={publicStyle.tableName}>访问记录</p>
217
         <p className={publicStyle.tableName}>访问记录</p>
210
         <BuildSelect onChange={changBuilding} value={buildingIdValue} />
218
         <BuildSelect onChange={changBuilding} value={buildingIdValue} />
211
         <Table
219
         <Table
212
-          dataSource={tableData.records}
220
+          dataSource={records}
213
           columns={columns}
221
           columns={columns}
214
           style={{ marginTop: '15px' }}
222
           style={{ marginTop: '15px' }}
215
-          pagination={{ pageSize: 10, total: tableData.total, onChange }}
223
+          pagination={{ pageSize: 10, total: records.length, onChange }}
216
         />
224
         />
217
       </div>
225
       </div>
218
     </>
226
     </>

+ 0
- 786
src/pages/customer/customerlist/index copy.jsx View File

1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, message } from 'antd';
3
-import moment from 'moment';
4
-import request from '../../../utils/request';
5
-import apis from '../../../services/apis';
6
-import Styles from './style.less';
7
-import router from 'umi/router';
8
-import withActions from '@/components/ActionList';
9
-import Attribution from './components/attribution'
10
-import AssistConsultant from './components/assistConsultant'
11
-import BatchAssistConsultant from './components/BatchAssistConsultant'
12
-import IntegralRecord from './components/integralRecord'
13
-import ModalRecommendRecord from './components/recommend'
14
-import ChangeStatus from './components/changeStatus'
15
-import BuildSelect from '../../../components/SelectButton/BuildSelect'
16
-import AuthButton from '@/components/AuthButton';
17
-import Navigate from '@/components/Navigate';
18
-import WxDictSelect from '@/components/SelectButton/WxDictSelect';
19
-import Prompt from 'umi/prompt';
20
-import EditIcon from '@/components/EditIcon';
21
-
22
-
23
-const { Option } = Select;
24
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
25
-const { Meta } = Card;
26
-
27
-/**
28
- *
29
- *
30
- * @param {*} props
31
- * @returns
32
- */
33
-function body(props) {
34
-  const { getFieldDecorator, getFieldsValue } = props.form
35
-
36
-  // eslint-disable-next-line react-hooks/rules-of-hooks
37
-  const [dataSource, setDataSource] = useState({ records: [] })
38
-  // eslint-disable-next-line react-hooks/rules-of-hooks
39
-  const [dataPub, setDataPub] = useState({ records: [] })
40
-  // 默认私客
41
-  // eslint-disable-next-line react-hooks/rules-of-hooks
42
-  const [customerType, setCustomerType] = useState('private')
43
-
44
-  // 调整归属 ============  start
45
-  // eslint-disable-next-line react-hooks/rules-of-hooks
46
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
47
-  // 调整归属 ============= end
48
-
49
-  // 积分记录 ============  start
50
-  // eslint-disable-next-line react-hooks/rules-of-hooks
51
-  const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
52
-  // 积分记录 ============= end
53
-
54
-  // 变更状态 ============  start
55
-  // eslint-disable-next-line react-hooks/rules-of-hooks
56
-  const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
57
-  // 变更状态 ============= end
58
-
59
-  // 推荐客户
60
-  const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
61
-
62
-  const [assistVisibleData, setAssistVisibleData] = useState({ visible: false, customerId: '', buildingId: '' })
63
-
64
-  const [loadingStatus, setLoadingStatus] = useState(false)
65
-
66
-  // 选中的公客信息
67
-  const [personInfo, setPersonInfo] = useState([])
68
-
69
-  const [batchAssistVisibleData, setBatchAssistVisibleData] = useState({ visible: false, customerId: [], buildingId: '' })
70
-
71
-  const [currentSelectedRows, setSelectedRows] = useState([])
72
-
73
-  const [selectedRowKeys, setSelectedRowKeys] = useState([])
74
-
75
-  // eslint-disable-next-line react-hooks/rules-of-hooks
76
-  useEffect(() => {
77
-    // localStorage.setItem("state", JSON.stringify({ value }))
78
-    if (localStorage.getItem("state")) {
79
-      console.log(localStorage.getItem("state"), 'state')
80
-      if (JSON.parse(localStorage.getItem("state")) == 'private') {
81
-        const localStorageValue = JSON.parse(localStorage.getItem('priPageParams'))
82
-        localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
83
-        localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
84
-        props.form.setFieldsValue(localStorageValue);
85
-        getList({ pageNumber: 1, pageSize: 10, ...JSON.parse(localStorage.getItem("priPageParams")) })
86
-      } else {
87
-        setCustomerType('public')
88
-        const localStorageValue = JSON.parse(localStorage.getItem("pubPageParams"))
89
-        localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
90
-        localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
91
-        props.form.setFieldsValue(localStorageValue);
92
-        getList({ pageNumber: 1, pageSize: 10, ...JSON.parse(localStorage.getItem("pubPageParams")) })
93
-      }
94
-
95
-    } else {
96
-      localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType }))
97
-      getList({ pageNumber: 1, pageSize: 10, customerType })
98
-    }
99
-  }, [])
100
-
101
-  function getList(params) {
102
-    // 网路请求
103
-    if (params.startCreateDate) {
104
-      params.startCreateDate = moment(params.startCreateDate).format('YYYY-MM-DD HH:mm:ss');
105
-    }
106
-    if (params.endCreateDate) {
107
-      params.endCreateDate = moment(params.endCreateDate).format('YYYY-MM-DD HH:mm:ss');
108
-    }
109
-    request({ ...apis.customer.customerRecommend, params: { ...params } }).then(res => {
110
-      if (params.customerType === 'private') {
111
-        setDataSource(res)
112
-      } else {
113
-        setDataPub(res)
114
-      }
115
-    }).catch(err => {
116
-      // eslint-disable-next-line no-unused-expressions
117
-      <Alert
118
-        style={{
119
-          marginBottom: 24,
120
-        }}
121
-        message={err}
122
-        type="error"
123
-        showIcon
124
-      />
125
-    })
126
-  }
127
-
128
-  function displayNone() {
129
-    setRecordVisibleData({ visible: false, customerId: '' })
130
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
131
-    setStatusVisibleData({ visible: false, customerId: '', status: '' })
132
-    setRecommendVisibleData({ visible: false, customerId: '' })
133
-  }
134
-
135
-  // 提交事件
136
-  function handleSubmit(e) {
137
-    displayNone()
138
-
139
-    setPersonInfo([])
140
-    setSelectedRowKeys([])
141
-
142
-    e.preventDefault();
143
-    props.form.validateFields((err, values) => {
144
-      if (!err) {
145
-        if (values.startCreateDate) {
146
-          values.startCreateDate = moment(values.startCreateDate).format('YYYY-MM-DD HH:mm:ss');
147
-        }
148
-        if (values.endCreateDate) {
149
-          values.endCreateDate = moment(values.endCreateDate).format('YYYY-MM-DD HH:mm:ss');
150
-        }
151
-        if (customerType === 'private') {
152
-          localStorage.setItem("priPageParams", JSON.stringify({ customerType: 'private', ...values }))
153
-          getList(JSON.parse(localStorage.getItem("priPageParams")))
154
-        } else {
155
-          localStorage.setItem("pubPageParams", JSON.stringify({ customerType: 'public', ...values }))
156
-          getList(JSON.parse(localStorage.getItem("pubPageParams")))
157
-        }
158
-        // getList({ pageNum: 1, pageSize: 10, customerType, ...values })
159
-
160
-
161
-      }
162
-    });
163
-  }
164
-
165
-  // Change 事件
166
-  function handleSelectChange(e) {
167
-    // eslint-disable-next-line no-console
168
-    console.log(e)
169
-  }
170
-
171
-  const localStorageDate = (date) => date ? moment(date) : ''
172
-
173
-  // 分页
174
-  function onChange(pageNum) {
175
-    // eslint-disable-next-line react-hooks/rules-of-hooks
176
-    props.form.validateFields((err, values) => {
177
-      if (!err) {
178
-        localStorage.setItem("state", JSON.stringify(customerType))
179
-        if (customerType === 'private') {
180
-          localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: pageNum, pageSize: 10, customerType: 'private', ...props.form.getFieldsValue() }))
181
-          getList(JSON.parse(localStorage.getItem("priPageParams")))
182
-        } else {
183
-          localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: pageNum, pageSize: 10, customerType: 'public', ...props.form.getFieldsValue() }))
184
-          getList(JSON.parse(localStorage.getItem("pubPageParams")))
185
-        }
186
-
187
-
188
-      }
189
-    });
190
-  }
191
-
192
-  // 私客/公客切换
193
-  function radioButtonHandleSizeChange(e) {
194
-
195
-    displayNone()
196
-
197
-    props.form.resetFields();
198
-    const { value } = e.target
199
-    setCustomerType(value)
200
-    localStorage.setItem("state", JSON.stringify(value))
201
-    if (value === 'private') {
202
-      if (localStorage.getItem("priPageParams")) {
203
-        const localStorageValue = JSON.parse(localStorage.getItem("priPageParams"))
204
-        localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
205
-        localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
206
-        props.form.setFieldsValue(localStorageValue);
207
-        getList(JSON.parse(localStorage.getItem("priPageParams")))
208
-      } else {
209
-        localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: value }))
210
-        getList({ pageNumber: 1, pageSize: 10, customerType: value })
211
-      }
212
-
213
-    } else {
214
-
215
-      if (localStorage.getItem("pubPageParams")) {
216
-        const localStorageValue = JSON.parse(localStorage.getItem("pubPageParams"))
217
-        localStorageValue.startCreateDate = localStorageDate(localStorageValue.startCreateDate)
218
-        localStorageValue.endCreateDate = localStorageDate(localStorageValue.endCreateDate)
219
-        props.form.setFieldsValue(localStorageValue);
220
-
221
-        getList({ pageNumber: 1, pageSize: 10, customerType, ...JSON.parse(localStorage.getItem("pubPageParams")) })
222
-      } else {
223
-        localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'public' }))
224
-        getList({ pageNumber: 1, pageSize: 10, customerType: 'public' })
225
-      }
226
-    }
227
-
228
-    //setColumns(value === 'private' ? privateColumns : publicColumns)
229
-
230
-  }
231
-
232
-  function handleReset() {
233
-    props.form.resetFields();
234
-    if (customerType === 'private') {
235
-      localStorage.setItem("priPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'private' }));
236
-      getList(JSON.parse(localStorage.getItem("priPageParams")))
237
-    } else {
238
-      localStorage.setItem("pubPageParams", JSON.stringify({ pageNumber: 1, pageSize: 10, customerType: 'public' }))
239
-      getList(JSON.parse(localStorage.getItem("pubPageParams")))
240
-    }
241
-
242
-  }
243
-
244
-
245
-  // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
246
-  // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
247
-
248
-  function showGM(record) {
249
-    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
250
-    setRecordVisibleData({ visible: false, customerId: '' })
251
-    setStatusVisibleData({ visible: false, customerId: '' })
252
-    setRecommendVisibleData({ visible: false, customerId: '' })
253
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
254
-  }
255
-
256
-  function showRecord(record) {
257
-    setRecordVisibleData({ visible: true, customerId: record.personId })
258
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
259
-    setStatusVisibleData({ visible: false, customerId: '' })
260
-    setRecommendVisibleData({ visible: false, customerId: '' })
261
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
262
-  }
263
-
264
-  function showStatus(record) {
265
-    setRecordVisibleData({ visible: false, customerId: '' })
266
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
267
-    setRecommendVisibleData({ visible: false, customerId: '' })
268
-    setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
269
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
270
-  }
271
-
272
-  // 推荐客户
273
-  function showRecommend(personId) {
274
-    setRecordVisibleData({ visible: false, customerId: '' })
275
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
276
-    setStatusVisibleData({ visible: false, customerId: '', status: '' })
277
-    setRecommendVisibleData({ visible: true, customerId: personId })
278
-    setBatchAssistVisibleData({ visible: false, customerId: '' })
279
-  }
280
-
281
-  //分配置业顾问
282
-  function assistConsultant(personId, buildingId) {
283
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
284
-    setRecordVisibleData({ visible: false, customerId: '' })
285
-    setStatusVisibleData({ visible: false, customerId: '' })
286
-    setRecommendVisibleData({ visible: false, customerId: '' })
287
-    setAssistVisibleData({ visible: true, customerId: personId, buildingId: buildingId })
288
-    setBatchAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
289
-  }
290
-
291
-  function batchAssistConsultant() {
292
-    console.log(personInfo, 'personInfo')
293
-    console.log(personInfo.length)
294
-    if (personInfo.length <= 0) {
295
-      return message.info('请至少选择一条数据');
296
-    }
297
-
298
-    const compareSet = new Set();
299
-    personInfo.filter(record => {
300
-      compareSet.add(record.buildingName)
301
-    })
302
-
303
-    if (compareSet.size != 1) {
304
-      return message.info('选中的公客存在于不同项目中,请分开进行分配置业顾问操作');
305
-    }
306
-
307
-    // const newSelectedRows = personInfo.filter()  
308
-
309
-    // console.log(newSelectedRows,'newSelectedRows')
310
-
311
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
312
-    setRecordVisibleData({ visible: false, customerId: '' })
313
-    setStatusVisibleData({ visible: false, customerId: '' })
314
-    setRecommendVisibleData({ visible: false, customerId: '' })
315
-    setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
316
-    setBatchAssistVisibleData({ visible: true, customerId: personInfo, buildingId: personInfo[0].buildingId })
317
-  }
318
-
319
-  function toCustomerDateil(record) {
320
-    router.push({
321
-      pathname: '/customer/customerlist/customerDetail',
322
-      query: {
323
-        id: record.customerId,
324
-      },
325
-    });
326
-  }
327
-  // 私客详情
328
-  function publicCustomerDetail(record) {
329
-    router.push({
330
-      pathname: '/customer/customerlist/publicCustomerDetail',
331
-      query: {
332
-        id: record.personId,
333
-      },
334
-    });
335
-  }
336
-
337
-  function exportCustomer() {
338
-    setLoadingStatus(true)
339
-    const fieldsValue = getFieldsValue()
340
-    if (fieldsValue.startCreateDate) {
341
-      fieldsValue.startCreateDate = moment(fieldsValue.startCreateDate).format('YYYY-MM-DD HH:mm:ss');
342
-    }
343
-    if (fieldsValue.endCreateDate) {
344
-      fieldsValue.endCreateDate = moment(fieldsValue.endCreateDate).format('YYYY-MM-DD HH:mm:ss');
345
-    }
346
-    request({ ...apis.customer.customerRecommendExport, responseType: 'blob', params: { ...fieldsValue, customerType } })
347
-      .then(response => {
348
-        download(response)
349
-        setLoadingStatus(false)
350
-      }).catch(error => {
351
-        message.err('连接超时');
352
-        setLoadingStatus(false)
353
-      })
354
-  }
355
-
356
-  function download(data) {
357
-    if (!data) {
358
-      return
359
-    }
360
-    const url = window.URL.createObjectURL(new Blob([data]))
361
-    const link = document.createElement('a')
362
-    link.style.display = 'none'
363
-    link.href = url
364
-    link.setAttribute('download', '客户列表.xlsx')
365
-    document.body.append(link)
366
-    link.click()
367
-  }
368
-
369
-  // 关闭调整归属的窗口
370
-  function closeAttribution() {
371
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
372
-    if (customerType === 'private') {
373
-      getList(JSON.parse(localStorage.getItem('priPageParams')))
374
-    } else {
375
-      getList(JSON.parse(localStorage.getItem('pubPageParams')))
376
-    }
377
-  }
378
-  // 回调关闭所有弹框
379
-  function closeAll() {
380
-    setRecordVisibleData({ visible: false, customerId: '' })
381
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
382
-    setStatusVisibleData({ visible: false, customerId: '', status: '' })
383
-    setRecommendVisibleData({ visible: false, customerId: '' })
384
-    setAssistVisibleData({ visible: false, customerId: '', buildingId: '' })
385
-    setBatchAssistVisibleData({ visible: false, customerId: '' })
386
-    if (customerType === 'private') {
387
-
388
-      getList(JSON.parse(localStorage.getItem("priPageParams")))
389
-    } else {
390
-
391
-      getList(JSON.parse(localStorage.getItem("pubPageParams")))
392
-    }
393
-    // getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
394
-  }
395
-
396
-  const rowSelection = {
397
-    selectedRowKeys,
398
-    onChange: (selectedRowKeys, selectedRows) => {
399
-      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
400
-      setSelectedRowKeys(selectedRowKeys)
401
-      const newSelectedRows = personInfo.filter(x => !selectedRows.some(y => x.customerId === y.customerId))     // 去重
402
-        .concat(selectedRows)                                                                 // 新增选择
403
-        .filter(x => selectedRowKeys.some(y => y === x.customerId))                             // 去掉未选的数据
404
-
405
-      // setSelectedRows(newSelectedRows)
406
-      console.log(newSelectedRows, "33333333333333333333")
407
-      setPersonInfo(newSelectedRows)
408
-    },
409
-  };
410
-
411
-  const publicColumns = [
412
-    {
413
-      title: '头像',
414
-      dataIndex: 'picture',
415
-      key: 'picture',
416
-      align: 'center',
417
-      width: '10%',
418
-      // render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
419
-      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => publicCustomerDetail(record)} src={record.picture} size={64} icon="user" />,
420
-    },
421
-    {
422
-      title: '姓名',
423
-      dataIndex: 'name',
424
-      key: 'name',
425
-      align: 'center',
426
-      width: '10%',
427
-      // eslint-disable-next-line no-nested-ternary
428
-      render: (_, record) => <><Navigate onClick={() => publicCustomerDetail(record)}>{record.name || record.nickname}</Navigate></>,
429
-    },
430
-    {
431
-      title: '电话',
432
-      dataIndex: 'phone',
433
-      key: 'phone',
434
-      align: 'center',
435
-      width: '15%',
436
-    },
437
-    {
438
-      title: '是否归属项目',
439
-      dataIndex: '',
440
-      key: '',
441
-      align: 'center',
442
-      width: '10%',
443
-      render: (_, record) => <><span>{record.buildingId != null ? '是' : '否'}</span></>,
444
-    },
445
-    {
446
-      title: '归属项目',
447
-      dataIndex: 'buildingName',
448
-      key: 'buildingName',
449
-      align: 'center',
450
-      width: '15%',
451
-    },
452
-    {
453
-      title: '推广人员',
454
-      dataIndex: 'sharePersonName',
455
-      key: 'sharePersonName',
456
-      align: 'center',
457
-      width: '10%',
458
-    },
459
-    {
460
-      title: '性别',
461
-      dataIndex: 'sex',
462
-      key: 'sex',
463
-      align: 'center',
464
-      width: '10%',
465
-      // eslint-disable-next-line no-nested-ternary
466
-      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
467
-    },
468
-    {
469
-      title: '操作',
470
-      dataIndex: 'customerId',
471
-      key: 'customerId',
472
-      align: 'center',
473
-      width: '20%',
474
-      render: withActions((text, record) => [
475
-        <EditIcon color="#FF4A4A" text="查看详情" onClick={() => publicCustomerDetail(record)} />,
476
-        <AuthButton name="admin.customer.recommend" noRight={null}>
477
-          <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
478
-        </AuthButton>,
479
-        <AuthButton name="admin.customer.assign" noRight={null}>
480
-          <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId, record.buildingId)}>分配置业顾问</Button>
481
-        </AuthButton>,
482
-        <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
483
-          <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
484
-        </AuthButton>
485
-      ]),
486
-      // render: (_, record) => (
487
-      //   <>
488
-      //     {/* <AuthButton name="admin.customer.public.detail" noRight={null}>
489
-      //       <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => publicCustomerDetail(record)}>查看详情</Button>
490
-      //     </AuthButton>
491
-      //     &nbsp;&nbsp; */}
492
-      //     <AuthButton name="admin.customer.recommend" noRight={null}>
493
-      //       <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
494
-      //     </AuthButton>
495
-      //     <AuthButton name="admin.customer.assign" noRight={null}>
496
-      //       <Button className={customerType === 'private' ? Styles.displayS : Styles.text} type="link" onClick={() => assistConsultant(record.customerId, record.buildingId)}>分配置业顾问</Button>
497
-      //     </AuthButton>
498
-      //     <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
499
-      //       <Button className={Styles.text} type="link" onClick={() => showRecord(record)}>积分记录</Button>
500
-      //     </AuthButton>
501
-      //   </>
502
-      // ),
503
-    },
504
-  ]
505
-
506
-  const privateColumns = [
507
-    {
508
-      title: '头像',
509
-      dataIndex: 'picture',
510
-      key: 'picture',
511
-      align: 'center',
512
-      width: '10%',
513
-      render: (_, record) => <Avatar shape="square" style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toCustomerDateil(record)} src={customerType === 'private' ? record.picture : record.avatarurl} size={64} icon="user" />,
514
-    },
515
-    {
516
-      title: '姓名',
517
-      dataIndex: 'name',
518
-      key: 'name',
519
-      align: 'center',
520
-      width: '10%',
521
-      // eslint-disable-next-line no-nested-ternary
522
-      render: (_, record) => <><Navigate onClick={() => toCustomerDateil(record)}>{customerType === 'private' ? record.name : record.nickname}</Navigate></>,
523
-    },
524
-    {
525
-      title: '电话',
526
-      dataIndex: 'phone',
527
-      key: 'phone',
528
-      align: 'center',
529
-      width: '10%',
530
-    },
531
-    {
532
-      title: '性别',
533
-      dataIndex: 'sex',
534
-      key: 'sex',
535
-      align: 'center',
536
-      width: '10%',
537
-      // eslint-disable-next-line no-nested-ternary
538
-      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
539
-    },
540
-    {
541
-      title: '置业顾问',
542
-      dataIndex: 'consultantName',
543
-      key: 'consultantName',
544
-      align: 'center',
545
-      width: '10%',
546
-      // eslint-disable-next-line no-nested-ternary
547
-      render: (_, record) => (
548
-        <>
549
-          <span>{record.consultantName}</span>
550
-          <br />
551
-          <span>{record.consultTel}</span>
552
-        </>
553
-      ),
554
-    },
555
-    {
556
-      title: '归属项目',
557
-      dataIndex: 'buildingName',
558
-      key: 'buildingName',
559
-      align: 'center',
560
-      width: '10%',
561
-    },
562
-    {
563
-      title: '推广人员',
564
-      dataIndex: 'sharePersonName',
565
-      key: 'sharePersonName',
566
-      align: 'center',
567
-      width: '10%',
568
-    },
569
-    {
570
-      title: '客户状态',
571
-      dataIndex: 'reportRecommendStatus',
572
-      key: 'reportRecommendStatus',
573
-      align: 'center',
574
-      width: '10%',
575
-      // eslint-disable-next-line no-nested-ternary
576
-      render: (text, records) => {
577
-        if (records.status === 1) { return '报备' }
578
-        if (records.status === 2) { return '到访' }
579
-        if (records.status === 3) { return '认购' }
580
-        if (records.status === 4) { return '签约' }
581
-      },
582
-    },
583
-    {
584
-      title: '操作',
585
-      dataIndex: 'customerId',
586
-      key: 'customerId',
587
-      align: 'center',
588
-      width: '20%',
589
-      render: withActions((text, record) => [
590
-        <EditIcon color="#FF4A4A" text="查看详情" onClick={() => toCustomerDateil(record)} />,
591
-        <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
592
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
593
-        </AuthButton>,
594
-
595
-        <AuthButton name="admin.customer.recommend.belong" noRight={null}>
596
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
597
-        </AuthButton>,
598
-
599
-        <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
600
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
601
-        </AuthButton>,
602
-
603
-        <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
604
-          <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
605
-        </AuthButton>
606
-      ]),
607
-      // render: (_, record) => (
608
-      //   <>
609
-      //     <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
610
-      //       <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
611
-      //     </AuthButton>
612
-      //     <AuthButton name="admin.customer.recommend.belong" noRight={null}>
613
-      //       <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
614
-      //     </AuthButton>
615
-
616
-      //     {/* <AuthButton name="admin.customer.recommend.get" noRight={null}>
617
-      //       <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
618
-      //     </AuthButton>
619
-      //       &nbsp;&nbsp; */}
620
-      //     <AuthButton name="admin.mine.taPointsRecords.point.record" noRight={null}>
621
-      //       <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
622
-      //     </AuthButton>
623
-      //     <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
624
-      //       <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
625
-      //     </AuthButton>
626
-
627
-      //   </>
628
-      // ),
629
-    },
630
-  ]
631
-
632
-  return (
633
-    <>
634
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
635
-        {customerType === 'public' && <Form.Item>
636
-          {getFieldDecorator('belongStatus')(
637
-            <Select style={{ width: '180px' }} placeholder="是否归属项目" onChange={handleSelectChange}>
638
-              <Option value={1}>是</Option>
639
-              <Option value={0}>否</Option>
640
-            </Select>,
641
-          )}
642
-        </Form.Item>}
643
-        <Form.Item>
644
-          {getFieldDecorator('buildingId')(
645
-            <BuildSelect />,
646
-          )}
647
-        </Form.Item>
648
-        {customerType === 'private' && <Form.Item>
649
-          {getFieldDecorator('status')(
650
-            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
651
-              <Option value={1}>报备</Option>
652
-              <Option value={2}>到访</Option>
653
-              <Option value={3}>认筹</Option>
654
-              <Option value={4}>签约</Option>
655
-            </Select>,
656
-          )}
657
-        </Form.Item>}
658
-        <Form.Item>
659
-          {getFieldDecorator('name')(
660
-            <Input
661
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
662
-              placeholder="姓名"
663
-            />,
664
-          )}
665
-        </Form.Item>
666
-        <Form.Item>
667
-          {getFieldDecorator('tel')(
668
-            <Input
669
-              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
670
-              placeholder="电话"
671
-            />,
672
-          )}
673
-        </Form.Item>
674
-        {customerType === 'private' && <Form.Item>
675
-          {getFieldDecorator('consultName')(
676
-            <Input placeholder="置业顾问" />,
677
-          )}
678
-        </Form.Item>}
679
-        {customerType === 'private' && <Form.Item>
680
-          {getFieldDecorator('consultTel')(
681
-            <Input placeholder="置业顾问电话" />,
682
-          )}
683
-        </Form.Item>}
684
-        <Form.Item >
685
-          {getFieldDecorator('startCreateDate')(
686
-            <DatePicker placeholder="注册开始时间" format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }} />)}
687
-        </Form.Item>
688
-        <Form.Item >
689
-          {getFieldDecorator('endCreateDate')(
690
-            <DatePicker placeholder="注册结束时间" format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }} />)}
691
-        </Form.Item>
692
-        <Form.Item>
693
-          {getFieldDecorator('sceneType')(
694
-            <WxDictSelect />,
695
-          )}
696
-        </Form.Item>
697
-        <Form.Item>
698
-          {getFieldDecorator('sharePersonName')(
699
-            <Input placeholder="推广人" />,
700
-          )}
701
-        </Form.Item>
702
-        <Form.Item>
703
-          <AuthButton name="admin.customer.recommend.search" noRight={null}>
704
-            <Button type="primary" htmlType="submit" >
705
-              搜索
706
-              </Button>
707
-          </AuthButton>
708
-          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
709
-            重置
710
-            </Button>
711
-        </Form.Item>
712
-      </Form>
713
-      {
714
-        customerType === 'private' ?
715
-          <AuthButton name="admin.customer.import" noRight={null}>
716
-            <Button type="primary" loading={loadingStatus} onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
717
-              导出
718
-          </Button>
719
-          </AuthButton> :
720
-          <>
721
-            <AuthButton name="admin.customer.import" noRight={null}>
722
-              <Button type="primary" onClick={() => batchAssistConsultant()} style={{ float: 'right', margin: '20px 0', marginLeft: '20px', zIndex: 1 }}>
723
-                批量分配置业顾问
724
-          </Button>
725
-            </AuthButton>
726
-            <AuthButton name="admin.customer.import" noRight={null}>
727
-              <Button type="primary" loading={loadingStatus} onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
728
-                导出
729
-          </Button>
730
-            </AuthButton>
731
-          </>
732
-      }
733
-
734
-
735
-      <div style={{ margin: '20px 0' }}>
736
-        <Radio.Group value={customerType} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
737
-          <Radio.Button value="private">私客</Radio.Button>
738
-          <Radio.Button value="public">公客</Radio.Button>
739
-        </Radio.Group>
740
-      </div>
741
-      {customerType === 'private' ?
742
-        <Table
743
-          // onRow={record => {
744
-          //   return {
745
-          //     onClick: () => toCustomerDateil(record),
746
-          //   };
747
-          // }}
748
-          dataSource={dataSource.records} columns={privateColumns} pagination={{ current: dataSource.current, total: dataSource.total, pageSize: dataSource.size, onChange }} rowKey={r => r.customerId} /> :
749
-        <Table rowSelection={rowSelection}
750
-          // onRow={record => {
751
-          //   return {
752
-          //     onClick: () => publicCustomerDetail(record),
753
-          //   };
754
-          // }}
755
-          dataSource={dataPub.records} columns={publicColumns} pagination={{ current: dataPub.current, total: dataPub.total, pageSize: dataPub.size, onChange }} rowKey={r => r.customerId} ></Table>
756
-      }
757
-
758
-      {/* 调整归属 */}
759
-      <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()} />
760
-
761
-      {/* 积分记录 */}
762
-      <IntegralRecord visibleData={recordVisibleData} onCancel={() => closeAll()} />
763
-
764
-      {/* 变更状态 */}
765
-      <ChangeStatus visibleData={statusVisibleData} onCancel={() => closeAll()} />
766
-
767
-      {/* 推荐客户 */}
768
-      <ModalRecommendRecord visibleData={recommendVisibleData} onCancel={() => closeAll()} />
769
-
770
-      {/* 分配置业顾问 */}
771
-      <AssistConsultant visibleData={assistVisibleData} onCancel={() => closeAll()} />
772
-
773
-      {/* 批量分配置业顾问 */}
774
-      <BatchAssistConsultant visibleData={batchAssistVisibleData} onCancel={() => closeAll()} />
775
-
776
-      <Prompt message={location =>
777
-        location.pathname.startsWith("/customer/customerlist")
778
-          ? true
779
-          : (localStorage.removeItem("priPageParams"), localStorage.removeItem("pubPageParams"), localStorage.removeItem("state"))} />
780
-    </>
781
-  );
782
-}
783
-
784
-const WrappedBody = Form.create({ name: 'body' })(body);
785
-
786
-export default WrappedBody

+ 2
- 2
src/pages/staff/staff/Edit/index.jsx View File

115
       extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像,限制大小:100k',
115
       extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像,限制大小:100k',
116
       value: userData.avatar,
116
       value: userData.avatar,
117
       beforeUpload: e => photoBeforeUpload(e),
117
       beforeUpload: e => photoBeforeUpload(e),
118
-      rules: [{ required: true, message: '请选择头像' }],
118
+      // rules: [{ required: true, message: '请选择头像' }],
119
     },
119
     },
120
 
120
 
121
     {
121
     {
161
       type: FieldTypes.Switch,
161
       type: FieldTypes.Switch,
162
       value: userData.isConsultant,
162
       value: userData.isConsultant,
163
       props: {
163
       props: {
164
-        disabled: userData.isConsultant,
164
+        // disabled: userData.isConsultant,
165
         onChange: e => {
165
         onChange: e => {
166
           console.log(e, '------');
166
           console.log(e, '------');
167
           setIsConsultant(e);
167
           setIsConsultant(e);

+ 70
- 22
src/pages/statistics/activity/index.jsx View File

1
 import React, { Component, useState, useEffect } from 'react';
1
 import React, { Component, useState, useEffect } from 'react';
2
-import { Card, Row, Col, Statistic, Icon } from 'antd';
2
+import { Card, Row, Col, Statistic, Icon, Table } from 'antd';
3
 // import IndexEcharts from './components/indexEcharts';
3
 // import IndexEcharts from './components/indexEcharts';
4
 // import Swiper from './swiper/index';
4
 // import Swiper from './swiper/index';
5
+import moment from 'moment';
5
 import router from 'umi/router';
6
 import router from 'umi/router';
6
 import request from '@/utils/request';
7
 import request from '@/utils/request';
7
 import apis from '@/services/apis';
8
 import apis from '@/services/apis';
9
+import TimeSelect from '../compents/TimeSelect';
10
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
8
 // import Count from './components/Count';
11
 // import Count from './components/Count';
9
 // import SourceRole from './components/SourceRole';
12
 // import SourceRole from './components/SourceRole';
10
 // import UserSex from './components/UserSex';
13
 // import UserSex from './components/UserSex';
13
 
16
 
14
 const DataReport = props => {
17
 const DataReport = props => {
15
   const [data, setData] = useState([]);
18
   const [data, setData] = useState([]);
19
+  const [time, setTime] = useState([]);
20
+  const [buildingValue, setBuildingValue] = useState();
21
+
22
+  useEffect(() => {
23
+    if (time) {
24
+      getTableList({
25
+        buildingValue,
26
+        startDate: moment(time[0]).format('YYYY-MM-DDT00:00:00.000') + 'Z',
27
+        endDate: moment(time[1]).format('YYYY-MM-DDT23:59:59.999') + 'Z',
28
+      });
29
+    }
30
+  }, [time, buildingValue]);
31
+
32
+  const columns = [
33
+    {
34
+      title: '活动名称',
35
+      dataIndex: 'activityName',
36
+      key: 'activityName',
37
+    },
38
+    {
39
+      title: '访问人数',
40
+      dataIndex: 'visitPersonNum',
41
+      key: 'visitPersonNum',
42
+    },
43
+    {
44
+      title: '访问次数',
45
+      dataIndex: 'visitNum',
46
+      key: 'visitNum',
47
+    },
48
+    {
49
+      title: '报名人数',
50
+      dataIndex: 'visitNum',
51
+      key: 'visitNum',
52
+      // sorter: true,
53
+      //   render: (text, record) => (
54
+      //     <Navigate onClick={toAddVisitNum(record)}>{record.visitNum}</Navigate>
55
+      //     // <a style={{ color: '#66B3FF' }} onClick={toAddVisitNum(record)}><span>{record.visitNum}</span></a>
56
+      //   ),
57
+    },
58
+  ];
59
+
60
+  function getTableList(params) {
61
+    request({
62
+      ...apis.activityDataStatis.activityDetailTableData,
63
+      params: {
64
+        ...params,
65
+        
66
+      },
67
+    })
68
+      .then(data => {
69
+        console.log(data);
70
+        // this.setState({ tableData: data.records, total: data.total });
71
+      })
72
+      .catch();
73
+  }
74
+
75
+  const onTimeChange = e => {
76
+    setTime(e);
77
+  };
16
 
78
 
17
   return (
79
   return (
18
-    <>234
19
-      {/* <div style={{ marginBottom: '20px' }}>
20
-        <Count></Count>
21
-      </div>
22
-      <div style={{ marginBottom: '20px' }}>
23
-        <Row gutter={16} style={{ textAlign: 'center' }}>
24
-          <Col span={8}>
25
-            <SourceRole></SourceRole>
26
-          </Col>
27
-          <Col span={8}>
28
-            <UserSex></UserSex>
29
-          </Col>
30
-          <Col span={8}>
31
-            <UserConversion></UserConversion>
32
-          </Col>
33
-        </Row>
34
-      </div>
35
-      <div style={{ marginBottom: '20px' }}>
36
-        <BuildingStatistic></BuildingStatistic>
37
-      </div> */}
38
-    </>
80
+    <Card
81
+      title={<BuildingSelect value={buildingValue} onChange={e => setBuildingValue(e)} all />}
82
+      headStyle={{ textAlign: 'left' }}
83
+      extra={<TimeSelect onChange={onTimeChange}></TimeSelect>}
84
+    >
85
+      <Table columns={columns} dataSource={[]}></Table>
86
+    </Card>
39
   );
87
   );
40
 };
88
 };
41
 export default DataReport;
89
 export default DataReport;

+ 1
- 1
src/pages/statistics/compents/TimeSelect.jsx View File

5
 
5
 
6
 const { RangePicker } = DatePicker;
6
 const { RangePicker } = DatePicker;
7
 const TimeSelect = props => {
7
 const TimeSelect = props => {
8
-  const { value, onChange } = props;
8
+  const { value, onChange=()=>{} } = props;
9
 
9
 
10
   const [rangePickerValue, setRangePickerValue] = useState();
10
   const [rangePickerValue, setRangePickerValue] = useState();
11
   const [type, setType] = useState('');
11
   const [type, setType] = useState('');

+ 13
- 1
src/services/apis.js View File

376
     getDetail: {
376
     getDetail: {
377
       method: 'GET',
377
       method: 'GET',
378
       url: `${prefix}/channelCustomer/:id`,
378
       url: `${prefix}/channelCustomer/:id`,
379
-      action: 'admin.customer.recommend.recommender.get',
379
+      action: 'admin.customer.get',
380
+    },
381
+    customerInfo: {
382
+      method: 'GET',
383
+      url: `${prefix}/customerInfo/:id`,
384
+      action: 'admin.customerInfo.id.get',
380
     },
385
     },
381
 
386
 
382
     getStatusChange: {
387
     getStatusChange: {
510
       url: `${prefix}/customer/list/:id`,
515
       url: `${prefix}/customer/list/:id`,
511
       action: 'admin.customer.list.get',
516
       action: 'admin.customer.list.get',
512
     },
517
     },
518
+    deleteChannelPerson: {
519
+      // 根据置业顾问查询客户
520
+      method: 'delete',
521
+      url: `${prefix}/channelPerson/:id`,
522
+      action: 'admin.channelPerson.id.get',
523
+    },
524
+
513
   },
525
   },
514
   indexEcharts: {
526
   indexEcharts: {
515
     list: {
527
     list: {