ly преди 3 години
родител
ревизия
c311e514ef

+ 44 - 1
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -170,7 +170,7 @@ public class TStaffmgrController extends BaseController
     }
 
     /**
-     * 查询人员管理列表
+     * 查询人员管理列表(包含离职)
      */
     @PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
     @GetMapping("/getAllList")
@@ -180,6 +180,28 @@ public class TStaffmgrController extends BaseController
         startPage();
         logger.info("staffmgr:" + tStaffmgr);
         List<TStaffmgr> list = tStaffmgrService.selectAllTStaffmgrList(tStaffmgr);
+        try {
+            //判断离职
+            if (!StringUtils.isEmpty(tStaffmgr.getLeftYear())) {
+                Iterator<TStaffmgr> iterator = list.iterator();
+                while (iterator.hasNext()) {
+                    TStaffmgr t = iterator.next();
+                    if (t.getLeftDate() != null && t.getDelFlag() == 9){
+                        Calendar cal = Calendar.getInstance();
+                        cal.setTime(t.getLeftDate());
+                        Integer year = cal.get(Calendar.YEAR);//获取年
+                        if (year < Integer.parseInt(tStaffmgr.getLeftYear())) {
+                            logger.debug(t.getName() + "离职年份小于数据");
+                            iterator.remove();
+                        }
+                    }
+                }
+            }
+        }catch (Exception e) {
+            logger.error(e.toString());
+        }
+
+
         return getDataTable(list);
     }
 
@@ -193,6 +215,27 @@ public class TStaffmgrController extends BaseController
         ServletUtils.getParameter("sexs");
         startPage();
         List<TStaffmgr> list = tStaffmgrService.selectRecordList(tStaffmgr);
