Przeglądaj źródła

Merge branch 'v3.5' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into v3.5

魏熙美 5 lat temu
rodzic
commit
86b2073dac

+ 87
- 7
src/pages/activity/SignList.jsx Wyświetl plik

41
     dataIndex: 'createDate',
41
     dataIndex: 'createDate',
42
     key: 'createDate',
42
     key: 'createDate',
43
     align: 'center',
43
     align: 'center',
44
-    render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD')}`}</span></>
44
+    render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD')}`}</span></>,
45
   },
45
   },
46
   {
46
   {
47
     title: '推广人',
47
     title: '推广人',
55
     key: 'orgName',
55
     key: 'orgName',
56
     align: 'center',
56
     align: 'center',
57
   },
57
   },
58
+  {
59
+    title: '状态',
60
+    dataIndex: 'isCheckin',
61
+    key: 'isCheckin',
62
+    align: 'center',
63
+    render: (x, row) => <><span>{row.isCheckin === 1 ? '已签到' : '未签到'}</span></>,
64
+  },
58
 ];
65
 ];
59
 
66
 
60
 
67
 
61
 
68
 
62
-const header = (props) => {
63
-  const [ data, setData ] = useState({list: {}})
69
+const header = props => {
70
+  const [data, setData] = useState({list: {}})
64
 //   const [page, changePage] = useState({})
71
 //   const [page, changePage] = useState({})
72
+// 存入导入数据的值
73
+const { getFieldDecorator, getFieldsValue } = props.form
74
+  // eslint-disable-next-line react-hooks/rules-of-hooks
65
   useEffect(() => {
75
   useEffect(() => {
66
-    getSignList({pageNum: 1,pageSize: 10, dynamicId: props.location.query.dynamicId });
67
-  },[])
76
+    // eslint-disable-next-line no-use-before-define
77
+    getSignList({ pageNum: 1, pageSize: 10, dynamicId: props.location.query.dynamicId });
78
+  }, [])
68
 
79
 
69
   // 查询列表
80
   // 查询列表
70
-  const getSignList = (params) => {
71
-    request({ ...apis.activity.signList, params: { ...params },}).then((data) => {
81
+  const getSignList = params => {
82
+    // eslint-disable-next-line no-shadow
83
+    request({ ...apis.activity.signList, params: { ...params } }).then(data => {
72
         console.log(data)
84
         console.log(data)
73
         setData(data)
85
         setData(data)
74
     })
86
     })
83
       pathname: '/activity/ActivityList',
95
       pathname: '/activity/ActivityList',
84
     });
96
     });
85
   }
97
   }
98
+    // 提交事件
99
+// eslint-disable-next-line no-shadow
100
+const handleSubmit = (e, props) => {
101
+    e.preventDefault();
102
+    props.form.validateFields((err, values) => {
103
+      getSignList({ pageNum: 1, pageSize: 10, dynamicId: props.location.query.dynamicId, isCheckin: values.isCheckin, name: values.name, phone: values.phone })
104
+    });
105
+  }
106
+   // 重置搜索
107
+   function handleReset() {
108
+    props.form.resetFields();
109
+    getSignList({ pageNum: 1, pageSize: 10, dynamicId: props.location.query.dynamicId })
110
+  }
111
+ // eslint-disable-next-line class-methods-use-this
112
+ function exportHelp() {
113
+  const fieldsValue = getFieldsValue()
114
+  console.log('fieldsValue', fieldsValue)
115
+    request({ ...apis.activity.getTaActivityDynamicEnlistExport, params: { ...fieldsValue, dynamicId: props.location.query.dynamicId } })
116
+      .then(data => {
117
+        if (!data) {
118
+          return
119
+        }
120
+        const url = window.URL.createObjectURL(new Blob([data]))
121
+        const link = document.createElement('a')
122
+        link.style.display = 'none'
123
+        link.href = url
124
+        link.setAttribute('download', '助力者记录.xlsx')
125
+        document.body.append(link)
126
+        link.click()
127
+      }).catch(() => {
128
+
129
+      })
130
+  }
86
 
131
 
