Przeglądaj źródła

查询 活动报名人

weiximei 6 lat temu
rodzic
commit
d87638d89e
16 zmienionych plików z 574 dodań i 14 usunięć
  1. 20
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java
  2. 27
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpActivitySignUpMapper.java
  3. 55
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpActivitySignUp.java
  4. 24
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpActivitySignUpService.java
  5. 3
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  6. 102
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivitySignUpServiceImpl.java
  7. 21
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/vo/ActivitySignUpVO.java
  8. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TpActivitySignUpMapper.xml
  9. 14
    2
      VUECODE/smart-property-manage/src/api/activity.js
  10. 7
    0
      VUECODE/smart-property-manage/src/router/index.js
  11. 10
    1
      VUECODE/smart-property-manage/src/store/modules/activity.js
  12. 1
    0
      VUECODE/smart-property-manage/src/views/social/activity/add/index.vue
  13. 1
    0
      VUECODE/smart-property-manage/src/views/social/activity/edi/index.vue
  14. 29
    2
      VUECODE/smart-property-manage/src/views/social/activity/index.vue
  15. 60
    9
      VUECODE/smart-property-manage/src/views/social/activity/info/index.vue
  16. 195
    0
      VUECODE/smart-property-manage/src/views/social/signUp/index.vue

+ 20
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/ActivityController.java Wyświetl plik

@@ -5,6 +5,7 @@ import com.community.commom.mode.ResponseBean;
5 5
 import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.common.base.BaseController;
7 7
 import com.community.huiju.service.ITpActivityService;
8
+import com.community.huiju.service.ITpActivitySignUpService;
8 9
 import io.swagger.annotations.Api;
9 10
 import io.swagger.annotations.ApiImplicitParam;
10 11
 import io.swagger.annotations.ApiImplicitParams;
@@ -33,6 +34,9 @@ public class ActivityController extends BaseController {
33 34
     @Autowired
34 35
     private ITpActivityService iTpActivityService;
35 36
 
37
+    @Autowired
38
+    private ITpActivitySignUpService iTpActivitySignUpService;
39
+
36 40
     @ApiOperation(value = "查询活动列表数据", notes = "根据条件查询活动列表")
37 41
     @ApiImplicitParams({
38 42
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
@@ -109,4 +113,20 @@ public class ActivityController extends BaseController {
109 113
         return responseBean;
110 114
     }
111 115
 
116
+    @ApiOperation(value = "查询 活动报名人", notes = "查询 活动报名人")
117
+    @ApiImplicitParams({
118
+//            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
119
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
120
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "活动id"),
121
+            @ApiImplicitParam(paramType = "body", dataTypeClass = Integer.class, name = "parameter", value = "userName用户名;phone手机号;pageNum第一页;pageSize一页多少行"),
122
+    })
123
+    @RequestMapping(value = "/signUp", method = RequestMethod.GET)
124
+    public ResponseBean getSignUp(@RequestBody String parameter,
125
+                                  HttpSession session) {
126
+
127
+        ResponseBean responseBean = new ResponseBean();
128
+        responseBean = iTpActivitySignUpService.getSignUpUser(parameter);
129
+        return responseBean;
130
+    }
131
+
112 132
 }

+ 27
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpActivitySignUpMapper.java Wyświetl plik

@@ -0,0 +1,27 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.community.huiju.model.TpActivitySignUp;
7
+import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+import org.apache.ibatis.annotations.Select;
10
+
11
+import java.util.List;
12
+
13
+/**
14
+ * <p>
15
+ * 物业web端活动报名表 Mapper 接口
16
+ * </p>
17
+ *
18
+ * @author weiximei
19
+ * @since 2019-01-03
20
+ */
21
+@Mapper
22
+public interface TpActivitySignUpMapper extends BaseMapper<TpActivitySignUp> {
23
+
24
+    @Select("SELECT tas.* FROM tp_activity_sign_up tas LEFT JOIN ta_user tau on tas.ta_user_id = tau.id where tau.user_name like concat('%',#{userName,jdbcType=VARCHAR},'%') and tau.login_name LIKE concat('%',#{phone,jdbcType=VARCHAR},'%')")
25
+    IPage<TpActivitySignUp> listQuery(Page page, @Param("userName") String userName, @Param("phone") String phone);
26
+
27
+}

+ 55
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpActivitySignUp.java Wyświetl plik

@@ -0,0 +1,55 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.TableName;
4
+import lombok.Data;
5
+import lombok.EqualsAndHashCode;
6
+import lombok.experimental.Accessors;
7
+
8
+import java.io.Serializable;
9
+import java.time.LocalDateTime;
10
+
11
+/**
12
+ * <p>
13
+ * 物业web端活动报名表
14
+ * </p>
15
+ *
16
+ * @author weiximei
17
+ * @since 2019-01-03
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+@TableName("tp_activity_sign_up")
23
+public class TpActivitySignUp implements Serializable {
24
+
25
+    private static final long serialVersionUID = 1L;
26
+
27
+    private Integer id;
28
+
29
+    /**
30
+     * 小区id
31
+     */
32
+    private Integer communityId;
33
+
34
+    /**
35
+     * 活动id
36
+     */
37
+    private Integer activityId;
38
+
39
+    /**
40
+     * 住户用户id
41
+     */
42
+    private Integer taUserId;
43
+
44
+    /**
45
+     * 报名时间
46
+     */
47
+    private LocalDateTime signUpTime;
48
+
49
+    /**
50
+     * 备注
51
+     */
52
+    private String remark;
53
+
54
+
55
+}

