瀏覽代碼

新需求

魏超 5 年之前
父節點
當前提交
b9835dfc02

+ 24
- 0
config/routes.js 查看文件

@@ -550,6 +550,30 @@ export default [
550 550
                 name: '活动统计',
551 551
                 component: './statistical/activity'
552 552
               },
553
+              {
554
+                path: '/statistical/activity/sharePersonNum',
555
+                name: '分享统计',
556
+                hideInMenu: true,
557
+                component: './statistical/activity/sharePersonNum',
558
+              },
559
+              {
560
+                path: '/statistical/activity/shareNum',
561
+                name: '分享统计',
562
+                hideInMenu: true,
563
+                component: './statistical/activity/shareNum',
564
+              },
565
+              {
566
+                path: '/statistical/activity/addRegistNum',
567
+                name: '分享统计',
568
+                hideInMenu: true,
569
+                component: './statistical/activity/addRegistNum',
570
+              },
571
+              {
572
+                path: '/statistical/activity/visitNum',
573
+                name: '分享统计',
574
+                hideInMenu: true,
575
+                component: './statistical/activity/visitNum',
576
+              },
553 577
               {
554 578
                 path: '/statistical/building',
555 579
                 name: '项目统计',

+ 195
- 0
src/pages/statistical/activity/addRegistNum.jsx 查看文件

@@ -0,0 +1,195 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3
+import moment from 'moment';
4
+import style from './compenents/style.less';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import router from 'umi/router';
8
+import AuthButton from '@/components/AuthButton';
9
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
10
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
11
+
12
+
13
+const { RangePicker } = DatePicker;
14
+const { Option } = Select
15
+
16
+const formItemLayout = {
17
+    labelCol: { span: 10},
18
+    wrapperCol: { span: 14 },
19
+  };
20
+  
21
+let daterange = []
22
+let tableTitle = ['类型']
23
+
24
+let columns = [
25
+  {
26
+    title: '姓名',
27
+    dataIndex: 'nickName',
28
+    key: 'nickName',
29
+  },
30
+  {
31
+    title: '电话',
32
+    dataIndex: 'phone',
33
+    key: 'phone',
34
+  },
35
+  {
36
+    title: '性别',
37
+    dataIndex: 'gender',
38
+    key: 'gender',
39
+  },
40
+  {
41
+    title: '归属地',
42
+    dataIndex: 'province',
43
+    key: 'province',
44
+  },
45
+  {
46
+    title: '归属地',
47
+    dataIndex: 'province',
48
+    key: 'province',
49
+  },
50
+  {
51
+    title: '来源渠道',
52
+    dataIndex: 'personFrom',
53
+    key: 'personFrom',
54
+  },
55
+  {
56
+    title: '置业顾问',
57
+    dataIndex: 'realtyConsultant',
58
+    key: 'realtyConsultant',
59
+  },
60
+  {
61
+    title: '置业顾问电话',
62
+    dataIndex: 'realtyConsultantPhone',
63
+    key: 'realtyConsultantPhone',
64
+  },
65
+  {
66
+    title: '分享者',
67
+    dataIndex: 'sharePersonName',
68
+    key: 'sharePersonName',
69
+  },
70
+  {
71
+    title: '分享者电话',
72
+    dataIndex: 'sharePersonPhone',
73
+    key: 'sharePersonPhone',
74
+  },
75
+]
76
+
77
+class SharePersonNum extends React.Component {
78
+
79
+  constructor(props) {
80
+    super(props)
81
+    const startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
82
+    const endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
83
+    console.log(startDate)
84
+    this.state = {
85
+      formData: {
86
+        personFrom: '',
87
+        pageNum:'',
88
+        pageSize:'',
89
+        startDate: startDate,
90
+        endDate: endDate
91
+      },
92
+      personData: [],  
93
+      dataSoures: [],
94
+      tableData: [],
95
+      userType: 'all',
96
+      buildingId: [],
97
+      targetType: []
98
+    }
99
+  }
100
+
101
+  componentDidMount() {
102
+    this.getTableList()
103
+  }
104
+
105
+  getTableList () {
106
+    const { formData } = this.state
107
+    console.log(formData)
108
+    request({ ...apis.activityDataStatis.activityAddRegist, params: formData }).then(data => {
109
+      console.log(data)
110
+      this.setState({ tableData: data.records, total: data.total})
111
+    }).catch()
112
+  }
113
+
114
+  handleSubmit = (e, props) => {
115
+    let startDate = null
116
+    let endDate = null
117
+    const personFrom = this.props.form.getFieldValue("personFrom");
118
+    const { formData } = this.state
119
+    this.setState({
120
+      formData: {
121
+        ...formData,
122
+        personFrom: personFrom,
123
+      }
124
+    }, this.getTableList)
125
+  }
126
+
127
+  //重置搜索
128
+  handleReset = e => {
129
+    this.props.form.resetFields()
130
+  }
131
+
132
+  exportActivityStats = () => {
133
+    const { formData } = this.state
134
+    request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: formData }).then(data => {
135
+      if (!data) {
136
+        return
137
+      }
138
+      const url = window.URL.createObjectURL(new Blob([data]))
139
+        const link = document.createElement('a')
140
+        link.style.display = 'none'
141
+        link.href = url
142
+        link.setAttribute('download', '分享统计.xlsx')
143
+        document.body.append(link)
144
+        link.click()
145
+    }).catch()
146
+  }
147
+
148
+  //排序
149
+  handleTableChange = (pagination, filters, sorter) => {
150
+    console.log(pagination, filters, sorter)
151
+    const { formData } = this.state
152
+    this.setState({
153
+      formData: {
154
+        ...formData,
155
+        personFrom: formData.personFrom,
156
+        pageNum: pagination.current,
157
+        pageSize: pagination.pageSize
158
+      }
159
+    }, this.getTableList)
160
+  };
161
+
162
+  render() {
163
+    const { radioVal } = this.state
164
+    const { getFieldDecorator } = this.props.form;
165
+
166
+    return (
167
+    <>
168
+        <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
169
+        <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
170
+          {getFieldDecorator('personFrom')(
171
+            <WxDictSelect />,
172
+          )}
173
+        </Form.Item>
174
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
175
+            <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
176
+                查询
177
+            </Button>
178
+            <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
179
+          </Form.Item>
180
+          </Form>     
181
+        <div>
182
+        <AuthButton name="admin.customer.import" noRight={null}>
183
+            <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
184
+                导出
185
+            </Button>
186
+            </AuthButton>
187
+          <Table style={{marginTop:'20px'}} dataSource={this.state.tableData} columns={columns} pagination={{ total: this.state.total}} onChange={this.handleTableChange} scroll={{ y: 500 }}></Table>
188
+        </div>
189
+    </>
190
+    )
191
+    
192
+  }
193
+}
194
+const WrappedTypeForm = Form.create()(SharePersonNum);
195
+export default WrappedTypeForm