+        try {
+            //判断离职
+            if (!StringUtils.isEmpty(tStaffmgr.getLeftYear())) {
+                Iterator<TStaffmgr> iterator = list.iterator();
+                while (iterator.hasNext()) {
+                    TStaffmgr t = iterator.next();
+                    if (t.getLeftDate() != null && t.getDelFlag() == 9){
+                        Calendar cal = Calendar.getInstance();
+                        cal.setTime(t.getLeftDate());
+                        Integer year = cal.get(Calendar.YEAR);//获取年
+                        if (year < Integer.parseInt(tStaffmgr.getLeftYear())) {
+                            logger.debug(t.getName() + "离职年份小于数据");
+                            iterator.remove();
+                        }
+                    }
+                }
+            }
+        }catch (Exception e) {
+            logger.error(e.toString());
+        }
+        logger.info("selectTime:" + list.size());
         List<TTrainingParticipants> tTrainingParticipants = tTrainingParticipantsService.selectTTrainingParticipantsList(new TTrainingParticipants());
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
         for (int i = 0; i < list.size(); i++) {

+ 10 - 0
master/src/main/java/com/ruoyi/project/plant/domain/TStaffmgr.java

@@ -128,6 +128,8 @@ public class TStaffmgr extends BaseEntity
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date leftDate;
 
+    private String leftYear;
+
     public Date getLeftDate() {
         return leftDate;
     }
@@ -376,6 +378,14 @@ public class TStaffmgr extends BaseEntity
 
     public String getSpecialDuty() { return specialDuty; }
 
+    public String getLeftYear() {
+        return leftYear;
+    }
+
+    public void setLeftYear(String leftYear) {
+        this.leftYear = leftYear;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 27 - 5
master/src/main/java/com/ruoyi/project/training/controller/TTrainingDeviceController.java

@@ -1,9 +1,7 @@
 package com.ruoyi.project.training.controller;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.plant.service.ITStaffmgrService;
@@ -11,6 +9,7 @@ import com.ruoyi.project.training.domain.TTraining;
 import com.ruoyi.project.training.domain.TTrainingRegular;
 import com.ruoyi.project.training.service.ITTrainingRegularService;
 import com.ruoyi.project.training.service.ITTrainingService;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -78,9 +77,32 @@ public class TTrainingDeviceController extends BaseController
         tTraining.setYear(tTrainingDevice.getYear());
         tTraining.setTrainingType(tTrainingDevice.getTrainingType());
         List<TTraining> tTrainings = tTrainingService.selectTTrainingList(tTraining);
-
         List<List> deviceLevelList = new ArrayList<>();
-        List<TStaffmgr> staffmgrs = tStaffmgrService.selectRecordList(new TStaffmgr());
+        //查询人员 ,客户的需求:units值
+        TStaffmgr paramStaff = new TStaffmgr();
+        paramStaff.setUnits(tTrainingDevice.getUnits());
+        List<TStaffmgr> staffmgrs = tStaffmgrService.selectRecordList(paramStaff);
+        try {
+            //判断离职
+            if (!StringUtils.isEmpty(tTrainingDevice.getYear())) {
+                Iterator<TStaffmgr> iterator = staffmgrs.iterator();
+                while (iterator.hasNext()) {
+                    TStaffmgr t = iterator.next();
+                    if (t.getLeftDate() != null && t.getDelFlag() == 9){
+                        Calendar cal = Calendar.getInstance();
+                        cal.setTime(t.getLeftDate());
+                        Integer year = cal.get(Calendar.YEAR);//获取年
+                        if (year < Integer.parseInt(tTrainingDevice.getYear())) {
+                            logger.debug(t.getName() + "离职年份小于数据");
+                            iterator.remove();
+                        }
+                    }
+                }
+            }
+        }catch (Exception e) {
+            logger.error(e.toString());
+        }
+        logger.info("deviceList:" + staffmgrs.size());
         for (int i = 0; i < tTrainings.size(); i++) {
             //每一类装置级培训数据
             List<String> device = new ArrayList<>();

+ 10 - 0
master/src/main/java/com/ruoyi/project/training/domain/TTrainingDevice.java

@@ -85,6 +85,8 @@ public class TTrainingDevice extends BaseEntity
     /** 年份 */
     private String year;
 
+    private String units;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -237,6 +239,14 @@ public class TTrainingDevice extends BaseEntity
 
     public String getYear() { return year; }
 
+    public String getUnits() {
+        return units;
+    }
+
+    public void setUnits(String units) {
+        this.units = units;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 1 - 1
master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml

@@ -219,7 +219,7 @@
                     #{item}
                 </foreach>
             </if>
-            and d.del_flag = 0
+            and d.del_flag in (0 , 9)
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}

+ 13 - 3
ui/src/views/ehs/environapproval/index.vue

@@ -411,6 +411,7 @@
                               v-model="form.reviewdate"
                               type="date"
                               value-format="yyyy-MM-dd"
+                              @change="handleStaff"
                               :placeholder="$t('请选择') + $t('本次回顾日期')">
               </el-date-picker>
             </el-form-item>
@@ -556,7 +557,7 @@
 
 <script>
 import { listEnvironapproval, getEnvironapproval, delEnvironapproval, addEnvironapproval, updateEnvironapproval, exportEnvironapproval } from "@/api/ehs/environapproval";
-import { listStaffmgr } from "@/api/plant/staffmgr";
+import { listStaffmgr,listAllStaffmgr } from "@/api/plant/staffmgr";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -820,10 +821,16 @@ export default {
         this.loading = false;
       });
     },
-    getReviewer() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getReviewer(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.reviewerOptions = response.rows;
       });
+    },
+    //年份选择change事件
+    handleStaff(val){
+      let year = val.substring(0,4)
+      this.getReviewer(year)
     },
      /** 查询部门下拉树结构 */
      getTreeselect() {
@@ -925,6 +932,7 @@ export default {
       this.form.reqPic = false;
       this.form.conPic = false;
       this.title = this.$t('新增') + " " + this.$t('环保批文清单');
+      this.getReviewer()
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -969,6 +977,8 @@ export default {
         this.picture.pId = row.id;
         this.open = true;
         this.title = this.$t('修改') + this.$t('环保批文清单');
+        //根据回顾日期筛选
+        this.getReviewer( response.data.reviewdate.substring(0,4))
       });
     },
     /** 主要内容操作 */

+ 13 - 3
ui/src/views/ehs/fireapproval/index.vue

@@ -304,6 +304,7 @@
                               v-model="form.reviewdate"
                               type="date"
                               value-format="yyyy-MM-dd"
+                              @change="handleStaff"
                               :placeholder="$t('请选择') + $t('本次回顾日期')">
               </el-date-picker>
             </el-form-item>
