许成详 6 years ago
parent
commit
04c39ed5fd

+ 1
- 1
config/index.js View File

24
     },
24
     },
25
     // Various Dev Server settings
25
     // Various Dev Server settings
26
     host: '0.0.0.0', // can be overwritten by process.env.HOST
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
     autoOpenBrowser: false,
28
     autoOpenBrowser: false,
29
     errorOverlay: true,
29
     errorOverlay: true,
30
     notifyOnErrors: true,
30
     notifyOnErrors: true,

+ 17
- 2
src/pages/system/verificationManager/drawVerification/index.vue View File

42
       </div>
42
       </div>
43
       <span slot="footer" class="dialog-footer">
43
       <span slot="footer" class="dialog-footer">
44
         <el-button @click="centerDialogVisible = false">取 消</el-button>
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
       </span>
46
       </span>
47
     </el-dialog>
47
     </el-dialog>
48
   </div>
48
   </div>
49
 </template>
49
 </template>
50
 
50
 
51
 <script>
51
 <script>
52
+import { createNamespacedHelpers } from 'vuex'
53
+const { mapActions: mapVerificActions } = createNamespacedHelpers('verification')
52
 export default {
54
 export default {
53
   name: '',
55
   name: '',
54
   data () {
56
   data () {
61
     this.$nextTick(function () { })
63
     this.$nextTick(function () { })
62
   },
64
   },
63
   methods: {
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
     toVerificationList () { // 定向到核销列表
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 View File

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

+ 25
- 1
src/store/verification/verification.js View File

49
           payload.callback()
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 View File

541
       method: 'put',
541
       method: 'put',
542
       url: `${baseUrl}${common}/verify/course/:id`
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
   goodsOrder: {
553
   goodsOrder: {
546
     getOnlineOrder: {
554
     getOnlineOrder: {