+ 24
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpActivitySignUpService.java Wyświetl plik

@@ -0,0 +1,24 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.model.TpActivitySignUp;
6
+
7
+/**
8
+ * <p>
9
+ * 物业web端活动报名表 服务类
10
+ * </p>
11
+ *
12
+ * @author weiximei
13
+ * @since 2019-01-03
14
+ */
15
+public interface ITpActivitySignUpService extends IService<TpActivitySignUp> {
16
+
17
+    /**
18
+     * 查询 活动的报名人员
19
+     * @param parameter 参数
20
+     * @return
21
+     */
22
+    ResponseBean getSignUpUser(String parameter);
23
+
24
+}

+ 3
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java Wyświetl plik

@@ -114,6 +114,9 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
114 114
             return responseBean;
115 115
         }
116 116
 
117
+        // 活动报名人数默认为 0
118
+        tpActivity.setSignUpCount(0);
119
+        tpActivity.setViewCount(0);
117 120
         tpActivity.setCommunityId(userElement.getCommunityId());
118 121
         tpActivity.setUpdateDate(LocalDateTime.now());
119 122
         tpActivity.setUpdateUser(userElement.getId());

+ 102
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivitySignUpServiceImpl.java Wyświetl plik

@@ -0,0 +1,102 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
+import com.baomidou.mybatisplus.core.metadata.IPage;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
+import com.community.commom.mode.ResponseBean;
9
+import com.community.commom.utils.BeanTools;
10
+import com.community.huiju.dao.*;
11
+import com.community.huiju.model.*;
12
+import com.community.huiju.service.ITpActivitySignUpService;
13
+import com.community.huiju.vo.ActivitySignUpVO;
14
+import com.google.common.collect.Maps;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.stereotype.Service;
17
+
18
+import java.util.List;
19
+import java.util.Map;
20
+import java.util.stream.Collectors;
21
+
22
+/**
23
+ * <p>
24
+ * 物业web端活动报名表 服务实现类
25
+ * </p>
26
+ *
27
+ * @author weiximei
28
+ * @since 2019-01-03
29
+ */
30
+@Service
31
+public class TpActivitySignUpServiceImpl extends ServiceImpl<TpActivitySignUpMapper, TpActivitySignUp> implements ITpActivitySignUpService {
32
+
33
+    @Autowired
34
+    private TpActivityMapper tpActivityMapper;
35
+
36
+    @Autowired
37
+    private TpActivitySignUpMapper tpActivitySignUpMapper;
38
+
39
+    @Autowired
40
+    private TaUserMapper taUserMapper;
41
+
42
+    @Autowired
43
+    private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
44
+
45
+    @Autowired
46
+    private TaSysRoleMapper taSysRoleMapper;
47
+
48
+
49
+
50
+    @Override
51
+    public ResponseBean getSignUpUser(String parameter) {
52
+        ResponseBean responseBean = new ResponseBean();
53
+
54
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
55
+        Integer activityId = jsonObject.getInteger("id");
56
+        Integer pageNum = jsonObject.getInteger("pageNum");
57
+        Integer pageSize = jsonObject.getInteger("pageSize");
58
+        String userName = jsonObject.getString("userName");
59
+        String phone = jsonObject.getString("userName");
60
+
61
+        TpActivity tpActivity = tpActivityMapper.selectById(activityId);
62
+        if (null == tpActivity) {
63
+            responseBean.addError("活动不存在!");
64
+            return responseBean;
65
+        }
66
+
67
+        Page<TpActivitySignUp> page = new Page<>();
68
+        page.setCurrent(null == pageNum ? 0 : pageNum);
69
+        page.setSize(null == pageSize ? 10 : pageSize);
70
+        page.setDesc("sign_up_time");
71
+
72
+        IPage<TpActivitySignUp> signUpIPage = tpActivitySignUpMapper.listQuery(page, userName, phone);
73
+
74
+        List<TpActivitySignUp> tpActivitySignUpList = signUpIPage.getRecords();
75
+        // 数据包装填充
76
+        List<ActivitySignUpVO> activitySignUpVOS = tpActivitySignUpList.stream().map(e->{
77
+            ActivitySignUpVO activitySignUpVO = new ActivitySignUpVO();
78
+            BeanTools.copyProperties(e, activitySignUpVO);
79
+
80
+            TaUser taUser = taUserMapper.selectByPrimaryKey(e.getTaUserId());
81
+            TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getTaUserId());
82
+            TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(taUser.getBuildingOwnerInfoId());
83
+
84
+            activitySignUpVO.setUserName(taUser.getUserName());
85
+            activitySignUpVO.setPhone(taUser.getLoginName());
86
+            activitySignUpVO.setRoleName(taSysRole.getRoleName());
87
+            activitySignUpVO.setAddress(tpBuildingOwnerInfo.getPhase() + tpBuildingOwnerInfo.getBuilding()
88
+                    + tpBuildingOwnerInfo.getUnit() + tpBuildingOwnerInfo.getLevel() + tpBuildingOwnerInfo.getRoomNo());
89
+
90
+            return activitySignUpVO;
91
+        }).collect(Collectors.toList());
92
+
93
+        Map<String, Object> map = Maps.newHashMap();
94
+        map.put("list", activitySignUpVOS);
95
+        map.put("total", signUpIPage.getTotal());
96
+        map.put("pageNum", signUpIPage.getCurrent());
97
+        map.put("pageSize", signUpIPage.getSize());
98
+
99
+        responseBean.addSuccess(map);
100
+        return responseBean;
101
+    }
102
+}

