zhouwx
2024-10-12 9b0cdc49f16ff49e050ed161da9a8ce9207da97f
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];