许成详 6 vuotta sitten
vanhempi
commit
04c39ed5fd

+ 1
- 1
config/index.js Näytä tiedosto

@@ -24,7 +24,7 @@ module.exports = {
24 24
     },
25 25
     // Various Dev Server settings
26 26
     host: '0.0.0.0', // can be overwritten by process.env.HOST
27
-    port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
27
+    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
28 28
     autoOpenBrowser: false,
29 29
     errorOverlay: true,
30 30
     notifyOnErrors: true,

+ 17
- 2
src/pages/system/verificationManager/drawVerification/index.vue Näytä tiedosto

@@ -42,13 +42,15 @@
42 42
       </div>
43 43
       <span slot="footer" class="dialog-footer">
44 44
         <el-button @click="centerDialogVisible = false">取 消</el-button>
45
-        <el-button type="primary" @click="toVerificationList">确 定</el-button>
45
+        <el-button type="primary" @click="toVerify">确 定</el-button>
46 46
       </span>
47 47
     </el-dialog>
48 48
   </div>
49 49
 </template>
50 50
 
51 51
 <script>
52
+import { createNamespacedHelpers } from 'vuex'
53
+const { mapActions: mapVerificActions } = createNamespacedHelpers('verification')
52 54
 export default {
53 55
   name: '',
54 56
   data () {
@@ -61,8 +63,21 @@ export default {
61 63
     this.$nextTick(function () { })
62 64
   },
63 65
   methods: {
66
+    ...mapVerificActions([
67
+      'drawVerifyList',
68
+    ]),
69
+    toVerify () {
70
+      this.drawVerifyList({
71
+        id: this.verificationCode
72
+      }).then((res) => {
73
+        // console.log(JSON.stringify(res))
74
+        if (res !== null) {
75
+          this.toVerificationList()
76
+        }
77
+      })
78
+    },
64 79
     toVerificationList () { // 定向到核销列表
65
-      this.$router.push({name: 'drawVerificationList', query: {code: this.verificationCode}})
80
+      this.$router.push({ name: 'drawVerificationList', query: { code: this.verificationCode } })
66 81
     },
67 82
   }
68 83
 }

+ 54
- 34
src/pages/system/verificationManager/drawVerification/verificationList/index.vue Näytä tiedosto

@@ -8,9 +8,9 @@
8 8
             type="warning"
9 9
             @click="reback">返回</el-button>
10 10
         </div>
11
-        <div v-if="(courses.list||[]).length>0">
11
+        <div>
12 12
           <el-table
13
-              :data="courses.list"
13
+              :data="info"
14 14
               stripe
15 15
               style="width: 100%">
16 16
               <el-table-column
@@ -18,29 +18,38 @@
18 18
                 label="所在案场">
19 19
               </el-table-column>
20 20
               <el-table-column
21
-                prop="LocationName"
22
-                label="课程分类">
21
+                prop="PrizeName"
22
+                label="奖品名称">
23 23
               </el-table-column>
24 24
               <el-table-column
25
-                prop="CourseName"
26
-                label="课程名称">
25
+                prop="Name"
26
+                label="姓名">
27 27
               </el-table-column>
28 28
               <el-table-column
29
-                prop="DetailName"
30
-                label="课时名称">
29
+                prop="CustomerName"
30
+                label="微信昵称">
31 31
               </el-table-column>
32 32
               <el-table-column
33
-                prop="StartDate"
34
-                label="课程开始时间">
33
+                prop="Phone"
34
+                label="手机号">
35
+              </el-table-column>
36
+              <el-table-column
37
+                prop="ActivitName"
38
+                label="活动名称">
39
+              </el-table-column>
40
+              <el-table-column
41
+                prop="CreateDate"
42
+                label="获取时间"
43
+                width="140px">
35 44
                 <template slot-scope="scope">
36
-                  <span>{{toolClass.dateFormat(scope.row.StartDate)}}</span>
45
+                  {{toolClass.dateFormat(scope.row.CreateDate)}}
37 46
                 </template>
38 47
               </el-table-column>
39 48
               <el-table-column
40
-                prop="EndDate"
41
-                label="课程结束时间">
49
+                prop="Status"
50
+                label="状态">
42 51
                 <template slot-scope="scope">
43
-                  <span>{{toolClass.dateFormat(scope.row.EndDate)}}</span>
52
+                  {{scope.row.Status === 0 ? '未核销' : '已核销'}}
44 53
                 </template>
45 54
               </el-table-column>
46 55
               <el-table-column
@@ -49,14 +58,14 @@
49 58
                   <el-button
50 59
                     size="mini"
51 60
                     type="success"
52
-                    v-if="scope.row.VerifyStatus!=='used'"
61
+                    v-if="scope.row.Status === 0"
53 62
                     @click="check(scope.row)">核销</el-button>
54
-                  <span v-else>已完成</span>
63
+                  <span v-else>已核销</span>
55 64
                 </template>
56 65
               </el-table-column>
57 66
             </el-table>
58 67
         </div>
59
-        <span class="noData" v-else>今日暂无可核销的课程</span>
68
+        <span class="noData" v-if="!info.length && ajaxOff">今日暂无可核销的课程</span>
60 69
       </div>
61 70
     </div>
62 71
   </div>
@@ -65,44 +74,55 @@
65 74
 <script>
66 75
 import { createNamespacedHelpers } from 'vuex'
67 76
 
68
-const { mapState: mapVerifState, mapActions: mapVerifActions } = createNamespacedHelpers('verification')
77
+const { mapActions: mapVerifActions } = createNamespacedHelpers('verification')
69 78
 
70 79
 export default {
71 80
   name: '',
72 81
   data () {
73 82
     return {
74
-      code: '',
83
+      ajaxOff: false,
84
+      info: [],
75 85
     }
76 86
   },
77 87
   mounted () {
78
-    const { code } = this.$route.query
79
-    this.code = code
80 88
     this.$nextTick(function () {
81
-      this.getList()
89
+      this.drawVerifyList({
90
+        id: this.$route.query.code
91
+      }).then((res) => {
92
+        // console.log(JSON.stringify(res))
93
+        if (res !== null) {
94
+          this.info.push(res)
95
+        }
96
+        this.ajaxOff = true
97
+      })
82 98
     })
83 99
   },
84 100
   computed: {
85
-    ...mapVerifState({
86
-      courses: x => x.courseVerifs
87
-    })
88 101
   },
89 102
   methods: {
90 103
     ...mapVerifActions([
91
-      'GetCourseVerList',
92
-      'CourseVerifs',
104
+      'drawVerify',
105
+      'drawVerifyList',
93 106
     ]),
94 107
     check (item) { // 核销
95
-      this.$confirm('确认核销此课程?', '提示', {
108
+      this.$confirm('确认核销此?', '提示', {
96 109
         confirmButtonText: '确定',
97 110
         cancelButtonText: '取消',
98 111
         type: 'warning'
99
-      })
100
-        .then(() => {
101
-          this.CourseVerifs({id: item.CustomerDetailId, callback: this.afterCheck})
112
+      }).then(() => {
113
+        this.drawVerify({
114
+          id: this.$route.query.code
115
+        }).then((res) => {
116
+          this.$message({
117
+            type: 'success',
118
+            message: '操作成功!'
119
+          })
120
+          this.$router.push({ name: 'drawVerification' })
102 121
         })
122
+      })
103 123
     },
104 124
     getList () {
105
-      this.GetCourseVerList({id: this.code})
125
+      // 1
106 126
     },
107 127
     afterCheck () {
108 128
       this.$message({
@@ -112,7 +132,7 @@ export default {
112 132
       this.getList()
113 133
     },
114 134
     reback () { // 返回
115
-      this.$router.push({name: 'drawVerificationList'})
135
+      this.$router.push({ name: 'drawVerificationList' })
116 136
     },
117 137
   }
118 138
 }
@@ -135,7 +155,7 @@ export default {
135 155
       }
136 156
     }
137 157
   }
138
-  .noData{
158
+  .noData {
139 159
     width: 100%;
140 160
     display: block;
141 161
     line-height: 40px;

+ 25
- 1
src/store/verification/verification.js Näytä tiedosto

@@ -49,6 +49,30 @@ export default {
49 49
           payload.callback()
50 50
         }
51 51
       })
52
-    }
52
+    },
53
+    drawVerify ({ commit }, { id }) {
54
+      return new Promise((resolve, reject) => {
55
+        ajax(api.verification.drawVerify.url, {
56
+          method: api.verification.drawVerify.method,
57
+          urlData: {
58
+            id,
59
+          }
60
+        }).then(res => {
61
+          resolve(res)
62
+        }).catch(reject)
63
+      })
64
+    },
65
+    drawVerifyList ({ commit }, { id }) {
66
+      return new Promise((resolve, reject) => {
67
+        ajax(api.verification.drawVerifyList.url, {
68
+          method: api.verification.drawVerifyList.method,
69
+          urlData: {
70
+            id,
71
+          }
72
+        }).then(res => {
73
+          resolve(res)
74
+        }).catch(reject)
75
+      })
76
+    },
53 77
   },
54 78
 }

+ 8
- 0
src/util/api.js Näytä tiedosto

@@ -541,6 +541,14 @@ const $api = {
541 541
       method: 'put',
542 542
       url: `${baseUrl}${common}/verify/course/:id`
543 543
     },
544
+    drawVerify: {
545
+      method: 'put',
546
+      url: `${baseUrl}${common}/luckdrawlist/verify/:id`
547
+    },
548
+    drawVerifyList: {
549
+      method: 'get',
550
+      url: `${baseUrl}${common}/luckdrawlist/verify/:id`
551
+    },
544 552
   },
545 553
   goodsOrder: {
546 554
     getOnlineOrder: {