+ 21
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/vo/ActivitySignUpVO.java Wyświetl plik

@@ -0,0 +1,21 @@
1
+package com.community.huiju.vo;
2
+
3
+import com.community.huiju.model.TpActivitySignUp;
4
+import lombok.Data;
5
+
6
+@Data
7
+public class ActivitySignUpVO extends TpActivitySignUp {
8
+
9
+    /** 用户姓名 **/
10
+    private String userName;
11
+
12
+    /** 角色名称 **/
13
+    private String roleName;
14
+
15
+    /** 住址 **/
16
+    private String address;
17
+
18
+    /** 联系方式 **/
19
+    private String phone;
20
+
21
+}

+ 5
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TpActivitySignUpMapper.xml Wyświetl plik

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.community.huiju.dao.TpActivitySignUpMapper">
4
+
5
+</mapper>

+ 14
- 2
VUECODE/smart-property-manage/src/api/activity.js Wyświetl plik

@@ -64,9 +64,21 @@ export function invalidActivity(data) {
64 64
   return request({
65 65
     url: '/activity/invalid',
66 66
     method: 'put',
67
+    data
68
+  })
69
+}
70
+
71
+// 查询活动报名人
72
+export function getSignUp(data) {
73
+  return request({
74
+    url: '/signUp',
75
+    method: 'get',
67 76
     data: {
68
-      ids: data
77
+      id: data.id,
78
+      userName: data.userName,
79
+      phone: data.phone,
80
+      pageNum: data.userName,
81
+      pageSize: data.pageSize
69 82
     }
70 83
   })
71 84
 }
