From c1823a7f91775fd157d4e4683b597d7e426cd2ed Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期三, 17 七月 2024 17:23:37 +0800
Subject: [PATCH] bug修改

---
 src/views/onlineEducation/classHourBatch/index.vue |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/views/onlineEducation/classHourBatch/index.vue b/src/views/onlineEducation/classHourBatch/index.vue
index af6dc53..71bcabd 100644
--- a/src/views/onlineEducation/classHourBatch/index.vue
+++ b/src/views/onlineEducation/classHourBatch/index.vue
@@ -26,8 +26,8 @@
       <el-table-column label="课程" prop="courseName" align="center"  />
       <el-table-column label="学习人数" prop="studentCount" align="center"  />
       <el-table-column label="总课时" prop="coursePeriodNum" align="center"  />
-      <el-table-column label="已完成人数" prop="" align="center"  />
-      <el-table-column label="完成率" prop="" align="center"  />
+      <el-table-column label="已完成人数" prop="finishCount" align="center"  />
+      <el-table-column label="完成率" prop="finishRate" align="center"  />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  width="180">
         <template #default="scope">
           <el-button link type="primary" @click="toStuChoose(scope.row)">学生数据</el-button>
@@ -74,7 +74,8 @@
   dataList: [],
   isAdmin: false,
   companyName: '',
-  remainPeriod: null
+  remainPeriod: null,
+  companyId: null
 
 });
 
@@ -89,6 +90,7 @@
     data.remainPeriod = userInfo.remainPeriod ? (userInfo.remainPeriod /60).toFixed(2).replace(/\.00$/, ''):''
     data.isAdmin = false;
     data.companyName = userInfo.companyName
+    data.companyId = userInfo.companyId
   }
   await getList()
 })
@@ -103,7 +105,8 @@
     data.dataList = res.data.list.map(item => {
       return {
         ...item,
-        coursePeriodNum: item.coursePeriod ? (item.coursePeriod /60).toFixed(2).replace(/\.00$/, '') + '分钟':''
+        coursePeriodNum: item.coursePeriod ? (item.coursePeriod /60).toFixed(2).replace(/\.00$/, '') + '分钟':'',
+        finishRate: item.finishCount ?  item.finishCount ===0 && item.studentCount ===0  ? '0%': (item.finishCount / item.studentCount).toFixed(2) *100 + '%' : ''
       }
     })
     data.total = res.data.total
@@ -146,6 +149,6 @@
 }
 
 const openDetail = () => {
-  classHourRef.value.openDialog()
+  classHourRef.value.openDialog(data.companyId)
 }
 </script>

--
Gitblit v1.9.2