dingxin hace 5 años
padre
commit
337dea2410

+ 0
- 2
src/store/modules/activity.js Ver fichero

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

+ 7
- 2
src/views/activity/add.vue Ver fichero

@@ -26,9 +26,14 @@
26 26
       <el-input v-model="activityQuery.title"></el-input>
27 27
     </el-form-item>
28 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 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 37
     </el-form-item>
33 38
     <el-form-item label="活动地点">
34 39
       <el-input  v-model="activityQuery.address"></el-input>

+ 3
- 1
src/views/activity/edit.vue Ver fichero

@@ -80,7 +80,7 @@ export default {
80 80
        endDate:'',
81 81
        buildingId:'',
82 82
        title:'',
83
-       isEnlist:'1',
83
+       isEnlist:'',
84 84
        text:'',
85 85
        enlistStart:'',
86 86
        enlistEnd:'',
@@ -184,6 +184,8 @@ export default {
184 184
         this.activityQuery.address = data.address
185 185
         this.activityQuery.personNum = data.personNum
186 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 Ver fichero

@@ -30,7 +30,7 @@
30 30
       prop="tel"
31 31
       label="活动时间">
32 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 34
       </template>
35 35
     </el-table-column>
36 36
     <el-table-column
@@ -55,7 +55,9 @@
55 55
     </el-table-column>
56 56
     <el-table-column   label="状态">
57 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 61
       </template>
60 62
     </el-table-column>
61 63
     <el-table-column
@@ -63,9 +65,9 @@
63 65
       label="操作">
64 66
       <template slot-scope="scope">
65 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 71
         <el-button type="text" @click="top(scope.row.dynamicId)" size="small">置顶</el-button>
70 72
       </template>
71 73
     </el-table-column>
@@ -84,6 +86,7 @@
84 86
 </template>
85 87
 
86 88
 <script>
89
+import dayjs from 'dayjs'
87 90
 import { createNamespacedHelpers } from "vuex";
88 91
 const { mapState: mapBuildingState, mapActions: mapBuildingActions } = createNamespacedHelpers('building')
89 92
 const { mapActions: mapActivity } = createNamespacedHelpers("activity");
@@ -142,18 +145,21 @@ export default {
142 145
       this.filterData.dynamicId = id
143 146
           this.finishActivity(
144 147
           JSON.stringify(this.filterData)
145
-        ) 
146
-          this.getList();
148
+        ).then((res) => {
149
+           this.getList();
147 150
           this.getBuildList()   
151
+        })
152
+       
148 153
     },
149 154
     top(id){
150 155
           this.filterData.dynamicId = id
151 156
           this.filterData.top = 1
152 157
           this.finishActivity(
153 158
           JSON.stringify(this.filterData)
154
-        ) 
155
-          this.getList();
159
+        ).then((res) => {
160
+           this.getList();
156 161
           this.getBuildList()   
162
+        })  
157 163
     },
158 164
     addDynamic() {
159 165
       this.$router.push({ name: "activity-add" });
@@ -179,7 +185,10 @@ export default {
179 185
     },
180 186
     getSignList(id){
181 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 193
   created() {
185 194
     this.pageNavi.current = this.$route.query.page || 1;

+ 8
- 1
src/views/activity/signList.vue Ver fichero

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