@@ -447,7 +448,7 @@
 
 <script>
 import { listFireapproval, getFireapproval, delFireapproval, addFireapproval, updateFireapproval, exportFireapproval } from "@/api/ehs/fireapproval";
-import { listStaffmgr } from "@/api/plant/staffmgr";
+import { listStaffmgr,listAllStaffmgr } from "@/api/plant/staffmgr";
 import {allFileList, delCommonfile} from "@/api/common/commonfile";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
@@ -676,10 +677,16 @@ export default {
         this.loading = false;
       });
     },
-    getReviewer() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getReviewer(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.reviewerOptions = response.rows;
       });
+    },
+    //年份选择change事件
+    handleStaff(val){
+      let year = val.substring(0,4)
+      this.getReviewer(year)
     },
      /** 查询部门下拉树结构 */
      getTreeselect() {
@@ -768,6 +775,7 @@ export default {
       this.open = true;
       this.chooseDate = [];
       this.title = this.$t('新增') + " " + this.$t('消防批文清单');
+      this.getReviewer()
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -784,6 +792,8 @@ export default {
         this.chooseDate = this.$set(this.form,'chooseDate',[""+response.data.validityBefore+"",""+response.data.validityAfter+""]);
         this.open = true;
         this.title = this.$t('修改') + this.$t('消防批文清单');
+        //根据回顾日期筛选
+        this.getReviewer( response.data.reviewdate.substring(0,4))
       });
     },
     /** 提交按钮 */

+ 13 - 3
ui/src/views/ehs/healthapproval/index.vue

@@ -283,6 +283,7 @@
                               v-model="form.reviewdate"
                               type="date"
                               value-format="yyyy-MM-dd"
+                              @change="handleStaff"
                               :placeholder="$t('请选择') + $t('本次回顾日期')">
               </el-date-picker>
             </el-form-item>
@@ -425,7 +426,7 @@
 
 <script>
 import { listHealthapproval, getHealthapproval, delHealthapproval, addHealthapproval, updateHealthapproval, exportHealthapproval} from "@/api/ehs/healthapproval";
-import { listStaffmgr } from "@/api/plant/staffmgr";
+import { listStaffmgr, listAllStaffmgr } from "@/api/plant/staffmgr";
 import {allFileList, delCommonfile} from "@/api/common/commonfile";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
@@ -609,11 +610,17 @@ export default {
               this.deptOptions = response.data;
           });
      },
-    getReviewer() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getReviewer(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.reviewerOptions = response.rows;
       });
     },
+    //年份选择change事件
+    handleStaff(val){
+      let year = val.substring(0,4)
+      this.getReviewer(year)
+    },
     // 证书有效期是否永久字典翻译
     isPermanentFormat(row, column) {
       return this.selectDictLabel(this.isPermanentOptions, row.isPermanent);
@@ -688,6 +695,7 @@ export default {
       this.reset();
       this.open = true;
       this.title = this.$t('添加') + this.$t('卫生批文清单');
+      this.getReviewer()
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -698,6 +706,8 @@ export default {
         this.chooseDate = this.$set(this.form,'chooseDate',[""+response.data.validityBefore+"",""+response.data.validityAfter+""]);
         this.open = true;
         this.title = this.$t('修改') + this.$t('卫生批文清单');
+        //根据回顾日期筛选
+        this.getReviewer( response.data.reviewdate.substring(0,4))
       });
     },
     /** 提交按钮 */

+ 16 - 4
ui/src/views/ehs/safetyapproval/index.vue

@@ -308,6 +308,7 @@
                               v-model="form.reviewdate"
                               type="date"
                               value-format="yyyy-MM-dd"
+                              @change="handleStaff"
                               :placeholder="$t('请选择') + $t('本次回顾日期')">
               </el-date-picker>
             </el-form-item>
@@ -451,7 +452,7 @@
 
 <script>
 import { listSafetyapproval, getSafetyapproval, delSafetyapproval, addSafetyapproval, updateSafetyapproval, exportSafetyapproval } from "@/api/ehs/safetyapproval";
-import { listStaffmgr } from "@/api/plant/staffmgr";
+import {listAllStaffmgr, listStaffmgr} from "@/api/plant/staffmgr";
 import {allFileList, delCommonfile} from "@/api/common/commonfile";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
@@ -585,7 +586,9 @@ export default {
         effetiveYear: null
       },
       //人员表查询参数
