dingxin 5 년 전
부모
커밋
04b42197cf

+ 13
- 2
config/routes.js 파일 보기

@@ -114,7 +114,7 @@ export default [
114 114
               },
115 115
               {
116 116
                 path: '/customer/recommendCustomer/audit',
117
-                name: '客户审核', 
117
+                name: '客户审核',
118 118
                 hideInMenu: true,
119 119
                 component: './customer/recommendCustomer/audit',
120 120
               },
@@ -263,6 +263,17 @@ export default [
263 263
                 hideInMenu: true,
264 264
                 component: './activity/SignList',
265 265
               },
266
+              {
267
+                path: '/activity/drainage/DrainageList',
268
+                name: '全网投放引流',
269
+                component: './activity/drainage/DrainageList',
270
+              },
271
+              {
272
+                path: '/activity/drainage/Detail',
273
+                name: '查看详情',
274
+                hideInMenu: true,
275
+                component: './activity/drainage/Detail',
276
+              },
266 277
               {
267 278
                 path: '/activity/helpActivity/list',
268 279
                 name: '助力活动',
@@ -334,7 +345,7 @@ export default [
334 345
                 name: '添加角色',
335 346
                 hideInMenu: true,
336 347
                 component: './staff/list/addRole',
337
-              },  
348
+              },
338 349
             ],
339 350
           },
340 351
           {

+ 144
- 0
src/pages/activity/drainage/Detail.jsx 파일 보기

@@ -0,0 +1,144 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+import moment from 'moment';
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request';
9
+import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from 'constants';
10
+
11
+
12
+
13
+const data = []
14
+
15
+const header = (props) => {
16
+  const drainageId = props.location.query.drainageId
17
+
18
+
19
+  const [datas, setDatas] = useState([])
20
+  const [content, setContent] = useState([{}, {}])
21
+  const [columns, setColumns] = useState([])
22
+  const [startDate, setStartDate] = useState('')
23
+  const [endDate, setEndDate] = useState('')
24
+  let daterange = []
25
+  // let content = {}
26
+  useEffect(() => {
27
+
28
+    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId })
29
+
30
+  }, [])
31
+
32
+  function gettaDrainageRecord (params) {
33
+    request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
34
+      // setDatas(data)
35
+      console.log(data, '3333333333333')
36
+      setDatas(tableData(data.records))
37
+      // content = data.records[0]
38
+      console.log('json: ', eval('(' + data.records[0].content + ')'))
39
+      setContent(eval('(' + data.records[0].content + ')'))
40
+      setColumns(tableTitle(eval('(' + data.records[0].content + ')')))
41
+    }).catch((err) => {
42
+      console.log(err)
43
+      message.info(err.msg || err.message)
44
+    })
45
+  }
46
+  function tableData (data) {
47
+    console.log('data', data)
48
+    return data.map((row, inx) => {
49
+      return eval('(' + row.content + ')').reduce((acc, col) => {
50
+        const r = {
51
+          key: inx + 1,
52
+          [`${col.key}`]: col.value,
53
+          ...acc,
54
+        }
55
+        console.log('r', r)
56
+        return r
57
+      }, {})
58
+    })
59
+  }
60
+
61
+  function tableTitle (data) {
62
+    return data.map((item) => {
63
+      const col = {
64
+        title: item.label,
65
+        dataIndex: item.key,
66
+        key: item.key
67
+      }
68
+      return col
69
+    })
70
+  }
71
+
72
+
73
+  function datalist() {
74
+
75
+    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate)  })
76
+  }
77
+
78
+  function fromTime(str) {
79
+    return str === '' ? null : `${moment(str).format('YYYY-MM-DDT00:00:00.000')}Z`
80
+  }
81
+
82
+  function onChangetime(dates, dateStrings) {
83
+ 
84
+    setEndDate(dateStrings[1])
85
+    setStartDate(dateStrings[0])
86
+    
87
+  }
88
+
89
+  function excelPort(){
90
+    // const fieldsValue = getFieldsValue()
91
+    request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
92
+      .then(response => {
93
+        download(response)
94
+      }).catch(error => {
95
+
96
+      })
97
+  }
98
+
99
+  function download (data) {
100
+    if (!data) {
101
+      return
102
+    }
103
+    const url = window.URL.createObjectURL(new Blob([data]))
104
+    const link = document.createElement('a')
105
+    link.style.display = 'none'
106
+    link.href = url
107
+    link.setAttribute('download', '引流.xlsx')
108
+    document.body.append(link)
109
+    link.click()
110
+  }
111
+
112
+  const { RangePicker } = DatePicker;
113
+  return (
114
+    <>
115
+
116
+<RangePicker
117
+          style={{ width: '400px' }}
118
+          // ranges={{
119
+          //   Today: [moment(), moment()],
120
+          //   'This Month': [moment().startOf('month'), moment().endOf('month')],
121
+          // }}
122
+          // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
123
+          showTime
124
+          onChange={onChangetime}
125
+        />
126
+        <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
127
+          搜索
128
+      </Button>
129
+    
130
+      <div>
131
+        {/* H5项目名称 */}
132
+        {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
133
+        <Table columns={columns} dataSource={datas}  pagination={false} />
134
+      </div>
135
+
136
+
137
+
138
+
139
+    </>
140
+  )
141
+}
142
+
143
+
144
+export default header