+ 56
- 4
src/pages/statistical/activity/compenents/OverView.jsx 查看文件

@@ -22,6 +22,58 @@ const formItemLayout = {
22 22
 let daterange = []
23 23
 let tableTitle = ['类型']
24 24
 
25
+const toSharePersonNum = rowData => () => {
26
+  console.log(rowData, 'rowData')
27
+  if(rowData) {
28
+    router.push({
29
+    pathname: '/statistical/activity/sharePersonNum',
30
+    query: {
31
+      queryDate: rowData.date,
32
+    },
33
+  });
34
+    return
35
+  }
36
+}
37
+
38
+const toShareNum = rowData => () => {
39
+  console.log(rowData, 'rowData')
40
+  if(rowData) {
41
+    router.push({
42
+    pathname: '/statistical/activity/shareNum',
43
+    query: {
44
+      queryDate: rowData.date,
45
+    },
46
+  });
47
+    return
48
+  }
49
+} 
50
+
51
+const toAddRegistNum = rowData => () => {
52
+  console.log(rowData, 'rowData')
53
+  if(rowData) {
54
+    router.push({
55
+    pathname: '/statistical/activity/addRegistNum',
56
+    query: {
57
+      queryDate: rowData.date,
58
+    },
59
+  });
60
+    return
61
+  }
62
+} 
63
+
64
+const toAddVisitNum = rowData => () => {
65
+  console.log(rowData, 'rowData')
66
+  if(rowData) {
67
+    router.push({
68
+    pathname: '/statistical/activity/visitNum',
69
+    query: {
70
+      queryDate: rowData.date,
71
+    },
72
+  });
73
+    return
74
+  }
75
+} 
76
+
25 77
 let columns = [
26 78
   {
27 79
     title: '日期',
@@ -34,7 +86,7 @@ let columns = [
34 86
     key: 'sharePersonNum',
35 87
     sorter: true,
36 88
     render: (text, record) => (
37
-    <a style={{ color: '#66B3FF' }}><span>{record.sharePersonNum}</span></a>
89
+    <a style={{ color: '#66B3FF' }} onClick={toSharePersonNum(record)}><span>{record.sharePersonNum}</span></a>
38 90
     ),
39 91
   },
40 92
   {
@@ -43,7 +95,7 @@ let columns = [
43 95
     key: 'shareNum',
44 96
     sorter: true,
45 97
     render: (text, record) => (
46
-      <a style={{ color: '#66B3FF' }}><span>{record.shareNum}</span></a>
98
+      <a style={{ color: '#66B3FF' }} onClick={toShareNum(record)}><span>{record.shareNum}</span></a>
47 99
       ),
48 100
   },
49 101
   {
@@ -61,7 +113,7 @@ let columns = [
61 113
     key: 'visitNum',
62 114
     sorter: true,
63 115
     render: (text, record) => (
64
-      <a style={{ color: '#66B3FF' }}><span>{record.visitNum}</span></a>
116
+      <a style={{ color: '#66B3FF' }} onClick={toAddVisitNum(record)}><span>{record.visitNum}</span></a>
65 117
       ),
66 118
   },
67 119
   {
@@ -70,7 +122,7 @@ let columns = [
70 122
     key: 'addRegistNum',
71 123
     sorter: true,
72 124
     render: (text, record) => (
73
-      <a style={{ color: '#66B3FF' }}><span>{record.addRegistNum}</span></a>
125
+      <a style={{ color: '#66B3FF' }} onClick={toAddRegistNum(record)}><span>{record.addRegistNum}</span></a>
74 126
       ),
75 127
   },
76 128
 ]

+ 198
- 0
src/pages/statistical/activity/shareNum.jsx 查看文件

@@ -0,0 +1,198 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3
+import moment from 'moment';
4
+import style from './compenents/style.less';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import router from 'umi/router';
8
+import AuthButton from '@/components/AuthButton';
9
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
10
+
11
+
12
+const { RangePicker } = DatePicker;
13
+const { Option } = Select
14
+
15
+const formItemLayout = {
16
+    labelCol: { span: 10},
17
+    wrapperCol: { span: 14 },
18
+  };
19
+  
20
+let daterange = []
21
+let tableTitle = ['类型']
22
+
23
+let columns = [
24
+  {
25
+    title: '分享者姓名',
26
+    dataIndex: 'sharePersonName',
27
+    key: 'sharePersonName',
28
+  },
29
+  {
30
+    title: '分享者类型',
31
+    dataIndex: 'shareType',
32
+    key: 'shareType',
33
+    render: (text, records) => {
34
+      if (records.sharePersonType === 'drift') { return '游客' }
35
+      if (records.sharePersonType === 'customer') { return '客户' }
36
+      if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
37
+    },
38
+  },
39
+  {
40
+    title: '分享时间',
41
+    dataIndex: 'shareTime',
42
+    key: 'shareTime',
43
+    render: (x, row) => <><span>{`${moment(row.shareTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
44
+  },
45
+  {
46
+    title: '分享者电话',
47
+    dataIndex: 'sharePersonPhone',
48
+    key: 'sharePersonPhone',
49
+  },
50
+  {
51
+    title: '访问人数',
52
+    dataIndex: 'visitPersonNum',
53
+    key: 'visitPersonNum',
54
+    sorter: true,
55
+  },
56
+]
57
+
58
+class SharePersonNum extends React.Component {
59
+
60
+  constructor(props) {
61
+    super(props)
62
+    const startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
63
+    const endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
64
+    console.log(startDate)
65
+    this.state = {
66
+      formData: {
67
+        sharePhone: '',
68
+        sharePersonType: '',
69
+        pageNum:'',
70
+        pageSize:'',
71
+        shareName:'',
72
+        sort:null,
73
+        colKey:null,
74
+        startDate: startDate,
75
+        endDate: endDate
76
+      },
77
+      personData: [],  
78
+      dataSoures: [],
79
+      tableData: [],
80
+      userType: 'all',
81
+      buildingId: [],
82
+      targetType: []
83
+    }
84
+  }
85
+
86
+  componentDidMount() {
87
+    this.getTableList()
88
+  }
89
+
90
+  getTableList () {
91
+    const { formData } = this.state
92
+    console.log(formData)
93
+    request({ ...apis.activityDataStatis.activityShareNum, params: formData }).then(data => {
94
+      console.log(data)
95
+      this.setState({ tableData: data.records, total: data.total})
96
+    }).catch()
97
+  }
98
+
99
+  handleSubmit = (e, props) => {
100
+    let startDate = null
101
+    let endDate = null
102
+    const sharePersonType = this.props.form.getFieldValue("sharePersonType");
103
+    const sharePersonPhone = this.props.form.getFieldValue("sharePersonPhone");
104
+    const sharePersonName = this.props.form.getFieldValue("sharePersonName");
105
+    const { formData } = this.state
106
+    this.setState({
107
+      formData: {
108
+        ...formData,
109
+        sharePersonType: sharePersonType,
110
+        sharePersonPhone: sharePersonPhone,
111
+        sharePersonName: sharePersonName
112
+      }
113
+    }, this.getTableList)
114
+  }
115
+
116
+  //重置搜索
117
+  handleReset = e => {
118
+    this.props.form.resetFields()
119
+  }
120
+
121
+  exportActivityStats = () => {
122
+    const { formData } = this.state
123
+    request({ ...apis.activityDataStatis.activityShareNumExport, params: formData }).then(data => {
124
+      if (!data) {
125
+        return
126
+      }
127
+      const url = window.URL.createObjectURL(new Blob([data]))
128
+        const link = document.createElement('a')
129
+        link.style.display = 'none'
130
+        link.href = url
131
+        link.setAttribute('download', '分享统计.xlsx')
132
+        document.body.append(link)
133
+        link.click()
134
+    }).catch()
135
+  }
136
+
137
+  //排序
138
+  handleTableChange = (pagination, filters, sorter) => {
139
+    console.log(pagination, filters, sorter)
140
+    const { formData } = this.state
141
+    this.setState({
142
+      formData: {
143
+        ...formData,
144
+        sharePersonType: formData.sharePersonType,
145
+        sharePhone: formData.sharePhone,
146
+        shareName: formData.shareName,
147
+        pageNum: pagination.current,
148
+        pageSize: pagination.pageSize,
149
+        sort: sorter.order,
150
+        colKey: sorter.columnKey
151
+      }
152
+    }, this.getTableList)
153
+  };
154
+
155
+  render() {
156
+    const { radioVal } = this.state
157
+    const { getFieldDecorator } = this.props.form;
158
+
159
+    return (
160
+    <>
161
+        <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
162
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
163
+            {getFieldDecorator('sharePersonType')(
164
+                <Select placeholder="分享者类型" style={{ width: 150, marginLeft:'20px'  }}>
165
+                <Option value="drift">游客</Option>
166
+                <Option value="customer">普通客户</Option>
167
+                <Option value="Realty Consultant">置业顾问</Option>
168
+            </Select>
169
+            )}
170
+          </Form.Item>
171
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
172
+              {getFieldDecorator('sharePersonPhone')(<Input placeholder="分享者电话"/>)}
173
+          </Form.Item>
174
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
175
+              {getFieldDecorator('sharePersonName')(<Input placeholder="分享者姓名"/>)}
176
+          </Form.Item>
177
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
178
+            <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
179
+                查询
180
+            </Button>
181
+            <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
182
+          </Form.Item>
183
+          </Form>     
184
+        <div>
185
+        <AuthButton name="admin.customer.import" noRight={null}>
186
+            <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
187
+                导出
188
+            </Button>
189
+            </AuthButton>
190
+          <Table style={{marginTop:'20px'}} dataSource={this.state.tableData} columns={columns} pagination={{ total: this.state.total}} onChange={this.handleTableChange} scroll={{ y: 500 }}></Table>
191
+        </div>
192
+    </>
193
+    )
194
+    
195
+  }
196
+}
197
+const WrappedTypeForm = Form.create()(SharePersonNum);
198
+export default WrappedTypeForm

+ 49
- 113
src/pages/statistical/activity/sharePersonNum.jsx 查看文件

@@ -1,7 +1,7 @@
1 1
 import React, { Component, useState, useEffect } from 'react';
2 2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3 3
 import moment from 'moment';
4
-import style from './componets/style.less';
4
+import style from './compenents/style.less';
5 5
 import request from '../../../utils/request';
6 6
 import apis from '../../../services/apis';
7 7
 import router from 'umi/router';
@@ -22,27 +22,24 @@ let tableTitle = ['类型']
22 22
 
23 23
 let columns = [
24 24
   {
25
-    title: '活动类型',
26
-    dataIndex: 'activityType',
27
-    key: 'activityType',
28
-    render: (text, records) => {
29
-      if (records.activityType === 'h5') { return 'H5活动' }
30
-      if (records.activityType === 'live') { return '直播活动' }
31
-      if (records.activityType === 'group') { return '拼团活动' }
32
-      if (records.activityType === 'help') { return '助力活动' }
33
-      if (records.activityType === 'activity') { return '报名活动' }
34
-    },
25
+    title: '分享者姓名',
26
+    dataIndex: 'sharePersonName',
27
+    key: 'sharePersonName',
35 28
   },
36 29
   {
37
-    title: '活动名称',
38
-    dataIndex: 'activityName',
39
-    key: 'activityName',
30
+    title: '分享者类型',
31
+    dataIndex: 'sharePersonType',
32
+    key: 'sharePersonType',
33
+    render: (text, records) => {
34
+      if (records.sharePersonType === 'drift') { return '游客' }
35
+      if (records.sharePersonType === 'customer') { return '客户' }
36
+      if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
37
+    },
40 38
   },
41 39
   {
42
-    title: '分享人数',
43
-    dataIndex: 'sharePersonNum',
44
-    key: 'sharePersonNum',
45
-    sorter: true,
40
+    title: '分享者电话',
41
+    dataIndex: 'sharePersonPhone',
42
+    key: 'sharePersonPhone',
46 43
   },
47 44
   {
48 45
     title: '分享次数',
@@ -62,46 +59,26 @@ let columns = [
62 59
     key: 'visitNum',
63 60
     sorter: true,
64 61
   },
65
-  {
66
-    title: '新增注册用户',
67
-    dataIndex: 'addRegistNum',
68
-    key: 'addRegistNum',
69
-    sorter: true,
70
-  },
71
-  {
72
-    title: '详情',
73
-    align: 'center',
74
-    render: (text, record) => (
75
-        <a style={{ color: '#66B3FF' }}>查看</a>
76
-    ),
77
-  },
78 62
 ]
79 63
 
80
-
81
-function getDayBegin(dt) {
82
-  return moment(dt, 'day').hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
83
-}
84
-
85
-
86
-function getDayEnd(dt) {
87
-  return moment(dt, 'day').hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
88
-}
89
-
90
-
91
-class OverView extends React.Component {
64
+class SharePersonNum extends React.Component {
92 65
 
93 66
   constructor(props) {
94 67
     super(props)
95
-
68
+    const startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
69
+    const endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
70
+    console.log(startDate)
96 71
     this.state = {
97 72
       formData: {
98
-        buildingId: '',
99
-        targetType: '',
73
+        sharePhone: '',
74
+        sharePersonType: '',
100 75
         pageNum:'',
101 76
         pageSize:'',
102
-        activityName:'',
77
+        shareName:'',
103 78
         sort:null,
104
-        colKey:null
79
+        colKey:null,
80
+        startDate: startDate,
81
+        endDate: endDate
105 82
       },
106 83
       personData: [],  
107 84
       dataSoures: [],
@@ -118,39 +95,26 @@ class OverView extends React.Component {
118 95
 
119 96
   getTableList () {
120 97
     const { formData } = this.state
121
-    request({ ...apis.activityDataStatis.activityDetailTableData, params: formData }).then(data => {
98
+    console.log(formData)
99
+    request({ ...apis.activityDataStatis.activitySharePersonNum, params: formData }).then(data => {
122 100
       console.log(data)
123 101
       this.setState({ tableData: data.records, total: data.total})
124 102
     }).catch()
125 103
   }
126 104
 
127
-
128
-  onChangetime = (_dates, dateStrings) => {
129
-    daterange[1] = dateStrings[1]
130
-    daterange[0] = dateStrings[0]
131
-  }
132
-
133 105
   handleSubmit = (e, props) => {
134 106
     let startDate = null
135 107
     let endDate = null
136
-    const buildingId = this.props.form.getFieldValue("buildingId");
137
-    const targetType = this.props.form.getFieldValue("targetType");
138
-    const activityName = this.props.form.getFieldValue("activityName");
139
-    if (this.props.form.getFieldValue("startDate") != undefined){
140
-      startDate = this.props.form.getFieldValue("startDate").toDate()
141
-    }
142
-    if (this.props.form.getFieldValue("endDate") != undefined){
143
-      endDate = this.props.form.getFieldValue("endDate").toDate()
144
-    }
108
+    const sharePersonType = this.props.form.getFieldValue("sharePersonType");
109
+    const sharePersonPhone = this.props.form.getFieldValue("sharePersonPhone");
110
+    const sharePersonName = this.props.form.getFieldValue("sharePersonName");
145 111
     const { formData } = this.state
146 112
     this.setState({
147 113
       formData: {
148 114
         ...formData,
149
-        startDate: startDate,
150
-        endDate: endDate,
151
-        buildingId: buildingId,
152
-        targetType: targetType,
153
-        activityName: activityName
115
+        sharePersonType: sharePersonType,
116
+        sharePersonPhone: sharePersonPhone,
117
+        sharePersonName: sharePersonName
154 118
       }
155 119
     }, this.getTableList)
156 120
   }
@@ -162,7 +126,7 @@ class OverView extends React.Component {
162 126
 
163 127
   exportActivityStats = () => {
164 128
     const { formData } = this.state
165
-    request({ ...apis.activityDataStatis.activityDetailTableDataExport, params: formData }).then(data => {
129
+    request({ ...apis.activityDataStatis.activitySharePersonNumExport, params: formData }).then(data => {
166 130
       if (!data) {
167 131
         return
168 132
       }
@@ -170,7 +134,7 @@ class OverView extends React.Component {
170 134
         const link = document.createElement('a')
171 135
         link.style.display = 'none'
172 136
         link.href = url
173
-        link.setAttribute('download', '活动统计.xlsx')
137
+        link.setAttribute('download', '分享统计.xlsx')
174 138
         document.body.append(link)
175 139
         link.click()
176 140
     }).catch()
@@ -183,10 +147,9 @@ class OverView extends React.Component {
183 147
     this.setState({
184 148
       formData: {
185 149
         ...formData,
186
-        startDate: formData.startDate,
187
-        endDate: formData.endDate,
188
-        buildingId: formData.buildingId,
189
-        targetType: formData.targetType,
150
+        sharePersonType: formData.sharePersonType,
151
+        sharePhone: formData.sharePhone,
152
+        shareName: formData.shareName,
190 153
         pageNum: pagination.current,
191 154
         pageSize: pagination.pageSize,
192 155
         sort: sorter.order,
@@ -198,50 +161,24 @@ class OverView extends React.Component {
198 161
   render() {
199 162
     const { radioVal } = this.state
200 163
     const { getFieldDecorator } = this.props.form;
201
-    console.log(this.state.formData,'this.state.formData')
202
-    const startDate = this.state.formData.startDate
203
-    const endDate = this.state.formData.endDate
204 164
 
205 165
     return (
206 166
     <>
207
-      <div style={{
208
-        backgroundColor: '#fff',
209
-        padding: '32PX 28px',
210
-        boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
211
-        borderRadius: '12px',
212
-        minHeight: '60vh'
213
-      }}>
214 167
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
215
-            <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
216
-            {getFieldDecorator('startDate', {initialValue: moment(startDate)
217
-              
218
-            })(
219
-                <DatePicker placeholder="开始日期"/>,
220
-            )}
221
-            </Form.Item>
222
-            <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
223
-            {getFieldDecorator('endDate', {initialValue: moment(endDate)
224
-              
225
-            })(
226
-                <DatePicker placeholder="结束日期"/>,
227
-            )}
228
-            </Form.Item>
229 168
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
230
-              {getFieldDecorator('buildingId')(<BuildingSelect />)}
231
-          </Form.Item>
232
-          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
233
-            {getFieldDecorator('targetType')(
234
-                <Select placeholder="活动类型" style={{ width: 150, marginLeft:'20px'  }}>
235
-                <Option value="activity">报名活动</Option>
236
-                <Option value="help">助力活动</Option>
237
-                <Option value="group">拼团活动</Option>
238
-                <Option value="h5">H5活动</Option>
239
-                <Option value="live">直播</Option>
169
+            {getFieldDecorator('sharePersonType')(
170
+                <Select placeholder="分享者类型" style={{ width: 150, marginLeft:'20px'  }}>
171
+                <Option value="drift">游客</Option>
172
+                <Option value="customer">普通客户</Option>
173
+                <Option value="Realty Consultant">置业顾问</Option>
240 174
             </Select>
241 175
             )}
242 176
           </Form.Item>
243 177
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
244
-              {getFieldDecorator('activityName')(<Input placeholder="请输入活动名称"/>)}
178
+              {getFieldDecorator('sharePersonPhone')(<Input placeholder="分享者电话"/>)}
179
+          </Form.Item>
180
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
181
+              {getFieldDecorator('sharePersonName')(<Input placeholder="分享者姓名"/>)}
245 182
           </Form.Item>
246 183
           <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
247 184
             <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
@@ -251,18 +188,17 @@ class OverView extends React.Component {
251 188
           </Form.Item>
252 189
           </Form>     
253 190
         <div>
254
-            <AuthButton name="admin.customer.import" noRight={null}>
191
+        <AuthButton name="admin.customer.import" noRight={null}>
255 192
             <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
256 193
                 导出
257 194
             </Button>
258 195
             </AuthButton>
259 196
           <Table style={{marginTop:'20px'}} dataSource={this.state.tableData} columns={columns} pagination={{ total: this.state.total}} onChange={this.handleTableChange} scroll={{ y: 500 }}></Table>
260 197
         </div>
261
-      </div>
262 198
     </>
263 199
     )
264 200
     
265 201
   }
266 202
 }
267
-const WrappedTypeForm = Form.create()(OverView);
203
+const WrappedTypeForm = Form.create()(SharePersonNum);
268 204
 export default WrappedTypeForm

+ 218
- 0
src/pages/statistical/activity/visitNum.jsx 查看文件

@@ -0,0 +1,218 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3
+import moment from 'moment';
4
+import style from './compenents/style.less';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+import router from 'umi/router';
8
+import AuthButton from '@/components/AuthButton';
9
+import BuildingSelect from '@/components/SelectButton/BuildSelect';
10
+import WxDictSelect from '@/components/SelectButton/WxDictSelect';
11
+
12
+
13
+const { RangePicker } = DatePicker;
14
+const { Option } = Select
15
+
16
+const formItemLayout = {
17
+    labelCol: { span: 10},
18
+    wrapperCol: { span: 14 },
19
+  };
20
+  
21
+let daterange = []
22
+let tableTitle = ['类型']
23
+
24
+let columns = [
25
+  {
26
+    title: '姓名',
27
+    dataIndex: 'nickName',
28
+    key: 'nickName',
29
+  },
30
+  {
31
+    title: '电话',
32
+    dataIndex: 'phone',
33
+    key: 'phone',
34
+  },
35
+  {
36
+    title: '性别',
37
+    dataIndex: 'gender',
38
+    key: 'gender',
39
+  },
40
+  {
41
+    title: '归属地',
42
+    dataIndex: 'province',
43
+    key: 'province',
44
+  },
45
+  {
46
+    title: '归属地',
47
+    dataIndex: 'province',
48
+    key: 'province',
49
+  },
50
+  {
51
+    title: '来源渠道',
52
+    dataIndex: 'personFrom',
53
+    key: 'personFrom',
54
+  },
55
+  {
56
+    title: '置业顾问',
57
+    dataIndex: 'realtyConsultant',
58
+    key: 'realtyConsultant',
59
+  },
60
+  {
61
+    title: '置业顾问电话',
62
+    dataIndex: 'realtyConsultantPhone',
63
+    key: 'realtyConsultantPhone',
64
+  },
65
+  {
66
+    title: '分享者',
67
+    dataIndex: 'sharePersonName',
68
+    key: 'sharePersonName',
69
+  },
70
+  {
71
+    title: '分享者电话',
72
+    dataIndex: 'sharePersonPhone',
73
+    key: 'sharePersonPhone',
74
+  },
75
+  {
76
+    title: '访问时间',
77
+    dataIndex: 'visitDate',
78
+    key: 'visitDate',
79
+    render: (x, row) => <><span>{`${moment(row.visitDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
80
+  },
81
+]
82
+
83
+class SharePersonNum extends React.Component {
84
+
85
+  constructor(props) {
86
+    super(props)
87
+    const startDate = moment(props.location.query.queryDate).hours(0).minutes(0).seconds(0).milliseconds(0).toDate();
88
+    const endDate = moment(props.location.query.queryDate).hours(23).minutes(59).seconds(59).milliseconds(999).toDate();
89
+    console.log(startDate)
90
+    this.state = {
91
+      formData: {
92
+        personFrom: '',
93
+        pageNum:'',
94
+        pageSize:'',
95
+        startDate: startDate,
96
+        endDate: endDate,
97
+        province:'',
98
+        realtyConsultant:'',
99
+        realtyConsultantPhone:''
100
+      },
101
+      personData: [],  
102
+      dataSoures: [],
103
+      tableData: [],
104
+      userType: 'all',
105
+      buildingId: [],
106
+      targetType: []
107
+    }
108
+  }
109
+
110
+  componentDidMount() {
111
+    this.getTableList()
112
+  }
113
+
114
+  getTableList () {
115
+    const { formData } = this.state
116
+    console.log(formData)
117
+    request({ ...apis.activityDataStatis.activityVisitNum, params: formData }).then(data => {
118
+      console.log(data)
119
+      this.setState({ tableData: data.records, total: data.total})
120
+    }).catch()
121
+  }
122
+
123
+  handleSubmit = (e, props) => {
124
+    let startDate = null
125
+    let endDate = null
126
+    const province = this.props.form.getFieldValue("province");
127
+    const realtyConsultant = this.props.form.getFieldValue("realtyConsultant");
128
+    const realtyConsultantPhone = this.props.form.getFieldValue("realtyConsultantPhone");
129
+
130
+    const { formData } = this.state
131
+    this.setState({
132
+      formData: {
133
+        ...formData,
134
+        personFrom: personFrom,
135
+        realtyConsultant: realtyConsultant,
136
+        realtyConsultant: realtyConsultant
137
+      }
138
+    }, this.getTableList)
139
+  }
140
+
141
+  //重置搜索
142
+  handleReset = e => {
143
+    this.props.form.resetFields()
144
+  }
145
+
146
+  exportActivityStats = () => {
147
+    const { formData } = this.state
148
+    request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: formData }).then(data => {
149
+      if (!data) {
150
+        return
151
+      }
152
+      const url = window.URL.createObjectURL(new Blob([data]))
153
+        const link = document.createElement('a')
154
+        link.style.display = 'none'
155
+        link.href = url
156
+        link.setAttribute('download', '分享统计.xlsx')
157
+        document.body.append(link)
158
+        link.click()
159
+    }).catch()
160
+  }
161
+
162
+  //排序
163
+  handleTableChange = (pagination, filters, sorter) => {
164
+    console.log(pagination, filters, sorter)
165
+    const { formData } = this.state
166
+    this.setState({
167
+      formData: {
168
+        ...formData,
169
+        personFrom: formData.personFrom,
170
+        pageNum: pagination.current,
171
+        pageSize: pagination.pageSize
172
+      }
173
+    }, this.getTableList)
174
+  };
175
+
176
+  render() {
177
+    const { radioVal } = this.state
178
+    const { getFieldDecorator } = this.props.form;
179
+
180
+    return (
181
+    <>
182
+        <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
183
+        <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
184
+          {getFieldDecorator('personFrom')(
185
+            <WxDictSelect />,
186
+          )}
187
+        </Form.Item>
188
+        <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
189
+            {getFieldDecorator('province')(<Input placeholder="请输入归属地"/>)}
190
+        </Form.Item>
191
+        <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
192
+            {getFieldDecorator('realtyConsultant')(<Input placeholder="置业顾问"/>)}
193
+        </Form.Item>
194
+        <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
195
+            {getFieldDecorator('realtyConsultantPhone')(<Input placeholder="置业顾问电话"/>)}
196
+        </Form.Item>
197
+          <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
198
+            <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}>
199
+                查询
200
+            </Button>
201
+            <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
202
+          </Form.Item>
203
+          </Form>     
204
+        <div>
205
+        <AuthButton name="admin.customer.import" noRight={null}>
206
+            <Button type="primary" style={{ float: 'right', margin: '20px 0', zIndex: 1 }} onClick={this.exportActivityStats}>
207
+                导出
208
+            </Button>
209
+            </AuthButton>
210
+          <Table style={{marginTop:'20px'}} dataSource={this.state.tableData} columns={columns} pagination={{ total: this.state.total}} onChange={this.handleTableChange} scroll={{ y: 500 }}></Table>
211
+        </div>
212
+    </>
213
+    )
214
+    
215
+  }
216
+}
217
+const WrappedTypeForm = Form.create()(SharePersonNum);
218
+export default WrappedTypeForm

+ 40
- 0
src/services/apis.js 查看文件

@@ -1625,6 +1625,46 @@ export default {
1625 1625
       url: `${prefix}/activityStatistical/activityDetailTableDataExport`,
1626 1626
       action: 'admin.contract.list.get',
1627 1627
     },
1628
+    activitySharePersonNum: {
1629
+      method: 'GET',
1630
+      url: `${prefix}/activityStatistical/selectActivitySharePersonNum`,
1631
+      action: 'admin.contract.list.get',
1632
+    },
1633
+    activitySharePersonNumExport: {
1634
+      method: 'GET',
1635
+      url: `${prefix}/activityStatistical/activitySharePersonNumExport`,
1636
+      action: 'admin.contract.list.get',
1637
+    },
1638
+    activityShareNum: {
1639
+      method: 'GET',
1640
+      url: `${prefix}/activityStatistical/selectActivityShareNum`,
1641
+      action: 'admin.contract.list.get',
1642
+    },
1643
+    activityShareNumExport: {
1644
+      method: 'GET',
1645
+      url: `${prefix}/activityStatistical/selectActivityShareNumExport`,
1646
+      action: 'admin.contract.list.get',
1647
+    },
1648
+    activityAddRegist: {
1649
+      method: 'GET',
1650
+      url: `${prefix}/activityStatistical/selectActivityAddRegistNum`,
1651
+      action: 'admin.contract.list.get',
1652
+    },
1653
+    activityAddRegistNumExport: {
1654
+      method: 'GET',
1655
+      url: `${prefix}/activityStatistical/selectActivityAddRegistNumExport`,
1656
+      action: 'admin.contract.list.get',
1657
+    },
1658
+    activityVisitNum: {
1659
+      method: 'GET',
1660
+      url: `${prefix}/activityStatistical/selectActivityVisitNum`,
1661
+      action: 'admin.contract.list.get',
1662
+    },
1663
+    activityVisitNumExport: {
1664
+      method: 'GET',
1665
+      url: `${prefix}/activityStatistical/activityVisitNumExport`,
1666
+      action: 'admin.contract.list.get',
1667
+    },
1628 1668
   },
1629 1669
   stats: {
1630 1670
     barList: {