72
-

+ 7
- 0
VUECODE/smart-property-manage/src/router/index.js Wyświetl plik

@@ -143,6 +143,13 @@ export const constantRouterMap = [
143 143
         name: 'announcement-add',
144 144
         hidden: true,
145 145
         meta: { title: '添加公告', icon: 'table' }
146
+      },
147
+      {
148
+        path: '/signUp/info',
149
+        component: () => import('@/views/social/signUp/index'),
150
+        name: 'signUp-info',
151
+        hidden: true,
152
+        meta: { title: '活动报名人', icon: 'table' }
146 153
       }
147 154
     ]
148 155
   },

+ 10
- 1
VUECODE/smart-property-manage/src/store/modules/activity.js Wyświetl plik

@@ -1,4 +1,4 @@
1
-import { activityList, addActivity, updateActivity, activityById, invalidActivity  } from '@/api/activity'
1
+import { activityList, addActivity, updateActivity, activityById, invalidActivity, getSignUp } from '@/api/activity'
2 2
 
3 3
 const activityInfo = {
4 4
   state: {
@@ -50,6 +50,15 @@ const activityInfo = {
50 50
           reject(error)
51 51
         })
52 52
       })
53
+    },
54
+    GetSignUp({ commit, state }, data) { // 查询 活动报名人员
55
+      return new Promise((resolve, reject) => {
56
+        getSignUp(data).then(response => {
57
+          resolve(response)
58
+        }).catch(error => {
59
+          reject(error)
60
+        })
61
+      })
53 62
     }
54 63
 
55 64
   }

+ 1
- 0
VUECODE/smart-property-manage/src/views/social/activity/add/index.vue Wyświetl plik

@@ -169,6 +169,7 @@ export default {
169 169
       })
170 170
       if (this.ruleForm.activityContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
171 171
         this.$message.error('活动内容描述 和 活动配图至少要存在一个!')
172
+        loading.close()
172 173
         return false
173 174
       }
174 175
       this.ruleForm.status = status // 发布状态  1 是已发布   2 是草稿

+ 1
- 0
VUECODE/smart-property-manage/src/views/social/activity/edi/index.vue Wyświetl plik

@@ -120,6 +120,7 @@ export default {
120 120
         if (valid) {
121 121
           if (this.ruleForm.activityContent.length <= 0 && this.ruleForm.contentImg.length <= 0) {
122 122
             this.$message.error('活动内容描述 和 活动配图至少要存在一个!')
123
+            loading.close()
123 124
             return false
124 125
           }
125 126
           this.ruleForm.status = 1 // 发布状态

+ 29
- 2
VUECODE/smart-property-manage/src/views/social/activity/index.vue Wyświetl plik

@@ -19,7 +19,7 @@
19 19
     <div class="operation">
20 20
       <el-button type="primary" @click="addActivity">添加</el-button>
21 21
       <el-button type="warning" @click="ediActivity">修改</el-button>
22
-      <el-button type="danger" >作废</el-button>
22
+      <el-button type="danger" @click="invalidActivity">作废</el-button>
23 23
     </div>
24 24
     <el-table
25 25
       v-loading="listLoading"
@@ -57,7 +57,11 @@
57 57
       <el-table-column
58 58
         prop="signUpCount"
59 59
         label="已报名人数"
60
-        align="center"/>
60
+        align="center">
61
+        <template slot-scope="scope">
62
+          <span style="color: #409EFF;cursor: pointer" @click="selectSignUpActivity(scope.row.id)" >{{ scope.row.signUpCount }}</span>
63
+        </template>
64
+      </el-table-column>
61 65
       <el-table-column
62 66
         prop="status"
63 67
         label="状态"
@@ -219,6 +223,29 @@ export default {
219 223
     },
220 224
     infoActivity(id) { // 查看活动
221 225
       this.$router.push({ name: 'activity-info', params: { id: id }})
226
+    },
227
+    invalidActivity() { //  批量作废
228
+      const ids = this.deleteIds
229
+      if (ids < 1) {
230
+        this.$message.error('请选择一行数据进行修改!')
231
+        return
232
+      }
233
+      this.$store.dispatch('InvalidActivity', ids).then((res) => {
234
+        if (res.code === '0') {
235
+          this.$message({
236
+            message: res.message,
237
+            type: 'success'
238
+          })
239
+          this.activityList()
240
+          return
241
+        }
242
+        this.$message.error(res.message)
243
+      }).catch(() => {
244
+        console.log('error InvalidActivity')
245
+      })
246
+    },
247
+    selectSignUpActivity(id) {
248
+      this.$router.push({ name: 'signUp-info', params: { id: id }})
222 249
     }
223 250
   }
224 251
 }