87
   return (
132
   return (
88
     <>
133
     <>
134
+    <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
135
+        <Form.Item>
136
+          {getFieldDecorator('isCheckin')(
137
+            <Select style={{ width: '180px' }} placeholder="签到状态">
138
+              <Option value="0">未签到</Option>
139
+              <Option value="1">已签到</Option>
140
+            </Select>,
141
+          )}
142
+        </Form.Item>
143
+        <Form.Item>
144
+          {getFieldDecorator('name')(
145
+            <Input
146
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
147
+              placeholder="用户姓名"
148
+            />,
149
+          )}
150
+        </Form.Item>
151
+        <Form.Item>
152
+          {getFieldDecorator('phone')(
153
+            <Input
154
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
155
+              placeholder="手机号"
156
+            />,
157
+          )}
158
+        </Form.Item>
159
+        <Form.Item>
160
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
161
+            搜索
162
+          </Button>
163
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
164
+              重置
165
+            </Button>
166
+        </Form.Item>
167
+      </Form>
89
       <Button type="primary" className={styles.addBtn} onClick={toActivityList}>返回</Button>
168
       <Button type="primary" className={styles.addBtn} onClick={toActivityList}>返回</Button>
169
+      <Button type="primary" style={{ marginLeft: '85%' }} onClick={exportHelp}>导出</Button>
90
       <Table dataSource={data.list.data} columns={columns} pagination={false} rowKey="activity"/>
170
       <Table dataSource={data.list.data} columns={columns} pagination={false} rowKey="activity"/>
91
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
171
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
92
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
172
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />

+ 1
- 1
src/pages/activity/groupActivity/editGroupActivity.jsx Wyświetl plik

140
       submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
140
       submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
141
       console.log('submit data --->', submitValue)
141
       console.log('submit data --->', submitValue)
142
       if (groupActivityId) {
142
       if (groupActivityId) {
143
-        submitValue.groupActicityId = groupActivityId
143
+        submitValue.groupActivityId = groupActivityId
144
         request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
144
         request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
145
           message.info("保存成功")
145
           message.info("保存成功")
146
           cancelPage()
146
           cancelPage()

+ 0
- 1
src/pages/activity/groupActivity/helpRecord.jsx Wyświetl plik

32
 
32
 
33
   componentDidUpdate (preProps, preState) {
33
   componentDidUpdate (preProps, preState) {
34
     const { groupActivityId } = this.props.visibleData
34
     const { groupActivityId } = this.props.visibleData
35
-    console.log("groupActivityId",this.props.visibleData);
36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
       this.getList({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })
36
       this.getList({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })
38
       this.setState({ visibleData: this.props.visibleData });
37
       this.setState({ visibleData: this.props.visibleData });

+ 6
- 6
src/pages/activity/groupActivity/list.jsx Wyświetl plik

101
           {row.activityStatus === 0 &&
101
           {row.activityStatus === 0 &&
102
           <AuthButton name="admin.SignList.get" noRight={null}>
102
           <AuthButton name="admin.SignList.get" noRight={null}>
103
         
103
         
104
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActicityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
104
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
105
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
105
             <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
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>
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
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
107
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
109
 
109
 
110
           {row.activityStatus === 1 &&
110
           {row.activityStatus === 1 &&
111
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
111
            <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
112
-                      <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditActivity(row.groupActicityId)}>编辑<Icon type="form" className={styles.edit} /></span>
112
+                      <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditActivity(row.groupActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
113
                       <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
113
                       <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
114
                       <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>
114
                       <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>
115
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
115
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
118
 
118
 
119
           {row.activityStatus === 2 &&
119
           {row.activityStatus === 2 &&
120
         <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
120
         <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
121
-           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActicityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
121
+           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
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>
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
             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
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
         </AuthButton>
124
         </AuthButton>
156
   
156
   
157
   //结束活动
157
   //结束活动
158
   const endGroupActivity = (row) => () => {
158
   const endGroupActivity = (row) => () => {
159
-      request({ ...apis.groupActivity.finish, urlData: { id: row.groupActicityId} }).then((data) => {
159
+      request({ ...apis.groupActivity.finish, urlData: { id: row.groupActivityId} }).then((data) => {
160
           console.log(data)
160
           console.log(data)
161
           message.info('操作成功!')
161
           message.info('操作成功!')
162
           getList({ pageNum: 1, pageSize: 10 })
162
           getList({ pageNum: 1, pageSize: 10 })
168
 
168
 
169
   //置顶
169
   //置顶
170
   const topGroupActivity = (row, weight) => () => {
170
   const topGroupActivity = (row, weight) => () => {
171
-    request({ ...apis.groupActivity.top, data: { groupActicityId: row.groupActicityId, weight: weight } }).then((data) => {
171
+    request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, weight: weight } }).then((data) => {
172
         console.log(data)
172
         console.log(data)
173
         message.info('操作成功!')
173
         message.info('操作成功!')
174
         getList({ pageNum: 1, pageSize: 10 })
174
         getList({ pageNum: 1, pageSize: 10 })
180
 
180
 
181
   //首页推荐
181
   //首页推荐
182
   const recommendGroupActivity = (row, code) => () => {
182
   const recommendGroupActivity = (row, code) => () => {
183
-    request({ ...apis.groupActivity.top, data: { groupActicityId: row.groupActicityId, sort: row.sort } }).then((data) => {
183
+    request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, sort: row.sort } }).then((data) => {
184
         console.log(data)
184
         console.log(data)
185
         message.info('操作成功!')
185
         message.info('操作成功!')
186
         getList({ pageNum: 1, pageSize: 10 })
186
         getList({ pageNum: 1, pageSize: 10 })

+ 0
- 1
src/pages/activity/helpActivity/helpRecord.jsx Wyświetl plik

68
 
68
 
69
   // eslint-disable-next-line class-methods-use-this
69
   // eslint-disable-next-line class-methods-use-this
70
   exportHelp() {
70
   exportHelp() {
71
-    console.log('this.state.25252464122', this.state.visibleData)
72
     request({ ...apis.helpActivity.gethelpRecordExport, responseType: 'blob', params: { helpRecordInitiateId: this.state.visibleData.helpId } })
71
     request({ ...apis.helpActivity.gethelpRecordExport, responseType: 'blob', params: { helpRecordInitiateId: this.state.visibleData.helpId } })
73
       .then(data => {
72
       .then(data => {
74
         if (!data) {
73
         if (!data) {

+ 5
- 0
src/services/apis.js Wyświetl plik

436
         method: 'GET',
436
         method: 'GET',
437
         action: 'admin.SignList.get',
437
         action: 'admin.SignList.get',
438
       },
438
       },
439
+      getTaActivityDynamicEnlistExport: {
440
+        url: `${prefix}/activityDynamicEnlist/export`,
441
+        method: 'GET',
442
+        action: 'admin.SignList.get',
443
+      },
439
       taDrainage: {
444
       taDrainage: {
440
         url: `${prefix}/taDrainage`,
445
         url: `${prefix}/taDrainage`,
441
         method: 'GET',
446
         method: 'GET',