dingxin 5 年之前
父節點
當前提交
337dea2410

+ 0
- 2
src/store/modules/activity.js 查看文件

67
           ...apis.activity.finishActivity,
67
           ...apis.activity.finishActivity,
68
           data: payload,
68
           data: payload,
69
         }).then((data) => {
69
         }).then((data) => {
70
-          window.console.log(data)
71
-          commit('updateList', { ...data, list: data.records})
72
           resolve(data)
70
           resolve(data)
73
         }).catch(({ message }) => {
71
         }).catch(({ message }) => {
74
           if (typeof message === 'string') {
72
           if (typeof message === 'string') {

+ 7
- 2
src/views/activity/add.vue 查看文件

26
       <el-input v-model="activityQuery.title"></el-input>
26
       <el-input v-model="activityQuery.title"></el-input>
27
     </el-form-item>
27
     </el-form-item>
28
     <el-form-item label="活动时间">
28
     <el-form-item label="活动时间">
29
-       <el-date-picker v-model="activityQuery.startDate" type="date" placeholder="选择日期"/>
29
+       <el-date-picker v-model="activityQuery.startDate"  type="datetime" placeholder="选择日期"/>
30
+       <!-- <el-date-picker
31
+                  v-model="detail.reportDate"
32
+                  type="datetime"
33
+                  placeholder="选择日期时间">
34
+          </el-date-picker> -->
30
         <span>-</span>
35
         <span>-</span>
31
-       <el-date-picker v-model="activityQuery.endDate" type="date" placeholder="选择日期"/>   
36
+       <el-date-picker v-model="activityQuery.endDate"  type="datetime" placeholder="选择日期"/>   
32
     </el-form-item>
37
     </el-form-item>
33
     <el-form-item label="活动地点">
38
     <el-form-item label="活动地点">
34
       <el-input  v-model="activityQuery.address"></el-input>
39
       <el-input  v-model="activityQuery.address"></el-input>

+ 3
- 1
src/views/activity/edit.vue 查看文件

80
        endDate:'',
80
        endDate:'',
81
        buildingId:'',
81
        buildingId:'',
82
        title:'',
82
        title:'',
83
-       isEnlist:'1',
83
+       isEnlist:'',
84
        text:'',
84
        text:'',
85
        enlistStart:'',
85
        enlistStart:'',
86
        enlistEnd:'',
86
        enlistEnd:'',
184
         this.activityQuery.address = data.address
184
         this.activityQuery.address = data.address
185
         this.activityQuery.personNum = data.personNum
185
         this.activityQuery.personNum = data.personNum
186
         this.imageUrl = data.url
186
         this.imageUrl = data.url
187
+        this.activityQuery.isEnlist = data.isEnlist
188
+        
187
        
189
        
188
         })
190
         })
189
     }
191
     }

+ 19
- 10
src/views/activity/list.vue 查看文件

30
       prop="tel"
30
       prop="tel"
31
       label="活动时间">
31
       label="活动时间">
32
      <template slot-scope="scope">
32
      <template slot-scope="scope">
33
-        <span>{{scope.row.startDate}} ~ {{scope.row.startDate}}</span>
33
+        <span>{{ formateDate(scope.row.startDate)}} ~ {{ formateDate(scope.row.startDate)}}</span>
34
       </template>
34
       </template>
35
     </el-table-column>
35
     </el-table-column>
36
     <el-table-column
36
     <el-table-column
55
     </el-table-column>
55
     </el-table-column>
56
     <el-table-column   label="状态">
56
     <el-table-column   label="状态">
57
       <template slot-scope="scope">
57
       <template slot-scope="scope">
58
-        <span :style="{color:(scope.row.status == 1?'':'red')}" >{{scope.row.status == 1 ? '启用' : '禁用'}}</span>
58
+      <span v-if="scope.row.isEnlist == '0'">未开始</span>
59
+      <span v-if="scope.row.isEnlist == '1'">进行中</span>
60
+      <span v-if="scope.row.isEnlist == '2'">已结束</span>
59
       </template>
61
       </template>
60
     </el-table-column>
62
     </el-table-column>
61
     <el-table-column
63
     <el-table-column
63
       label="操作">
65
       label="操作">
64
       <template slot-scope="scope">
66
       <template slot-scope="scope">
65
         <!-- <el-button type="text" @click="toDetail(scope.row)" size="small">{{scope.row.status == 1?'停用':'启用'}}</el-button> -->
67
         <!-- <el-button type="text" @click="toDetail(scope.row)" size="small">{{scope.row.status == 1?'停用':'启用'}}</el-button> -->