-      staffmgrQueryParams: {},
+      staffmgrQueryParams: {
+        leftYear: null
+      },
       // 表单参数
       form: {},
       //证书是否永久
@@ -689,11 +692,17 @@ export default {
               this.deptOptions = response.data;
           });
      },
-    getReviewer() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getReviewer(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.reviewerOptions = response.rows;
       });
     },
+    //年份选择change事件
+    handleStaff(val){
+      let year = val.substring(0,4)
+      this.getReviewer(year)
+    },
     // 装置字典翻译
     plantCodeFormat(row, column) {
       return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
@@ -767,6 +776,7 @@ export default {
       this.open = true;
       this.chooseDate = [];
       this.title = this.$t('新增') + " " + this.$t('安全批文清单');
+      this.getReviewer()
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -783,6 +793,8 @@ export default {
         this.chooseDate = this.$set(this.form,'chooseDate',[""+response.data.validityBefore+"",""+response.data.validityAfter+""]);
         this.open = true;
         this.title = this.$t('修改') + this.$t('安全批文清单');
+        //根据回顾日期筛选
+        this.getReviewer( response.data.reviewdate.substring(0,4))
       });
     },
     /** 主要内容操作 */

+ 23 - 7
ui/src/views/plant/targetagreement/index.vue

@@ -153,7 +153,13 @@
     <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="$t('年份')" prop="year">
-          <el-input v-model="form.year" :placeholder="$t('请输入')+$t('年份')" :disabled="isDisabled" />
+          <el-date-picker clearable size="small" style="width: 200px" @change="handleStaff"
+                          v-model="form.year"
+                          type="year"
+                          value-format="yyyy"
+                          :disabled="isDisabled"
+                          :placeholder="$t('请选择')+$t('年份')">
+          </el-date-picker>
         </el-form-item>
         <el-form-item :label="$t('姓名')" prop="employeeid">
           <el-select v-model="form.employeeid" filterable :placeholder="$t('请选择')+$t('人员')" :disabled="isDisabled" >
@@ -425,7 +431,7 @@
 <script>
 import { listTargetagreement, getTargetagreement, delTargetagreement, addTargetagreement, updateTargetagreement, generateTargetagreement, exportTargetagreement, importTemplate} from "@/api/plant/targetagreement";
 import { listTargetyardstick, getTargetyardstick, delTargetyardstick, addTargetyardstick, updateTargetyardstick } from "@/api/plant/targetyardstick";
-import { listStaffmgr } from "@/api/plant/staffmgr";
+import {listAllStaffmgr, listStaffmgr} from "@/api/plant/staffmgr";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import {allFileList, delCommonfile ,updateCommonfile ,addCommonfile} from "@/api/common/commonfile";
@@ -554,7 +560,8 @@ export default {
       },
       //人员表查询参数
       staffmgrQueryParams: {
-        actualposts: null
+        actualposts: null,
+        leftYear: null
       },
       // 表单参数
       form: {},
@@ -625,16 +632,23 @@ export default {
             this.deptOptions = response.data;
         });
      },
-    getEmployee() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getEmployee(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.employeeOptions = response.rows;
       });
     },
-    getAppraiser() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getAppraiser(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.appraiserOptions = response.rows;
       });
     },
+    //年份选择change事件
+    handleStaff(val){
+      this.getAppraiser(val)
+      this.getEmployee(val)
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -728,6 +742,8 @@ export default {
         this.form = response.data;
         this.open = true;
         this.title = this.$t('修改')+this.$t('目标协议');
+        this.getAppraiser(response.data.year)
+        this.getEmployee(response.data.year)
       });
     },
     /** 判断标准按钮操作 */

+ 8 - 3
ui/src/views/plant/targetmeasures/index.vue

@@ -50,7 +50,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="targetlistList" :span-method="mergeMethod" @selection-change="handleSelectionChange" :cell-class-name="tableCellClassName" :height="clientHeight" border>
+    <el-table v-loading="loading" :data="targetlistList" :span-method="mergeMethod" @selection-change="handleSelectionChange"  :height="clientHeight" border>
       <el-table-column type="selection" width="50" align="center" />
       <el-table-column :label="$t('年份')" align="center" prop="year" width="50" />
       <el-table-column :label="$t('序号')" align="center" prop="item" width="50" />