+ 60
- 9
VUECODE/smart-property-manage/src/views/social/activity/info/index.vue Wyświetl plik

@@ -1,31 +1,76 @@
1 1
 <template>
2 2
   <div id="root">
3
-    <span class="activityTile">活动标题</span>
4
-    <img src="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/1543484412841.png" width="700" height="500">
3
+    <span class="activityTile">{{ ruleForm.activityTitle }}</span>
4
+    <img :src="ruleForm.activityCarouselImg" width="700" height="500">
5 5
     <div class="activityContext">
6
-      尊敬的业主/住户:
7
-      为丰富小区入住业主/住户的社区文化活动,增进各业主/住户间的联系,现物业服务中心特协调银城旗下分公司南京锦城佳业营销策划有限公司举办为期两个月的暑期露天电影节活动!详情请关注通知及各幢大堂的公告通知,下周六11月24日晚将进行第一场活动!更多细节敬请期待!
6
+      {{ ruleForm.activityContent }}
8 7
     </div>
9 8
     <div class="activityContextImg">
10
-      <img src="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/1543484412841.png" width="700" height="500">
11
-      <img src="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/1543484412841.png" width="700" height="500">
9
+      <img v-for="item in ruleForm.contentImg" :src="item" width="700" height="500" >
12 10
     </div>
13 11
     <div class="progress">
14 12
       <div class="text-progress">
15
-        <span class="people-number">已报名人数100</span>
13
+        <span class="people-number">已报名人数 {{ ruleForm.signUpCount }}</span>
16 14
         <div class="outer-layer"/>
17 15
         <div class="inner-layer"/>
18 16
       </div>
19 17
       <div class="circular"/>
20
-      <div class="people-limit">限制100人</div>
18
+      <div class="people-limit">限制{{ ruleForm.signUpMax }}人</div>
21 19
       <el-button type="primary" style="float: left;">查看报名名单</el-button>
22 20
     </div>
21
+    <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span>
22
+    <div class="bom-button">
23
+      <el-button type="primary" style="width: 100px;" @click="ediActivity">修改</el-button>
24
+    </div>
23 25
   </div>
24 26
 </template>
25 27
 
26 28
 <script>
