Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/admin into dev

yuantianjiao 6 years ago
parent
commit
3fa2326fcb

+ 2
- 2
src/components/dashboardList/index.vue View File

@@ -2,7 +2,7 @@
2 2
   <div class="dashboardList">
3 3
     <ul class="flex-h">
4 4
       <li class="flex-item" v-for="(item,index) in data.list" :key="index">
5
-        <div>
5
+        <div :style="{background:colorList[index%colorList.length]}">
6 6
           <div class="centerLabel">
7 7
             <span>{{item.name}}</span>
8 8
             <span>{{item.value}}</span>
@@ -19,7 +19,7 @@ export default {
19 19
   props: ['data'],
20 20
   data () {
21 21
     return {
22
-
22
+      colorList: ['#fc6243', '#409EFF', '#4ddea2', '#f6e259', '#5c59f6', '#f66f59'],
23 23
     }
24 24
   },
25 25
   mounted () {

+ 1
- 0
src/pages/system/courseManager/courseList/index.vue View File

@@ -358,6 +358,7 @@ export default {
358 358
       this.GetCourseList(this.postData)
359 359
     },
360 360
     handleCurrentChange (val) { // 跳转到分页
361
+      this.postData.page = val
361 362
       this.getList()
362 363
     },
363 364
     handleEdit (index, row) { // 编辑

+ 2
- 2
src/pages/system/page.js View File

@@ -71,7 +71,7 @@ import editSchedule from './courseManager/scheduleManager/edit' // 新增、编
71 71
 
72 72
 import verificationManager from './verificationManager/index' // 核销管理
73 73
 import qrcodeVerification from './verificationManager/qrcodeVerification/index' // 二维码核销
74
-import qrcodeVerificationList from './verificationManager/qrcodeVerification/verificationList/index' // 二维码核销列表
74
+// import qrcodeVerificationList from './verificationManager/qrcodeVerification/verificationList/index' // 二维码核销列表
75 75
 import phoneVerification from './verificationManager/phoneVerification/index' // 手机核销
76 76
 import phoneVerificationList from './verificationManager/phoneVerification/verificationList/index' // 手机核销列表
77 77
 
@@ -403,7 +403,7 @@ export default {
403 403
           children: [{ // 二维码核销列表
404 404
             path: 'qrcodeVerificationList',
405 405
             name: 'qrcodeVerificationList',
406
-            component: qrcodeVerificationList,
406
+            component: phoneVerificationList,
407 407
             children: []
408 408
           }]
409 409
         }, { // 手机核销

+ 1
- 1
src/pages/system/verificationManager/phoneVerification/index.vue View File

@@ -31,7 +31,7 @@ export default {
31 31
   },
32 32
   methods: {
33 33
     toVerificationList () { // 前往核销列表
34
-      this.$router.push({name: 'phoneVerificationList', query: {code: this.phone}})
34
+      this.$router.push({name: 'phoneVerificationList', query: {tel: this.phone}})
35 35
     },
36 36
   }
37 37
 }

+ 75
- 32
src/pages/system/verificationManager/phoneVerification/verificationList/index.vue View File

@@ -6,9 +6,9 @@
6 6
           <div class="flex-item">
7 7
             <div class="userInfo">
8 8
               <span>用户名:</span>
9
-              <b>某某某</b>
9
+              <b>{{(courses.customerInfo || {}).Name || (courses.customerInfo || {}).CustomerName }}</b>
10 10
               <span>手机号:</span>
11
-              <b>{{phone}}</b>
11
+              <b>{{(courses.customerInfo || {}).Phone}}</b>
12 12
             </div>
13 13
           </div>
14 14
           <el-button
@@ -16,9 +16,9 @@
16 16
             type="warning"
17 17
             @click="reback">返回</el-button>
18 18
         </div>
19
-        <div>
19
+        <div v-if="(courses.list||[]).length>0">
20 20
           <el-table
21
-              :data="coursesList"
21
+              :data="courses.list"
22 22
               stripe
23 23
               style="width: 100%">
24 24
               <el-table-column
@@ -26,8 +26,8 @@
26 26
                 label="所在案场">
27 27
               </el-table-column>
28 28
               <el-table-column
29
-                prop="LocationId"
30
-                label="课程类">
29
+                prop="LocationName"
30
+                label="课程类">
31 31
               </el-table-column>
32 32
               <el-table-column
33 33
                 prop="CourseName"
@@ -38,12 +38,18 @@
38 38
                 label="课时名称">
39 39
               </el-table-column>
40 40
               <el-table-column
41
-                prop="BeginDate"
41
+                prop="StartDate"
42 42
                 label="课程开始时间">
43
+                <template slot-scope="scope">
44
+                  <span>{{toolClass.dateFormat(scope.row.StartDate)}}</span>
45
+                </template>
43 46
               </el-table-column>
44 47
               <el-table-column
45 48
                 prop="EndDate"
46 49
                 label="课程结束时间">
50
+                <template slot-scope="scope">
51
+                  <span>{{toolClass.dateFormat(scope.row.EndDate)}}</span>
52
+                </template>
47 53
               </el-table-column>
48 54
               <el-table-column
49 55
                 label="操作">
@@ -51,55 +57,92 @@
51 57
                   <el-button
52 58
                     size="mini"
53 59
                     type="success"
60
+                    v-if="scope.row.VerifyStatus!=='used'"
54 61
                     @click="check(scope.row)">核销</el-button>
62
+                  <span>已完成</span>
55 63
                 </template>
56 64
               </el-table-column>
57 65
             </el-table>
66
+            <el-pagination
67
+            @current-change="handleCurrentChange"
68
+            :current-page.sync="courses.page"
69
+            :page-size="courses.pagesize"
70
+            layout="prev, pager, next, jumper"
71
+            :total="courses.pagenum">
72
+          </el-pagination>
58 73
         </div>
59
-        <span class="noData">今日暂无可核销的课程</span>
74
+        <span class="noData" v-else>今日暂无可核销的课程</span>
60 75
       </div>
61 76
     </div>
62
-    <el-dialog
63
-      title="提示"
64
-      :visible.sync="centerDialogVisible"
65
-      width="300px"
66
-      center>
67
-      <span style="width:100%;display:block;text-align:center;margin:20px 0;">确认核销此课程?</span>
68
-      <span slot="footer" class="dialog-footer">
69
-        <el-button @click="centerDialogVisible = false">取 消</el-button>
70
-        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
71
-      </span>
72
-    </el-dialog>
73 77
   </div>
74 78
 </template>
75 79
 
76 80
 <script>
81
+import { createNamespacedHelpers } from 'vuex'
82
+
83
+const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
77 84
 
78 85
 export default {
79 86
   name: '',
80 87
   data () {
81 88
     return {
82
-      phone: this.$route.query.code,
83
-      centerDialogVisible: false,
84
-      coursesList: [{
85
-        CaseName: 'xxx',
86
-        LocationId: 'xxx',
87
-        CourseName: 'xxx',
88
-        DetailName: 'xxx',
89
-        BeginDate: 'xxx',
90
-        EndDate: 'xxx',
91
-      }],
89
+      code: '',
90
+      tel: '',
91
+      page: 1,
92
+      pagesize: 10,
92 93
     }
93 94
   },
94 95
   mounted () {
95
-    this.$nextTick(function () { })
96
+    const { code, tel } = this.$route.query
97
+    this.code = code
98
+    this.tel = tel
99
+    this.$nextTick(function () {
100
+      this.getList()
101
+    })
102
+  },
103
+  computed: {
104
+    ...mapVerifState({
105
+      courses: x => x.courseVerifs
106
+    })
96 107
   },
97 108
   methods: {
109
+    ...mapVerifActions([
110
+      'GetCourseVerList',
111
+      'CourseVerifs',
112
+      'GetCourseVerListByTel',
113
+    ]),
98 114
     check (item) { // 核销
99
-      this.centerDialogVisible = true
115
+      this.$confirm('确认核销此课程?', '提示', {
116
+        confirmButtonText: '确定',
117
+        cancelButtonText: '取消',
118
+        type: 'warning'
119
+      })
120
+        .then(() => {
121
+          this.CourseVerifs({id: item.CustomerDetailId, callback: this.afterCheck})
122
+        })
123
+    },
124
+    getList () {
125
+      if (this.code && this.code !== '') {
126
+        this.GetCourseVerList({id: this.code, page: this.page, pagesize: this.pagesize})
127
+      } else {
128
+        if (this.tel && this.tel !== '') {
129
+          this.GetCourseVerListByTel({tel: this.tel, page: this.page, pagesize: this.pagesize})
130
+        }
131
+      }
132
+    },
133
+    handleCurrentChange (val) { // 跳转到分页
134
+      this.page = val
135
+      this.getList()
136
+    },
137
+    afterCheck () {
138
+      this.$message({
139
+        type: 'success',
140
+        message: '操作成功!'
141
+      })
142
+      this.getList()
100 143
     },
101 144
     reback () { // 返回
102
-      this.$router.push({name: 'phoneVerification'})
145
+      this.$router.push({name: 'qrcodeVerification'})
103 146
     },
104 147
   }
105 148
 }

+ 0
- 1
src/pages/system/verificationManager/qrcodeVerification/index.vue View File

@@ -49,7 +49,6 @@
49 49
 </template>
50 50
 
51 51
 <script>
52
-
53 52
 export default {
54 53
   name: '',
55 54
   data () {

+ 50
- 28
src/pages/system/verificationManager/qrcodeVerification/verificationList/index.vue View File

@@ -8,9 +8,9 @@
8 8
             type="warning"
9 9
             @click="reback">返回</el-button>
10 10
         </div>
11
-        <div>
11
+        <div v-if="(courses.list||[]).length>0">
12 12
           <el-table
13
-              :data="coursesList"
13
+              :data="courses.list"
14 14
               stripe
15 15
               style="width: 100%">
16 16
               <el-table-column
@@ -18,8 +18,8 @@
18 18
                 label="所在案场">
19 19
               </el-table-column>
20 20
               <el-table-column
21
-                prop="LocationId"
22
-                label="课程类">
21
+                prop="LocationName"
22
+                label="课程类">
23 23
               </el-table-column>
24 24
               <el-table-column
25 25
                 prop="CourseName"
@@ -30,12 +30,18 @@
30 30
                 label="课时名称">
31 31
               </el-table-column>
32 32
               <el-table-column
33
-                prop="BeginDate"
33
+                prop="StartDate"
34 34
                 label="课程开始时间">
35
+                <template slot-scope="scope">
36
+                  <span>{{toolClass.dateFormat(scope.row.StartDate)}}</span>
37
+                </template>
35 38
               </el-table-column>
36 39
               <el-table-column
37 40
                 prop="EndDate"
38 41
                 label="课程结束时间">
42
+                <template slot-scope="scope">
43
+                  <span>{{toolClass.dateFormat(scope.row.EndDate)}}</span>
44
+                </template>
39 45
               </el-table-column>
40 46
               <el-table-column
41 47
                 label="操作">
@@ -43,51 +49,67 @@
43 49
                   <el-button
44 50
                     size="mini"
45 51
                     type="success"
52
+                    v-if="scope.row.VerifyStatus!=='used'"
46 53
                     @click="check(scope.row)">核销</el-button>
54
+                  <span>已完成</span>
47 55
                 </template>
48 56
               </el-table-column>
49 57
             </el-table>
50 58
         </div>
51
-        <span class="noData">今日暂无可核销的课程</span>
59
+        <span class="noData" v-else>今日暂无可核销的课程</span>
52 60
       </div>
53 61
     </div>
54
-    <el-dialog
55
-      title="提示"
56
-      :visible.sync="centerDialogVisible"
57
-      width="300px"
58
-      center>
59
-      <span style="width:100%;display:block;text-align:center;margin:20px 0;">确认核销此课程?</span>
60
-      <span slot="footer" class="dialog-footer">
61
-        <el-button @click="centerDialogVisible = false">取 消</el-button>
62
-        <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
63
-      </span>
64
-    </el-dialog>
65 62
   </div>
66 63
 </template>
67 64
 
68 65
 <script>
66
+import { createNamespacedHelpers } from 'vuex'
67
+
68
+const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
69 69
 
70 70
 export default {
71 71
   name: '',
72 72
   data () {
73 73
     return {
74
-      centerDialogVisible: false,
75
-      coursesList: [{
76
-        CaseName: 'xxx',
77
-        LocationId: 'xxx',
78
-        CourseName: 'xxx',
79
-        DetailName: 'xxx',
80
-        BeginDate: 'xxx',
81
-        EndDate: 'xxx',
82
-      }],
74
+      code: '',
83 75
     }
84 76
   },
85 77
   mounted () {
86
-    this.$nextTick(function () { })
78
+    const { code } = this.$route.query
79
+    this.code = code
80
+    this.$nextTick(function () {
81
+      this.getList()
82
+    })
83
+  },
84
+  computed: {
85
+    ...mapVerifState({
86
+      courses: x => x.courseVerifs
87
+    })
87 88
   },
88 89
   methods: {
90
+    ...mapVerifActions([
91
+      'GetCourseVerList',
92
+      'CourseVerifs',
93
+    ]),
89 94
     check (item) { // 核销
90
-      this.centerDialogVisible = true
95
+      this.$confirm('确认核销此课程?', '提示', {
96
+        confirmButtonText: '确定',
97
+        cancelButtonText: '取消',
98
+        type: 'warning'
99
+      })
100
+        .then(() => {
101
+          this.CourseVerifs({id: item.CustomerDetailId, callback: this.afterCheck})
102
+        })
103
+    },
104
+    getList () {
105
+      this.GetCourseVerList({id: this.code})
106
+    },
107
+    afterCheck () {
108
+      this.$message({
109
+        type: 'success',
110
+        message: '操作成功!'
111
+      })
112
+      this.getList()
91 113
     },
92 114
     reback () { // 返回
93 115
       this.$router.push({name: 'qrcodeVerification'})

+ 1
- 0
src/store/index.js View File

@@ -21,6 +21,7 @@ export const modules = {
21 21
   course: () => require('./course/course').default,
22 22
   coursetag: () => require('./course/tag').default,
23 23
   schedule: () => require('./course/schedule').default,
24
+  verification: () => require('./verification/verification').default,
24 25
 }
25 26
 
26 27
 Object.keys(modules).forEach((modKey) => {

+ 54
- 0
src/store/verification/verification.js View File

@@ -0,0 +1,54 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    courseVerifs: [],
8
+  },
9
+  mutations: {
10
+    updateCourseList (state, payload) {
11
+      state.courseVerifs = payload || []
12
+    },
13
+  },
14
+  actions: {
15
+    GetCourseVerList ({ commit }, payload) {
16
+      ajax(api.verification.coursebycode.url, {
17
+        method: api.verification.coursebycode.method,
18
+        urlData: {
19
+          id: payload.id
20
+        },
21
+        queryData: {
22
+          ...payload
23
+        }
24
+      }).then(res => {
25
+        commit('updateCourseList', res)
26
+      })
27
+    },
28
+    GetCourseVerListByTel ({ commit }, payload) {
29
+      ajax(api.verification.coursebytel.url, {
30
+        method: api.verification.coursebytel.method,
31
+        urlData: {
32
+          tel: payload.tel
33
+        },
34
+        queryData: {
35
+          ...payload
36
+        }
37
+      }).then(res => {
38
+        commit('updateCourseList', res)
39
+      })
40
+    },
41
+    CourseVerifs ({ commit }, payload) {
42
+      ajax(api.verification.courseverify.url, {
43
+        method: api.verification.courseverify.method,
44
+        urlData: {
45
+          id: payload.id
46
+        }
47
+      }).then(res => {
48
+        if (payload.callback) {
49
+          payload.callback()
50
+        }
51
+      })
52
+    }
53
+  },
54
+}

+ 15
- 1
src/util/api.js View File

@@ -510,6 +510,20 @@ const $api = {
510 510
       method: 'delete',
511 511
       url: `${baseUrl}${common}/detail/:id`
512 512
     },
513
-  }
513
+  },
514
+  verification: {
515
+    coursebycode: {
516
+      method: 'get',
517
+      url: `${baseUrl}${common}/verify/course/code/:id`
518
+    },
519
+    coursebytel: {
520
+      method: 'get',
521
+      url: `${baseUrl}${common}/verify/course/tel/:tel`
522
+    },
523
+    courseverify: {
524
+      method: 'put',
525
+      url: `${baseUrl}${common}/verify/course/:id`
526
+    },
527
+  },
514 528
 }
515 529
 export default $api