+ 323
- 0
src/pages/activity/drainage/DrainageList.jsx 파일 보기

@@ -0,0 +1,323 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import router from 'umi/router';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+import apis from '../../../services/apis';
7
+import request from '../../../utils/request';
8
+import XForm, { FieldTypes } from '../../../components/XForm';
9
+import moment from 'moment';
10
+
11
+const toEditList = (drainageId) => () => {
12
+  console.log(drainageId,'12344567')
13
+  router.push({
14
+    pathname: '/activity/drainage/Detail',
15
+    query: {
16
+      drainageId
17
+    },
18
+  });
19
+}
20
+
21
+
22
+
23
+const data = [
24
+
25
+  {
26
+    Id: '1',
27
+    name: 'zls',
28
+    // StartTime:'',
29
+    // EndTime:'',
30
+    number: 33,
31
+  }
32
+
33
+
34
+];
35
+
36
+const header = (props) => {
37
+  // const [data, setData] = useState({ data: [] })
38
+  const [datas, setDatas] = useState([])//表格数据
39
+  const [date, setDate] = useState({})
40
+  const [formsdate, setFormsDate] = useState({})
41
+  //   const [page, changePage] = useState({})
42
+  useEffect(() => {
43
+
44
+    gettaDrainage({ pageNum: 1, pageSize: 10 })
45
+    setDate({
46
+      ModalText: 'Content of the modal',
47
+      visible: false,
48
+      confirmLoading: false,
49
+    })
50
+    
51
+  }, [])
52
+
53
+  function gettaDrainage (params) {
54
+    request({ ...apis.activity.taDrainage, params: params  }).then((data) => {
55
+      setDatas(data)
56
+      console.log(data.records, '_213_')
57
+    }).catch((err) => {
58
+      console.log(err)
59
+      message.info(err.msg || err.message)
60
+    })
61
+  }
62
+
63
+  const deleteDrainage = (drainageIid) => () => {
64
+    Modal.confirm({
65
+      title: '确认删除该引流?',
66
+      okText: '确认',
67
+      cancelText: '取消',
68
+      onOk() {
69
+        request({ ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }).then((data) => {
70
+          message.info('操作成功!')
71
+          gettaDrainage({ pageNum: 1, pageSize: 10 })
72
+        }).catch((err) => {
73
+          console.log('111111',err)
74
+          message.info(err.msg || err.message)
75
+        })
76
+      }
77
+    });
78
+  }
79
+  
80
+  const columns = [
81
+    {
82
+      title: 'H5项目编号',
83
+      dataIndex: 'drainageId',
84
+      key: 'drainageId',
85
+      align: 'center',
86
+    },
87
+    {
88
+      title: 'H5项目名称',
89
+      dataIndex: 'name',
90
+      key: 'name',
91
+      align: 'center',
92
+      render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
93
+    },
94
+    {
95
+      title: '新建时间',
96
+      dataIndex: 'createDate',
97
+      key: 'createDate',
98
+      align: 'center',
99
+      render: (x, row) => (
100
+        <>
101
+          <span>{ row.createDate && moment(row.createDate).format('YYYY-MM-DD hh:mm:ss') }</span>
102
+        </>
103
+      ),
104
+    },
105
+    {
106
+      title: '截止时间',
107
+      dataIndex: 'endDate',
108
+      key: 'endDate',
109
+      align: 'center',
110
+      render: (x, row) => (
111
+        <>
112
+          <span>{ row.endDate && moment(row.endDate).format('YYYY-MM-DD hh:mm:ss') }</span>
113
+        </>
114
+      ),
115
+    },
116
+    {
117
+      title: '参与数',
118
+      dataIndex: 'enlistNum',
119
+      key: 'enlistNum',
120
+      align: 'center',
121
+      // render:
122
+    },
123
+    {
124
+      title: '操作',
125
+      key: 'action',
126
+      align: 'center',
127
+      render: (text, datas) => (
128
+        <>
129
+          <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(datas.drainageId)}>
130
+            查看详情
131
+            </span>
132
+  
133
+          <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={deleteDrainage(datas.drainageId)}>
134
+            删除
135
+            </span>
136
+        </>
137
+      ),
138
+    },
139
+  ];
140
+  const Forms = props => {
141
+   
142
+    console.log(date,'---------------')
143
+    console.log(formsdate,'---------------')
144
+    console.log(formsdate,'22222222')
145
+    const fields = [
146
+      {
147
+        label: 'H5项目名称',
148
+        name: 'name',
149
+        type: FieldTypes.Text,
150
+        placeholder:"请输入H5项目名称",
151
+        value: formsdate.name,
152
+
153
+      },
154
+      {
155
+        label: '截止时间',
156
+        name: 'endDate',
157
+        type: FieldTypes.DatePicker,
158
+        value:formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null
159
+        // render: <DatePicker placeholder="截止时间" value= {formsdate.endDate} />,
160
+      },
161
+
162
+
163
+    ]
164
+
165
+    const handleSubmit = val => {
166
+      console.log(date,'111---------------')
167
+    console.log(formsdate,'111---------------')
168
+    console.log(formsdate,'11122222222')
169
+      // data: { ...submitValue }
170
+      alert(val)
171
+      console.log(formsdate.drainageId,'9999999999999')
172
+      if (formsdate.drainageId) {
173
+        // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
174
+        request({ ...apis.activity.updatetaDrainage, urlData: { id: formsdate.drainageId }, data: val}).then((data) => {
175
+          message.info('操作成功!')
176
+          // gettaDrainage({ pageNum: 1, pageSize: 10 })
177
+        }).catch((err) => {
178
+          console.log('111111',err)
179
+          message.info(err.msg || err.message)
180
+        })
181
+       
182
+      } else {
183
+
184
+     
185
+
186
+        request({ ...apis.activity.addtaDrainage, data: val }).then((data) => {
187
+          message.info("保存成功")
188
+          console.log(data, '22222')
189
+          
190
+        }).catch((err) => {
191
+          message.error(err.msg || err.message)
192
+        })
193
+      }
194
+    }
195
+
196
+    return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
197
+    
198
+  }
199
+
200
+
201
+
202
+
203
+  //重置搜索
204
+  function handleReset () {
205
+    props.form.resetFields();
206
+  }
207
+
208
+  
209
+
210
+  function addshowModal (datas) {
211
+
212
+    // alert(datas.drainageId)
213
+console.log(datas,'22222222')
214
+    setFormsDate({
215
+      drainageId:datas.drainageId,
216
+      name:datas.name,
217
+      endDate:datas.endDate,
218
+    })
219
+    console.log(formsdate,'22222222')
220
+    setDate({
221
+      visible: true,
222
+    });
223
+  };
224
+  function showModal () {
225
+    setFormsDate({
226
+      drainageId:'',
227
+      name:'',
228
+      endDate:'',
229
+    })
230
+    setDate({
231
+      visible: true,
232
+    });
233
+  };
234
+
235
+
236
+  function handleOk () {
237
+
238
+
239
+    setDate({
240
+      ModalText: 'The modal will be closed after two seconds',
241
+      confirmLoading: true,
242
+    });
243
+    function setTimeout () {
244
+      setDate({
245
+        visible: false,
246
+        confirmLoading: false,
247
+      });
248
+    };
249
+  };
250
+
251
+  function handleCancel () {
252
+    console.log('Clicked cancel button');
253
+    setDate({
254
+      visible: false,
255
+    });
256
+  };
257
+  function handleSubmit(e) {
258
+    e.preventDefault();
259
+    props.form.validateFields((err, values) => {
260
+      console.log('values', values)
261
+      if (!err) {
262
+        console.log('values', values)
263
+        gettaDrainage({ pageNum: 1, pageSize: 10, ...values })
264
+      }
265
+    });
266
+  }
267
+
268
+  const { getFieldDecorator } = props.form;
269
+  const { visible, confirmLoading, ModalText } = date;
270
+  return (
271
+    <>
272
+      <div>
273
+        <Form layout="inline" onSubmit={handleSubmit}>
274
+          <Form.Item>
275
+            {getFieldDecorator('drainageId')(
276
+              <Input
277
+                // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
278
+                placeholder="H5项目编号"
279
+              />,
280
+
281
+              // {getFieldDecorator('name', {
282
+              // })(<Input/>)}
283
+            )}
284
+          </Form.Item>
285
+          <Form.Item>
286
+            {getFieldDecorator('name')(
287
+              <Input
288
+                // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
289
+                placeholder="H5项目名称"
290
+              />,
291
+            )}
292
+          </Form.Item>
293
+          <Form.Item>
294
+            <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
295
+              搜索
296
+          </Button>
297
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
298
+              重置
299
+            </Button>
300
+          </Form.Item>
301
+        </Form>
302
+        {/* <AuthButton name="admin.buildingDynamic.add.post" noRight={null}> */}
303
+        <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
304
+
305
+        <Modal
306
+          title="新建H5项目"
307
+          visible={visible}
308
+          //  onOk={handleOk}
309
+          confirmLoading={confirmLoading}
310
+          onCancel={handleCancel}
311
+          footer={null}
312
+        >
313
+          <Forms />
314
+        </Modal>
315
+        <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList"/>
316
+     
317
+      </div>
318
+    </>
319
+  )
320
+}
321
+const WrappedHeader = Form.create({ name: 'header' })(header);
322
+
323
+export default WrappedHeader

