فهرست منبع

王子文 专项培训

wangggziwen 3 سال پیش
والد
کامیت
a4d0b8ebc9

+ 21 - 2
ui/src/views/training/spec/mentorfeedback/index.vue

@@ -46,6 +46,7 @@
           ref="feedbackListTable"
           :height="clientHeight"
           border
+          :cell-style="tableCellStyle"
         >
           <el-table-column label="学员" width="80" align="center" :show-overflow-tooltip="true" prop="staffName"/>
           <el-table-column label="时间" align="center" :show-overflow-tooltip="true" width="120">
@@ -57,7 +58,7 @@
           <el-table-column label="开始日期" align="center" :show-overflow-tooltip="true" width="120" prop="startDate"/>
           <el-table-column label="结束日期" align="center" :show-overflow-tooltip="true" width="120" prop="endDate"/>
           <el-table-column label="实际完成日期" align="center" :show-overflow-tooltip="true" width="120" prop="dateOfCompletion"/>
-          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyState"/>
+          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyState" :formatter="studyStateFormat"/>
           <el-table-column label="学员反馈" align="center" prop="successorFeedback" :show-overflow-tooltip="true">
             <template slot-scope="scope">
               <span>{{scope.row.feecbackStatus ? scope.row.successorFeedback : ""}}</span>
@@ -152,6 +153,7 @@
           :height="clientHeight"
           ref="feedbackListSeasonalTable"
           border
+          :cell-style="tableCellStyle"
         >
           <el-table-column label="学员" width="80" align="center" :show-overflow-tooltip="true" prop="staffName"/>
           <el-table-column label="时间" align="center" :show-overflow-tooltip="true" width="200">
@@ -163,7 +165,7 @@
           <el-table-column label="开始日期" align="center" :show-overflow-tooltip="true" width="120" prop="startDate"/>
           <el-table-column label="结束日期" align="center" :show-overflow-tooltip="true" width="120" prop="endDate"/>
           <el-table-column label="实际完成日期" align="center" :show-overflow-tooltip="true" width="120" prop="dateOfCompletion"/>
-          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyState"/>
+          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyState" :formatter="studyStateFormat"/>
           <el-table-column label="导师反馈" align="center" prop="mentorFeedback" :show-overflow-tooltip="true"/>
           <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
             <template slot-scope="scope">
