Quellcode durchsuchen

fix:修复员工记录卡分数展示,以及增加图片预览

sunqijun vor 2 Wochen
Ursprung
Commit
ab5af5a3fb

+ 24 - 6
src/views/production-safety/safetyTrainingAndEducation/employeeTrainingRecordCardManagement/components/commonTable.vue

@@ -2,7 +2,7 @@
  * @Author: liuJie
  * @Date: 2026-02-13 16:04:29
  * @LastEditors: liuJie
- * @LastEditTime: 2026-03-19 10:32:45
+ * @LastEditTime: 2026-04-17 17:39:36
  * @Describe: file describe
 -->
 <script setup lang="ts">
@@ -142,6 +142,21 @@
     tableQuery.pageNumber = 1;
     handleSearch();
   };
+  const getNumber = (value, unit)=>{
+    if(value===0){
+        return value + unit;
+    }else if(value === null || value === undefined || value === ''){
+        return '-';
+    } else {
+        return value + unit
+    }
+  }
+  const preViewVisible = ref(false)
+  const imageUrl = ref('')
+  const preview = (url)=>{
+    preViewVisible.value = true
+    imageUrl.value = url
+  }
 </script>
 <template>
   <div>
@@ -163,23 +178,22 @@
 
     <!-- 表格 -->
     <el-table border stripe :data="tableData">
-      <el-table-column type="selection" width="50" />
-      <el-table-column label="编号" type="index" width="80" />
+      <el-table-column label="编号" type="index" width="80" align="center" />
       <el-table-column label="日期" prop="logDate" width="200" />
       <el-table-column label="教育内容" prop="educationContent" width="280" />
       <el-table-column label="学时" prop="creditHour">
         <template #default="scope">
