傅行帆 il y a 4 ans
Parent
révision
65faec0749

+ 8
- 0
src/api/lottery/shop-api.js Voir le fichier

@@ -17,4 +17,12 @@ shopApi.getPageList = data => {
17 17
   })
18 18
 }
19 19
 
20
+shopApi.update = data => {
21
+  return request({
22
+    url: '/taShop/update',
23
+    method: 'post',
24
+    data
25
+  })
26
+}
27
+
20 28
 export default shopApi

+ 106
- 0
src/views/lottery/shop/components/shop-verify.vue Voir le fichier

@@ -0,0 +1,106 @@
1
+<template>
2
+  <el-dialog
3
+    title="店铺审核"
4
+    :visible.sync="dialogVisible"
5
+    custom-class="page-dialog sys-user-dialog"
6
+  >
7
+    <el-form
8
+      ref="shopVerifyForm"
9
+      :rules="rules"
10
+      :model="form"
11
+      label-position="right"
12
+      label-width="80px"
13
+      class="page-form"
14
+      style="width: 100%;"
15
+    >
16
+      <el-form-item prop="state">
17
+        <el-radio-group v-model="form.status">
18
+          <el-radio :label="1">审核通过</el-radio>
19
+          <el-radio :label="2">审核不通过</el-radio>
20
+        </el-radio-group>
21
+      </el-form-item>
22
+    </el-form>
23
+    <div slot="footer" class="dialog-footer">
24
+      <template>
25
+        <el-button type="primary" @click="submitUpdateForm()">保存</el-button>
26
+      </template>
27
+    </div>
28
+  </el-dialog>
29
+</template>
30
+
31
+<script>
32
+  import shopApi from '@/api/lottery/shop-api'
33
+
34
+  export default {
35
+    name: 'ShopVerify',
36
+    components: { },
37
+    props: {
38
+    },
39
+    data() {
40
+      return {
41
+        dialogVisible: false,
42
+        form: {
43
+          status: null,
44
+        },
45
+        updateId: null,
46
+        rules: {
47
+          status: [
48
+            { required: true, message: '请选择状态', trigger: 'change' }
49
+          ]
50
+        }
51
+      }
52
+    },
53
+    computed: {},
54
+    created() {
55
+
56
+    },
57
+    mounted() {
58
+
59
+    },
60
+    methods: {
61
+      handle(id) {
62
+        console.log(id, "id-----")
63
+        this.updateId = id;
64
+        this.dialogVisible = true
65
+      },
66
+      submitUpdateForm() {
67
+        this.$refs.shopVerifyForm.validate((valid) => {
68
+          if (valid) {
69
+            console.log('submit!')
70
+            this.updateUser()
71
+            // this.$emit("getList")
72
+          } else {
73
+            console.log('error submit!!')
74
+            return false
75
+          }
76
+        });
77
+      },
78
+      updateUser() {
79
+        const updateParam = {
80
+          shopId: this.updateId,
81
+          status: this.form.status
82
+        }
83
+        shopApi.update(updateParam).then(response => {
84
+          if (response.code === 200) {
85
+            this.dialogVisible = false
86
+            this.$message({
87
+              message: '审核成功',
88
+              type: 'success'
89
+            })
90
+            this.$emit('change')
91
+          }
92
+        })
93
+      }
94
+    }
95
+  }
96
+</script>
97
+
98
+<style lang="scss">
99
+  .sys-user-dialog {
100
+    margin-top: 40px !important;
101
+  }
102
+</style>
103
+
104
+<style lang="scss" scoped>
105
+
106
+</style>

+ 9
- 15
src/views/lottery/shop/shop-lottery-list.vue Voir le fichier

@@ -50,13 +50,15 @@
50 50
       </el-table-column>
51 51
       <el-table-column label="操作" align="center" width="240" class-name="operation">
52 52
         <template slot-scope="{row}">
53
-          <el-link type="warning" @click="handUpdate(row.id)">审核</el-link>
53
+          <el-link type="warning" @click="handVerify(row.shopId)">{{row.status == 0 ? "审核" : ""}}</el-link>
54 54
         </template>
55 55
       </el-table-column>
56 56
     </el-table>
57 57
 
58 58
     <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageIndex" :limit.sync="listQuery.pageSize" @pagination="getList" />
59 59
 
60
+    <shop-verify ref="verifyPage" @change="getList"/>
61
+
60 62
   </div>
61 63
 </template>
62 64
 
@@ -65,6 +67,8 @@
65 67
   import Pagination from '@/components/Pagination'
66 68
   import shopApi from '@/api/lottery/shop-api'
67 69
 
70
+  import ShopVerify from './components/shop-verify'
71
+
68 72
   const stateEnum = { 0: '待审核', 1: '已审核', 2: '审核不通过' }
69 73
   const statusOptions = [
70 74
     { label: '已审核', value: 1 },
@@ -74,7 +78,7 @@
74 78
 
75 79
   export default {
76 80
     name: 'shopLotteryList',
77
-    components: { Pagination },
81
+    components: { Pagination, ShopVerify },
78 82
     directives: { waves },
79 83
     filters: {
80 84
       statusFilter(state) {
@@ -146,19 +150,9 @@
146 150
           return ''
147 151
         }
148 152
       },
149
-      handUpdate(id, username) {
150
-        this.$confirm('您确定要删除 ' + username + ' ?', '删除提示', {
151
-          confirmButtonText: '确定',
152
-          cancelButtonText: '取消',
153
-          type: 'warning'
154
-        }).then(() => {
155
-          sysUserApi.delete(id).then(response => {
156
-            this.$message({
157
-              type: 'success',
158
-              message: '删除成功!'
159
-            });
160
-            this.handleFilter();
161
-          })
153
+      handVerify(id) {
154
+        this.$nextTick(() => {
155
+          this.$refs.verifyPage.handle(id)
162 156
         });
163 157
       }
164 158
     }