27 29
 export default {
28
-  name: 'Index'
30
+  name: 'Index',
31
+  data() {
32
+    return {
33
+      asOfdate: '2018/10/10 23:59:59',
34
+      ruleForm: {
35
+        id: '',
36
+        activityTitle: '',
37
+        activityCarouselImg: '', // 轮播图
38
+        activityContent: '', // 活动内容详细
39
+        contentImg: [], // 活动内容配图
40
+        signUpCount: '', // 报名人数统计
41
+        signUpMax: '', //  活动人数上限
42
+        registrationEndTime: '', // 报名活动结束时间
43
+        sort: 1, // 权重
44
+        status: '' // 状态 0 是已作废 1 是已发布   2 是草稿 3 是已修改
45
+      }
46
+    }
47
+  },
48
+  mounted() {
49
+    this.getById(this.$route.params.id)
50
+  },
51
+  methods: {
52
+    getById(id) { // 根据ID获取活动信息
53
+      this.$store.dispatch('ActivityById', id).then((res) => {
54
+        const resData = res.data
55
+        this.ruleForm = resData.info
56
+        this.ruleForm.contentImg = resData.contentImg
57
+      })
58
+    },
59
+    formatDate(val) {
60
+      var value = new Date(val)
61
+      var year = value.getFullYear()
62
+      var month = value.getMonth() + 1
63
+      var day = value.getDate()
64
+      // var hour = value.getHours()
65
+      // var minutes = value.getMinutes()
66
+      // var seconds = value.getSeconds()
67
+      // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
68
+      return year + '-' + month + '-' + day
69
+    },
70
+    ediActivity() { // 修改活动
71
+      this.$router.push({ name: 'activity-edi', params: { id: this.ruleForm.id }})
72
+    }
73
+  }
29 74
 }
30 75
 </script>
31 76
 