@@ -116,7 +116,7 @@
             <el-form-item :label="$t('负责人')" prop="responsible">
               <el-select v-model="responsibles" filterable multiple :placeholder="$t('请选择') + $t('负责人')">
                 <el-option
-                  v-for="dict in responsibleOptions"
+                  v-for="dict in responsibleOptions2"
                   :key="dict.staffid"
                   :label="dict.name"
                   :value="dict.staffid">
@@ -393,7 +393,8 @@
         },
         //人员表查询参数
         staffmgrQueryParams: {
-          actualposts: "12,14,16,18,20,24,26,36"
+          actualposts: "12,14,16,18,20,24,26,36",
+          leftYear: null
         },
         staffmgrPrincipal: {
           actualposts: null
@@ -583,6 +584,10 @@
             this.form.targets = response.data.targets;
             this.open = true;
             this.title = this.$t('修改')+this.$t('目标措施');
+            this.staffmgrQueryParams.leftYear =  this.form.year
+            listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+              this.responsibleOptions2 = response.rows;
+            });
           });
         });
       },

+ 5 - 3
ui/src/views/training/regular/index.vue

@@ -137,6 +137,7 @@
                           v-model="form.year"
                           type="year"
                           value-format="yyyy"
+                          @change="getLecturer"
                           :placeholder="$t('请选择') + $t('年份')">
           </el-date-picker>
         </el-form-item>
@@ -269,7 +270,7 @@
 
 <script>
   import { listRegular, getRegular, delRegular, addRegular, updateRegular, exportRegular, importTemplate} from "@/api/training/regular";
-  import { listStaffmgr } from "@/api/plant/staffmgr";
+  import { listStaffmgr, listAllStaffmgr } from "@/api/plant/staffmgr";
   import { treeselect } from "@/api/system/dept";
   import { getToken } from "@/utils/auth";
   import Treeselect from "@riophae/vue-treeselect";
@@ -459,8 +460,9 @@
           })
         });
       },
