From db905ecd14f63dba9337b4f4715584ef2d7e8c7e Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 07 三月 2025 14:45:00 +0800
Subject: [PATCH] 修改

---
 src/views/onlineEducation/count/components/studentList.vue |  115 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 96 insertions(+), 19 deletions(-)

diff --git a/src/views/onlineEducation/count/components/studentList.vue b/src/views/onlineEducation/count/components/studentList.vue
index 7ab47c9..edc2859 100644
--- a/src/views/onlineEducation/count/components/studentList.vue
+++ b/src/views/onlineEducation/count/components/studentList.vue
@@ -8,56 +8,84 @@
     :before-close="handleClose"
   >
     <el-table
+      height="250"
       :data="learningTable"
       style="width: 100%;">
       <el-table-column
         prop="name"
         label="姓名"
+        align="center"
       >
       </el-table-column>
       <el-table-column
         label="身份证号"
-        prop="idCard"
-        width="160" :show-overflow-tooltip="true">
+        prop="idcard"
+        align="center"
+        width="180" :show-overflow-tooltip="true">
       </el-table-column>
       <el-table-column
-        prop="totalTime"
+        prop="lessonTocal"
         label="总学时"
+        align="center"
       >
+        <template #default="scope">
+          {{type == 'batch' ? scope.row.batchLessonNum : scope.row.courseLessonNum}}
+        </template>
       </el-table-column>
       <el-table-column
-        prop="learnedTime"
+        prop="lessonNum"
         label="已学学时"
+        align="center"
       ></el-table-column>
       <el-table-column
-        prop="isEnd"
+        prop="finishStatus"
         label="是否已结束培训"
-      ></el-table-column>
+        width="175"
+        align="center"
+      >
+        <template #default="scope">
+          {{scope.row.finishStatus == 0 ? '未结束' : '已结束'}}
+        </template>
+
+      </el-table-column>
       <el-table-column label="学时报告" align="center" class-name="small-padding fixed-width">
         <template #default="scope">
           <el-button
-            v-if="scope.row.isEnd === '是'"
+            v-if="scope.row.finishStatus == 1"
             size="mini"
             type="text"
             style="color: #1890ff"
-            @click="viewLessonReport"
+            @click="viewLessonReport(scope.row.url)"
           >查看学时报告</el-button>
         </template>
       </el-table-column>
+      <el-table-column label="未达标短信提醒" align="center" class-name="small-padding fixed-width">
+        <template #default="scope">
+          <el-button
+            v-if="scope.row.finishStatus == 0"
+            size="mini"
+            type="text"
+            style="color: #1890ff"
+            @click="sendMessage(scope.row)"
+          >短信提醒</el-button>
+        </template>
+      </el-table-column>
     </el-table>
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageIndex"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+<!--    <pagination-->
+<!--      v-show="total>0"-->
+<!--      :total="total"-->
+<!--      :page.sync="queryParams.pageIndex"-->
+<!--      :limit.sync="queryParams.pageSize"-->
+<!--      @pagination="getList"-->
+<!--    />-->
     <lessonReport ref="lessonRef"></lessonReport>
   </el-dialog>
 </template>
 
 <script >
 import lessonReport from '@/views/onlineEducation/studentSupervision/compontents/lessonReport.vue'
+import { sendMessage, studentCourseDetail, studentDetail } from '@/api/onlineEducation/student'
+import { listCourse } from '@/api/onlineEducation/course'
 export default {
   name: 'addUser',
   components: {
@@ -68,8 +96,13 @@
       dialogVisible: false,
       dialogStatus: '',
       dataForm: {},
-      total: 2,
-      queryParams: {},
+      uuid: '',
+      total: 0,
+      type: '',
+      queryParams: {
+        pageIndex: 1,
+        pageSize: 10
+      },
       learningTable: [
         {
           name: '张三',
@@ -96,11 +129,31 @@
   },
   methods: {
     getList() {
+      this.loading = true;
+      if(this.type === 'course'){
+        studentCourseDetail( this.uuid).then((res) => {
+          if (res.code == 200) {
+            this.learningTable = res.data
+            this.loading = false;
+            // this.total = res.data.total
+          }
+        })
+      }else {
+        studentDetail( this.uuid).then((res) => {
+          if (res.code == 200) {
+            this.learningTable = res.data
+            this.loading = false;
+            // this.total = res.data.total
+          }
+        })
+      }
 
     },
-    openDialog (type, data) {
+    openDialog (data,type) {
+      this.type = type;
+      this.uuid = data.uuid;
+      this.getList();
       this.dialogVisible = true;
-      this.dialogStatus = type;
     },
 
     handleClose() {
@@ -109,6 +162,30 @@
     },
     viewLessonReport(data){
       this.$refs.lessonRef.openDialog(data)
+    },
+    sendMessage(row){
+      this.$confirm('此操作将向该学员发送短信, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        sendMessage(row.idcard).then((res) => {
+          if (res.code == 200) {
+            this.$message({
+              message: '发送成功',
+              type: 'success'
+            })
+            this.handleClose()
+          }else {
+            this.$message({
+              message: res.msg,
+              type: 'warning'
+            })
+          }
+        })
+      }).catch(() => {
+
+      });
     }
   }
 }

--
Gitblit v1.9.2