@@ -94,4 +139,10 @@ export default {
94 139
 .people-limit {
95 140
   margin-top: 13px;
96 141
 }
142
+.bom-button{
143
+  display: flex;
144
+  justify-content: center;
145
+  margin-top: 20px;
146
+  margin-bottom: 100px;
147
+}
97 148
 </style>

+ 195
- 0
VUECODE/smart-property-manage/src/views/social/signUp/index.vue Wyświetl plik

@@ -0,0 +1,195 @@
1
+
2
+<template>
3
+  <div id="root">
4
+    <el-form :inline="true" :model="listQuery" class="form-inline">
5
+      <el-form-item label="报名人姓名">
6
+        <el-input v-model="listQuery.userName" placeholder="报名人姓名"/>
7
+      </el-form-item>
8
+      <el-form-item label="报名人手机号">
9
+        <el-input v-model="listQuery.phone" placeholder="报名人手机号"/>
10
+      </el-form-item>
11
+      <!--<el-form-item label="活动内容">-->
12
+      <!--<el-input v-model="formInline.user" placeholder="活动内容"/>-->
13
+      <!--</el-form-item>-->
14
+      <el-form-item>
15
+        <el-button type="info" @click="clearListQuery">清空</el-button>
16
+        <el-button type="primary" @click="onSubmit">查询</el-button>
17
+      </el-form-item>
18
+    </el-form>
19
+    <el-table
20
+      v-loading="listLoading"
21
+      ref="multipleTable"
22
+      :data="list"
23
+      tooltip-effect="dark"
24
+      style="width: 100%; margin-top: 20px;"
25
+      border
26
+      @selection-change="handleSelectionChange">
27
+      <el-table-column
28
+        type="selection"
29
+        align="center"/>
30
+      <el-table-column
31
+        label="编号"
32
+        align="center">
33
+        <template slot-scope="scope">{{ scope.row.id }}</template>
34
+      </el-table-column>
35
+      <el-table-column
36
+        prop="userName"
37
+        label="姓名"
38
+        align="center"/>
39
+      <el-table-column
40
+        prop="roleName"
41
+        label="角色"
42
+        show-overflow-tooltip
43
+        align="center">
44
+        <template slot-scope="scope">{{ getRoleName(scope.row.roleName) }}</template>
45
+      </el-table-column>
46
+      <el-table-column
47
+        prop="address"
48
+        label="房号"
49
+        align="center"/>
50
+      <el-table-column
51
+        prop="signUpTime"
52
+        label="报名时间"
53
+        align="center">
54
+        <template slot-scope="scope">{{ formatDate(scope.row.signUpTime) }}</template>
55
+      </el-table-column>
56
+      <el-table-column
57
+        prop="remark"
58
+        label="报名备注"
59
+        align="center">
60
+        <template slot-scope="scope">{{ scope.row.remark }}</template>
61
+      </el-table-column>
62
+      <el-table-column
63
+        prop="phone"
64
+        label="联系电话"
65
+        align="center"/>
66
+      <el-table-column
67
+        prop="id"
68
+        label="操作"
69
+        align="center">
70
+        <template slot-scope="scope">{{ '删除报名' }}</template>
71
+      </el-table-column>
72
+    </el-table>
73
+    <div class="block">
74
+      <el-pagination
75
+        :current-page.sync="listQuery.pageNum"
76
+        :page-sizes="[10, 20, 40, 100]"
77
+        :page-size.sync="listQuery.pageSize"
78
+        :total="total"
79
+        layout="total, sizes, prev, pager, next, jumper"
80
+        @size-change="handleSizeChange"
81
+        @current-change="handleCurrentChange"/>
82
+    </div>
83
+  </div>
84
+</template>
85
+<script>
86
+export default {
87
+  name: 'Index',
88
+  data() {
89
+    return {
90
+      listQuery: {
91
+        userName: '',
92
+        phone: '',
93
+        pageNum: 1,
94
+        pageSize: 10
95
+      },
96
+      total: 0, // 数据总数
97
+      list: [],
98
+      listLoading: true // 表格加载框
99
+    }
100
+  },
101
+  mounted() {
102
+    this.listQuery.id = this.$route.params.id
103
+    this.signUpList()
104
+  },
105
+  methods: {
106
+    onSubmit() {
107
+      this.listQuery.pageNum = 1
108
+      this.signUpList()
109
+    },
110
+    clearListQuery() {
111
+      this.listQuery.pageNum = 1
112
+      this.listQuery.pageSize = 10
113
+      this.listQuery.id = ''
114
+      this.listQuery.activityTitle = ''
115
+      this.signUpList()
116
+    },
117
+    handleSelectionChange(data) { // 表格选择
118
+      // 设置为 空
119
+      this.deleteIds = []
120
+      for (let i = 0; i < data.length; i++) {
121
+        this.deleteIds.push(data[i].id)
122
+      }
123
+    },
124
+    handleSizeChange(val) {
125
+      console.log(`每页 ${val} 条`)
126
+      this.listQuery.pageNum = 1
127
+      this.listQuery.pageSize = val
128
+      this.signUpList()
129
+    },
130
+    handleCurrentChange(val) {
131
+      console.log(`当前页: ${val}`)
132
+      this.listQuery.pageNum = val
133
+      this.signUpList()
134
+    },
135
+    signUpList() { // 查询列表
136
+      this.listLoading = true
137
+      this.$store.dispatch('GetSignUp', this.listQuery).then((res) => {
138
+        const resData = res.data
139
+        this.list = resData.list
140
+        this.listQuery.pageNum = resData.pageNum
141
+        this.listQuery.pageSize = resData.pageSize
142
+        this.total = resData.total
143
+        this.listLoading = false
144
+      }).catch(() => {
145
+        this.listLoading = false
146
+        console.log('error GetSignUp get')
147
+      })
148
+    },
149
+    formatDate(val) {
150
+      var value = new Date(val)
151
+      var year = value.getFullYear()
152
+      var month = value.getMonth() + 1
153
+      var day = value.getDate()
154
+      // var hour = value.getHours()
155
+      // var minutes = value.getMinutes()
156
+      // var seconds = value.getSeconds()
157
+      // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
158
+      return year + '-' + month + '-' + day
159
+    },
160
+    getRoleName(roleName) {
161
+      let role = ''
162
+      switch (roleName) {
163
+        case 'OWNER':
164
+          role = '业主'
165
+          break
166
+        case 'TENANT':
167
+          role = '租客'
168
+          break
169
+        case 'RELATION':
170
+          role = '家属'
171
+          break
172
+        default:
173
+          role = '未认证'
174
+      }
175
+      return role
176
+    }
177
+  }
178
+}
179
+</script>
180
+
181
+<style scoped>
182
+#root {
183
+  margin-top: 20px;
184
+}
185
+.form-inline{
186
+  margin-left: 20px;
187
+}
188
+.operation {
189
+  margin-left: 20px;
190
+}
191
+.block {
192
+  display: flex;
193
+  justify-content: flex-end;
194
+}
195
+</style>