66
-         <el-button type="text" @click="getSignList(scope.row.dynamicId)" size="small">报名记录</el-button>
67
-        <el-button type="text" @click="toDetail(scope.row.dynamicId)" size="small">编辑</el-button>
68
-        <el-button type="text" @click="finish(scope.row.dynamicId)" size="small">结束活动</el-button>
68
+         <el-button type="text" @click="getSignList(scope.row.dynamicId)" size="small" v-if="scope.row.isEnlist == '1' || scope.row.isEnlist === '2'">报名记录</el-button>
69
+         <el-button type="text" @click="toDetail(scope.row.dynamicId)" size="small" v-if="scope.row.isEnlist == '0'">编辑</el-button>
70
+        <el-button type="text" @click="finish(scope.row.dynamicId)" size="small" v-if="scope.row.isEnlist == '1'">结束活动</el-button>
69
         <el-button type="text" @click="top(scope.row.dynamicId)" size="small">置顶</el-button>
71
         <el-button type="text" @click="top(scope.row.dynamicId)" size="small">置顶</el-button>
70
       </template>
72
       </template>
71
     </el-table-column>
73
     </el-table-column>
84
 </template>
86
 </template>
85
 
87
 
86
 <script>
88
 <script>
89
+import dayjs from 'dayjs'
87
 import { createNamespacedHelpers } from "vuex";
90
 import { createNamespacedHelpers } from "vuex";
88
 const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
91
 const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
89
 const { mapActions: mapActivity } = createNamespacedHelpers("activity");
92
 const { mapActions: mapActivity } = createNamespacedHelpers("activity");
142
       this.filterData.dynamicId = id
145
       this.filterData.dynamicId = id
143
           this.finishActivity(
146
           this.finishActivity(
144
           JSON.stringify(this.filterData)
147
           JSON.stringify(this.filterData)
145
-        ) 
146
-          this.getList();
148
+        ).then((res) => {
149
+           this.getList();
147
           this.getBuildList()   
150
           this.getBuildList()   
151
+        })
152
+       
148
     },
153
     },
149
     top(id){
154
     top(id){
150
           this.filterData.dynamicId = id
155
           this.filterData.dynamicId = id
151
           this.filterData.top = 1
156
           this.filterData.top = 1
152
           this.finishActivity(
157
           this.finishActivity(
153
           JSON.stringify(this.filterData)
158
           JSON.stringify(this.filterData)
154
-        ) 
155
-          this.getList();
159
+        ).then((res) => {
160
+           this.getList();
156
           this.getBuildList()   
161
           this.getBuildList()   
162
+        })  
157
     },
163
     },
158
     addDynamic() {
164
     addDynamic() {
159
       this.$router.push({ name: "activity-add" });
165
       this.$router.push({ name: "activity-add" });
179
     },
185
     },
180
     getSignList(id){
186
     getSignList(id){
181
       this.$router.push({ name: "activity-signList",query: { id } }); 
187
       this.$router.push({ name: "activity-signList",query: { id } }); 
182
-    }
188
+    },
189
+    formateDate(dt) {
190
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
191
+    },
183
   },
192
   },
184
   created() {
193
   created() {
185
     this.pageNavi.current = this.$route.query.page || 1;
194
     this.pageNavi.current = this.$route.query.page || 1;

+ 8
- 1
src/views/activity/signList.vue 查看文件

22
     <el-table-column
22
     <el-table-column
23
       prop="createDate"
23
       prop="createDate"
24
       label="报名时间">
24
       label="报名时间">
25
+      <template slot-scope="scope">
26
+        <span>{{ formateDate(scope.row.createDate)}}</span>
27
+      </template>
25
     </el-table-column>
28
     </el-table-column>
26
   </el-table>
29
   </el-table>
27
   <el-pagination
30
   <el-pagination
37
 </template>
40
 </template>
38
 
41
 
39
 <script>
42
 <script>
43
+import dayjs from 'dayjs'
40
 import { createNamespacedHelpers } from "vuex";
44
 import { createNamespacedHelpers } from "vuex";
41
 const { mapActions: mapActivity } = createNamespacedHelpers("activity");
45
 const { mapActions: mapActivity } = createNamespacedHelpers("activity");
42
 
46
 
77
     },
81
     },
78
     getPageList(){
82
     getPageList(){
79
        this.getList();
83
        this.getList();
80
-    }
84
+    },
85
+    formateDate(dt) {
86
+      return !dt ? '' : dayjs(dt).format('YYYY-MM-DD HH:mm')
87
+    },
81
   },
88
   },
82
   created() {
89
   created() {
83
     this.filterData.dynamicId = this.$route.query.id
90
     this.filterData.dynamicId = this.$route.query.id