From 9b0cdc49f16ff49e050ed161da9a8ce9207da97f Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期六, 12 十月 2024 13:28:10 +0800
Subject: [PATCH] 修改

---
 src/views/onlineEducation/courseSupervision/components/courseDialog.vue |   43 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/src/views/onlineEducation/courseSupervision/components/courseDialog.vue b/src/views/onlineEducation/courseSupervision/components/courseDialog.vue
index 7078a23..7dcc9f3 100644
--- a/src/views/onlineEducation/courseSupervision/components/courseDialog.vue
+++ b/src/views/onlineEducation/courseSupervision/components/courseDialog.vue
@@ -74,13 +74,15 @@
 
     </div>
     <span slot="footer" class="dialog-footer" v-if="showBtn">
-    <el-button type="primary" @click="dialogVisible = false">审核通过</el-button>
-    <el-button type="warning" @click="dialogVisible = false">审核驳回</el-button>
+    <el-button type="primary" @click="examine('pass')">审核通过</el-button>
+    <el-button type="warning" @click="examine('reject')">审核驳回</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script >
+import { checkCourse, listCourse } from '@/api/onlineEducation/course'
+
 export default {
   name: 'addUser',
   components: {
@@ -101,7 +103,8 @@
   methods: {
     openDialog (data,type,courseType) {
       this.dialogVisible = true;
-      console.log('this.showBtn ',type,courseType )
+      this.dataForm = data;
+      console.log('dataForm ',this.dataForm )
       if(type === 'course'){
         this.courseList = data.outline
         this.courseTable = this.recursion(data.outline,type)
@@ -175,6 +178,40 @@
         this.$emit("getList");
         this.dialogVisible = false;
     },
+    examine(type){
+      let msg = '';
+      const param = {
+        id: this.dataForm.id,
+        status: null
+      }
+      if(type === 'pass'){
+        param.status = 2
+        msg = '审核通过'
+      }else {
+        param.status = 3
+        msg = '审核驳回'
+      }
+      this.$confirm(`确定${msg}该条数据?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        checkCourse(param).then((res) => {
+          if (res.code == 200) {
+            this.$message({
+              message: '成功',
+              type: 'success'
+            })
+            this.handleClose()
+          }else {
+            this.$message({
+              message: res.msg,
+              type: 'warning'
+            })
+          }
+        })
+      })
+    },
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
       if(columnIndex === 0) {
         const currentValue = row[column.property];

--
Gitblit v1.9.2