lrf402788946 3 年 前
コミット
e14e2bb17c

+ 15 - 2
src/views/admin/live/achieve/apply.vue

@@ -15,7 +15,7 @@
     </el-row>
     <el-dialog title="产品审核" :visible.sync="productDialog" width="50%" :before-close="handleClose">
       <achieve v-if="form.type == '1'" :form="form"></achieve>
-      <techol v-if="form.type == '0'" :form="form"></techol>
+      <techol v-if="form.type == '0'" :form="form" @submit="toSubmit"></techol>
     </el-dialog>
   </div>
 </template>
@@ -65,7 +65,7 @@ export default {
     this.search();
   },
   methods: {
-    ...dockUser(['query']),
+    ...dockUser(['query', 'update']),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       info.dock_id = this.user.id;
       const res = await this.query({ skip, limit, ...info });
@@ -74,6 +74,19 @@ export default {
         this.$set(this, `total`, res.total);
       }
     },
+    async toSubmit(data, status) {
+      data.status = status;
+      const apply = this.list.find(f => f.productList.find(pf => pf._id === data._id));
+      const pindex = apply.productList.findIndex(pf => pf._id === data._id);
+      apply.productList[pindex] = data;
+      console.log(apply);
+      const res = await this.update(apply);
+      if (this.$checkRes(res, '审核成功', res.errmsg || '审核失败')) {
+        this.handleClose();
+        this.back();
+        this.search();
+      }
+    },
     // 审核产品
     toCheck({ data }) {
       this.$set(this, `productList`, data.productList);

+ 8 - 0
src/views/admin/live/achieve/apply/techol.vue

@@ -122,6 +122,10 @@
               {{ form.condition || '暂无' }}
             </el-col>
           </el-col>
+          <el-col :span="24" style="text-align:center;padding-top:20px">
+            <el-button @click="toStatus('1')" type="primary">通过</el-button>
+            <el-button @click="toStatus('-1')" type="danger">拒绝</el-button>
+          </el-col>
         </el-col>
       </el-col>
     </el-row>
@@ -129,6 +133,7 @@
 </template>
 
 <script>
+const _ = require('lodash');
 import { mapState, createNamespacedHelpers } from 'vuex';
 export default {
   name: 'techol',
@@ -160,6 +165,9 @@ export default {
         }
       }
     },
+    toStatus(status) {
+      this.$emit('submit', _.cloneDeep(this.form), status);
+    },
   },
   computed: {
     ...mapState(['user']),