+ 528
- 0
src/pages/activity/groupActivity/helpRecord.jsx 파일 보기

@@ -0,0 +1,528 @@
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 } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import AuthButton from '@/components/AuthButton';
9
+
10
+
11
+const { Option } = Select;
12
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+const { Meta } = Card;
14
+
15
+/**
16
+ * 拼团者弹框
17
+ */
18
+class InviteTable extends React.Component {
19
+  constructor(props) {
20
+    super(props);
21
+    this.state = {
22
+      dataSource: { records: [] },
23
+      visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+    }
25
+  }
26
+
27
+  // 挂载之后
28
+  componentDidMount () {
29
+    const { customerId } = this.state.visibleData
30
+    this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate (preProps, preState) {
34
+    const { customerId } = this.state.visibleData
35
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36
+      this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
37
+      this.setState({ visibleData: this.props.visibleData });
38
+    }
39
+  }
40
+
41
+  // 弹框确定按钮
42
+  // eslint-disable-next-line react/sort-comp
43
+  handleOk () {
44
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
45
+  }
46
+
47
+  // 弹框取消按钮
48
+  handleCancel () {
49
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
50
+  }
51
+
52
+  getList (params) {
53
+    request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
54
+      this.setState({ dataSource: res })
55
+    }).catch(err => {
56
+      // eslint-disable-next-line no-unused-expressions
57
+      <Alert
58
+        style={{
59
+          marginBottom: 24,
60
+        }}
61
+        message={err}
62
+        type="error"
63
+        showIcon
64
+      />
65
+    })
66
+  }
67
+
68
+  // 分页
69
+  onChange (pageNum) {
70
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
71
+  }
72
+
73
+  render () {
74
+    const columns = [
75
+      {
76
+        title: '用户姓名',
77
+        dataIndex: 'name',
78
+        key: 'name',
79
+        align: 'center',
80
+      },
81
+      {
82
+        title: '手机号',
83
+        dataIndex: 'phone',
84
+        key: 'phone',
85
+        align: 'center',
86
+        render: text => <a>{text}</a>,
87
+      },
88
+      {
89
+        title: '开团时间',
90
+        dataIndex: 'createDate',
91
+        key: 'createDate',
92
+        align: 'center',
93
+      },
94
+    ]
95
+    return (
96
+      <>
97
+        <Modal
98
+          title="参团者"
99
+          destroyOnClose="true"
100
+          width={900}
101
+          footer={null}
102
+          visible={this.state.visibleData.visible}
103
+          // onOk={() => this.handleOk()}
104
+          onCancel={(e) => this.handleCancel(e)}
105
+        >
106
+          <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
107
+        </Modal>
108
+      </>
109
+    );
110
+  }
111
+}
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+/**
120
+ * 拼团者弹框
121
+ */
122
+class Verifier extends React.Component {
123
+  constructor(props) {
124
+    super(props);
125
+    this.state = {
126
+      helpRecordInitiateId: { id: '' },
127
+      visibleData: { visible: false, customerId: '', realtyConsultant: '', helpRecordInitiateId: '' },
128
+    }
129
+  }
130
+
131
+  // 挂载之后
132
+  componentDidMount () {
133
+    const { customerId } = this.state.visibleData
134
+    this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
135
+  }
136
+
137
+  componentDidUpdate (preProps, preState) {
138
+    const { customerId } = this.state.visibleData
139
+    console.log('this.state.visibleData', this.state.visibleData)
140
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
141
+      this.getList({ helpRecordInitiateId: customerId, pageNumber: 1, pageSize: 5 })
142
+      this.setState({ visibleData: this.props.visibleData });
143
+    }
144
+  }
145
+
146
+  // 弹框确定按钮
147
+  // eslint-disable-next-line react/sort-comp
148
+  handleOk () {
149
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
150
+  }
151
+
152
+  // 弹框取消按钮
153
+  handleCancel () {
154
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
155
+  }
156
+
157
+  getList (params) {
158
+    request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
159
+        console.log(res);
160
+      this.setState({ dataSource: res })
161
+    }).catch(err => {
162
+      // eslint-disable-next-line no-unused-expressions
163
+      <Alert
164
+        style={{
165
+          marginBottom: 24,
166
+        }}
167
+        message={err}
168
+        type="error"
169
+        showIcon
170
+      />
171
+    })
172
+  }
173
+
174
+  // eslint-disable-next-line class-methods-use-this
175
+  verify(e) {
176
+    console.log('111', e.target.value)
177
+  }
178
+
179
+  // eslint-disable-next-line class-methods-use-this
180
+  verification(e) {
181
+    console.log('this.state.visibleData', this.state.visibleData)
182
+      alert(1)
183
+  }
184
+
185
+  render () {
186
+    return (
187
+      <>
188
+        <Modal
189
+          title="核销"
190
+          destroyOnClose="true"
191
+          width={300}
192
+          footer={null}
193
+          visible={this.state.visibleData.visible}
194
+          // onOk={() => this.handleOk()}
195
+          onCancel={(e) => this.handleCancel(e)}
196
+        >
197
+          <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
198
+           <Button onClick={(e) => this.verification(e)}>立即核销</Button>
199
+          </div>
200
+        </Modal>
201
+      </>
202
+    );
203
+  }
204
+}
205
+
206
+/**
207
+ *主体列表
208
+ *
209
+ * @param {*} props
210
+ * @returns
211
+ */
212
+function body(props) {
213
+  const [gInviteData, setGInviteData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
214
+
215
+  const [gVerifierData, setVerifierData] = useState({ visible: false, customerId: '', realtyConsultant: '', helpRecordInitiateId: '' })
216
+
217
+  const { getFieldDecorator, getFieldsValue } = props.form
218
+
219
+  // eslint-disable-next-line react-hooks/rules-of-hooks
220
+  const [dataSource, setDataSource] = useState({ records: [] })
221
+  // eslint-disable-next-line react-hooks/rules-of-hooks
222
+  // const [columns, setColumns] = useState(privateColumns)
223
+
224
+  // 默认成功
225
+  // eslint-disable-next-line react-hooks/rules-of-hooks
226
+  const [groupStatus, setgroupStatus] = useState('0')
227
+
228
+  // 调整归属 ============  start
229
+  // eslint-disable-next-line react-hooks/rules-of-hooks
230
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
231
+
232
+
233
+  // 变更状态 ============= end
234
+
235
+  // eslint-disable-next-line react-hooks/rules-of-hooks
236
+  const { groupActivityId } = props.location.query
237
+  useEffect(() => {
238
+    getList({ pageNumber: 1, pageSize: 10, status: groupStatus, groupActivityId: groupActivityId })
239
+  }, [])
240
+
241
+  
242
+  function getFailList(params) {
243
+    // 网路请求
244
+    request({ ...apis.groupActivity.shareFailList, params: { ...params } }).then(res => {
245
+        console.log(res);
246
+      setDataSource(res)
247
+    }).catch(err => {
248
+      // eslint-disable-next-line no-unused-expressions
249
+      <Alert
250
+        style={{
251
+          marginBottom: 24,
252
+        }}
253
+        message={err}
254
+        type="error"
255
+        showIcon
256
+      />
257
+    })
258
+  }
259
+
260
+  function getList(params) {
261
+    // 网路请求
262
+    request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
263
+        console.log(res);
264
+      setDataSource(res)
265
+    }).catch(err => {
266
+      // eslint-disable-next-line no-unused-expressions
267
+      <Alert
268
+        style={{
269
+          marginBottom: 24,
270
+        }}
271
+        message={err}
272
+        type="error"
273
+        showIcon
274
+      />
275
+    })
276
+  }
277
+
278
+  function displayNone() {
279
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
280
+  }
281
+
282
+  // 提交事件
283
+  function handleSubmit(e) {
284
+    displayNone()
285
+
286
+
287
+    e.preventDefault();
288
+    props.form.validateFields((err, values) => {
289
+      if (!err) {
290
+        getList({ pageNum: 1, pageSize: 10, groupStatus, ...values })
291
+      }
292
+    });
293
+  }
294
+
295
+  // Change 事件
296
+  function handleSelectChange(e) {
297
+    // eslint-disable-next-line no-console
298
+    console.log(e)
299
+  }
300
+
301
+  // 分页
302
+  function onChange(pageNum) {
303
+    // eslint-disable-next-line react-hooks/rules-of-hooks
304
+    getList({ pageNumber: pageNum, pageSize: 10, groupStatus })
305
+  }
306
+
307
+  // 助力成功/进行中/助力失败
308
+  function radioButtonHandleSizeChange(e) {
309
+    setGInviteData({ visible: true, customerId: '', realtyConsultant: '' })
310
+    displayNone()
311
+
312
+    const { value } = e.target
313
+    setgroupStatus(value)
314
+    // setColumns(value === 'helpSucceed' ? privateColumns : publicColumns)
315
+    if (value == 0) { 
316
+        console.log("success", value)
317
+        getList({ pageNumber: 1, pageSize: 10, status: value, groupActivityId }) }
318
+    if (value == 1 || value == 2) {
319
+        console.log("faile", value)
320
+         getFailList({ pageNumber: 1, pageSize: 10, status: value, groupActivityId })
321
+         }
322
+  }
323
+
324
+  function handleReset() {
325
+    props.form.resetFields();
326
+    getList({ pageNumber: 1, pageSize: 10, groupStatus })
327
+  }
328
+
329
+  function toCustomerDateil(record) {
330
+    router.push({
331
+      pathname: '/customer/customerlist/customerDetail',
332
+      query: {
333
+        id: record.customerId,
334
+      },
335
+    });
336
+  }
337
+
338
+  function exportCustomer () {
339
+    const fieldsValue = getFieldsValue()
340
+    request({ ...apis.customer.customerRecommendExport, responseType: 'blob', params: { ...fieldsValue, groupStatus } })
341
+      .then(response => {
342
+        download(response)
343
+      }).catch(error => {
344
+
345
+      })
346
+  }
347
+
348
+  function download (data) {
349
+    if (!data) {
350
+      return
351
+    }
352
+    const url = window.URL.createObjectURL(new Blob([data]))
353
+    const link = document.createElement('a')
354
+    link.style.display = 'none'
355
+    link.href = url
356
+    link.setAttribute('download', '客户列表.xlsx')
357
+    document.body.append(link)
358
+    link.click()
359
+  }
360
+
361
+// 助力记录弹框
362
+function helpRecord(row) {
363
+// 关闭核销
364
+// eslint-disable-next-line max-len
365
+setVerifierData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
366
+  // eslint-disable-next-line max-len
367
+  setGInviteData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
368
+}
369
+ // 核销
370
+ function helpInitiateRecordVerify(row) {
371
+// 关闭助力记录弹框
372
+// eslint-disable-next-line max-len
373
+  setVerifierData({ visible: true, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
374
+  // eslint-disable-next-line max-len
375
+  setGInviteData({ visible: false, customerId: row.helpRecordInitiateId, realtyConsultant: row.realtyConsultant })
376
+ }
377
+
378
+  const publicColumns = [
379
+    {
380
+      title: '拼团者',
381
+      dataIndex: 'nickname',
382
+      key: 'nickname',
383
+      align: 'center',
384
+      width: '15%',
385
+    },
386
+    {
387
+      title: '拼团者手机号',
388
+      dataIndex: 'phone',
389
+      key: 'phone',
390
+      align: 'center',
391
+      width: '10%',
392
+    },
393
+    {
394
+      title: '拼团时间',
395
+      dataIndex: 'createTime',
396
+      key: 'createTime',
397
+      align: 'center',
398
+      width: '15%',
399
+    },
400
+    {
401
+      title: '参团者',
402
+      dataIndex: 'helpCount',
403
+      key: 'helpCount',
404
+      align: 'center',
405
+      width: '15%',
406
+      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick={() => helpRecord(record)}>{record.joinPeople}/{record.groupBuyPeople}</a>,
407
+    },
408
+  ]
409
+
410
+  const privateColumns = [
411
+    {
412
+      title: '拼团者',
413
+      dataIndex: 'nickname',
414
+      key: 'nickname',
415
+      align: 'center',
416
+      width: '15%',
417
+      // render: (_, record) => <Avatar shape="square" src={groupStatus === 'helpSucceed' ? record.picture : record.avatarurl} size={64} icon="user" />,
418
+    },
419
+    {
420
+      title: '手机号',
421
+      dataIndex: 'phone',
422
+      key: 'phone',
423
+      align: 'center',
424
+      width: '10%',
425
+      // eslint-disable-next-line no-nested-ternary
426
+      // render: (_, record) => <><span>{groupStatus === 'helpSucceed' ? record.name : record.nickname}</span></>,
427
+    },
428
+    {
429
+      title: '发起时间',
430
+      dataIndex: 'createTime',
431
+      key: 'createTime',
432
+      align: 'center',
433
+      width: '10%',
434
+      // eslint-disable-next-line no-nested-ternary
435
+    },
436
+    {
437
+        title: '成团时间',
438
+        dataIndex: 'endTime',
439
+        key: 'endTime',
440
+        align: 'center',
441
+        width: '10%',
442
+        // eslint-disable-next-line no-nested-ternary
443
+    },
444
+    {
445
+      title: '核销状态',
446
+      dataIndex: 'verificationStatus',
447
+      key: 'verificationStatus',
448
+      align: 'center',
449
+      width: '10%',
450
+      // eslint-disable-next-line no-nested-ternary
451
+      render: (text, records) => {
452
+        if (records.verificationStatus === 0) { return '未核销' }
453
+        if (records.verificationStatus === 1) { return '已核销' }
454
+      },
455
+    },
456
+    {
457
+      title: '操作',
458
+      dataIndex: 'customerId',
459
+      key: 'customerId',
460
+      align: 'center',
461
+      width: '25%',
462
+      render: (x, row) => (
463
+        <>
464
+          {row.verificationStatus === 0 &&
465
+          <AuthButton name="admin.SignList.get" noRight={null}>
466
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={() => helpInitiateRecordVerify(row)}>核销</span>
467
+          </AuthButton>
468
+        }
469
+        </>
470
+      ),
471
+    },
472
+  ]
473
+
474
+  
475
+  const changePageNum = pageNumber => {
476
+    getList({ pageNum: pageNumber, pageSize: 10 })
477
+  }
478
+
479
+  return (
480
+    <>
481
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
482
+        <Form.Item>
483
+          {getFieldDecorator('tel')(
484
+            <Input
485
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
486
+              placeholder="电话"
487
+            />,
488
+          )}
489
+        </Form.Item>
490
+        <Form.Item>
491
+            <Button type="primary" htmlType="submit" >
492
+              查询
493
+            </Button>
494
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
495
+              重置
496
+            </Button>
497
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
498
+              返回
499
+            </Button>
500
+        </Form.Item>
501
+      </Form>
502
+      <Button type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
503
+        导出
504
+      </Button>
505
+
506
+      <div style={{ margin: '20px 0' }}>
507
+        <AuthButton name="admin.customer.recommend.get" noRight={null}>
508
+          <Radio.Group value={groupStatus} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
509
+            <Radio.Button value="0">拼团成功</Radio.Button>
510
+            <Radio.Button value="1">进行中</Radio.Button>
511
+            <Radio.Button value="2">拼团失败</Radio.Button>
512
+          </Radio.Group>
513
+        </AuthButton>
514
+      </div>
515
+
516
+      {groupStatus === '0' ?
517
+        <Table dataSource={dataSource.records} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
518
+        <Table dataSource={dataSource.records} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
519
+      }
520
+       {/* <InviteTable visibleData={gInviteData} />
521
+       <Verifier visibleData={gVerifierData} /> */}
522
+    </>
523
+  );
524
+}
525
+
526
+const WrappedBody = Form.create({ name: 'body' })(body);
527
+
528
+export default WrappedBody

+ 13
- 13
src/pages/activity/groupActivity/list.jsx 파일 보기

@@ -60,7 +60,7 @@ const toEditActivity = (groupActivityId) => () => {
60 60
       dataIndex: 'startTime',
61 61
       key: 'startTime',
62 62
       align: 'center',
63
-      render: (x, row) => <><span>{`${moment(row.startTime).format('YYYY-MM-DD')} —— ${moment(row.endTime).format('YYYY-MM-DD')}`}</span></>
63
+      render: (x, row) => <><span>{`${moment(row.startTime).format('YYYY-MM-DD hh:mm:ss')} —— ${moment(row.endTime).format('YYYY-MM-DD hh:mm:ss')}`}</span></>
64 64
     },
65 65
     {
66 66
         title: '所需积分',
@@ -82,13 +82,13 @@ const toEditActivity = (groupActivityId) => () => {
82 82
     },  
83 83
     {
84 84
       title: '状态',
85
-      dataIndex: 'status',
86
-      key: 'status',
85
+      dataIndex: 'activityStatus',
86
+      key: 'activityStatus',
87 87
       align: 'center',
88 88
       render: (text, records) => {
89
-        if (records.status === 0) { return '进行中' }
90
-        if (records.status === 1) { return '未开始' }
91
-        if (records.status === 2) { return '已结束' }
89
+        if (records.activityStatus === 0) { return '进行中' }
90
+        if (records.activityStatus === 1) { return '未开始' }
91
+        if (records.activityStatus === 2) { return '已结束' }
92 92
       },
93 93
     },
94 94
     {
@@ -98,16 +98,16 @@ const toEditActivity = (groupActivityId) => () => {
98 98
       align: 'center',
99 99
       render: (x, row) => (
100 100
         <>
101
-          {row.status === 0 &&
101
+          {row.activityStatus === 0 &&
102 102
           <AuthButton name="admin.SignList.get" noRight={null}>
103 103
         
104
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
104
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActicityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
105 105
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
106 106
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
107 107
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
108 108
         </AuthButton> }
109 109
 
110
-          {row.status === 1 &&
110
+          {row.activityStatus === 1 &&
111 111
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
112 112
                       <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditActivity(row.groupActicityId)}>编辑<Icon type="form" className={styles.edit} /></span>
113 113
                       <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
@@ -116,9 +116,9 @@ const toEditActivity = (groupActivityId) => () => {
116 116
         </AuthButton>
117 117
           }
118 118
 
119
-          {row.status === 2 &&
119
+          {row.activityStatus === 2 &&
120 120
         <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
121
-           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
121
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActicityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
122 122
            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
123 123
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
124 124
         </AuthButton>
@@ -127,11 +127,11 @@ const toEditActivity = (groupActivityId) => () => {
127 127
       ),
128 128
     },
129 129
   ];
130
-  const getSignList = recordId => {
130
+  const getSignList = groupActivityId => {
131 131
       router.push({
132 132
           pathname: '/activity/groupActivity/helpRecord',
133 133
           query: {
134
-            recordId,
134
+            groupActivityId,
135 135
           },
136 136
         });
137 137
   }

+ 38
- 2
src/services/apis.js 파일 보기

@@ -357,6 +357,7 @@ export default {
357 357
       url: `${prefix}/selectCityUser`,
358 358
       action: 'admin.selectCityUser.get',
359 359
     },
360
+    
360 361
 
361 362
   },
362 363
   activity: {
@@ -434,6 +435,36 @@ export default {
434 435
         url: `${prefix}/SignList`,
435 436
         method: 'GET',
436 437
         action: 'admin.SignList.get',
438
+      },
439
+      taDrainage: {
440
+        url: `${prefix}/taDrainage`,
441
+        method: 'GET',
442
+        action: 'admin.taDrainage.get',
443
+      },
444
+      addtaDrainage: {
445
+        url: `${prefix}/taDrainage/add`,
446
+        method: 'POST',
447
+        action: 'admin.taDrainage.add.post',
448
+      },
449
+      deletetaDrainage: {
450
+        url: `${prefix}/taDrainage/:id`,
451
+        method: 'DELETE',
452
+        action: 'admin.taDrainage.id.delete',
453
+      },
454
+      updatetaDrainage: {
455
+        url: `${prefix}/taDrainage/:id`,
456
+        method: 'PUT',
457
+        action: 'admin.taDrainage.id.put',
458
+      },
459
+      taDrainageRecord:{
460
+        url: `${prefix}/taDrainageRecord`,
461
+        method: 'GET',
462
+        action: 'admin.taDrainageRecord.get',
463
+      },
464
+      exporttaDrainageRecord:{
465
+        url: `${prefix}/taDrainageRecord/export`,
466
+        method: 'GET',
467
+        action: 'admin.taDrainageRecord/export.get',
437 468
       }
438 469
   },
439 470
   integralMall: {
@@ -761,11 +792,16 @@ export default {
761 792
     method: 'put',
762 793
     action: 'admin.taShareActivity.weight',
763 794
   },
764
-  record: {
765
-    url: `${prefix}/helpRecord`,
795
+  shareSuccList: {
796
+    url: `${prefix}/taShareSuccessRecord`,
766 797
     method: 'get',
767 798
     action: 'admin.taRole.get',
768 799
   },
800
+  shareFailList : {
801
+    url: `${prefix}/taShareFailAndProcessingRecord`,
802
+    method: 'get',
803
+    action: 'admin.taRole.get',
804
+  }
769 805
  },
770 806
  third: {
771 807
   thirdPartyMiniapp: {