瀏覽代碼

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

魏熙美 5 年之前
父節點
當前提交
86b2073dac

+ 87
- 7
src/pages/activity/SignList.jsx 查看文件

@@ -41,7 +41,7 @@ const columns = [
41 41
     dataIndex: 'createDate',
42 42
     key: 'createDate',
43 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 47
     title: '推广人',
@@ -55,20 +55,32 @@ const columns = [
55 55
     key: 'orgName',
56 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 71
 //   const [page, changePage] = useState({})
72
+// 存入导入数据的值
73
+const { getFieldDecorator, getFieldsValue } = props.form
74
+  // eslint-disable-next-line react-hooks/rules-of-hooks
65 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 84
         console.log(data)
73 85
         setData(data)
74 86
     })
@@ -83,10 +95,78 @@ const header = (props) => {
83 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 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 168
       <Button type="primary" className={styles.addBtn} onClick={toActivityList}>返回</Button>
169
+      <Button type="primary" style={{ marginLeft: '85%' }} onClick={exportHelp}>导出</Button>
90 170
       <Table dataSource={data.list.data} columns={columns} pagination={false} rowKey="activity"/>
91 171
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
92 172
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />

+ 1
- 1
src/pages/activity/groupActivity/editGroupActivity.jsx 查看文件

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

+ 0
- 1
src/pages/activity/groupActivity/helpRecord.jsx 查看文件

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

+ 6
- 6
src/pages/activity/groupActivity/list.jsx 查看文件

@@ -101,7 +101,7 @@ const toEditActivity = (groupActivityId) => () => {
101 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.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 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>
@@ -109,7 +109,7 @@ const toEditActivity = (groupActivityId) => () => {
109 109
 
110 110
           {row.activityStatus === 1 &&
111 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 113
                       <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
114 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 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,7 +118,7 @@ const toEditActivity = (groupActivityId) => () => {
118 118
 
119 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.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 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>
@@ -156,7 +156,7 @@ const toEditActivity = (groupActivityId) => () => {
156 156
   
157 157
   //结束活动
158 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 160
           console.log(data)
161 161
           message.info('操作成功!')
162 162
           getList({ pageNum: 1, pageSize: 10 })
@@ -168,7 +168,7 @@ const toEditActivity = (groupActivityId) => () => {
168 168
 
169 169
   //置顶
170 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 172
         console.log(data)
173 173
         message.info('操作成功!')
174 174
         getList({ pageNum: 1, pageSize: 10 })
@@ -180,7 +180,7 @@ const toEditActivity = (groupActivityId) => () => {
180 180
 
181 181
   //首页推荐
182 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 184
         console.log(data)
185 185
         message.info('操作成功!')
186 186
         getList({ pageNum: 1, pageSize: 10 })

+ 0
- 1
src/pages/activity/helpActivity/helpRecord.jsx 查看文件

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

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

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