-          <span>{{ scope.row.creditHour }}</span>
+          <span>{{  getNumber(scope.row.creditHour, '时') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="成绩" prop="scoreMust">
         <template #default="scope">
-          <span>{{ scope.row.scoreMust }}</span>
+          <span>{{  getNumber(scope.row.scoreMust, '分') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="受教育者签字" prop="educationSign" width="220">
         <template #default="scope">
-            <img :src="scope.row.educationSign" style="width:100%" v-if="scope.row.educationSign" alt="">
+            <img :src="scope.row.educationSign" style="width:100%;height:60px; cursor: pointer;" @click="preview(scope.row.educationSign)" v-if="scope.row.educationSign" alt="">
         </template>
       </el-table-column>
       <el-table-column label="操作" width="220">
@@ -217,6 +231,10 @@
         <el-button type="primary" @click="confirmHandle">保存</el-button>
       </template>
     </el-dialog>
+    <!-- 预览 -->
+     <el-dialog v-model="preViewVisible" width="60%" @close="preViewVisible = false">
+        <img :src="imageUrl" style="width: 100%;" alt="">
+     </el-dialog>
   </div>
 </template>
 

+ 14 - 6
src/views/production-safety/safetyTrainingAndEducation/employeeTrainingRecordCardManagement/components/commonTable2.vue

@@ -2,7 +2,7 @@
  * @Author: liuJie
  * @Date: 2026-02-13 16:04:29
  * @LastEditors: liuJie
- * @LastEditTime: 2026-03-19 10:27:05
+ * @LastEditTime: 2026-04-17 17:31:01
  * @Describe: file describe
 -->
 <script setup lang="ts">
@@ -145,6 +145,15 @@
     tableQuery.pageNumber = 1;
     handleSearch();
   };
+  const getNumber = (value, unit)=>{
+    if(value===0){
+        return value + unit;
+    }else if(value === null || value === undefined || value === ''){
+        return '-';
+    } else {
+        return value + unit
+    }
+  }
 </script>
 <template>
   <div>
@@ -166,25 +175,24 @@
 
     <!-- 表格 -->
     <el-table border stripe :data="tableData">
-      <el-table-column type="selection" width="50" />
-      <el-table-column label="编号" prop="serialNum" width="100" />
+      <el-table-column label="编号" type="index" width="80" align="center" />
       <el-table-column label="日期" prop="logDate" width="200" />
       <el-table-column label="工种名称" prop="educationContent" width="180" />
       <el-table-column label="考核成绩-应知" prop="score" width="220">
         <template #default="scope">
-          <span>{{ scope.row.score }}</span>
+          <span>{{  getNumber(scope.row.score, '分') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="考核成绩-应会" prop="scoreMust" width="220">
         <template #default="scope">
-          <span>{{ scope.row.scoreMust }}</span>
+          <span>{{  getNumber(scope.row.scoreMust, '分') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作证号" prop="operationCertificateNum" width="220" />
       <el-table-column label="培训单位" prop="trainingCompany" width="220" />
       <el-table-column label="学时" prop="creditHour" width="120">
         <template #default="scope">
-          <span>{{ scope.row.creditHour }}</span>
+          <span>{{  getNumber(scope.row.creditHour, '时') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" width="220" fixed="right">

+ 2 - 2
src/views/production-safety/safetyTrainingAndEducation/employeeTrainingRecordCardManagement/components/employeeTrainingRecordCardManagementDetail.vue

@@ -39,8 +39,8 @@
           <el-descriptions-item label="文化程度">{{ employeeDetail.highestDegree }}</el-descriptions-item>
           <el-descriptions-item label="从事岗位">{{ employeeDetail.staffJob }}</el-descriptions-item>
 
-          <el-descriptions-item label="本岗位工龄">{{ employeeDetail.jobSeniority }}</el-descriptions-item>
-          <el-descriptions-item label="技术等级">{{ employeeDetail.technicalLvl }}</el-descriptions-item>
+          <el-descriptions-item label="本岗位工龄">{{ employeeDetail.jobSeniority }}</el-descriptions-item>
+          <el-descriptions-item label="技术等级">{{ employeeDetail.technicalLvl }}</el-descriptions-item>
 
           <el-descriptions-item label="职称">{{ employeeDetail.professionalTitle }}</el-descriptions-item>
           <el-descriptions-item label="照片">

+ 10 - 2
src/views/production-safety/safetyTrainingAndEducation/employeeTrainingRecordCardManagement/configs/tables.ts

@@ -2,7 +2,7 @@
  * @Author: liuJie
  * @Date: 2026-02-03 17:55:50
  * @LastEditors: liuJie
- * @LastEditTime: 2026-02-24 17:33:42
+ * @LastEditTime: 2026-04-17 17:05:07
  * @Describe: file describe
  */
 import type { TableColumnProps } from '@/types/basic-table';
@@ -17,7 +17,7 @@ export const TABLE_OPTIONS = {
 export const TABLE_COLUMNS: TableColumnProps[] = [
   {
     label: '编号',
-    prop: 'serialNum',
+    type: 'index',
     align: 'center',
     width: '80px',
   },
@@ -25,41 +25,49 @@ export const TABLE_COLUMNS: TableColumnProps[] = [
     label: '员工工号',
     prop: 'staffNo',
     align: 'left',
+    minWidth: '140px',
   },
   {
     label: '状态',
     prop: 'statusName',
     align: 'left',
+    minWidth: '120px',
   },
   {
     label: '员工姓名',
     prop: 'staffName',
     align: 'center',
+    minWidth: '120px',
   },
   {
     label: '从事岗位',
     prop: 'staffJob',
     align: 'left',
+    minWidth: '120px',
   },
   {
     label: '文化程度',
     prop: 'highestDegree',
     align: 'left',
+    minWidth: '120px',
   },
   {
     label: '本岗位工龄',
     prop: 'jobSeniority',
     align: 'center',
+    minWidth: '160px',
   },
   {
     label: '职称',
     prop: 'professionalTitle',
     align: 'left',
+    minWidth: '120px',
   },
   {
     label: '入职日期',
     prop: 'dateOfJoining',
     align: 'center',
+    minWidth: '160px',
   },
   {
     label: '操作',