@@ -281,6 +283,9 @@ export default {
   components: { Treeselect },
   data() {
     return {
+      // 学习状态字典
+      studyStateOptions: [],
+      // 复选框是否选中
       checked:false,
       // 标签页选中项
       activeName: 'first',
@@ -308,6 +313,7 @@ export default {
       clientHeight:300,
       // 是否显示弹出层
       open: false,
+      open2: false,
         // 用户导入参数
         upload: {
             // 是否显示弹出层(用户导入)
@@ -416,11 +422,24 @@ export default {
       this.$nextTick(() => {
           this.clientHeight = document.body.clientHeight -250
       })
+    this.getDicts("st_study_state").then(response => {
+      this.studyStateOptions = response.data;
+    });
     this.getList();
     this.getListSeasonal();
     this.getTreeselect();
   },
   methods: {
+    // 单元格样式
+    tableCellStyle (row, column, rowIndex, columnIndex) {
+      if (row.column.label === "实际完成培训日期" && row.row.dateOfCompletion > row.row.endDate) {
+        return "background: #FFEEEE"
+      }
+    },
+    /** 学习状态字典翻译 */
+    studyStateFormat(row, column) {
+      return this.selectDictLabel(this.studyStateOptions, row.studyState);
+    },
     // 合并单元格
     spanMethod({ row, column, rowIndex, columnIndex }) {
       // 按月合并单元格

+ 5 - 9
ui/src/views/training/spec/myplan/index.vue

@@ -110,7 +110,7 @@
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row> -->
     <!-- 表格 -->
-    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :row-style="tableRowStyle">
+    <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :cell-style="tableCellStyle">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="培训员工" align="center" prop="staffName" :show-overflow-tooltip="true"/>
       <el-table-column label="培训内容" align="center" prop="plantName" :show-overflow-tooltip="true"/>
@@ -547,15 +547,11 @@ export default {
     });
   },
   methods: {
-    /** 表格行样式 */
-    tableRowStyle({row, rowIndex}) {
-      let rowBackground = {};
-      // 实际完成培训日期超出培训结束日期
-      if (row.endDate < row.dateOfCompletion) {
-        // 修改变行背景色
-        rowBackground.background = "#FFEEEE";
+    // 单元格样式
+    tableCellStyle (row, column, rowIndex, columnIndex) {
+      if (row.column.label === "实际完成培训日期" && row.row.dateOfCompletion > row.row.endDate) {
+        return "background: #FFEEEE"
       }
-      return rowBackground;
     },
     /** 结束学习处理 */
     handleEnd(row) {

+ 11 - 9
ui/src/views/training/spec/plan/index.vue

@@ -112,7 +112,7 @@
 	  <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
     </el-row>
     <!-- 表格 -->
-    <el-table v-loading="loading" ref="planTable" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :row-style="tableRowStyle">
+    <el-table v-loading="loading" ref="planTable" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border :cell-style="tableCellStyle">
       <el-table-column type="selection" width="55"   align="center" />
       <el-table-column label="培训员工" fixed="left"align="center"   prop="staffName" :show-overflow-tooltip="true"/>
       <el-table-column label="培训内容" fixed="left" align="center" width="150"   prop="plantName" :show-overflow-tooltip="true"/>
@@ -742,15 +742,17 @@ export default {
     this.getSuccessorOptions();
   },
   methods: {
-    /** 表格行样式 */
-    tableRowStyle({row, rowIndex}) {
-      let rowBackground = {};
-      // 实际完成培训日期超出培训结束日期
-      if (row.endDate < row.dateOfCompletion) {
-        // 修改变行背景色
-        rowBackground.background = "#FFEEEE";
+    // 单元格样式
+    tableCellStyle (row, column, rowIndex, columnIndex) {
+      if (row.column.label === "实际完成培训日期" && row.row.dateOfCompletion > row.row.endDate) {
+        return "background: #FFEEEE"
+      }
+      if (row.column.label === "修改人" && row.row.updateBy!=null) {
+        return "background: #FFFFDB"
+      }
+      if (row.column.label === "修改时间" && row.row.updatedate!=null) {
+        return "background: #FFFFDB"
       }
-      return rowBackground;
     },
     /** 评价提交处理 */
     handleAddComment() {

+ 20 - 3
ui/src/views/training/spec/successorfeedback/index.vue

@@ -35,7 +35,8 @@
           :data="feedbackList" 
           @selection-change="handleSelectionChange" 
           :height="clientHeight" 
-          border
+          border 
+          :cell-style="tableCellStyle"
         >
           <el-table-column label="时间" align="center" :show-overflow-tooltip="true" width="120">
             <template slot-scope="scope">
@@ -46,7 +47,7 @@
           <el-table-column label="开始日期" align="center" :show-overflow-tooltip="true" width="120" prop="startDate"/>
           <el-table-column label="结束日期" align="center" :show-overflow-tooltip="true" width="120" prop="endDate"/>
           <el-table-column label="实际完成日期" align="center" :show-overflow-tooltip="true" width="120" prop="dateOfCompletion"/>
-          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyStatus"/>
+          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyStatus"  :formatter="studyStateFormat"/>
           <el-table-column label="学员反馈" align="center" prop="successorFeedback" :show-overflow-tooltip="true"/>
           <el-table-column label="导师反馈" align="center" prop="mentorFeedback" :show-overflow-tooltip="true"/>
           <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
@@ -130,6 +131,7 @@
         </el-form>
         <!-- 列表 -->
         <el-table
+          :cell-style="tableCellStyle"
           :span-method="spanMethod" 
           v-loading="loading" 
           :data="feedbackListSeasonal" 
@@ -146,7 +148,7 @@
           <el-table-column label="开始日期" align="center" :show-overflow-tooltip="true" width="120" prop="startDate"/>
           <el-table-column label="结束日期" align="center" :show-overflow-tooltip="true" width="120" prop="endDate"/>
           <el-table-column label="实际完成日期" align="center" :show-overflow-tooltip="true" width="120" prop="dateOfCompletion"/>
-          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyStatus"/>
+          <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyStatus"  :formatter="studyStateFormat"/>
           <el-table-column label="导师反馈" align="center" prop="mentorFeedback" :show-overflow-tooltip="true"/>
           <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
             <template slot-scope="scope">
@@ -249,6 +251,8 @@ export default {
   components: { Treeselect },
   data() {
     return {
+      // 学习状态字典
+      studyStateOptions: [],
       // 标签页选中项
       activeName: 'first',
       // 遮罩层
@@ -378,11 +382,24 @@ export default {
       this.$nextTick(() => {
           this.clientHeight = document.body.clientHeight -250
       })
+    this.getDicts("st_study_state").then(response => {
+      this.studyStateOptions = response.data;
+    });
     this.getList();
     this.getListSeasonal();
     this.getTreeselect();
   },
   methods: {
+    // 单元格样式
+    tableCellStyle (row, column, rowIndex, columnIndex) {
+      if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
+        return "background: #FFEEEE"
+      }
+    },
+    /** 学习状态字典翻译 */
+    studyStateFormat(row, column) {
+      return this.selectDictLabel(this.studyStateOptions, row.studyState);
+    },
     // 合并单元格
     spanMethod({ row, column, rowIndex, columnIndex }) {
       if (columnIndex === 0 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8) {