Browse Source

王子文 2022年4月19日 10点47分 专项培训 - 培训计划
1) 调整:新增模态框 - 培训员工文本框 - 修改为为下拉列表(key = staffId, label = staffName)
2) 调整:新增模态框 - 学习状态下拉列表 - 移除 新增默认为“未学习”
3) 调整:查询所有培训计划 - 后端API返回数据集合新增属性staffName(sys_user.nick_name)
4) 调整:查询所有培训计划 - 修改列名“培训员工编号”修改为“培训员工” 值staffId修改为staffName

wangggziwen 3 years ago
parent
commit
f6e25aa988

+ 1 - 5
master/src/main/java/com/ruoyi/project/training/spec/controller/TStPlanController.java

@@ -53,11 +53,7 @@ public class TStPlanController extends BaseController
     @GetMapping("/getSuccessorListByMentorId")
     public AjaxResult getSuccessorListByMentorId(TStSuccessor tStSuccessor) {
         List<TStSuccessor> tStSuccessors = tStSuccessorService.selectTStSuccessorListByMentorId(tStSuccessor);
-        Map<String, String> successorMap = new HashMap<>();
-        for (TStSuccessor successor : tStSuccessors) {
-            successorMap.put(successor.getStaffId(), successor.getStaffName());
-        }
-        return AjaxResult.success(successorMap);
+        return AjaxResult.success(tStSuccessors);
     }
 
     /**

+ 0 - 2
master/src/main/resources/mybatis/aspen/TDashboarddayelecMapper.xml

@@ -94,7 +94,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             date_day
         from
             t_dashboarddayelec
-        <!-- 王子文 2022年4月15日 修改 -->
     </sql>
 
     <select id="selectTDashboarddayelecList" parameterType="TDashboarddayelec" resultMap="TDashboarddayelecResult">
@@ -141,7 +140,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <!-- 王子文 2022年4月15日 修改 -->
             <!-- and d.del_flag = 0  -->
             and del_flag = 0
-            <!-- 王子文 2022年4月15日 修改 -->
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}

+ 26 - 13
ui/src/views/training/spec/plan/index.vue

@@ -112,7 +112,7 @@
 
     <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="培训员工编号" align="center" prop="staffId" :show-overflow-tooltip="true"/>
+      <el-table-column label="培训员工" align="center" prop="staffName" :show-overflow-tooltip="true"/>
       <el-table-column label="培训内容" align="center" prop="plantName" :show-overflow-tooltip="true"/>
       <el-table-column label="开始日期" align="center" prop="startDate" width="100">
         <template slot-scope="scope">
@@ -127,7 +127,7 @@
       <el-table-column label="学时" align="center" prop="classHour" :show-overflow-tooltip="true"/>
       <el-table-column label="具体内容" align="center" prop="classContent" :show-overflow-tooltip="true"/>
       <el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat" />
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -158,16 +158,17 @@
     <!-- 添加或修改培训计划对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <!-- <el-form-item label="培训员工" prop="staffId">
-          <el-select v-model="form.successorOptions" placeholder="请选择学员">
+        <!-- 添加对话框显示下拉列表 -->
+        <el-form-item label="培训员工" prop="staffId">
+          <el-select v-model="form.staffId" placeholder="请选择学员">
             <el-option
               v-for="successor in successorOptions"
-              :key="successor.value"
-              :label="successor.label"
-              :value="successor.value"
+              :key="successor.key"
+              :label="successor.value"
+              :value="successor.key"
             ></el-option>
           </el-select>
-        </el-form-item> -->
+        </el-form-item>
         <el-form-item label="培训内容" prop="plantName">
           <el-input v-model="form.plantName" placeholder="请输入培训内容" />
         </el-form-item>
@@ -194,9 +195,15 @@
           <el-input v-model="form.classHour" placeholder="请输入学时" />
         </el-form-item>
         <el-form-item label="具体内容">
-          <editor v-model="form.classContent" :min-height="192"/>
+          <!-- <editor v-model="form.classContent" :min-height="192"/> -->
+          <el-input
+            type="textarea"
+            :rows="6"
+            placeholder="请输入内容"
+            v-model="form.classContent">
+          </el-input>
         </el-form-item>
-        <el-form-item label="学习状态" prop="studyState">
+        <el-form-item label="学习状态" prop="studyState" v-if="this.operation=='modify'">
           <el-select v-model="form.studyState" placeholder="请选择学习状态">
             <el-option
               v-for="dict in studyStateOptions"
@@ -281,6 +288,8 @@ export default {
       planList: [],
       // 弹出层标题
       title: "",
+      // 操作
+      operation: "",
       // 部门树选项
       deptOptions: undefined,
       clientHeight:300,
@@ -350,10 +359,12 @@ export default {
     getSuccessorOptions() {
       getSuccessorListByMentorId(this.queryObject).then(response => {
         let successorList = response.data;
-        for (successor in successorList) {
-          console.log(successor);
+        for (let i = 0; i < successorList.length; i++) {
+          let successor = {};
+          successor.key = successorList[i].staffId;
+          successor.value = successorList[i].staffName;
+          this.successorOptions.push(successor);
         }
-        // this.successorOptions = response.data;
       });
     },
     /** 查询培训计划列表 */
@@ -422,6 +433,7 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加培训计划";
+      this.operation = "add";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -431,6 +443,7 @@ export default {
         this.form = response.data;
         this.open = true;
         this.title = "修改培训计划";
+        this.operation = "modify";
       });
     },
     /** 提交按钮 */