-      getLecturer() {
-        listStaffmgr(this.staffmgrQueryParams).then(response => {
+      getLecturer(year) {
+        this.staffmgrQueryParams.leftYear = year
+        listAllStaffmgr(this.staffmgrQueryParams).then(response => {
           this.lecturerOptions = response.rows;
         });
       },

+ 17 - 7
ui/src/views/training/training/index.vue

@@ -311,6 +311,7 @@
                               v-model="form.year"
                               type="year"
                               value-format="yyyy"
+                              @change="handleStaff"
                               :placeholder="$t('请选择') + $t('年份')">
               </el-date-picker>
             </el-form-item>
@@ -343,7 +344,7 @@
             <el-form-item :label="$t('指定人员')" prop="designatedStaff" v-if="haveDesignated === true && designatedPositions.length > 0">
               <el-select v-model="designatedStaffs" filterable multiple :placeholder="$t('请选择') + $t('指定人员')">
                 <el-option
-                  v-for="dict in stffmgrOptions"
+                  v-for="dict in designatedStaffsOptions"
                   :key="dict.staffid"
                   :label="dict.name"
                   :value="dict.staffid">
@@ -519,7 +520,7 @@
 import { listTraining, getTraining, delTraining, addTraining, updateTraining, exportTraining } from "@/api/training/training";
 import nonAdd from './trainingNon'
 import newAdd from './trainingNew'
-import {listStaffmgrAll, listStaffmgr } from "@/api/plant/staffmgr";
+import {listStaffmgrAll,listAllStaffmgr, listStaffmgr } from "@/api/plant/staffmgr";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -582,6 +583,8 @@ export default {
       stffmgrOptions: undefined,
       //人员表联查-包含离职
       stffmgrAllOptions: undefined,
+      //指定人员选项
+      designatedStaffsOptions: [],
       // 用户导入参数
       upload: {
         downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
@@ -861,11 +864,16 @@ export default {
       return this.selectDictLabel(this.isfinishOptions, row.isfinish);
     },
     //获取人员表
-    getStaffmar() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+    getStaffmar(year) {
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
         this.stffmgrOptions = response.rows;
       });
     },
+    //年份选择change事件
+    handleStaff(val){
+      this.getStaffmar(val)
+    },
     //获取人员表--包含离职
     getStaffmarAll() {
       listStaffmgrAll(this.staffmgrQueryParams).then(response => {
@@ -975,7 +983,7 @@ export default {
         })
         this.staffmgrQueryParams.actualposts = designatedId;
         listStaffmgr(this.staffmgrQueryParams).then(response => {
-          this.stffmgrOptions = response.rows;
+          this.designatedStaffsOptions = response.rows;
         });
 
         let _this = this
@@ -1015,6 +1023,7 @@ export default {
       });
       this.form.trainingType = this.queryParams.trainingType
       this.title = this.$t('新增') + this.$t('空格') + this.$t('培训计划');
+      this.getStaffmar()
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -1024,6 +1033,7 @@ export default {
       const id = row.id || this.ids
       getTraining(id).then(response => {
         this.form = response.data;
+        this.getStaffmar(response.data.year)
         if (this.form.position != null) {
           this.form.position = this.form.position.split(',');
           this.getDicts("ACTUALPOST").then(response => {
@@ -1065,8 +1075,8 @@ export default {
           })
           this.staffmgrQueryParams.actualposts = designatedId;
           this.$nextTick(() => {
-            listStaffmgr(this.staffmgrQueryParams).then(response => {
-              this.stffmgrOptions = response.rows;
+            listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+              this.designatedStaffsOptions = response.rows;
             });
           })
         }else {

+ 30 - 12
ui/src/views/training/trainingrecords/index.vue

@@ -406,7 +406,7 @@
     </el-dialog>
     <!-- 装置级培训跟踪矩阵对话框 -->
     <el-dialog v-dialogDrag :title="deviceTrainingTitle" :visible.sync="deviceTrainingOpen" width="1400px" append-to-body @close="closeDialog()">
-      <el-form :model="deviceParams" ref="queryRegularForm" label-width="68px" :inline="true">
+      <el-form :model="deviceParams" ref="deviceParamsForm" label-width="68px" :inline="true">
         <el-form-item :label="$t('年份')" prop="year">
           <el-date-picker clearable size="small" style="width: 200px"
                           v-model="deviceParams.year"
@@ -797,7 +797,8 @@ export default {
       },
       //人员表查询参数
       staffmgrQueryParams: {
-        units: "10,18"
+        units: "10,18",
+        leftYear: this.getNowTime(),
       },
       queryCompanyParams: {
         staffId: null,
@@ -810,9 +811,10 @@ export default {
         trainingType: null
       },
       deviceParams: {
+        units: "10,18",
         staffId: null,
         regularId: null,
-        year: this.getNowTime(),
+        year: null,
         trainingType: null
       },
       worklicenseParams: {
@@ -1028,13 +1030,26 @@ export default {
     },
     //获取装置级培训列表
     getDeviceTraining() {
-      deviceListParticipants(this.deviceParams).then(response => {
-        this.devicelevelListTemp = response;
-        this.devicelevelList = response
-        this.deviceTrainingLoad = false
-        this.$nextTick(() => {
-          this.$refs.deviceTable.doLayout(); // 解决表格错位
-        });
+      this.staffmgrQueryParams.leftYear = this.deviceParams.year
+      selectTimeStaffmgr(this.staffmgrQueryParams).then(response => {
+        const allData = response.rows
+        const data = [];
+        for (let i = 0; i < allData.length; i++) {
+          data.push({
+            name: allData[i].name,
+            actualpost: this.selectDictLabel(this.positionOptions, allData[i].actualpost),
+            trainingTime: allData[i].trainingTime
+          });
+        }
+        this.transTitle = data;
+        deviceListParticipants(this.deviceParams).then(response => {
+          this.devicelevelListTemp = response;
+          this.devicelevelList = response
+          this.deviceTrainingLoad = false
+          this.$nextTick(() => {
+            this.$refs.deviceTable.doLayout(); // 解决表格错位
+          });
+        })
       })
     },
      /** 查询部门下拉树结构 */
@@ -1221,9 +1236,12 @@ export default {
       this.deviceTrainingOpen = true
       this.tableShow = true
       this.deviceParams.year = this.getNowTime();
-      setTimeout(() => {
+      this.$nextTick(() => {
         this.getDeviceTraining();
-      }, 10);
+      });
+      // setTimeout(() => {
+      //   this.getDeviceTraining();
+      // }, 10);
     },
     /** 人员培训时长按钮操作 */
     handleTime() {