ly 3 viikkoa sitten
vanhempi
commit
0206754c09
47 muutettua tiedostoa jossa 3085 lisäystä ja 900 poistoa
  1. 258 0
      master/src/main/java/com/ruoyi/framework/task/trainingbcc/TrainingMatrixTask.java
  2. 173 0
      master/src/main/java/com/ruoyi/project/document/controller/TPlantproglistController.java
  3. 126 1
      master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java
  4. 11 0
      master/src/main/java/com/ruoyi/project/plant/domain/TStaffmgr.java
  5. 2 2
      master/src/main/java/com/ruoyi/project/training/controller/TTrainingMatrixController.java
  6. 20 1
      master/src/main/java/com/ruoyi/project/training/controller/TTrainingbccRegularController.java
  7. 24 0
      master/src/main/java/com/ruoyi/project/training/domain/TTrainingMatrix.java
  8. 15 1
      master/src/main/java/com/ruoyi/project/training/domain/TTrainingbccDevice.java
  9. 22 0
      master/src/main/java/com/ruoyi/project/training/domain/TTrainingbccRegular.java
  10. 24 0
      master/src/main/java/com/ruoyi/project/training/elearn/controller/TElUserBookController.java
  11. 39 0
      master/src/main/java/com/ruoyi/project/training/elearn/controller/TElUserQuController.java
  12. 13 0
      master/src/main/java/com/ruoyi/project/training/elearn/domain/TElPaper.java
  13. 12 0
      master/src/main/java/com/ruoyi/project/training/elearn/domain/TElUserBook.java
  14. 10 0
      master/src/main/java/com/ruoyi/project/training/elearn/domain/TElUserQu.java
  15. 2 0
      master/src/main/java/com/ruoyi/project/training/elearn/mapper/TElUserBookMapper.java
  16. 0 0
      master/src/main/java/com/ruoyi/project/training/elearn/mapper/TElUserQuMapper.java
  17. 30 11
      master/src/main/java/com/ruoyi/project/training/elearn/service/impl/TElPaperServiceImpl.java
  18. 3 0
      master/src/main/java/com/ruoyi/project/training/mapper/TTrainingbccDeviceMapper.java
  19. 2 0
      master/src/main/java/com/ruoyi/project/training/mapper/TTrainingbccRegularMapper.java
  20. 8 1
      master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml
  21. 11 1
      master/src/main/resources/mybatis/training/TTrainingMatrixMapper.xml
  22. 27 0
      master/src/main/resources/mybatis/training/TTrainingbccDeviceMapper.xml
  23. 1 0
      master/src/main/resources/mybatis/training/TTrainingbccMapper.xml
  24. 40 2
      master/src/main/resources/mybatis/training/TTrainingbccRegularMapper.xml
  25. 6 1
      master/src/main/resources/mybatis/training/elearn/TElPaperMapper.xml
  26. 16 0
      master/src/main/resources/mybatis/training/elearn/TElUserBookMapper.xml
  27. 8 0
      ui/src/api/document/plantproglist.js
  28. 10 0
      ui/src/api/plant/staffmgr.js
  29. 10 0
      ui/src/api/training/bccregular.js
  30. 9 0
      ui/src/api/training/elearn/userBook.js
  31. 9 0
      ui/src/api/training/elearn/userQu.js
  32. 8 0
      ui/src/router/index.js
  33. 24 1
      ui/src/views/components/PlantProgList/index.vue
  34. 2 2
      ui/src/views/login.vue
  35. 3 3
      ui/src/views/plant/organization/branch.vue
  36. 5 5
      ui/src/views/plant/organization/index.vue
  37. 112 44
      ui/src/views/plant/staffmgr/index.vue
  38. 13 1
      ui/src/views/training/bccdevice/index.vue
  39. 34 815
      ui/src/views/training/bccregular/index.vue
  40. 812 0
      ui/src/views/training/bccregular/new-regular.vue
  41. 838 0
      ui/src/views/training/bccregular/regular.vue
  42. 3 1
      ui/src/views/training/elearn/paper/list.vue
  43. 1 0
      ui/src/views/training/elearn/paper/preview.vue
  44. 208 0
      ui/src/views/training/elearn/userBook/device-train.vue
  45. 45 5
      ui/src/views/training/matrix/index.vue
  46. 25 2
      ui/src/views/training/trainingbcc/deviceList.vue
  47. 11 0
      ui/src/views/training/trainingbcc/index.vue

+ 258 - 0
master/src/main/java/com/ruoyi/framework/task/trainingbcc/TrainingMatrixTask.java

@@ -0,0 +1,258 @@
+package com.ruoyi.framework.task.trainingbcc;
+
+import com.ruoyi.common.jpush.JiGuangPushService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.plant.service.ITStaffmgrService;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.mapper.SysUserMapper;
+import com.ruoyi.project.system.service.ISysDictTypeService;
+import com.ruoyi.project.training.domain.TTrainingMatrix;
+import com.ruoyi.project.training.domain.TTrainingbcc;
+import com.ruoyi.project.training.domain.TTrainingbccDevice;
+import com.ruoyi.project.training.domain.TTrainingbccRegular;
+import com.ruoyi.project.training.mapper.TTrainingbccRegularMapper;
+import com.ruoyi.project.training.service.ITTrainingMatrixService;
+import com.ruoyi.project.training.service.ITTrainingbccDeviceService;
+import com.ruoyi.project.training.service.ITTrainingbccRegularService;
+import com.ruoyi.project.training.service.ITTrainingbccService;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.time.LocalDate;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * 每年矩阵新增培训
+ *
+ * @author ruoyi
+ */
+@Component("trainingMatrixTask")
+public class TrainingMatrixTask extends BaseController
+{
+    @Autowired
+    private ITTrainingbccDeviceService tTrainingbccDeviceService;
+    @Autowired
+    private ITTrainingbccService tTrainingbccService;
+    @Resource
+    private SysUserMapper sysUserMapper;
+    @Autowired
+    private ITStaffmgrService tStaffmgrService;
+    @Autowired
+    private ITTrainingbccRegularService tTrainingbccRegularService;
+    @Autowired
+    private ISysDictTypeService iSysDictTypeService;
+    @Autowired
+    private ITTrainingbccService trainingbccService;
+    @Autowired
+    private ITTrainingbccDeviceService trainingbccDeviceService;
+    @Autowired
+    private ITTrainingMatrixService tTrainingMatrixService;
+
+    @Resource
+    private TTrainingbccRegularMapper tTrainingbccRegularMapper;
+
+    /**
+     * 每年矩阵新增培训
+     * 功能:基于fq_year字段的培训频率控制
+     * 
+     * 判断逻辑:根据最新一次regular记录的年份,计算距离当前年份的年数,
+     * 如果年数 >= fq_year,则需要添加培训
+     * 
+     * 注意:不再使用frequency字段,完全基于fq_year字段控制
+     */
+    public void trainingMatrixTask()
+    {
+
+        TTrainingbccRegular tr =new TTrainingbccRegular();
+        TTrainingMatrix tTrainingMatrix = new TTrainingMatrix();
+        tTrainingMatrix.setDeptId(103l);
+        tTrainingMatrix.setTrainingLevel("14");
+        List<TTrainingMatrix> list = tTrainingMatrixService.selectTTrainingMatrixList(tTrainingMatrix);
+        logger.info("===========" + list.size() + "");
+        int currentYear = LocalDate.now().getYear();
+        int resNum = 0;
+        for (TTrainingMatrix matrix: list
+        ) {
+            int addFlag = 0;
+            
+            // 新增:基于fq_year字段的判断逻辑
+            if (matrix.getFqYear() != null && !matrix.getFqYear().isEmpty()) {
+                try {
+                    int fqYear = Integer.parseInt(matrix.getFqYear());
+                    if (fqYear > 0) {
+                        // 根据最新的一次regular记录来判断是否需要添加培训
+                        tr.setItem(matrix.getItem());
+                        // 查询该培训项目的所有regular记录,按年份排序
+                        List<TTrainingbccRegular> allRegulars = tTrainingbccRegularService.selectTTrainingbccRegularList(tr);
+                        
+                        if (allRegulars.isEmpty()) {
+                            // 如果没有任何记录,则添加培训
+                            addFlag = 1;
+                            logger.info("培训项目:" + matrix.getItem() + ",fq_year=" + fqYear + 
+                                      ",无任何历史记录,需要添加培训");
+                        } else {
+                            // 找到最新的一次培训记录年份
+                            int latestYear = allRegulars.stream()
+                                .mapToInt(r -> {
+                                    try {
+                                        return Integer.parseInt(r.getYear());
+                                    } catch (NumberFormatException e) {
+                                        return 0;
+                                    }
+                                })
+                                .max()
+                                .orElse(0);
+                            
+                            // 计算距离最新培训的年数
+                            int yearsSinceLastTraining = currentYear - latestYear;
+                            
+                            logger.info("培训项目:" + matrix.getItem() + ",fq_year=" + fqYear + 
+                                      ",最新培训年份=" + latestYear + ",距离最新培训年数=" + yearsSinceLastTraining);
+                            
+                            // 如果距离最新培训的年数 >= fq_year,则需要添加培训
+                            if (yearsSinceLastTraining >= fqYear) {
+                                addFlag = 1;
+                                logger.info("根据fq_year=" + fqYear + ",距离最新培训" + yearsSinceLastTraining + 
+                                          "年,需要添加培训:" + matrix.getItem());
+                            } else {
+                                logger.info("培训项目:" + matrix.getItem() + ",fq_year=" + fqYear + 
+                                          ",距离最新培训" + yearsSinceLastTraining + "年,无需添加培训");
+                            }
+                        }
+                    }
+                } catch (NumberFormatException e) {
+                    logger.warn("fq_year字段值不是有效数字:" + matrix.getFqYear() + ",培训项目:" + matrix.getItem());
+                }
+            }
+            
+            // 如果fq_year字段为空或无效,则不添加培训
+            if (addFlag == 0) {
+                logger.info("培训项目:" + matrix.getItem() + ",fq_year字段为空或无效,跳过添加");
+            }
+            
+            if (addFlag == 1) {
+                TTrainingbccRegular tTrainingRegular = new TTrainingbccRegular();
+                tTrainingRegular.setDeptId(matrix.getDeptId());
+                tTrainingRegular.setActualpostId(matrix.getActualpostId());
+                tTrainingRegular.setCourseCode(matrix.getCourseCode());
+                tTrainingRegular.setItem(matrix.getItem());
+                tTrainingRegular.setHour(matrix.getHour());
+                tTrainingRegular.setInvolvedMoc("false");
+                tTrainingRegular.setNotPlan("false");
+                tTrainingRegular.setYear(String.valueOf(currentYear));
+
+                int doInsert = tTrainingbccRegularService.insertTTrainingbccRegular(tTrainingRegular);
+
+                logger.info("regular:" + tTrainingRegular);
+                tTrainingRegular.setDeptId(103l); //bcc专用
+                //新增培训计划定期类
+                TTrainingbcc tTraining = new TTrainingbcc();
+                tTraining.setTrainingType("10");
+                tTraining.setYears(tTrainingRegular.getYear());
+                tTraining.setCourse(tTrainingRegular.getItem());
+                tTraining.setCourseid(tTrainingRegular.getCourseCode());
+                tTraining.setDuration(tTrainingRegular.getHour());
+                tTraining.setTrainer(tTrainingRegular.getLecturer());
+                tTraining.setPosition(tTrainingRegular.getActualpostId());
+                tTraining.setIsfinish(Long.parseLong("0"));
+                tTraining.setDeptId(tTrainingRegular.getDeptId());
+                tTraining.setRegularId(tTrainingRegular.getId());
+                trainingbccService.insertTTrainingbcc(tTraining);
+                Long trainingId = tTraining.getId();
+                //新增人员-装置级关系
+                // 参培岗位人员
+                if (tTrainingRegular.getActualpostId() != null) {
+                    logger.info("参培岗位人员");
+                    TStaffmgr staffmgr = new TStaffmgr();
+                    staffmgr.setActualposts(tTrainingRegular.getActualpostId());
+                    staffmgr.setDeptId(tTrainingRegular.getDeptId());
+                    List<TStaffmgr> staffmgrs = tStaffmgrService.selectAllTStaffmgrList(staffmgr);
+                    try {
+                        //判断离职
+                        if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
+                            Iterator<TStaffmgr> iterator = staffmgrs.iterator();
+                            while (iterator.hasNext()) {
+                                TStaffmgr t = iterator.next();
+                                if (t.getLeftDate() != null && t.getDelFlag() == 9){
+                                    if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() < 0l ) {
+                                        logger.debug(t.getName() + "离职时间小于培训时间");
+                                        iterator.remove();
+                                    }
+                                }
+                            }
+                        }
+                    }catch (Exception e) {
+                        logger.error(e.toString());
+                    }
+                    for (TStaffmgr s : staffmgrs) {
+                        TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                        tTrainingDevice.setStaffId(s.getStaffid());
+                        tTrainingDevice.setRegularId(trainingId);
+                        tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                        tTrainingDevice.setSupplementary("0");
+                        trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                    }
+                }
+                //指定岗位人员
+                if (tTrainingRegular.getDesignatedStaff() != null) {
+                    logger.info("指定岗位人员");
+                    String[] designatedStaffs = tTrainingRegular.getDesignatedStaff().split(",");
+                    for (String staffId : designatedStaffs) {
+                        TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                        tTrainingDevice.setStaffId(staffId);
+                        tTrainingDevice.setRegularId(trainingId);
+                        tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                        tTrainingDevice.setSupplementary("0");
+                        trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                    }
+                }
+                //涉及其他部门
+                if (tTrainingRegular.getInvolvedMoc().equals("true")){
+                    logger.info("涉及MOC人员");
+                    TStaffmgr staffmgrMoc = new TStaffmgr();
+                    staffmgrMoc.setActualposts(tTrainingRegular.getDesignatedOther());
+                    List<TStaffmgr> staffmgrsMoc = tStaffmgrService.selectAllTStaffmgrList(staffmgrMoc);
+                    try {
+                        //判断离职
+                        if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
+                            Iterator<TStaffmgr> iterator = staffmgrsMoc.iterator();
+                            while (iterator.hasNext()) {
+                                TStaffmgr t = iterator.next();
+                                if (t.getLeftDate() != null && t.getDelFlag() == 9){
+                                    if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
+                                        logger.debug(t.getName() + "离职时间小于培训时间");
+                                        iterator.remove();
+                                    }
+                                }
+                            }
+                        }
+                    }catch (Exception e) {
+                        logger.error(e.toString());
+                    }
+                    for (TStaffmgr s : staffmgrsMoc) {
+                        TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                        tTrainingDevice.setStaffId(s.getStaffid());
+                        tTrainingDevice.setRegularId(trainingId);
+                        tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                        tTrainingDevice.setSupplementary("0");
+                        trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                    }
+                }
+                resNum ++;
+            }
+        }
+        logger.info("成功添加" + resNum + "条培训");
+    }
+
+
+
+
+
+
+}

+ 173 - 0
master/src/main/java/com/ruoyi/project/document/controller/TPlantproglistController.java

@@ -12,13 +12,24 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.common.domain.DataEntity;
+import com.ruoyi.project.common.domain.TCommonfile;
+import com.ruoyi.project.common.service.ITCommonfileService;
 import com.ruoyi.project.document.domain.TPlantproglist;
 import com.ruoyi.project.document.mapper.TPlantproglistMapper;
 import com.ruoyi.project.document.service.ITPlantproglistService;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
+import com.ruoyi.project.training.domain.TTrainingMatrix;
+import com.ruoyi.project.training.domain.TTrainingbcc;
+import com.ruoyi.project.training.domain.TTrainingbccDevice;
+import com.ruoyi.project.training.domain.TTrainingbccRegular;
+import com.ruoyi.project.training.service.ITTrainingMatrixService;
+import com.ruoyi.project.training.service.ITTrainingbccDeviceService;
+import com.ruoyi.project.training.service.ITTrainingbccService;
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
@@ -32,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 
 /**
@@ -54,6 +66,16 @@ public class TPlantproglistController extends BaseController
     private ISysDictTypeService iSysDictTypeService;
     @Resource
     private TPlantproglistMapper tPlantproglistMapper;
+    @Autowired
+    private ITTrainingMatrixService tTrainingMatrixService;
+    @Autowired
+    private ITTrainingbccService trainingbccService;
+    @Autowired
+    private ITTrainingbccDeviceService trainingbccDeviceService;
+    @Autowired
+    private ITStaffmgrService tStaffmgrService;
+    @Autowired
+    private ITCommonfileService tCommonfileService;
     /**
      * 查询装置程序清单列表
      */
@@ -159,6 +181,157 @@ public class TPlantproglistController extends BaseController
         return toAjax(tPlantproglistService.deleteTPlantproglistByIds(ids));
     }
 
+    /**
+     * 培训装置程序清单
+     */
+    @PreAuthorize("@ss.hasPermi('document:plantproglist:remove')")
+    @Log(title = "装置程序清单", businessType = BusinessType.OTHER)
+    @DeleteMapping("/addTraining/{id}")
+    public AjaxResult addTraining(@PathVariable Long id)
+    {
+        TPlantproglist tPlantproglist = tPlantproglistService.selectTPlantproglistById(id);
+        TTrainingMatrix matrixP = new TTrainingMatrix();
+        matrixP.setCourseCode(tPlantproglist.getFileno());
+        List<TTrainingMatrix> matrixList = tTrainingMatrixService.selectTTrainingMatrixList(matrixP);
+        if (matrixList.size() == 0) {
+            return AjaxResult.error("未找到培训矩阵");
+        }else {
+            TCommonfile fileParam = new TCommonfile();
+            fileParam.setpId(id);
+            fileParam.setpType("plantproglist");
+            List<TCommonfile> fileList = tCommonfileService.selectAllFileList(fileParam);
+            String fileUrl = "";
+            String fileName = "";
+            if (fileList.size() > 0) {
+                fileUrl = fileList.get(0).getFileUrl();
+                fileName= fileList.get(0).getFileName();
+            }
+
+            TTrainingMatrix matrix = matrixList.get(0);
+            //添加培训
+            TTrainingbccRegular tTrainingRegular = new TTrainingbccRegular();
+            tTrainingRegular.setDeptId(matrix.getDeptId());
+            tTrainingRegular.setActualpostId(matrix.getActualpostId());
+            tTrainingRegular.setCourseCode(matrix.getCourseCode());
+            tTrainingRegular.setItem(matrix.getItem());
+            tTrainingRegular.setHour(matrix.getHour());
+            tTrainingRegular.setInvolvedMoc("false");
+            tTrainingRegular.setNotPlan("false");
+            tTrainingRegular.setYear(String.valueOf(LocalDate.now().getYear()));
+            
+            // 设置培训开始时间为发布时日期(当前时间)
+            Date currentDate = new Date();
+            tTrainingRegular.setPlanTrainingdate(currentDate);
+            
+            // 设置授课人为程序的"更新负责人"
+            tTrainingRegular.setLecturer(tPlantproglist.getResponsibility());
+            
+            logger.info("regular:" + tTrainingRegular);
+            tTrainingRegular.setDeptId(103l); //bcc专用
+            //新增培训计划定期类
+            TTrainingbcc tTraining = new TTrainingbcc();
+            tTraining.setTrainingType("10");
+            tTraining.setYears(tTrainingRegular.getYear());
+            tTraining.setCourse(tTrainingRegular.getItem());
+            tTraining.setCourseid(tTrainingRegular.getCourseCode());
+            tTraining.setDuration(tTrainingRegular.getHour());
+            tTraining.setTrainer(tTrainingRegular.getLecturer());
+            tTraining.setPosition(tTrainingRegular.getActualpostId());
+            tTraining.setIsfinish(Long.parseLong("0"));
+            tTraining.setDeptId(tTrainingRegular.getDeptId());
+            tTraining.setRegularId(tTrainingRegular.getId());
+            tTraining.setFileUrl(fileUrl);
+            tTraining.setFileName(fileName);
+            tTraining.setTrainer(tPlantproglist.getResponsibility());
+            // 设置培训开始时间为发布时日期
+            tTraining.setCourseStartdate(currentDate);
+            
+            // 设置培训结束时间为发布后一个月
+            Calendar calendar = Calendar.getInstance();
+            calendar.setTime(currentDate);
+            calendar.add(Calendar.MONTH, 1);
+            Date endDate = calendar.getTime();
+            tTraining.setCourseEnddate(endDate);
+            
+            trainingbccService.insertTTrainingbcc(tTraining);
+            Long trainingId = tTraining.getId();
+            //新增人员-装置级关系
+            // 参培岗位人员
+            if (tTrainingRegular.getActualpostId() != null) {
+                logger.info("参培岗位人员");
+                TStaffmgr staffmgr = new TStaffmgr();
+                staffmgr.setActualposts(tTrainingRegular.getActualpostId());
+                staffmgr.setDeptId(tTrainingRegular.getDeptId());
+                List<TStaffmgr> staffmgrs = tStaffmgrService.selectAllTStaffmgrList(staffmgr);
+                try {
+                    //判断离职
+                    if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
+                        Iterator<TStaffmgr> iterator = staffmgrs.iterator();
+                        while (iterator.hasNext()) {
+                            TStaffmgr t = iterator.next();
+                            if (t.getDelFlag() == 9){
+                                    iterator.remove();
+                            }
+                        }
+                    }
+                }catch (Exception e) {
+                    logger.error(e.toString());
+                }
+                for (TStaffmgr s : staffmgrs) {
+                    TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                    tTrainingDevice.setStaffId(s.getStaffid());
+                    tTrainingDevice.setRegularId(trainingId);
+                    tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                    tTrainingDevice.setSupplementary("0");
+                    trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                }
+            }
+            //指定岗位人员
+            if (tTrainingRegular.getDesignatedStaff() != null) {
+                logger.info("指定岗位人员");
+                String[] designatedStaffs = tTrainingRegular.getDesignatedStaff().split(",");
+                for (String staffId : designatedStaffs) {
+                    TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                    tTrainingDevice.setStaffId(staffId);
+                    tTrainingDevice.setRegularId(trainingId);
+                    tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                    tTrainingDevice.setSupplementary("0");
+                    trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                }
+            }
+            //涉及其他部门
+            if (tTrainingRegular.getInvolvedMoc().equals("true")){
+                logger.info("涉及MOC人员");
+                TStaffmgr staffmgrMoc = new TStaffmgr();
+                staffmgrMoc.setActualposts(tTrainingRegular.getDesignatedOther());
+                List<TStaffmgr> staffmgrsMoc = tStaffmgrService.selectAllTStaffmgrList(staffmgrMoc);
+                try {
+                    //判断离职
+                    if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
+                        Iterator<TStaffmgr> iterator = staffmgrsMoc.iterator();
+                        while (iterator.hasNext()) {
+                            TStaffmgr t = iterator.next();
+                            if (t.getDelFlag() == 9){
+                                iterator.remove();
+                            }
+                        }
+                    }
+                }catch (Exception e) {
+                    logger.error(e.toString());
+                }
+                for (TStaffmgr s : staffmgrsMoc) {
+                    TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                    tTrainingDevice.setStaffId(s.getStaffid());
+                    tTrainingDevice.setRegularId(trainingId);
+                    tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                    tTrainingDevice.setSupplementary("0");
+                    trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                }
+            }
+        }
+        return AjaxResult.success() ;
+    }
+
     /**
      * 批量导入装置程序清单
      */

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

@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.framework.interceptor.annotation.RepeatSubmit;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
@@ -23,10 +24,12 @@ import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ISysUserService;
 import com.ruoyi.project.training.domain.*;
+import com.ruoyi.project.training.mapper.TTrainingbccDeviceMapper;
 import com.ruoyi.project.training.service.*;
 import com.ruoyi.project.training.spec.service.ITStPlanService;
 import com.ruoyi.project.training.spec.service.ITStSuccessorService;
 import org.apache.commons.lang.StringUtils;
+import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -39,6 +42,8 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -94,7 +99,16 @@ public class TStaffmgrController extends BaseController {
 
     @Autowired
     private ITStPlanService tStPlanService;
-
+    @Autowired
+    private ITTrainingMatrixService tTrainingMatrixService;
+    @Autowired
+    private ITTrainingbccRegularService tTrainingbccRegularService;
+    @Autowired
+    private ITTrainingbccService trainingbccService;
+    @Resource
+    private TTrainingbccDeviceMapper tTrainingbccDeviceMapper;
+    @Autowired
+    private ITTrainingbccDeviceService trainingbccDeviceService;
     /**
      * 获取SAI整改负责人列表
      */
@@ -534,6 +548,57 @@ public class TStaffmgrController extends BaseController {
 
         int insertResult = tStaffmgrService.insertTStaffmgr(tStaffmgr);
         tStaffmgr.setCreaterCode(getUserId().toString());
+        //如果为新员工,添加新员工培训
+        if (tStaffmgr.getIsNew() == 1) {
+            TTrainingMatrix tTrainingMatrix = new TTrainingMatrix();
+            tTrainingMatrix.setDeptId(103l);
+            tTrainingMatrix.setTrainingLevel("14");
+            tTrainingMatrix.setIsNewstaff("1");
+            List<TTrainingMatrix> list = tTrainingMatrixService.selectTTrainingMatrixList(tTrainingMatrix);
+            int currentYear = LocalDate.now().getYear();
+            for (TTrainingMatrix matrix: list
+            ) {
+                //矩阵
+                TTrainingbccRegular tTrainingRegular = new TTrainingbccRegular();
+                tTrainingRegular.setDeptId(matrix.getDeptId());
+                tTrainingRegular.setActualpostId(matrix.getActualpostId());
+                tTrainingRegular.setCourseCode(matrix.getCourseCode());
+                tTrainingRegular.setItem(matrix.getItem());
+                tTrainingRegular.setHour(matrix.getHour());
+                tTrainingRegular.setInvolvedMoc("false");
+                tTrainingRegular.setNotPlan("false");
+                tTrainingRegular.setYear(String.valueOf(currentYear));
+                tTrainingRegular.setNewStaff(tStaffmgr.getStaffid());
+                int doInsert = tTrainingbccRegularService.insertTTrainingbccRegular(tTrainingRegular);
+
+                logger.info("regular:" + tTrainingRegular);
+                tTrainingRegular.setDeptId(103l); //bcc专用
+                //新增培训计划定期类
+                TTrainingbcc tTraining = new TTrainingbcc();
+                tTraining.setTrainingType("10");
+                tTraining.setYears(tTrainingRegular.getYear());
+                tTraining.setCourse(tTrainingRegular.getItem());
+                tTraining.setCourseid(tTrainingRegular.getCourseCode());
+                tTraining.setDuration(tTrainingRegular.getHour());
+                tTraining.setTrainer(tTrainingRegular.getLecturer());
+                tTraining.setPosition(tTrainingRegular.getActualpostId());
+                tTraining.setIsfinish(Long.parseLong("0"));
+                tTraining.setDeptId(tTrainingRegular.getDeptId());
+                tTraining.setRegularId(tTrainingRegular.getId());
+                trainingbccService.insertTTrainingbcc(tTraining);
+                Long trainingId = tTraining.getId();
+
+                //培训详情
+                TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                tTrainingDevice.setStaffId(tStaffmgr.getStaffid());
+                tTrainingDevice.setRegularId(trainingId);
+                tTrainingDevice.setStartDate(tTrainingRegular.getPlanTrainingdate());
+                tTrainingDevice.setSupplementary("0");
+                trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+            }
+
+        }
+
         if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18") || tStaffmgr.getUnit().equals("20") || tStaffmgr.getUnit().equals("30")) {
             TTrainingrecords tTrainingrecords = new TTrainingrecords();
             tTrainingrecords.setStaffId(tStaffmgr.getId());
@@ -647,6 +712,66 @@ public class TStaffmgrController extends BaseController {
         return toAjax(tStaffmgrService.updateTStaffmgr(tStaffmgr));
     }
 
+    /**
+     * 修改人员管理
+     */
+    @PreAuthorize("@ss.hasPermi('plant:staffmgr:edit')")
+    @Log(title = "人员管理转岗", businessType = BusinessType.UPDATE)
+    @RepeatSubmit
+    @PutMapping("/updatePost")
+    public AjaxResult updatePost(@RequestBody TStaffmgr tStaffmgr) {
+        TStaffmgr old = tStaffmgrService.selectTStaffmgrById(tStaffmgr.getId());
+        if (old.getActualpost().equals(tStaffmgr.getActualpost()) ) {
+            return AjaxResult.error("已经是此岗位");
+        }
+        if (old.getDeptId() != 103) { //非bcc
+            return toAjax(tStaffmgrService.updateTStaffmgr(tStaffmgr));
+        }
+        //
+        TTrainingbccRegular regular = new TTrainingbccRegular();
+        regular.setActualpostId(tStaffmgr.getActualpost());
+        regular.setYear(String.valueOf(LocalDate.now().getYear()));
+        List<TTrainingbccRegular> regularList = tTrainingbccRegularService.selectTTrainingbccRegularList(regular);
+        for (TTrainingbccRegular r: regularList
+             ) {
+            TTrainingbccDevice bccDevice = new TTrainingbccDevice();
+            bccDevice.setStaffId(String.valueOf(tStaffmgr.getId()));
+            bccDevice.setRegularId(r.getId());
+            List<TTrainingbccDevice> deviceList = tTrainingbccDeviceMapper.selectTTrainingbccDeviceByReguar(bccDevice);
+            if (deviceList.size() == 0) { //新岗位需要培训
+                TTrainingbcc tTrainingbcc = new TTrainingbcc();
+                tTrainingbcc.setRegularId(r.getId());
+                List<TTrainingbcc> tTrainingbccList = trainingbccService.selectTTrainingbccList(tTrainingbcc);
+                if (tTrainingbccList.size() > 0) {
+                    TTrainingbcc t = tTrainingbccList.get(0);
+                    // 获取课程结束时间
+                    Date endDate = t.getCourseEnddate();
+                    // 获取当前时间
+                    Date now = new Date();
+                    if (endDate == null || endDate.after(now)) {
+                        System.out.println("课程未结束");
+                        TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                        tTrainingDevice.setStaffId(old.getStaffid());
+                        tTrainingDevice.setRegularId(t.getId());
+                        tTrainingDevice.setStartDate(t.getCourseStartdate());
+                        tTrainingDevice.setSupplementary("0");
+                        trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                    } else {
+                        System.out.println("课程已结束");
+                        TTrainingbccDevice tTrainingDevice = new TTrainingbccDevice();
+                        tTrainingDevice.setStaffId(old.getStaffid());
+                        tTrainingDevice.setRegularId(t.getId());
+                        tTrainingDevice.setStartDate(t.getCourseStartdate());
+                        tTrainingDevice.setSupplementary("1");
+                        trainingbccDeviceService.insertTTrainingbccDevice(tTrainingDevice);
+                    }
+                }
+            }
+        }
+
+        return toAjax(tStaffmgrService.updateTStaffmgr(tStaffmgr));
+    }
+
     /**
      * 删除人员管理
      */

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

@@ -137,6 +137,9 @@ public class TStaffmgr extends BaseEntity
     /** 是否退休 */
     private Integer isRetire;
 
+    /** 是否新员工 */
+    private Integer isNew;
+
     /** 区域 */
     private String region;
 
@@ -476,6 +479,14 @@ public class TStaffmgr extends BaseEntity
         this.isRetire = isRetire;
     }
 
+    public Integer getIsNew() {
+        return isNew;
+    }
+
+    public void setIsNew(Integer isNew) {
+        this.isNew = isNew;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 2 - 2
master/src/main/java/com/ruoyi/project/training/controller/TTrainingMatrixController.java

@@ -99,13 +99,13 @@ public class TTrainingMatrixController extends BaseController {
                     String[] designatedOther = t.getDesignatedOther().split(",");
                     for (String d : designatedOther) {
                         if (d.equals("28")) {
-                            postStatu.set(postStatu.size() - 5, "(M)");
+                            postStatu.set(postStatu.size() - 6, "(M)");
                         }
                         if (d.equals("30")) {
                             postStatu.set(postStatu.size() - 4, "(M)");
                         }
                         if (d.equals("32")) {
-                            postStatu.set(postStatu.size() - 3, "(M)");
+                            postStatu.set(postStatu.size() - 1, "(M)");
                         }
                     }
                 }

+ 20 - 1
master/src/main/java/com/ruoyi/project/training/controller/TTrainingbccRegularController.java

@@ -9,6 +9,7 @@ import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.training.domain.*;
+import com.ruoyi.project.training.mapper.TTrainingbccRegularMapper;
 import com.ruoyi.project.training.service.*;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -28,6 +29,8 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
 
+import javax.annotation.Resource;
+
 /**
  * 装置培训计划Controller
  *
@@ -51,6 +54,9 @@ public class TTrainingbccRegularController extends BaseController
     private ITTrainingMatrixService tTrainingMatrixService;
     @Autowired
     private ITStaffmgrService tStaffmgrService;
+    @Resource
+    private TTrainingbccRegularMapper tTrainingbccRegularMapper;
+
     /**
      * 查询装置培训计划列表
      */
@@ -62,7 +68,7 @@ public class TTrainingbccRegularController extends BaseController
         List<TTrainingbccRegular> list = tTrainingbccRegularService.selectTTrainingbccRegularList(tTrainingRegular);
         List<SysDictData> actualpost = iSysDictTypeService.selectDictDataByType("ACTUALPOST");
         for (TTrainingbccRegular t : list) {
-            String[] actualpostId = new String[0];;
+            String[] actualpostId = new String[0];
             if (t.getActualpostId() != null) {
                 actualpostId = t.getActualpostId().split(",");
             }
@@ -111,6 +117,19 @@ public class TTrainingbccRegularController extends BaseController
         return getDataTable(list);
     }
 
+
+    @PreAuthorize("@ss.hasPermi('training:bccregular:list')")
+    @GetMapping("/listNew")
+    public TableDataInfo listNew(TTrainingbccRegular tTrainingRegular)
+    {
+        startPage();
+        List<TTrainingbccRegular> list = tTrainingbccRegularMapper.selectTTrainingbccRegularListNew(tTrainingRegular);
+        for (TTrainingbccRegular t : list) {
+            TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(t.getNewStaff());
+            t.setNewStaffName(staffmgr.getName());
+        }
+        return getDataTable(list);
+    }
     /**
      * 导出装置培训计划列表
      */

+ 24 - 0
master/src/main/java/com/ruoyi/project/training/domain/TTrainingMatrix.java

@@ -34,6 +34,14 @@ public class TTrainingMatrix extends BaseEntity
     @Excel(name = "课程代码")
     private String courseCode;
 
+    /** 新员工培训 */
+    @Excel(name = "新员工培训")
+    private String isNewstaff;
+
+    /** 年一次 */
+    @Excel(name = "年一次")
+    private String fqYear;
+
     /** 频率(年) */
     @Excel(name = "频率")
     private String frequency;
@@ -254,6 +262,22 @@ public class TTrainingMatrix extends BaseEntity
 
     public String getTrainingLevel() { return trainingLevel; }
 
+    public String getIsNewstaff() {
+        return isNewstaff;
+    }
+
+    public void setIsNewstaff(String isNewstaff) {
+        this.isNewstaff = isNewstaff;
+    }
+
+    public String getFqYear() {
+        return fqYear;
+    }
+
+    public void setFqYear(String fqYear) {
+        this.fqYear = fqYear;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 15 - 1
master/src/main/java/com/ruoyi/project/training/domain/TTrainingbccDevice.java

@@ -85,12 +85,17 @@ public class TTrainingbccDevice extends BaseEntity
     @Excel(name = "学习时长min")
     private Long learnTime;
 
+    /** 班组 */
+    private String team;
+
+    /** 培训信息 */
+    private TTrainingbcc trainingbcc;
+
     /** 年份 */
     private String year;
 
     private String units;
 
-    private TTrainingbcc trainingbcc;
     private String trainingType;
 
     private Integer isLock;
@@ -288,6 +293,14 @@ public class TTrainingbccDevice extends BaseEntity
         this.units = units;
     }
 
+    public String getTeam() {
+        return team;
+    }
+
+    public void setTeam(String team) {
+        this.team = team;
+    }
+
     public Integer getIsLock() {
         return isLock;
     }
@@ -314,6 +327,7 @@ public class TTrainingbccDevice extends BaseEntity
             .append("examState", getExamState())
             .append("examId", getExamId())
             .append("learnTime", getLearnTime())
+            .append("team", getTeam())
             .toString();
     }
 }

+ 22 - 0
master/src/main/java/com/ruoyi/project/training/domain/TTrainingbccRegular.java

@@ -96,6 +96,12 @@ public class TTrainingbccRegular extends BaseEntity
     @Excel(name = "指定人员")
     private String designatedStaff;
 
+    /** 指定人员 */
+    @Excel(name = "新员工")
+    private String newStaff;
+
+    private String newStaffName;
+
     /** 是否涉及其他部门 */
     @Excel(name = "是否涉及其他部门")
     private String involvedMoc;
@@ -112,6 +118,22 @@ public class TTrainingbccRegular extends BaseEntity
     @Excel(name = "指定其他部门")
     private String designatedOther;
 
+    public String getNewStaff() {
+        return newStaff;
+    }
+
+    public void setNewStaff(String newStaff) {
+        this.newStaff = newStaff;
+    }
+
+    public String getNewStaffName() {
+        return newStaffName;
+    }
+
+    public void setNewStaffName(String newStaffName) {
+        this.newStaffName = newStaffName;
+    }
+
     public List<String> getActualpost() {
         return actualpost;
     }

+ 24 - 0
master/src/main/java/com/ruoyi/project/training/elearn/controller/TElUserBookController.java

@@ -94,6 +94,30 @@ public class TElUserBookController extends BaseController
         return AjaxResult.success(userbook.getQuId());
     }
 
+    /**
+     * 订正下一题
+     */
+    @PostMapping(value = "/nextBookQuDevice")
+    public AjaxResult nextQuDevice(@RequestBody TElUserBook book)
+    {
+        book.setUserId(getUserId());
+
+        if (book.getQuId() == null) { //答题第一题
+
+        }else {
+            List<TElUserBook> list =  tElUserBookMapper.selectTElUserBookList(book);
+            if (list.size() >0) {
+                book.setUpdatedate(list.get(0).getUpdatedate());
+            }
+        }
+        //继续答题
+        TElUserBook userbook =  tElUserBookMapper.selectTElUserBookDeviceByLast(book);
+        if (userbook == null) {
+            return  AjaxResult.error("已经是最后一题");
+        }
+        return AjaxResult.success(userbook.getQuId());
+    }
+
     /**
      * 移除错题集
      */

+ 39 - 0
master/src/main/java/com/ruoyi/project/training/elearn/controller/TElUserQuController.java

@@ -4,6 +4,7 @@ import java.util.Date;
 import java.util.List;
 
 import com.github.pagehelper.PageHelper;
+import com.ruoyi.project.training.domain.TTrainingbccDevice;
 import com.ruoyi.project.training.elearn.domain.TElQu;
 import com.ruoyi.project.training.elearn.domain.TElQuRepo;
 import com.ruoyi.project.training.elearn.domain.TElUserBook;
@@ -11,6 +12,7 @@ import com.ruoyi.project.training.elearn.mapper.TElQuMapper;
 import com.ruoyi.project.training.elearn.mapper.TElQuRepoMapper;
 import com.ruoyi.project.training.elearn.mapper.TElUserBookMapper;
 import com.ruoyi.project.training.elearn.mapper.TElUserQuMapper;
+import com.ruoyi.project.training.service.ITTrainingbccDeviceService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -52,6 +54,8 @@ public class TElUserQuController extends BaseController
     private TElUserBookMapper tElUserBookMapper;
     @Resource
     private TElQuMapper tElQuMapper;
+    @Autowired
+    private ITTrainingbccDeviceService tTrainingbccDeviceService;
     /**
      * 查询答题记录列表
      */
@@ -152,6 +156,41 @@ public class TElUserQuController extends BaseController
         return toAjax(tElUserQuService.insertTElUserQu(tElUserQu));
     }
 
+    /**
+     * 新增答题记录
+     */
+    @Log(title = "订正答题记录", businessType = BusinessType.INSERT)
+    @PostMapping(value = "/bookDevice")
+    public AjaxResult addBookDevice(@RequestBody TElUserQu tElUserQu)
+    {
+        long userId = getUserId();
+        tElUserQu.setUserId(userId);
+        if (0 == tElUserQu.getIsRight()) { //加入错题
+
+        }else {
+            TElUserBook quey = new TElUserBook();
+            quey.setDeviceId(tElUserQu.getDeviceId());
+
+            TElUserBook book = new TElUserBook();
+            book.setUserId(userId);
+            book.setQuId(tElUserQu.getQuId());
+            tElUserBookMapper.deleteTElUserBookByQuId(book);
+            //
+            List<TElUserBook> deviceBooks = tElUserBookMapper.selectTElUserBookList(quey);
+            if (deviceBooks.size() == 0) { //修改培训状态
+                logger.info("修改培训状态");
+                TTrainingbccDevice t = new TTrainingbccDevice();
+                t.setId(tElUserQu.getDeviceId());
+                t.setExamState(1l);
+                tTrainingbccDeviceService.updateTTrainingbccDevice(t);
+            }
+
+        }
+        // 确保分页状态被清除
+        PageHelper.clearPage();
+        return toAjax(tElUserQuService.insertTElUserQu(tElUserQu));
+    }
+
     /**
      * 修改答题记录
      */

+ 13 - 0
master/src/main/java/com/ruoyi/project/training/elearn/domain/TElPaper.java

@@ -115,6 +115,11 @@ public class TElPaper extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    /** 所属部门 */
+    @Excel(name = "培训Id")
+    private Long deviceId;
+
+
     private List<TElPaperQu> radioList;
 
     private List<TElPaperQu> multiList;
@@ -368,6 +373,14 @@ public class TElPaper extends BaseEntity
         this.quList = quList;
     }
 
+    public Long getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(Long deviceId) {
+        this.deviceId = deviceId;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 12 - 0
master/src/main/java/com/ruoyi/project/training/elearn/domain/TElUserBook.java

@@ -65,6 +65,10 @@ public class TElUserBook extends BaseEntity
     @Excel(name = "排序")
     private Long sort;
 
+    /** 所属部门 */
+    @Excel(name = "培训Id")
+    private Long deviceId;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -174,6 +178,14 @@ public class TElUserBook extends BaseEntity
         return sort;
     }
 
+    public Long getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(Long deviceId) {
+        this.deviceId = deviceId;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@@ -67,6 +67,8 @@ public class TElUserQu extends BaseEntity
 
     private Long isRight;
 
+    private Long deviceId;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -180,6 +182,14 @@ public class TElUserQu extends BaseEntity
         return isRight;
     }
 
+    public Long getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(Long deviceId) {
+        this.deviceId = deviceId;
+    }
+
     public void setIsRight(Long isRight) {
         this.isRight = isRight;
     }

+ 2 - 0
master/src/main/java/com/ruoyi/project/training/elearn/mapper/TElUserBookMapper.java

@@ -63,4 +63,6 @@ public interface TElUserBookMapper
     TElUserBook selectTElUserBookByLast(TElUserBook book);
 
     public int deleteTElUserBookByQuId(TElUserBook book);
+
+    TElUserBook selectTElUserBookDeviceByLast(TElUserBook book);
 }

+ 0 - 0
master/src/main/java/com/ruoyi/project/training/mapper/TElUserQuMapper.java → master/src/main/java/com/ruoyi/project/training/elearn/mapper/TElUserQuMapper.java


+ 30 - 11
master/src/main/java/com/ruoyi/project/training/elearn/service/impl/TElPaperServiceImpl.java

@@ -153,6 +153,9 @@ public class TElPaperServiceImpl implements ITElPaperService {
     public TElPaper createPaper(TElPaper tElPaper, Long userId) {
         // 查找考试
         TElExam exam = tElExamMapper.selectTElExamById(tElPaper.getExamId());
+//        if (exam.getExamType() == 2 && tElPaper.getDeviceId()==null) { //装置培训
+//            throw new IndexOutOfBoundsException("无法匹配装置培训");
+//        }
 
         // 考试题目列表
         List<TElPaperQu> paperQuList = new ArrayList<>();
@@ -209,6 +212,7 @@ public class TElPaperServiceImpl implements ITElPaperService {
 
         //保存试卷基本信息
         TElPaper paper = new TElPaper();
+        paper.setDeviceId(tElPaper.getDeviceId());
         paper.setExamId(exam.getExamId());
         paper.setTitle(exam.getTitle());
         paper.setTotalScore(exam.getTotalScore());
@@ -333,7 +337,11 @@ public class TElPaperServiceImpl implements ITElPaperService {
         //更新试卷
         tElPaperMapper.updateTElPaper(paper);
 
+        TElExam exam = tElExamMapper.selectTElExamById(paper.getExamId());
+
         new Thread(() -> {
+            Long deviceId = paper.getDeviceId();;
+
             //错题本
             TElPaperQu param = new TElPaperQu();
             param.setPaperId(paperQu.getPaperId());
@@ -347,7 +355,7 @@ public class TElPaperServiceImpl implements ITElPaperService {
                 List<TElUserBook> books = tElUserBookMapper.selectTElUserBookList(quey);
                 TElQu qu = tElQuMapper.selectTElQuById(i.getQuId());
 
-                if (books.size() == 0) {
+//                if (books.size() == 0) {
                     TElUserBook book = new TElUserBook();
                     book.setExamId(paper.getExamId());
                     book.setUserId(paper.getUserId());
@@ -355,20 +363,22 @@ public class TElPaperServiceImpl implements ITElPaperService {
                     book.setQuId(i.getQuId());
                     book.setWrongCount(1l);
                     book.setUpdatedate(new Date());
+                    book.setDeviceId(deviceId);
                     tElUserBookMapper.insertTElUserBook(book);
-                } else {
-                    TElUserBook book = books.get(0);
-                    book.setUpdatedate(new Date());
-                    book.setWrongCount(book.getWrongCount() + 1);
-                    tElUserBookMapper.updateTElUserBook(book);
-                }
+//                } else {
+//                    TElUserBook book = books.get(0);
+//                    book.setUpdatedate(new Date());
+//                    book.setWrongCount(book.getWrongCount() + 1);
+//                    tElUserBookMapper.updateTElUserBook(book);
+//                }
             }
+            //订正本
+
         }, "错题本").start();
 
-        TElExam exam = tElExamMapper.selectTElExamById(paper.getExamId());
-        if (exam.getExamType() == 2) {
-            new Thread(() -> {
 
+        if (exam.getExamType() == 2) { //装置培训考试
+            new Thread(() -> {
                 TTrainingbcc param = new TTrainingbcc();
                 logger.info("===================" + paper.getExamId());
                 logger.info("++++++++++++++++++++++" + exam.getExamId());
@@ -384,7 +394,16 @@ public class TElPaperServiceImpl implements ITElPaperService {
                         if (!CollectionUtils.isEmpty(deviceList)) {
                             for (TTrainingbccDevice d : deviceList
                             ) {
-                                long pass = objScore >= paper.getQualifyScore() ? 1 : 0;
+
+                                long pass;
+                                if (objScore >= paper.getTotalScore()) {
+                                    pass = 1; // 满分情况
+                                } else if (objScore >= paper.getQualifyScore()) {
+                                    pass = 3; // 及格但未满分
+                                } else {
+                                    pass = 0; // 不及格
+                                }
+                                paper.getTotalScore();
                                 d.setExamState(pass);
                                 d.setExamNum(d.getExamNum() + 1);
                                 if (d.getExamNum() >= 5) {

+ 3 - 0
master/src/main/java/com/ruoyi/project/training/mapper/TTrainingbccDeviceMapper.java

@@ -27,6 +27,9 @@ public interface TTrainingbccDeviceMapper
      * @return 人员-装置级培训关系集合
      */
     public List<TTrainingbccDevice> selectTTrainingbccDeviceList(TTrainingbccDevice tTrainingbccDevice);
+
+    public List<TTrainingbccDevice> selectTTrainingbccDeviceByReguar(TTrainingbccDevice tTrainingbccDevice);
+
     public List<TTrainingbccDevice> sortSelectTTrainingbccDeviceList(TTrainingbccDevice tTrainingbccDevice);
 
     /**

+ 2 - 0
master/src/main/java/com/ruoyi/project/training/mapper/TTrainingbccRegularMapper.java

@@ -60,4 +60,6 @@ public interface TTrainingbccRegularMapper
      * @return 结果
      */
     public int deleteTTrainingbccRegularByIds(Long[] ids);
+
+    List<TTrainingbccRegular> selectTTrainingbccRegularListNew(TTrainingbccRegular tTrainingRegular);
 }

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

@@ -35,10 +35,11 @@
         <result property="isRetire"    column="is_retire"    />
         <result property="region"    column="region"    />
         <result property="userId"    column="user_id"    />
+        <result property="isNew"    column="is_new"    />
     </resultMap>
 
     <sql id="selectTStaffmgrVo">
-         select d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
+         select d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region,d.is_new, s.dept_name from t_staffmgr d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -121,6 +122,7 @@
         <where>
             <if test="name != null  and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
             <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
+            <if test="isNew != null  and isNew != ''"> and isNew = #{is_new}</if>
             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
             <if test="specialDuty != null  and specialDuty != ''"> and special_duty like concat(concat('%', #{specialDuty}), '%')</if>
             <if test="units != null  and units != ''">
@@ -390,6 +392,7 @@
             <if test="pId != null">p_id,</if>
             <if test="specialDuty != null">special_duty,</if>
             <if test="region != null">region,</if>
+            <if test="isNew != null">is_new,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -418,6 +421,8 @@
             <if test="pId != null">#{pId},</if>
             <if test="specialDuty != null">#{specialDuty},</if>
             <if test="region != null">#{region},</if>
+            <if test="isNew != null">#{isNew},</if>
+
         </trim>
     </insert>
 
@@ -450,6 +455,8 @@
             <if test="pId != null">p_id = #{pId},</if>
             <if test="specialDuty != null">special_duty = #{specialDuty},</if>
             <if test="leftDate != null">left_date = #{leftDate},</if>
+            <if test="isNew != null">is_new = #{isNew},</if>
+
         </trim>
         where id = #{id}
     </update>

+ 11 - 1
master/src/main/resources/mybatis/training/TTrainingMatrixMapper.xml

@@ -25,10 +25,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="designatedOther"    column="designated_other"    />
         <result property="trainingLevel"    column="training_level"    />
         <result property="deptName" column="dept_name" />
+        <result property="isNewstaff"    column="is_newstaff"    />
+        <result property="fqYear"    column="fq_year"    />
+
     </resultMap>
 
     <sql id="selectTTrainingMatrixVo">
-        select d.id, d.course_code, d.item, d.actualpost_id, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.lecturer, d.hour, d.designated_position, d.frequency, d.involved_moc, d.training_level, d.respons_dept, d.designated_other ,s.dept_name from t_training_matrix d
+        select d.id, d.course_code, d.item, d.actualpost_id, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.lecturer, d.hour, d.designated_position, d.frequency, d.involved_moc, d.training_level, d.respons_dept, d.designated_other,d.is_newstaff,d.fq_year ,s.dept_name from t_training_matrix d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -39,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="item != null  and item != ''"> and item like concat(concat('%', #{item}), '%')</if>
             <if test="courseCode != null  and courseCode != ''"> and d.course_code = #{courseCode}</if>
             <if test="deptId != null  and deptId != ''"> and d.dept_id = #{deptId}</if>
+            <if test="isNewstaff != null  and isNewstaff != ''"> and d.is_newstaff = #{isNewstaff}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -76,6 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="frequency != null">frequency,</if>
             <if test="responsDept != null">respons_dept,</if>
             <if test="trainingLevel != null">training_level,</if>
+            <if test="isNewstaff != null">is_newstaff,</if>
+            <if test="fqYear != null">fq_year,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -97,6 +103,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="frequency != null">#{frequency},</if>
             <if test="responsDept != null">#{responsDept},</if>
             <if test="trainingLevel != null">#{trainingLevel},</if>
+            <if test="isNewstaff != null">#{isNewstaff},</if>
+            <if test="fqYear != null">#{fqYear},</if>
          </trim>
     </insert>
 
@@ -123,6 +131,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="frequency != null">frequency = #{frequency},</if>
             <if test="responsDept != null">respons_dept = #{responsDept},</if>
             <if test="trainingLevel != null">training_level = #{trainingLevel},</if>
+            <if test="isNewstaff != null">is_newstaff = #{isNewstaff},</if>
+            <if test="fqYear != null">fq_year = #{fqYear},</if>
         </trim>
         where id = #{id}
     </update>

+ 27 - 0
master/src/main/resources/mybatis/training/TTrainingbccDeviceMapper.xml

@@ -38,6 +38,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="staffId != null  and staffId != ''"> and d.staff_id = #{staffId} and d.exam_state != 1 and ((ADD_MONTHS(TRUNC(SYSDATE, 'MM'), 1) > t.course_startdate and t.course_enddate >= SYSDATE) or (d.supplementary = 1 and d.exam_state = 0))  </if>
             <if test="regularId != null "> and d.regular_id = #{regularId}</if>
             <if test="startDate != null "> and d.start_date = #{startDate}</if>
+            <if test="team != null and team != ''"> and s.team = #{team}</if>
+            <if test="remarks != null  and remarks != ''"> and d.remarks = #{remarks}</if>
+            <if test="createrCode != null  and createrCode != ''"> and d.creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and d.createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and d.updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and d.updatedate = #{updatedate}</if>
+            <if test="supplementary != null  and supplementary != ''"> and d.supplementary = #{supplementary}</if>
+            <if test="learnState != null "> and d.learn_state = #{learnState}</if>
+            <if test="examState != null "> and d.exam_state = #{examState}</if>
+            <if test="examId != null "> and d.exam_id = #{examId}</if>
+            <if test="learnTime != null "> and d.learn_time = #{learnTime}</if>
+            <if test="trainingType != null and trainingType != ''">and t.training_type = #{trainingType}</if>
+            and d.del_flag = 0
+        </where>
+        order by d.exam_state, d.start_date
+    </select>
+
+
+    <select id="selectTTrainingbccDeviceByReguar" parameterType="TTrainingbccDevice" resultMap="TTrainingbccDeviceResult">
+        select d.id,s.name , d.staff_id, d.regular_id, d.start_date, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.supplementary, d.learn_state, d.exam_state, d.exam_id,d.exam_num, d.learn_time from t_trainingbcc_device d
+        left join t_staffmgr s on s.staffid = d.staff_id
+        left join t_trainingbcc t on t.id = d.regular_id and t.DEL_FLAG = 0
+        <where>
+            <if test="staffId != null  and staffId != ''"> and d.staff_id = #{staffId} </if>
+            <if test="regularId != null "> and d.regular_id = #{regularId}</if>
+            <if test="startDate != null "> and d.start_date = #{startDate}</if>
+            <if test="team != null and team != ''"> and s.team = #{team}</if>
             <if test="remarks != null  and remarks != ''"> and d.remarks = #{remarks}</if>
             <if test="createrCode != null  and createrCode != ''"> and d.creater_code = #{createrCode}</if>
             <if test="createdate != null "> and d.createdate = #{createdate}</if>

+ 1 - 0
master/src/main/resources/mybatis/training/TTrainingbccMapper.xml

@@ -59,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="trainingType != null and trainingType != ''">and training_type = #{trainingType}</if>
             <if test="examId != null and examId != ''">and exam_id = #{examId}</if>
             <if test="isfinish != null and isfinish != ''">and isfinish = #{isfinish}</if>
+            <if test="regularId != null and regularId != ''">and regular_id = #{regularId}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->

+ 40 - 2
master/src/main/resources/mybatis/training/TTrainingbccRegularMapper.xml

@@ -27,14 +27,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="notPlan"    column="not_plan"    />
         <result property="notTrainingdate"    column="not_trainingdate"    />
         <result property="designatedOther"    column="designated_other"    />
+        <result property="newStaff"    column="new_staff"    />
         <result property="deptName" column="dept_name" />
     </resultMap>
 
     <sql id="selectTTrainingbccRegularVo">
-        select d.id, d.course_code, d.item, d.actualpost_id, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.plan_trainingdate, d.actual_completedate, d.lecturer, d.hour, d.year, d.designated_position, d.designated_staff, d.involved_moc, d.not_plan, d.not_trainingdate, d.designated_other  from t_trainingbcc_regular d
+        select d.id, d.course_code, d.item, d.actualpost_id, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.plan_trainingdate, d.actual_completedate, d.lecturer, d.hour, d.year, d.designated_position, d.designated_staff, d.involved_moc, d.not_plan, d.not_trainingdate, d.designated_other ,d.new_staff from t_trainingbcc_regular d
     </sql>
 
     <select id="selectTTrainingbccRegularList" parameterType="TTrainingbccRegular" resultMap="TTrainingbccRegularResult">
+        <include refid="selectTTrainingbccRegularVo"/>
+        <where>
+            <if test="courseCode != null  and courseCode != ''"> and course_code = #{courseCode}</if>
+            <if test="item != null  and item != ''"> and item = #{item}</if>
+            <if test="actualpostId != null  and actualpostId != ''"> and d.actualpost_id like concat(concat('%', #{actualpostId}), '%')</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="planTrainingdate != null "> and to_char(plan_trainingdate, 'yyyy-mm') = to_char(#{planTrainingdate}, 'yyyy-mm') </if>
+            <if test="actualCompletedate != null "> and actual_completedate = #{actualCompletedate}</if>
+            <if test="lecturer != null  and lecturer != ''"> and lecturer = #{lecturer}</if>
+            <if test="hour != null  and hour != ''"> and hour = #{hour}</if>
+            <if test="year != null  and year != ''"> and year = #{year}</if>
+            <if test="designatedPosition != null  and designatedPosition != ''"> and designated_position = #{designatedPosition}</if>
+            <if test="designatedStaff != null  and designatedStaff != ''"> and designated_staff = #{designatedStaff}</if>
+            <if test="involvedMoc != null  and involvedMoc != ''"> and involved_moc = #{involvedMoc}</if>
+            <if test="notPlan != null  and notPlan != ''"> and not_plan = #{notPlan}</if>
+            <if test="notTrainingdate != null  and notTrainingdate != ''"> and not_trainingdate = #{notTrainingdate}</if>
+            <if test="designatedOther != null  and designatedOther != ''"> and designated_other = #{designatedOther}</if>
+            and d.del_flag = 0 and new_staff is null
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by year desc,plan_trainingdate
+    </select>
+
+    <select id="selectTTrainingbccRegularListNew" parameterType="TTrainingbccRegular" resultMap="TTrainingbccRegularResult">
         <include refid="selectTTrainingbccRegularVo"/>
         <where>
             <if test="courseCode != null  and courseCode != ''"> and course_code = #{courseCode}</if>
@@ -57,7 +88,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="notPlan != null  and notPlan != ''"> and not_plan = #{notPlan}</if>
             <if test="notTrainingdate != null  and notTrainingdate != ''"> and not_trainingdate = #{notTrainingdate}</if>
             <if test="designatedOther != null  and designatedOther != ''"> and designated_other = #{designatedOther}</if>
-            and d.del_flag = 0
+            <if test="newStaff != null  and newStaff != ''"> and new_staff = #{newStaff}</if>
+            and d.del_flag = 0 and new_staff is not null
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
@@ -97,6 +129,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="notPlan != null">not_plan,</if>
             <if test="notTrainingdate != null">not_trainingdate,</if>
             <if test="designatedOther != null">designated_other,</if>
+            <if test="newStaff != null">new_staff,</if>
+
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -121,6 +155,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="notPlan != null">#{notPlan},</if>
             <if test="notTrainingdate != null">#{notTrainingdate},</if>
             <if test="designatedOther != null">#{designatedOther},</if>
+            <if test="newStaff != null">#{newStaff},</if>
+
          </trim>
     </insert>
 
@@ -148,6 +184,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="notPlan != null">not_plan = #{notPlan},</if>
             <if test="notTrainingdate != null">not_trainingdate = #{notTrainingdate},</if>
             <if test="designatedOther != null">designated_other = #{designatedOther},</if>
+            <if test="newStaff != null">new_staff = #{newStaff},</if>
+
         </trim>
         where id = #{id}
     </update>

+ 6 - 1
master/src/main/resources/mybatis/training/elearn/TElPaperMapper.xml

@@ -28,10 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="deviceId" column="device_id" />
     </resultMap>
 
     <sql id="selectTElPaperVo">
-        select d.paper_id, d.user_id, d.staff_id, d.exam_id, d.title, d.total_time, d.user_time, d.total_score, d.qualify_score, d.obj_score, d.subj_score, d.user_score, d.has_saq, d.state, d.limit_time, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_el_paper d
+        select d.paper_id, d.user_id, d.staff_id, d.exam_id, d.title, d.total_time, d.user_time, d.total_score, d.qualify_score, d.obj_score, d.subj_score, d.user_score, d.has_saq, d.state, d.limit_time, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks,d.device_id ,s.dept_name from t_el_paper d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="deviceId != null "> and device_id = #{deviceId}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             and d.del_flag = 0
         </where>
@@ -96,6 +98,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
+            <if test="deviceId != null">device_id,</if>
+
             <if test="remarks != null">remarks,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -120,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
+            <if test="deviceId != null">#{deviceId},</if>
             <if test="remarks != null">#{remarks},</if>
          </trim>
     </insert>

+ 16 - 0
master/src/main/resources/mybatis/training/elearn/TElUserBookMapper.xml

@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updatedate"    column="updatedate"    />
         <result property="sort"    column="sort"    />
         <result property="deptName" column="dept_name" />
+        <result property="deviceId" column="device_id" />
     </resultMap>
 
     <sql id="selectTElUserBookVo">
@@ -37,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="sort != null "> and sort = #{sort}</if>
+            <if test="deviceId != null "> and device_id = #{deviceId}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -59,6 +61,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where rownum = 1
     </select>
 
+    <select id="selectTElUserBookDeviceByLast" parameterType="TElUserBook" resultMap="TElUserBookResult">
+        select * from ( select d.id, d.user_id, d.exam_id, d.qu_id, d.wrong_count, d.title, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.sort  from t_el_user_book d
+        <where>
+            <if test="updatedate != null ">and #{updatedate} > updatedate</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="deviceId != null "> and device_id = #{deviceId}</if>
+            and d.del_flag = 0
+        </where>
+        order by d.updatedate desc)
+        where rownum = 1
+    </select>
+
     <insert id="insertTElUserBook" parameterType="TElUserBook">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_el_user_book.NEXTVAL as id FROM DUAL
@@ -77,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
             <if test="sort != null">sort,</if>
+            <if test="deviceId != null">device_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -91,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
             <if test="sort != null">#{sort},</if>
+            <if test="deviceId != null">#{deviceId},</if>
          </trim>
     </insert>
 

+ 8 - 0
ui/src/api/document/plantproglist.js

@@ -70,6 +70,14 @@ export function delPlantproglist(id) {
   })
 }
 
+// 删除装置程序清单
+export function addProglistTraining(id) {
+  return request({
+    url: '/document/plantproglist/addTraining/' + id,
+    method: 'delete'
+  })
+}
+
 // 导出装置程序清单
 export function exportPlantproglist(query) {
   return request({

+ 10 - 0
ui/src/api/plant/staffmgr.js

@@ -202,6 +202,16 @@ export function updateStaffmgr(data) {
   })
 }
 
+// 转岗人员管理
+export function updatePost(data) {
+  return request({
+    url: '/plant/staffmgr/updatePost',
+    method: 'put',
+    data: data
+  })
+}
+
+
 // 删除人员管理
 export function delStaffmgr(id) {
   return request({

+ 10 - 0
ui/src/api/training/bccregular.js

@@ -9,6 +9,16 @@ export function listBccregular(query) {
   })
 }
 
+// 查询装置培训计划列表
+export function listBccregularNew(query) {
+  return request({
+    url: '/training/bccregular/listNew',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询装置培训计划详细
 export function getBccregular(id) {
   return request({

+ 9 - 0
ui/src/api/training/elearn/userBook.js

@@ -26,6 +26,15 @@ export function nextBookQu(data) {
   })
 }
 
+// 题库练习
+export function nextBookQuDevice(data) {
+  return request({
+    url: '/elearn/userBook/nextBookQuDevice',
+    method: 'post',
+    data: data
+  })
+}
+
 // 题库练习
 export function removBookQu(data) {
   return request({

+ 9 - 0
ui/src/api/training/elearn/userQu.js

@@ -37,6 +37,15 @@ export function addUserQu(data) {
   })
 }
 
+// 新增答题记录
+export function addUserQuDevice(data) {
+  return request({
+    url: '/elearn/userQu/bookDevice',
+    method: 'post',
+    data: data
+  })
+}
+
 // 修改答题记录
 export function updateUserQu(data) {
   return request({

+ 8 - 0
ui/src/router/index.js

@@ -782,6 +782,14 @@ export const constantRoutes = [
         meta: {title: '错题训练', noCache: true},
         hidden: true
       },
+      {
+        path: 'userBook/bookDeviceTraining',
+        component: () => import('@/views/training/elearn/userBook/device-train'),
+        name: 'BookDeviceTraining',
+        meta: {title: '错题订正', noCache: true},
+        hidden: true
+      },
+
       {
         path: 'repo/training/:repoId',
         component: () => import('@/views/training/elearn/userQu/train'),

+ 24 - 1
ui/src/views/components/PlantProgList/index.vue

@@ -186,6 +186,14 @@
             v-hasPermi="['document:plantproglist:remove']"
           >{{ $t('删除') }}
           </el-button>
+          <el-button v-if="scope.row.deptId == 103"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleTraining(scope.row)"
+            v-hasPermi="['document:plantproglist:remove']"
+          >培训
+          </el-button>
           <el-button
             size="mini"
             type="text"
@@ -524,7 +532,8 @@ import {
   exportPlantproglist,
   getPlantproglist,
   listPlantproglist,
-  updatePlantproglist
+  updatePlantproglist,
+  addProglistTraining
 } from "@/api/document/plantproglist";
 import {allFileList, delCommonfile} from "@/api/common/commonfile";
 import {treeselect} from "@/api/system/dept";
@@ -920,6 +929,20 @@ export default {
         this.msgSuccess(this.$t('删除成功'));
       })
     },
+    /** 删除按钮操作 */
+    handleTraining(row) {
+      const ids = row.id;
+      this.$confirm('是否确认发起装置培训', {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return addProglistTraining(row.id );
+      }).then(() => {
+        this.getList();
+        this.msgSuccess(this.$t('操作成功'));
+      })
+    },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;

+ 2 - 2
ui/src/views/login.vue

@@ -261,8 +261,8 @@ export default {
   justify-content: center;
   align-items: center;
   height: 100%;
-  //background-image: url("../assets/image/CPMS20210107.jpg");
-  background-image: url("../assets/image/cpms-test.jpg");
+  background-image: url("../assets/image/CPMS20210107.jpg");
+  //background-image: url("../assets/image/cpms-test.jpg");
   background-size: cover;
 }
 

+ 3 - 3
ui/src/views/plant/organization/branch.vue

@@ -1,8 +1,8 @@
 <template>
     <ul :class="{'double': isHaveChild(dataArray)}">
       <li v-for="(item, index) in dataArray" :key="index" v-if="!item.level" :class="[{
-        'liequal': item.post.trim()==='EHS督导'},{
-        'litop': item.post.trim()==='装置经理'
+        'liequal': item.post.trim()==='安全专员'},{
+        'litop': item.post.trim()==='首席经理'
         }]">
         <div class="branch-box" @click.prevent="clickHandle(item)" v-if="item.post.trim() !== 'EHS督导'">
           <div class="branch-title">{{item.post}}</div>
@@ -20,7 +20,7 @@
           </div>
         </div>
         <!-- 平级 -->
-        <div class="branch-box" :class="item.post.trim() === 'EHS督导' ? 'equal':''" @click.prevent="clickHandle(item)" v-if="item.post.trim() === 'EHS督导'">
+        <div class="branch-box" :class="item.post.trim() === '安全专员' ? 'equal':''" @click.prevent="clickHandle(item)" v-if="item.post.trim() === '安全专员'">
           <div class="branch-title">{{item.post}}</div>
           <img class="branch-pic" :src=item.img>
           <div class="branch-name">{{item.label}}</div>

+ 5 - 5
ui/src/views/plant/organization/index.vue

@@ -146,7 +146,7 @@ export default {
       },
       units: [],
       teams: [],
-      actualposts: ["24", "26", "14", "16", "18", "20", "12", "10", "34", "36","15","11"],
+      actualposts: ["24","25", "26", "14", "16", "18", "20", "12", "10", "34", "36","15","11"],
       dragMove: true,
       drawer: false,
       info: {},
@@ -675,14 +675,14 @@ export default {
         }
       });
       list.forEach(item => {
-        if (item.post == 'EHS督导') { //
-          console.log('EHS督导')
+        if (item.post == '安全专员') { //
+          console.log('安全专员')
           item.secretary = null
         }
         if(this.$store.state.user.homeType == 5) { //合成器生产主管和工程师再一个位置
           if (item.pId !== 0 && map[item.pId]) {
             // map[item.pId].children ? map[item.pId].children.push(item) : map[item.pId].children = [item];
-            if (item.post == '装置副经理' || item.post == 'EHS督导') {
+            if (item.post == '装置经理' || item.post == '安全专员' || item.post == '首席专家') {
               map[item.pId].secretary ? map[item.pId].secretary[0].push(item) : map[item.pId].secretary[0] = [item];
             } else if (item.post == '生产主管' || item.post == '工长') {
               map[item.pId].secretary[0].push(item)
@@ -695,7 +695,7 @@ export default {
         }else {
           if (item.pId !== 0 && map[item.pId]) {
             // map[item.pId].children ? map[item.pId].children.push(item) : map[item.pId].children = [item];
-            if (item.post == '装置副经理' || item.post == 'EHS督导') {
+            if (item.post == '装置经理' || item.post == '安全专员'|| item.post == '首席专家') {
               map[item.pId].secretary ? map[item.pId].secretary[0].push(item) : map[item.pId].secretary[0] = [item];
             } else if (item.post == '生产主管' || item.post == '工长') {
               map[item.pId].secretary[1].push(item)

+ 112 - 44
ui/src/views/plant/staffmgr/index.vue

@@ -165,7 +165,22 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column :label="$t('装置名称')" align="center" prop="plantCode" :formatter="plantCodeFormat" />
       <el-table-column :label="$t('员工编号')" align="center" prop="staffid" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('员工姓名')" align="center" prop="name" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('员工姓名')" align="center" prop="name" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <div>
+            {{ scope.row.name  }}
+            <el-tag
+              v-if="scope.row.isNew == 1"
+              type="success"
+              size="mini"
+              class="tag-item"
+            >
+              新
+            </el-tag>
+          </div>
+        </template>
+      </el-table-column>
+
       <el-table-column :label="$t('性别')" align="center" prop="sex" :formatter="sexFormat" />
       <el-table-column :label="$t('出生日期')" align="center" prop="birthday" width="100">
         <template slot-scope="scope">
@@ -192,6 +207,13 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['plant:staffmgr:edit']"
           >{{ $t('修改') }}</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleChangePost(scope.row)"
+            v-hasPermi="['plant:staffmgr:edit']"
+          >转岗</el-button>
           <el-button
             size="mini"
             type="text"
@@ -233,8 +255,8 @@
     />
 
     <!-- 添加或修改人员管理对话框 -->
-    <el-dialog  :close-on-click-modal="false" v-dialogDrag ref="dialog__wrapper" :title="title" :visible.sync="open" width="700px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag ref="dialog__wrapper" :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
         <el-row>
           <el-col :span="12">
             <el-form-item :label="$t('装置名称')" prop="plantCode">
@@ -373,46 +395,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item :label="$t('备注')" prop="remarks">
-              <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" type="textarea" />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <!--<el-form-item label="证件照" prop="photo">
-              <el-upload
-                ref="photo"
-                class="avatar-uploader"
-                :headers="photo.headers"
-                :action="photo.url + '?pType=' + photo.pType + '&pId=' + photo.pId"
-                :show-file-list="false"
-                :on-progress="handleAvatarProgress"
-                :on-success="handleAvatarSuccess"
-                :auto-upload="false"
-              >
-                <img v-if="form.photo" :src="photoUrl" class="avatar">
-                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
-              </el-upload>
-            </el-form-item>-->
-            <el-form-item :label="$t('证件照')" prop="photo" v-if="notPhoto === true">
-              <el-upload
-                ref="photo"
-                :headers="photo.headers"
-                :action="photo.url + '?pType=' + photo.pType + '&pId=' + photo.pId"
-                :show-file-list="false"
-                :on-success="handleAvatarSuccess"
-                list-type="picture-card">
-                <img v-if="photoUrl" :src="photoUrl" class="avatar">
-                <i v-else class="el-icon-plus "></i>
-              </el-upload>
 
-              <el-dialog  :close-on-click-modal="false" v-dialogDrag :visible.sync="dialogVisible" append-to-body>
-                <img width="100%" :src="dialogImageUrl" alt="">
-              </el-dialog>
-            </el-form-item>
-          </el-col>
-        </el-row>
         <el-row>
           <el-col :span="12">
             <el-form-item :label="$t('特殊职能')" prop="specialDuty">
@@ -449,12 +432,71 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="12">
+          <el-form-item label="本年度新员工" prop="isNew" v-if="notPhoto === false">
+            <el-radio-group v-model="form.isNew">
+              <el-radio :label="1" border>是</el-radio>
+              <el-radio :label="0" border>否</el-radio>
+            </el-radio-group>
+          </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item :label="$t('备注')" prop="remarks">
+              <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" type="textarea" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item :label="$t('证件照')" prop="photo" v-if="notPhoto === true">
+              <el-upload
+                ref="photo"
+                :headers="photo.headers"
+                :action="photo.url + '?pType=' + photo.pType + '&pId=' + photo.pId"
+                :show-file-list="false"
+                :on-success="handleAvatarSuccess"
+                list-type="picture-card">
+                <img v-if="photoUrl" :src="photoUrl" class="avatar">
+                <i v-else class="el-icon-plus "></i>
+              </el-upload>
+
+              <el-dialog  :close-on-click-modal="false" v-dialogDrag :visible.sync="dialogVisible" append-to-body>
+                <img width="100%" :src="dialogImageUrl" alt="">
+              </el-dialog>
+            </el-form-item>
+          </el-col>
+        </el-row>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
         <el-button @click="cancel">{{ $t('取 消') }}</el-button>
       </div>
     </el-dialog>
+    <!-- 修改岗位 -->
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag ref="dialog__wrapper" :title="title" :visible.sync="postOpen" width="600px" append-to-body>
+      <el-form ref="postForm" :model="postForm"  label-width="110px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item :label="$t('实际岗位')" prop="actualpost">
+              <el-select v-model="postForm.actualpost" :placeholder="$t('请选择') + $t('实际岗位')">
+                <el-option
+                  v-for="dict in actualpostOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitPostForm">{{ $t('确 定') }}</el-button>
+        <el-button @click="postOpen = false">{{ $t('取 消') }}</el-button>
+      </div>
+    </el-dialog>
+
     <!-- 用户导入对话框 -->
     <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
       <el-upload
@@ -652,7 +694,7 @@
 </template>
 
 <script>
-  import { listStaffmgr, listpIdStaffmgr, listLeftStaffmgr, getStaffmgr,delRetireStaffmgr, delStaffmgr, delLeftStaffmgr,reLeftStaffmgr ,addStaffmgr, updateStaffmgr, exportStaffmgr } from "@/api/plant/staffmgr";
+  import { listStaffmgr, listpIdStaffmgr, listLeftStaffmgr, getStaffmgr,delRetireStaffmgr, delStaffmgr, delLeftStaffmgr,reLeftStaffmgr ,addStaffmgr, updateStaffmgr,updatePost, exportStaffmgr } from "@/api/plant/staffmgr";
   import { allFileList, listCommonfile, getCommonfile, delCommonfile, addCommonfile, updateCommonfile, exportCommonfile} from "@/api/common/commonfile";
   import { treeselect } from "@/api/system/dept";
   import { getToken } from "@/utils/auth";
@@ -694,6 +736,7 @@
         clientHeight:300,
         // 是否显示弹出层
         open: false,
+        postOpen: false,
         // 装置名称字典
         plantCodeOptions: [],
         // 性别字典
@@ -830,6 +873,7 @@
         specialDutys: [],
         // 表单参数
         form: {},
+        postForm: {},
         // 表单校验
         rules: {
           plantCode: [
@@ -1013,9 +1057,15 @@
           photo: null,
           pId: null,
           specialDuty: null,
-          region:null
+          region:null,
+          isNew: 0,
         };
+        this.postForm = {
+          actualpost: null,
+          id: null,
+        }
         this.resetForm("form");
+        this.resetForm("postForm");
       },
       /** 搜索按钮操作 */
       handleQuery() {
@@ -1088,6 +1138,24 @@
           }
         });
       },
+      handleChangePost(row) {
+        const id = row.id
+        this.reset();
+        getStaffmgr(id).then(response => {
+          this.postForm = response.data;
+          this.postOpen = true;
+          this.title = '修改岗位';
+        });
+      },
+      submitPostForm(){
+        if (this.postForm.id != null) {
+          updatePost(this.postForm).then(response => {
+            this.msgSuccess(this.$t('修改成功'));
+            this.postOpen = false;
+            this.getList();
+          });
+        }
+      },
       /** 删除按钮操作 */
       handleDelete(row) {
         const ids = row.id || this.ids;

+ 13 - 1
ui/src/views/training/bccdevice/index.vue

@@ -74,6 +74,7 @@
           <el-tag v-if="scope.row.examState == 1" size="small" type="success">合格</el-tag>
           <el-tag v-else-if="scope.row.examState == 0" size="small" type="info">未完成</el-tag>
           <el-tag v-else-if="scope.row.examState == -1" size="small" type="danger">不合格</el-tag>
+          <el-tag v-else-if="scope.row.examState == 3" size="small" type="danger">待订正</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
@@ -91,6 +92,13 @@
             icon="el-icon-edit"
             @click="hanldeExam(scope.row)"
           >考试</el-button>
+          <el-button
+            v-if="scope.row.examState == 3"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleBook(scope.row)"
+          >订正</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -392,7 +400,11 @@ export default {
       this.multiple = !selection.length
     },
     hanldeExam(row){
-      this.$router.push({ name: 'paper', params: { examId: row.trainingbcc.examId }})
+      this.$router.push({ name: 'paper', params: { examId: row.trainingbcc.examId,deviceId: row.id }})
+    },
+    /** 新增按钮操作 */
+    handleBook(row) {
+      this.$router.push({ name: 'BookDeviceTraining', params: { deviceId: row.id }})
     },
     /** 新增按钮操作 */
     handleAdd() {

+ 34 - 815
ui/src/views/training/bccregular/index.vue

@@ -1,838 +1,57 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item :label="$t('年份')" prop="year">
-        <el-date-picker clearable size="small" style="width: 200px"
-                        v-model="queryParams.year"
-                        type="year"
-                        value-format="yyyy"
-                        :placeholder="$t('请选择') + $t('年份')"
-                        @input="handleQuery">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item :label="$t('课程名称')" prop="item">
-        <el-input
-          v-model="queryParams.item"
-          :placeholder="$t('请输入') + $t('课程名称')"
-          clearable
-          size="small"
-          @input="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['training:regular:add']"
-        >{{ $t('新增') }}</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['training:regular:edit']"
-        >{{ $t('修改') }}</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['training:regular:remove']"
-        >{{ $t('删除') }}</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAddBatch"
-          v-hasPermi="['training:regular:add']"
-        >矩阵自动添加</el-button>
-      </el-col>
-      <!--<el-col :span="1.5">
-        <el-button
-          type="info"
-          icon="el-icon-upload2"
-          size="mini"
-          @click="handleImport"
-          v-hasPermi="['training:regular:edit']"
-        >导入</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['training:regular:export']"
-        >{{ $t('导出') }}</el-button>
-      </el-col>-->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-row class="colorMark">
-      <svg-icon icon-class="rectangleLightgreen" class="rectangleLightgreen"></svg-icon>{{ $t('需要培训') }}
-      <svg-icon icon-class="rectangleFlesh" class="rectangleFlesh"></svg-icon>{{ $t('指定人员') }}
-      <svg-icon icon-class="rectangleYellow" class="rectangleYellow"></svg-icon>{{ $t('当被此项目涉及到时,如MOC、事件调查,需要培训') }}
-    </el-row>
-
-    <el-table ref="regularTable" v-loading="loading" :data="regularList" @selection-change="handleSelectionChange" :cell-class-name="tableCellClassName" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column :label="$t('年份')" align="center" prop="year" width="50" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('课程名称')" align="center" prop="item" width="350" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('计划培训时间')" align="center" prop="planTrainingdate" width="100">
-        <template slot-scope="scope">
-          <span v-if="scope.row.notPlan === 'false'">{{ scope.row.notTrainingdate }}</span>
-          <span v-else>{{ scope.row.planTrainingdate }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('授课人')" align="center" prop="lecturerName" width="230" :show-overflow-tooltip="true" />
-      <el-table-column :label="$t('课时')" align="center" prop="hour" :show-overflow-tooltip="true"/>
-      <el-table-column v-for="(item, index) in actualpostIdOptions" width="150" :label="item.dictLabel" :key="index" align="center">
-        <template slot-scope="scope">
-          {{scope.row.actualpost[index]}}
-        </template>
-      </el-table-column>
-      <el-table-column :label="$t('备注')" align="center" prop="remarks" width="300" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['training:regular:edit']"
-          >{{ $t('修改') }}</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['training:regular:remove']"
-          >{{ $t('删除') }}</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改装置培训计划对话框 -->
-    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
-        <el-form-item :label="$t('年份')" prop="year">
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.year"
-                          type="year"
-                          value-format="yyyy"
-                          @change="getLecturer"
-                          :placeholder="$t('请选择') + $t('年份')">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item :label="$t('课程代码')" prop="courseCode">
-          <el-input v-model="form.courseCode" :placeholder="$t('请输入') + $t('课程代码')" />
-        </el-form-item>
-        <el-form-item :label="$t('课程名称')" prop="item">
-          <el-input v-model="form.item" :placeholder="$t('请输入') + $t('课程名称')" />
-        </el-form-item>
-        <el-form-item :label="$t('需参培岗位')" prop="actualpostId">
-          <el-select v-model="actualpostIds" multiple :placeholder="$t('请选择') + $t('需参培岗位')" @change="changeActualpost">
-            <el-option
-              v-for="dict in actualpostOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item :label="$t('是否存在')+$t('空格') +$t('指定人员')" prop="haveDesignated">
-          <el-checkbox v-model="haveDesignated"></el-checkbox>
-        </el-form-item>
-        <el-form-item :label="$t('指定人员')+$t('空格') + $t('岗位')" prop="designatedPosition" v-if="haveDesignated === true">
-          <el-select v-model="designatedPositions" multiple :placeholder="$t('请选择') + $t('指定岗位')" @change="changeDesignated">
-            <el-option
-              v-for="dict in designatedPositionOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <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"
-              :key="dict.staffid"
-              :label="dict.name"
-              :value="dict.staffid">
-              <span style="float: left">{{ dict.name }}</span>
-              <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item :label="$t('是否涉及') + $t('其他部门')" prop="involvedMoc">
-          <el-checkbox v-model="form.involvedMoc" @change="changeInvolved"></el-checkbox>
-        </el-form-item>
-        <el-form-item :label="$t('指定其他部门')" prop="designatedOther" v-if="form.involvedMoc === true">
-          <el-select v-model="otherPositions" multiple :placeholder="$t('请选择') + $t('其他部门')">
-            <el-option
-              v-for="dict in otherPositionOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item :label="$t('备注')" prop="remarks">
-          <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
-        </el-form-item>
-        <el-form-item :label="$t('是否') + $t('计划培训时间')" prop="notPlan">
-          <el-checkbox v-model="form.notPlan"></el-checkbox>
-        </el-form-item>
-        <el-form-item :label="$t('计划培训时间')" >
-          <el-date-picker clearable size="small" style="width: 200px"
-                          v-model="form.planTrainingdate"
-                          type="month"
-                          value-format="yyyy-MM"
-                          v-if="form.notPlan === true"
-                          :placeholder="$t('请选择') + $t('计划培训时间')">
-          </el-date-picker>
-          <el-input v-model="form.notTrainingdate" :placeholder="$t('请输入') + $t('计划培训时间')" v-if="form.notPlan === false" />
-        </el-form-item>
-        <el-form-item :label="$t('授课人')" prop="lecturer">
-          <el-select v-model="lecturers" filterable multiple :placeholder="$t('请选择') +$t('授课人')">
-            <el-option
-              v-for="dict in lecturerOptions"
-              :key="dict.staffid"
-              :label="dict.name"
-              :value="dict.staffid">
-              <span style="float: left">{{ dict.name }}</span>
-              <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item :label="$t('课时')" prop="hour">
-          <el-input v-model="form.hour" :placeholder="$t('请输入') + $t('课时')" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" :disabled="submitDisabled">{{ $t('确 定') }}</el-button>
-        <el-button @click="cancel">{{ $t('取 消') }}</el-button>
-      </div>
-    </el-dialog>
+    <el-tabs type="border-card"v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="装置培训" name="first">
+        <regular-bcc item="1" typename="" v-if="isFirst"></regular-bcc>
+      </el-tab-pane>
+      <el-tab-pane label="新员工培训" name="second">
+        <new-regular item="2" typename="" v-if="isSecond"></new-regular>
+      </el-tab-pane>
+
+    </el-tabs>
   </div>
 </template>
 
 <script>
-import {batchAddTraining, listBccregular, getBccregular, delBccregular, addBccregular, updateBccregular, exportBccregular} from "@/api/training/bccregular";
-import { listStaffmgr, listAllStaffmgr } from "@/api/plant/staffmgr";
-import { treeselect } from "@/api/system/dept";
-import { getToken } from "@/utils/auth";
-import Treeselect from "@riophae/vue-treeselect";
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import RegularBcc from '@/views/training/bccregular/regular'
+import NewRegular from '@/views/training/bccregular/new-regular'
 
 export default {
   name: "Regular",
-  components: { Treeselect },
+  components: { RegularBcc ,NewRegular},
   data() {
     return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: false,
-      // 总条数
-      total: 0,
-      // 装置培训计划表格数据
-      regularList: [],
-      // 弹出层标题
-      title: "",
-      // 部门树选项
-      deptOptions: undefined,
-      clientHeight:300,
-      // 是否显示弹出层
-      open: false,
-      // 台账显示岗位字典
-      actualpostIdOptions: [],
-      // 需参培岗位字典
-      actualpostOptions: [],
-      // 授课人字典
-      lecturerOptions: [],
-      // 指定岗位字典
-      designatedPositionOptions: [],
-      // 指定部门字典
-      otherPositionOptions: [],
-      //培训岗位多选
-      actualpostIds: [],
-      //指定人员岗位多选
-      designatedPositions: [],
-      //其他部门多选
-      otherPositions: [],
-      //指定人员id多选
-      designatedStaffs: [],
-      //授课人多选
-      lecturers: [],
-      //是否存在岗位多选
-      haveDesignated: false,
-      //人员表联查
-      stffmgrOptions: undefined,
-      //人员表查询参数
-      staffmgrQueryParams: {
-        actualposts: null
-      },
-      //确认按钮是否可点
-      submitDisabled: false,
-      // 用户导入参数
-      upload: {
-        // 是否显示弹出层(用户导入)
-        open: false,
-        // 弹出层标题(用户导入)
-        title: "",
-        // 是否禁用上传
-        isUploading: false,
-        // 是否更新已经存在的用户数据
-        updateSupport: 0,
-        // 设置上传的请求头部
-        headers: { Authorization: "Bearer " + getToken() },
-        // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/training/regular/importData"
-      },
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 20,
-        year: this.getNowTime()
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        year: [
-          { required: true, message: this.$t('年份') + this.$t('不能为空'), trigger: "blur" }
-        ],
-        courseCode: [
-          { required: true, message: this.$t('课程代码') + this.$t('不能为空'), trigger: "blur" }
-        ],
-        item: [
-          { required: true, message: this.$t('课程名称') + this.$t('不能为空'), trigger: "blur" }
-        ],
-        deptId: [
-          { required: true, message: this.$t('部门编号')+ this.$t('不能为空'), trigger: "blur" }
-        ],
-      }
-    };
-  },
-  watch: {
-    // 根据名称筛选部门树
-    deptName(val) {
-      this.$refs.tree.filter(val);
+      activeName: 'first',
+      isFirst: true,
+      isSecond: false,
     }
   },
-  created() {
-    //设置表格高度对应屏幕高度
-    this.$nextTick(() => {
-      this.clientHeight = document.body.clientHeight -250
-    })
-
-    this.getDicts("ACTUALPOST").then(response => {
-      this.actualpostIdOptions = response.data;
-    });
-    this.getDicts("ACTUALPOST").then(response => {
-      this.actualpostOptions = response.data;
-    });
-    this.getDicts("ACTUALPOST").then(response => {
-      this.designatedPositionOptions = response.data;
-    });
-    let _this = this
-    this.getDicts("ACTUALPOST").then(response => {
-      response.data.forEach(function (positionValue, positionkey, arr) {
-        if (positionValue.dictValue === "28" || positionValue.dictValue === "30" || positionValue.dictValue === "32") {
-          _this.otherPositionOptions.push(positionValue)
-        }
-      })
-      this.getStaffmar();
-      this.getLecturer();
-      this.getTreeselect();
-    });
-  },
   methods: {
-    /** 查询装置培训计划列表 */
-    getList() {
-      this.loading = true;
-      let _this = this
-      listBccregular(this.queryParams).then(response => {
-        this.regularList = response.rows;
-        this.regularList.forEach(function (value,key,arr) {
-          let stffmgrName = "";
-          if (value.lecturer != null) {
-            let staffId = value.lecturer.split(",");
-            staffId.forEach(function (id, index) {
-              _this.stffmgrOptions.forEach(function (item) {
-                if (item.staffid === id) {
-                  if (index === 0) {
-                    stffmgrName = item.name
-                  }else {
-                    stffmgrName = stffmgrName + "," + item.name
-                  }
-                }
-              });
-            });
-          }
-          _this.regularList[key].lecturerName = stffmgrName
-        });
-        this.total = response.total;
-        this.loading = false;
-        this.$nextTick(() => {
-          this.$refs.regularTable.doLayout(); // 解决表格错位
-        });
-      });
-    },
-    /** 获取当前年份 */
-    getNowTime() {
-      var now = new Date();
-      var year = now.getFullYear(); //得到年份
-      var defaultDate = `${year}`;
-      defaultDate = `${year}`
-      return defaultDate;
-    },
-    /** 查询部门下拉树结构 */
-    getTreeselect() {
-      treeselect().then(response => {
-        this.deptOptions = response.data;
-      });
-    },
-    //获取人员表
-    getStaffmar() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
-        this.stffmgrOptions = response.rows;
-        this.$nextTick(() => {
-          this.getList();
-        })
-      });
-    },
-    getLecturer(year) {
-      console.log("年份========" +year)
-      this.staffmgrQueryParams.leftYear = year
-      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
-        this.lecturerOptions = response.rows;
-      });
-    },
-    //根据分数显示颜色提示
-    tableCellClassName({ row, column, rowIndex, columnIndex }) {
-      var postNum = this.actualpostIdOptions.length;
-      for (var i = 0; i < postNum; i++) {
-        if (columnIndex == 7 + i){
-          return this.changeColor(row.actualpost[i])
-        }
-      }
-    },
-    changeColor (value) {
-      if (value === "M") {
-        return 'cellChoose'
-      }else if (value === "|") {
-        return 'cellDesignated'
-      }else if (value === "(M)") {
-        return 'cellInvolvedMoc'
-      }
-    },
-    //需培训岗位变动
-    changeActualpost() {
-      let _this = this
-      this.getDicts("ACTUALPOST").then(response => {
-        this.designatedPositionOptions = response.data;
-        this.actualpostIds.forEach(function (value, key, arr) {
-          _this.designatedPositionOptions.forEach(function (positionValue, positionkey, arr) {
-            if (positionValue.dictValue === value) {
-              _this.designatedPositionOptions.splice(positionkey ,1)
-            }
-          })
-        })
-      });
-    },
-    //指定人员训岗位变动
-    changeDesignated() {
-      if (this.designatedPositions.length > 0) {
-        var designatedId = null;
-        this.designatedPositions.forEach(function (value,key,arr) {
-          if (key != 0) {
-            designatedId = designatedId + "," + value;
-          }else if (key == 0) {
-            designatedId = value;
-          }
-        })
-        this.staffmgrQueryParams.actualposts = designatedId;
-        this.staffmgrQueryParams.leftYear = this.form.year
-        listAllStaffmgr(this.staffmgrQueryParams).then(response => {
-          this.stffmgrOptions = response.rows;
-        });
-
-        let _this = this
-        this.getDicts("ACTUALPOST").then(response => {
-          this.actualpostOptions = response.data;
-          this.designatedPositions.forEach(function (value, key, arr) {
-            _this.actualpostOptions.forEach(function (positionValue, positionkey, arr) {
-              if (positionValue.dictValue === value) {
-                _this.actualpostOptions.splice(positionkey ,1)
-              }
-            })
-          })
-        });
-      }else {
-        this.designatedStaffs = [];
-      }
-    },
-    //是否涉及其他部门变动
-    changeInvolved() {
-      if (this.form.involvedMoc === true) {
-        this.otherPositions = ['28','30','32']
-      }else {
-        this.otherPositions = []
+    handleClick(tab) {
+      if (tab.name === 'first') {
+        this.isFirst = true
+        this.isSecond = false
+      } else if (tab.name === 'second') {
+        this.isFirst = false
+        this.isSecond = true
+      } else if (tab.name === 'third') {
+        this.isFirst = false
+        this.isSecond = false
+      } else if (tab.name === 'fourth') {
+        this.isFirst = false
+        this.isSecond = false
+      } else if (tab.name === 'fifth') {
+        this.isFirst = false
+        this.isSecond = false
+      } else if (tab.name === 'sixth') {
+        this.isFirst = false
+        this.isSecond = false
       }
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        courseCode: null,
-        item: null,
-        actualpostId: null,
-        remarks: null,
-        delFlag: null,
-        createrCode: null,
-        createdate: null,
-        updaterCode: null,
-        updatedate: null,
-        deptId: null,
-        planTrainingdate: null,
-        actualCompletedate: null,
-        lecturer: null,
-        hour: null,
-        year: null,
-        designatedPosition: null,
-        designatedStaff: null,
-        involvedMoc: null,
-        designatedOther: null,
-        notPlan: null,
-        notTrainingdate: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.submitDisabled = false;
-      this.form.involvedMoc = false
-      this.form.notPlan = true
-      this.actualpostIds = [];
-      this.lecturers = [];
-      this.haveDesignated = false;
-      this.designatedPositions = [];
-      this.otherPositions = [];
-      this.getDicts("ACTUALPOST").then(response => {
-        this.actualpostOptions = response.data;
-      });
-      this.getDicts("ACTUALPOST").then(response => {
-        this.designatedPositionOptions = response.data;
-      });
-      this.title = this.$t('添加') + this.$t('装置') +this.$t('空格') + this.$t('培训计划');
-    },
-    handleAddBatch(){
-      batchAddTraining(null).then(response => {
-        this.getList()
-        this.msgSuccess(response.msg);
-      })
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      let _this = this
-      this.submitDisabled = false;
-      const id = row.id || this.ids
-      getBccregular(id).then(response => {
-        this.form = response.data;
-        if (this.form.actualpostId != null) {
-          this.actualpostIds = this.form.actualpostId.split(',');
-          this.getDicts("ACTUALPOST").then(response => {
-            this.designatedPositionOptions = response.data;
-            this.actualpostIds.forEach(function (value, key, arr) {
-              _this.designatedPositionOptions.forEach(function (positionValue, positionkey, arr) {
-                if (positionValue.dictValue === value) {
-                  _this.designatedPositionOptions.splice(positionkey ,1)
-                }
-              })
-            })
-          });
-        }else {
-          this.getDicts("ACTUALPOST").then(response => {
-            this.designatedPositionOptions = response.data;
-          })
-          this.actualpostIds = [];
-        }
-        if (this.form.designatedPosition != null) {
-          this.designatedPositions = this.form.designatedPosition.split(',');
-          this.getDicts("ACTUALPOST").then(response => {
-            this.actualpostOptions = response.data;
-            this.designatedPositions.forEach(function (value, key, arr) {
-              _this.actualpostOptions.forEach(function (positionValue, positionkey, arr) {
-                if (positionValue.dictValue === value) {
-                  _this.actualpostOptions.splice(positionkey ,1)
-                }
-              })
-            })
-          });
-          this.haveDesignated = true;
-          var designatedId = null;
-          this.designatedPositions.forEach(function (value,key,arr) {
-            if (key != 0) {
-              designatedId = designatedId + "," + value;
-            }else if (key == 0) {
-              designatedId = value;
-            }
-          })
-          this.staffmgrQueryParams.actualposts = designatedId;
-          this.staffmgrQueryParams.leftYear = this.form.year
-          this.$nextTick(() => {
-            listStaffmgr(this.staffmgrQueryParams).then(response => {
-              this.stffmgrOptions = response.rows;
-            });
-          })
-        }else {
-          this.haveDesignated = false;
-          this.designatedPositions = [];
-          this.getDicts("ACTUALPOST").then(response => {
-            this.actualpostOptions = response.data;
-          })
-        }
-        if (this.form.designatedStaff != null) {
-          this.designatedStaffs = this.form.designatedStaff.split(',');
-        }else {
-          this.designatedStaffs = [];
-        }
-        if (this.form.lecturer != null) {
-          this.lecturers = this.form.lecturer.split(',');
-        }else {
-          this.lecturers =[];
-        }
-        if (response.data.involvedMoc === 'true') {
-          this.form.involvedMoc = true
-        }else {
-          this.form.involvedMoc = false
-        }
-
-        //指定其他部门下拉框内容
-        if (this.form.designatedOther != null) {
-          this.otherPositions = this.form.designatedOther.split(',');
-        }else {
-          this.otherPositions = [];
-        }
-
-        if (response.data.notPlan === 'true') {
-          this.form.notPlan = true
-        }else {
-          this.form.notPlan = false
-        }
-        this.open = true;
-        this.title = this.$t('修改') + this.$t('装置') +this.$t('空格') + this.$t('培训计划');
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        this.submitDisabled = true;
-        if (valid) {
-          var id = null;
-          this.actualpostIds.forEach(function (value,key,arr) {
-            if (key != 0) {
-              id = id + "," + value;
-            }else if (key == 0) {
-              id = value;
-            }
-          })
-          this.form.actualpostId = id;
-
-          var designatedId = null;
-          this.designatedPositions.forEach(function (value,key,arr) {
-            if (key != 0) {
-              designatedId = designatedId + "," + value;
-            }else if (key == 0) {
-              designatedId = value;
-            }
-          })
-          // 王子文 2022年4月18日 13点31分 修改
-          // 如果 复选框被选中 将指定人信息存入数据传输对象
-          if (this.haveDesignated === true) {
-            this.form.designatedPosition = designatedId;
-          } else {
-            this.form.designatedPosition = null;
-          }
-          // this.form.designatedPosition = designatedId;
-
-          var designatedOther = null;
-          this.otherPositions.forEach(function (value,key,arr) {
-            if (key != 0) {
-              designatedOther = designatedOther + "," + value;
-            }else if (key == 0) {
-              designatedOther = value;
-            }
-          })
-          this.form.designatedOther = designatedOther;
-
-          var staffId = null;
-          this.designatedStaffs.forEach(function (value,key,arr) {
-            if (key != 0) {
-              staffId = staffId + "," + value;
-            }else if (key == 0) {
-              staffId = value;
-            }
-          })
-          this.form.designatedStaff = staffId;
-
-          var lecturerId = null;
-          this.lecturers.forEach(function (value,key,arr) {
-            if (key != 0) {
-              lecturerId = lecturerId + "," + value;
-            }else if (key == 0) {
-              lecturerId = value;
-            }
-          })
-          this.form.lecturer = lecturerId;
-          if (this.form.id != null) {
-            updateBccregular(this.form).then(response => {
-              this.msgSuccess(this.$t('修改成功'));
-              this.open = false;
-              this.submitDisabled = false;
-              this.getList();
-            });
-          } else {
-            addBccregular(this.form).then(response => {
-              this.msgSuccess(this.$t('新增成功'));
-              this.open = false;
-              this.submitDisabled = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
-        confirmButtonText: this.$t('确定'),
-        cancelButtonText: this.$t('取消'),
-        type: "warning"
-      }).then(function() {
-        return delBccregular(ids);
-      }).then(() => {
-        this.getList();
-        this.msgSuccess(this.$t('删除成功'));
-      })
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm(this.$t('是否确认导出所有装置培训计划数据项?'), this.$t('警告'), {
-        confirmButtonText: this.$t('确定'),
-        cancelButtonText: this.$t('取消'),
-        type: "warning"
-      }).then(function() {
-        return exportBccregular(queryParams);
-      }).then(response => {
-        this.download(response.msg);
-      })
-    },
-    /** 导入按钮操作 */
-    handleImport() {
-      this.upload.title = this.$t('用户导入');
-      this.upload.open = true;
-    },
-    // 文件上传中处理
-    handleFileUploadProgress(event, file, fileList) {
-      this.upload.isUploading = true;
-    },
-    // 文件上传成功处理
-    handleFileSuccess(response, file, fileList) {
-      this.upload.open = false;
-      this.upload.isUploading = false;
-      this.$refs.upload.clearFiles();
-      this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
-      this.getList();
-    },
-    // 提交上传文件
-    submitFileForm() {
-      this.$refs.upload.submit();
-    }
   }
 };
 </script>
 
 <style scoped>
-.colorMark {
-  color: #6f6f6f;
-  text-align: right;
-  font-weight:bold;
-  font-size: 13px;
-  padding-bottom: 5px;
-}
 
-.rectangleLightgreen {
-  width: 40px !important;
-  height: 20px !important;
-}
-.rectangleFlesh {
-  width: 40px !important;
-  height: 20px !important;
-}
-.rectangleYellow {
-  width: 40px !important;
-  height: 20px !important;
-}
 </style>

+ 812 - 0
ui/src/views/training/bccregular/new-regular.vue

@@ -0,0 +1,812 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item :label="$t('年份')" prop="year">
+        <el-date-picker clearable size="small" style="width: 200px"
+                        v-model="queryParams.year"
+                        type="year"
+                        value-format="yyyy"
+                        :placeholder="$t('请选择') + $t('年份')"
+                        @input="handleQuery">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item :label="$t('课程名称')" prop="item">
+        <el-input
+          v-model="queryParams.item"
+          :placeholder="$t('请输入') + $t('课程名称')"
+          clearable
+          size="small"
+          @input="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['training:regular:edit']"
+        >{{ $t('修改') }}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['training:regular:remove']"
+        >{{ $t('删除') }}</el-button>
+      </el-col>
+
+      <!--<el-col :span="1.5">
+        <el-button
+          type="info"
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['training:regular:edit']"
+        >导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['training:regular:export']"
+        >{{ $t('导出') }}</el-button>
+      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table ref="regularTable" v-loading="loading" :data="regularList" @selection-change="handleSelectionChange"  :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column :label="$t('年份')" align="center" prop="year" width="50" :show-overflow-tooltip="true"/>
+      <el-table-column label="新员工" align="center" prop="newStaffName" width="150" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('课程名称')" align="center" prop="item" width="350" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('计划培训时间')" align="center" prop="planTrainingdate" width="100">
+        <template slot-scope="scope">
+          <span v-if="scope.row.notPlan === 'false'">{{ scope.row.notTrainingdate }}</span>
+          <span v-else>{{ scope.row.planTrainingdate }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('授课人')" align="center" prop="lecturerName" width="230" :show-overflow-tooltip="true" />
+      <el-table-column :label="$t('课时')" align="center" prop="hour" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('备注')" align="center" prop="remarks" width="300" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['training:regular:edit']"
+          >{{ $t('修改') }}</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['training:regular:remove']"
+          >{{ $t('删除') }}</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改装置培训计划对话框 -->
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item :label="$t('年份')" prop="year">
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.year"
+                          type="year"
+                          value-format="yyyy"
+                          @change="getLecturer"
+                          :placeholder="$t('请选择') + $t('年份')">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item :label="$t('课程代码')" prop="courseCode">
+          <el-input v-model="form.courseCode" :placeholder="$t('请输入') + $t('课程代码')" />
+        </el-form-item>
+        <el-form-item :label="$t('课程名称')" prop="item">
+          <el-input v-model="form.item" :placeholder="$t('请输入') + $t('课程名称')" />
+        </el-form-item>
+        <el-form-item :label="$t('需参培岗位')" prop="actualpostId">
+          <el-select v-model="actualpostIds" multiple :placeholder="$t('请选择') + $t('需参培岗位')" @change="changeActualpost">
+            <el-option
+              v-for="dict in actualpostOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('是否存在')+$t('空格') +$t('指定人员')" prop="haveDesignated">
+          <el-checkbox v-model="haveDesignated"></el-checkbox>
+        </el-form-item>
+        <el-form-item :label="$t('指定人员')+$t('空格') + $t('岗位')" prop="designatedPosition" v-if="haveDesignated === true">
+          <el-select v-model="designatedPositions" multiple :placeholder="$t('请选择') + $t('指定岗位')" @change="changeDesignated">
+            <el-option
+              v-for="dict in designatedPositionOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <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"
+              :key="dict.staffid"
+              :label="dict.name"
+              :value="dict.staffid">
+              <span style="float: left">{{ dict.name }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('是否涉及') + $t('其他部门')" prop="involvedMoc">
+          <el-checkbox v-model="form.involvedMoc" @change="changeInvolved"></el-checkbox>
+        </el-form-item>
+        <el-form-item :label="$t('指定其他部门')" prop="designatedOther" v-if="form.involvedMoc === true">
+          <el-select v-model="otherPositions" multiple :placeholder="$t('请选择') + $t('其他部门')">
+            <el-option
+              v-for="dict in otherPositionOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('备注')" prop="remarks">
+          <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
+        </el-form-item>
+        <el-form-item :label="$t('是否') + $t('计划培训时间')" prop="notPlan">
+          <el-checkbox v-model="form.notPlan"></el-checkbox>
+        </el-form-item>
+        <el-form-item :label="$t('计划培训时间')" >
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.planTrainingdate"
+                          type="month"
+                          value-format="yyyy-MM"
+                          v-if="form.notPlan === true"
+                          :placeholder="$t('请选择') + $t('计划培训时间')">
+          </el-date-picker>
+          <el-input v-model="form.notTrainingdate" :placeholder="$t('请输入') + $t('计划培训时间')" v-if="form.notPlan === false" />
+        </el-form-item>
+        <el-form-item :label="$t('授课人')" prop="lecturer">
+          <el-select v-model="lecturers" filterable multiple :placeholder="$t('请选择') +$t('授课人')">
+            <el-option
+              v-for="dict in lecturerOptions"
+              :key="dict.staffid"
+              :label="dict.name"
+              :value="dict.staffid">
+              <span style="float: left">{{ dict.name }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('课时')" prop="hour">
+          <el-input v-model="form.hour" :placeholder="$t('请输入') + $t('课时')" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" :disabled="submitDisabled">{{ $t('确 定') }}</el-button>
+        <el-button @click="cancel">{{ $t('取 消') }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {batchAddTraining, listBccregularNew, getBccregular, delBccregular, addBccregular, updateBccregular, exportBccregular} from "@/api/training/bccregular";
+import { listStaffmgr, listAllStaffmgr } from "@/api/plant/staffmgr";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "NewRegularBcc",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 装置培训计划表格数据
+      regularList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+      // 台账显示岗位字典
+      actualpostIdOptions: [],
+      // 需参培岗位字典
+      actualpostOptions: [],
+      // 授课人字典
+      lecturerOptions: [],
+      // 指定岗位字典
+      designatedPositionOptions: [],
+      // 指定部门字典
+      otherPositionOptions: [],
+      //培训岗位多选
+      actualpostIds: [],
+      //指定人员岗位多选
+      designatedPositions: [],
+      //其他部门多选
+      otherPositions: [],
+      //指定人员id多选
+      designatedStaffs: [],
+      //授课人多选
+      lecturers: [],
+      //是否存在岗位多选
+      haveDesignated: false,
+      //人员表联查
+      stffmgrOptions: undefined,
+      //人员表查询参数
+      staffmgrQueryParams: {
+        actualposts: null
+      },
+      //确认按钮是否可点
+      submitDisabled: false,
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/training/regular/importData"
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        year: this.getNowTime()
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        year: [
+          { required: true, message: this.$t('年份') + this.$t('不能为空'), trigger: "blur" }
+        ],
+        courseCode: [
+          { required: true, message: this.$t('课程代码') + this.$t('不能为空'), trigger: "blur" }
+        ],
+        item: [
+          { required: true, message: this.$t('课程名称') + this.$t('不能为空'), trigger: "blur" }
+        ],
+        deptId: [
+          { required: true, message: this.$t('部门编号')+ this.$t('不能为空'), trigger: "blur" }
+        ],
+      }
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
+  created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = document.body.clientHeight -250
+    })
+
+    this.getDicts("ACTUALPOST").then(response => {
+      this.actualpostIdOptions = response.data;
+    });
+    this.getDicts("ACTUALPOST").then(response => {
+      this.actualpostOptions = response.data;
+    });
+    this.getDicts("ACTUALPOST").then(response => {
+      this.designatedPositionOptions = response.data;
+    });
+    let _this = this
+    this.getDicts("ACTUALPOST").then(response => {
+      response.data.forEach(function (positionValue, positionkey, arr) {
+        if (positionValue.dictValue === "28" || positionValue.dictValue === "30" || positionValue.dictValue === "32") {
+          _this.otherPositionOptions.push(positionValue)
+        }
+      })
+      this.getStaffmar();
+      this.getLecturer();
+      this.getTreeselect();
+    });
+  },
+  methods: {
+    /** 查询装置培训计划列表 */
+    getList() {
+      this.loading = true;
+      let _this = this
+      listBccregularNew(this.queryParams).then(response => {
+        this.regularList = response.rows;
+        // this.regularList.forEach(function (value,key,arr) {
+        //   let stffmgrName = "";
+        //   if (value.lecturer != null) {
+        //     let staffId = value.lecturer.split(",");
+        //     staffId.forEach(function (id, index) {
+        //       _this.stffmgrOptions.forEach(function (item) {
+        //         if (item.staffid === id) {
+        //           if (index === 0) {
+        //             stffmgrName = item.name
+        //           }else {
+        //             stffmgrName = stffmgrName + "," + item.name
+        //           }
+        //         }
+        //       });
+        //     });
+        //   }
+        //   _this.regularList[key].lecturerName = stffmgrName
+        // });
+        this.total = response.total;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.$refs.regularTable.doLayout(); // 解决表格错位
+        });
+      });
+    },
+    /** 获取当前年份 */
+    getNowTime() {
+      var now = new Date();
+      var year = now.getFullYear(); //得到年份
+      var defaultDate = `${year}`;
+      defaultDate = `${year}`
+      return defaultDate;
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    //获取人员表
+    getStaffmar() {
+      listStaffmgr(this.staffmgrQueryParams).then(response => {
+        this.stffmgrOptions = response.rows;
+        this.$nextTick(() => {
+          this.getList();
+        })
+      });
+    },
+    getLecturer(year) {
+      console.log("年份========" +year)
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+        this.lecturerOptions = response.rows;
+      });
+    },
+    //根据分数显示颜色提示
+    tableCellClassName({ row, column, rowIndex, columnIndex }) {
+      var postNum = this.actualpostIdOptions.length;
+      for (var i = 0; i < postNum; i++) {
+        if (columnIndex == 7 + i){
+          return this.changeColor(row.actualpost[i])
+        }
+      }
+    },
+    changeColor (value) {
+      if (value === "M") {
+        return 'cellChoose'
+      }else if (value === "|") {
+        return 'cellDesignated'
+      }else if (value === "(M)") {
+        return 'cellInvolvedMoc'
+      }
+    },
+    //需培训岗位变动
+    changeActualpost() {
+      let _this = this
+      this.getDicts("ACTUALPOST").then(response => {
+        this.designatedPositionOptions = response.data;
+        this.actualpostIds.forEach(function (value, key, arr) {
+          _this.designatedPositionOptions.forEach(function (positionValue, positionkey, arr) {
+            if (positionValue.dictValue === value) {
+              _this.designatedPositionOptions.splice(positionkey ,1)
+            }
+          })
+        })
+      });
+    },
+    //指定人员训岗位变动
+    changeDesignated() {
+      if (this.designatedPositions.length > 0) {
+        var designatedId = null;
+        this.designatedPositions.forEach(function (value,key,arr) {
+          if (key != 0) {
+            designatedId = designatedId + "," + value;
+          }else if (key == 0) {
+            designatedId = value;
+          }
+        })
+        this.staffmgrQueryParams.actualposts = designatedId;
+        this.staffmgrQueryParams.leftYear = this.form.year
+        listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+          this.stffmgrOptions = response.rows;
+        });
+
+        let _this = this
+        this.getDicts("ACTUALPOST").then(response => {
+          this.actualpostOptions = response.data;
+          this.designatedPositions.forEach(function (value, key, arr) {
+            _this.actualpostOptions.forEach(function (positionValue, positionkey, arr) {
+              if (positionValue.dictValue === value) {
+                _this.actualpostOptions.splice(positionkey ,1)
+              }
+            })
+          })
+        });
+      }else {
+        this.designatedStaffs = [];
+      }
+    },
+    //是否涉及其他部门变动
+    changeInvolved() {
+      if (this.form.involvedMoc === true) {
+        this.otherPositions = ['28','30','32']
+      }else {
+        this.otherPositions = []
+      }
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        courseCode: null,
+        item: null,
+        actualpostId: null,
+        remarks: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        planTrainingdate: null,
+        actualCompletedate: null,
+        lecturer: null,
+        hour: null,
+        year: null,
+        designatedPosition: null,
+        designatedStaff: null,
+        involvedMoc: null,
+        designatedOther: null,
+        notPlan: null,
+        notTrainingdate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.submitDisabled = false;
+      this.form.involvedMoc = false
+      this.form.notPlan = true
+      this.actualpostIds = [];
+      this.lecturers = [];
+      this.haveDesignated = false;
+      this.designatedPositions = [];
+      this.otherPositions = [];
+      this.getDicts("ACTUALPOST").then(response => {
+        this.actualpostOptions = response.data;
+      });
+      this.getDicts("ACTUALPOST").then(response => {
+        this.designatedPositionOptions = response.data;
+      });
+      this.title = this.$t('添加') + this.$t('装置') +this.$t('空格') + this.$t('培训计划');
+    },
+    handleAddBatch(){
+      batchAddTraining(null).then(response => {
+        this.getList()
+        this.msgSuccess(response.msg);
+      })
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      let _this = this
+      this.submitDisabled = false;
+      const id = row.id || this.ids
+      getBccregular(id).then(response => {
+        this.form = response.data;
+        if (this.form.actualpostId != null) {
+          this.actualpostIds = this.form.actualpostId.split(',');
+          this.getDicts("ACTUALPOST").then(response => {
+            this.designatedPositionOptions = response.data;
+            this.actualpostIds.forEach(function (value, key, arr) {
+              _this.designatedPositionOptions.forEach(function (positionValue, positionkey, arr) {
+                if (positionValue.dictValue === value) {
+                  _this.designatedPositionOptions.splice(positionkey ,1)
+                }
+              })
+            })
+          });
+        }else {
+          this.getDicts("ACTUALPOST").then(response => {
+            this.designatedPositionOptions = response.data;
+          })
+          this.actualpostIds = [];
+        }
+        if (this.form.designatedPosition != null) {
+          this.designatedPositions = this.form.designatedPosition.split(',');
+          this.getDicts("ACTUALPOST").then(response => {
+            this.actualpostOptions = response.data;
+            this.designatedPositions.forEach(function (value, key, arr) {
+              _this.actualpostOptions.forEach(function (positionValue, positionkey, arr) {
+                if (positionValue.dictValue === value) {
+                  _this.actualpostOptions.splice(positionkey ,1)
+                }
+              })
+            })
+          });
+          this.haveDesignated = true;
+          var designatedId = null;
+          this.designatedPositions.forEach(function (value,key,arr) {
+            if (key != 0) {
+              designatedId = designatedId + "," + value;
+            }else if (key == 0) {
+              designatedId = value;
+            }
+          })
+          this.staffmgrQueryParams.actualposts = designatedId;
+          this.staffmgrQueryParams.leftYear = this.form.year
+          this.$nextTick(() => {
+            listStaffmgr(this.staffmgrQueryParams).then(response => {
+              this.stffmgrOptions = response.rows;
+            });
+          })
+        }else {
+          this.haveDesignated = false;
+          this.designatedPositions = [];
+          this.getDicts("ACTUALPOST").then(response => {
+            this.actualpostOptions = response.data;
+          })
+        }
+        if (this.form.designatedStaff != null) {
+          this.designatedStaffs = this.form.designatedStaff.split(',');
+        }else {
+          this.designatedStaffs = [];
+        }
+        if (this.form.lecturer != null) {
+          this.lecturers = this.form.lecturer.split(',');
+        }else {
+          this.lecturers =[];
+        }
+        if (response.data.involvedMoc === 'true') {
+          this.form.involvedMoc = true
+        }else {
+          this.form.involvedMoc = false
+        }
+
+        //指定其他部门下拉框内容
+        if (this.form.designatedOther != null) {
+          this.otherPositions = this.form.designatedOther.split(',');
+        }else {
+          this.otherPositions = [];
+        }
+
+        if (response.data.notPlan === 'true') {
+          this.form.notPlan = true
+        }else {
+          this.form.notPlan = false
+        }
+        this.open = true;
+        this.title = this.$t('修改') + this.$t('装置') +this.$t('空格') + this.$t('培训计划');
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        this.submitDisabled = true;
+        if (valid) {
+          var id = null;
+          this.actualpostIds.forEach(function (value,key,arr) {
+            if (key != 0) {
+              id = id + "," + value;
+            }else if (key == 0) {
+              id = value;
+            }
+          })
+          this.form.actualpostId = id;
+
+          var designatedId = null;
+          this.designatedPositions.forEach(function (value,key,arr) {
+            if (key != 0) {
+              designatedId = designatedId + "," + value;
+            }else if (key == 0) {
+              designatedId = value;
+            }
+          })
+          // 王子文 2022年4月18日 13点31分 修改
+          // 如果 复选框被选中 将指定人信息存入数据传输对象
+          if (this.haveDesignated === true) {
+            this.form.designatedPosition = designatedId;
+          } else {
+            this.form.designatedPosition = null;
+          }
+          // this.form.designatedPosition = designatedId;
+
+          var designatedOther = null;
+          this.otherPositions.forEach(function (value,key,arr) {
+            if (key != 0) {
+              designatedOther = designatedOther + "," + value;
+            }else if (key == 0) {
+              designatedOther = value;
+            }
+          })
+          this.form.designatedOther = designatedOther;
+
+          var staffId = null;
+          this.designatedStaffs.forEach(function (value,key,arr) {
+            if (key != 0) {
+              staffId = staffId + "," + value;
+            }else if (key == 0) {
+              staffId = value;
+            }
+          })
+          this.form.designatedStaff = staffId;
+
+          var lecturerId = null;
+          this.lecturers.forEach(function (value,key,arr) {
+            if (key != 0) {
+              lecturerId = lecturerId + "," + value;
+            }else if (key == 0) {
+              lecturerId = value;
+            }
+          })
+          this.form.lecturer = lecturerId;
+          if (this.form.id != null) {
+            updateBccregular(this.form).then(response => {
+              this.msgSuccess(this.$t('修改成功'));
+              this.open = false;
+              this.submitDisabled = false;
+              this.getList();
+            });
+          } else {
+            addBccregular(this.form).then(response => {
+              this.msgSuccess(this.$t('新增成功'));
+              this.open = false;
+              this.submitDisabled = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return delBccregular(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm(this.$t('是否确认导出所有装置培训计划数据项?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return exportBccregular(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = this.$t('用户导入');
+      this.upload.open = true;
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
+  }
+};
+</script>
+
+<style scoped>
+.colorMark {
+  color: #6f6f6f;
+  text-align: right;
+  font-weight:bold;
+  font-size: 13px;
+  padding-bottom: 5px;
+}
+
+.rectangleLightgreen {
+  width: 40px !important;
+  height: 20px !important;
+}
+.rectangleFlesh {
+  width: 40px !important;
+  height: 20px !important;
+}
+.rectangleYellow {
+  width: 40px !important;
+  height: 20px !important;
+}
+</style>

+ 838 - 0
ui/src/views/training/bccregular/regular.vue

@@ -0,0 +1,838 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item :label="$t('年份')" prop="year">
+        <el-date-picker clearable size="small" style="width: 200px"
+                        v-model="queryParams.year"
+                        type="year"
+                        value-format="yyyy"
+                        :placeholder="$t('请选择') + $t('年份')"
+                        @input="handleQuery">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item :label="$t('课程名称')" prop="item">
+        <el-input
+          v-model="queryParams.item"
+          :placeholder="$t('请输入') + $t('课程名称')"
+          clearable
+          size="small"
+          @input="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['training:regular:add']"
+        >{{ $t('新增') }}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['training:regular:edit']"
+        >{{ $t('修改') }}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['training:regular:remove']"
+        >{{ $t('删除') }}</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAddBatch"
+          v-hasPermi="['training:regular:add']"
+        >矩阵自动添加</el-button>
+      </el-col>
+      <!--<el-col :span="1.5">
+        <el-button
+          type="info"
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['training:regular:edit']"
+        >导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['training:regular:export']"
+        >{{ $t('导出') }}</el-button>
+      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-row class="colorMark">
+      <svg-icon icon-class="rectangleLightgreen" class="rectangleLightgreen"></svg-icon>{{ $t('需要培训') }}
+      <svg-icon icon-class="rectangleFlesh" class="rectangleFlesh"></svg-icon>{{ $t('指定人员') }}
+      <svg-icon icon-class="rectangleYellow" class="rectangleYellow"></svg-icon>{{ $t('当被此项目涉及到时,如MOC、事件调查,需要培训') }}
+    </el-row>
+
+    <el-table ref="regularTable" v-loading="loading" :data="regularList" @selection-change="handleSelectionChange" :cell-class-name="tableCellClassName" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column :label="$t('年份')" align="center" prop="year" width="50" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('课程名称')" align="center" prop="item" width="350" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('计划培训时间')" align="center" prop="planTrainingdate" width="100">
+        <template slot-scope="scope">
+          <span v-if="scope.row.notPlan === 'false'">{{ scope.row.notTrainingdate }}</span>
+          <span v-else>{{ scope.row.planTrainingdate }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('授课人')" align="center" prop="lecturerName" width="230" :show-overflow-tooltip="true" />
+      <el-table-column :label="$t('课时')" align="center" prop="hour" :show-overflow-tooltip="true"/>
+      <el-table-column v-for="(item, index) in actualpostIdOptions" width="150" :label="item.dictLabel" :key="index" align="center">
+        <template slot-scope="scope">
+          {{scope.row.actualpost[index]}}
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('备注')" align="center" prop="remarks" width="300" :show-overflow-tooltip="true"/>
+      <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['training:regular:edit']"
+          >{{ $t('修改') }}</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['training:regular:remove']"
+          >{{ $t('删除') }}</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改装置培训计划对话框 -->
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item :label="$t('年份')" prop="year">
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.year"
+                          type="year"
+                          value-format="yyyy"
+                          @change="getLecturer"
+                          :placeholder="$t('请选择') + $t('年份')">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item :label="$t('课程代码')" prop="courseCode">
+          <el-input v-model="form.courseCode" :placeholder="$t('请输入') + $t('课程代码')" />
+        </el-form-item>
+        <el-form-item :label="$t('课程名称')" prop="item">
+          <el-input v-model="form.item" :placeholder="$t('请输入') + $t('课程名称')" />
+        </el-form-item>
+        <el-form-item :label="$t('需参培岗位')" prop="actualpostId">
+          <el-select v-model="actualpostIds" multiple :placeholder="$t('请选择') + $t('需参培岗位')" @change="changeActualpost">
+            <el-option
+              v-for="dict in actualpostOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('是否存在')+$t('空格') +$t('指定人员')" prop="haveDesignated">
+          <el-checkbox v-model="haveDesignated"></el-checkbox>
+        </el-form-item>
+        <el-form-item :label="$t('指定人员')+$t('空格') + $t('岗位')" prop="designatedPosition" v-if="haveDesignated === true">
+          <el-select v-model="designatedPositions" multiple :placeholder="$t('请选择') + $t('指定岗位')" @change="changeDesignated">
+            <el-option
+              v-for="dict in designatedPositionOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <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"
+              :key="dict.staffid"
+              :label="dict.name"
+              :value="dict.staffid">
+              <span style="float: left">{{ dict.name }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('是否涉及') + $t('其他部门')" prop="involvedMoc">
+          <el-checkbox v-model="form.involvedMoc" @change="changeInvolved"></el-checkbox>
+        </el-form-item>
+        <el-form-item :label="$t('指定其他部门')" prop="designatedOther" v-if="form.involvedMoc === true">
+          <el-select v-model="otherPositions" multiple :placeholder="$t('请选择') + $t('其他部门')">
+            <el-option
+              v-for="dict in otherPositionOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('备注')" prop="remarks">
+          <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
+        </el-form-item>
+        <el-form-item :label="$t('是否') + $t('计划培训时间')" prop="notPlan">
+          <el-checkbox v-model="form.notPlan"></el-checkbox>
+        </el-form-item>
+        <el-form-item :label="$t('计划培训时间')" >
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.planTrainingdate"
+                          type="month"
+                          value-format="yyyy-MM"
+                          v-if="form.notPlan === true"
+                          :placeholder="$t('请选择') + $t('计划培训时间')">
+          </el-date-picker>
+          <el-input v-model="form.notTrainingdate" :placeholder="$t('请输入') + $t('计划培训时间')" v-if="form.notPlan === false" />
+        </el-form-item>
+        <el-form-item :label="$t('授课人')" prop="lecturer">
+          <el-select v-model="lecturers" filterable multiple :placeholder="$t('请选择') +$t('授课人')">
+            <el-option
+              v-for="dict in lecturerOptions"
+              :key="dict.staffid"
+              :label="dict.name"
+              :value="dict.staffid">
+              <span style="float: left">{{ dict.name }}</span>
+              <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item :label="$t('课时')" prop="hour">
+          <el-input v-model="form.hour" :placeholder="$t('请输入') + $t('课时')" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm" :disabled="submitDisabled">{{ $t('确 定') }}</el-button>
+        <el-button @click="cancel">{{ $t('取 消') }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {batchAddTraining, listBccregular, getBccregular, delBccregular, addBccregular, updateBccregular, exportBccregular} from "@/api/training/bccregular";
+import { listStaffmgr, listAllStaffmgr } from "@/api/plant/staffmgr";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "RegularBcc",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 装置培训计划表格数据
+      regularList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+      // 台账显示岗位字典
+      actualpostIdOptions: [],
+      // 需参培岗位字典
+      actualpostOptions: [],
+      // 授课人字典
+      lecturerOptions: [],
+      // 指定岗位字典
+      designatedPositionOptions: [],
+      // 指定部门字典
+      otherPositionOptions: [],
+      //培训岗位多选
+      actualpostIds: [],
+      //指定人员岗位多选
+      designatedPositions: [],
+      //其他部门多选
+      otherPositions: [],
+      //指定人员id多选
+      designatedStaffs: [],
+      //授课人多选
+      lecturers: [],
+      //是否存在岗位多选
+      haveDesignated: false,
+      //人员表联查
+      stffmgrOptions: undefined,
+      //人员表查询参数
+      staffmgrQueryParams: {
+        actualposts: null
+      },
+      //确认按钮是否可点
+      submitDisabled: false,
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/training/regular/importData"
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        year: this.getNowTime()
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        year: [
+          { required: true, message: this.$t('年份') + this.$t('不能为空'), trigger: "blur" }
+        ],
+        courseCode: [
+          { required: true, message: this.$t('课程代码') + this.$t('不能为空'), trigger: "blur" }
+        ],
+        item: [
+          { required: true, message: this.$t('课程名称') + this.$t('不能为空'), trigger: "blur" }
+        ],
+        deptId: [
+          { required: true, message: this.$t('部门编号')+ this.$t('不能为空'), trigger: "blur" }
+        ],
+      }
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
+  created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = document.body.clientHeight -250
+    })
+
+    this.getDicts("ACTUALPOST").then(response => {
+      this.actualpostIdOptions = response.data;
+    });
+    this.getDicts("ACTUALPOST").then(response => {
+      this.actualpostOptions = response.data;
+    });
+    this.getDicts("ACTUALPOST").then(response => {
+      this.designatedPositionOptions = response.data;
+    });
+    let _this = this
+    this.getDicts("ACTUALPOST").then(response => {
+      response.data.forEach(function (positionValue, positionkey, arr) {
+        if (positionValue.dictValue === "28" || positionValue.dictValue === "30" || positionValue.dictValue === "32") {
+          _this.otherPositionOptions.push(positionValue)
+        }
+      })
+      this.getStaffmar();
+      this.getLecturer();
+      this.getTreeselect();
+    });
+  },
+  methods: {
+    /** 查询装置培训计划列表 */
+    getList() {
+      this.loading = true;
+      let _this = this
+      listBccregular(this.queryParams).then(response => {
+        this.regularList = response.rows;
+        this.regularList.forEach(function (value,key,arr) {
+          let stffmgrName = "";
+          if (value.lecturer != null) {
+            let staffId = value.lecturer.split(",");
+            staffId.forEach(function (id, index) {
+              _this.stffmgrOptions.forEach(function (item) {
+                if (item.staffid === id) {
+                  if (index === 0) {
+                    stffmgrName = item.name
+                  }else {
+                    stffmgrName = stffmgrName + "," + item.name
+                  }
+                }
+              });
+            });
+          }
+          _this.regularList[key].lecturerName = stffmgrName
+        });
+        this.total = response.total;
+        this.loading = false;
+        this.$nextTick(() => {
+          this.$refs.regularTable.doLayout(); // 解决表格错位
+        });
+      });
+    },
+    /** 获取当前年份 */
+    getNowTime() {
+      var now = new Date();
+      var year = now.getFullYear(); //得到年份
+      var defaultDate = `${year}`;
+      defaultDate = `${year}`
+      return defaultDate;
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    //获取人员表
+    getStaffmar() {
+      listStaffmgr(this.staffmgrQueryParams).then(response => {
+        this.stffmgrOptions = response.rows;
+        this.$nextTick(() => {
+          this.getList();
+        })
+      });
+    },
+    getLecturer(year) {
+      console.log("年份========" +year)
+      this.staffmgrQueryParams.leftYear = year
+      listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+        this.lecturerOptions = response.rows;
+      });
+    },
+    //根据分数显示颜色提示
+    tableCellClassName({ row, column, rowIndex, columnIndex }) {
+      var postNum = this.actualpostIdOptions.length;
+      for (var i = 0; i < postNum; i++) {
+        if (columnIndex == 7 + i){
+          return this.changeColor(row.actualpost[i])
+        }
+      }
+    },
+    changeColor (value) {
+      if (value === "M") {
+        return 'cellChoose'
+      }else if (value === "|") {
+        return 'cellDesignated'
+      }else if (value === "(M)") {
+        return 'cellInvolvedMoc'
+      }
+    },
+    //需培训岗位变动
+    changeActualpost() {
+      let _this = this
+      this.getDicts("ACTUALPOST").then(response => {
+        this.designatedPositionOptions = response.data;
+        this.actualpostIds.forEach(function (value, key, arr) {
+          _this.designatedPositionOptions.forEach(function (positionValue, positionkey, arr) {
+            if (positionValue.dictValue === value) {
+              _this.designatedPositionOptions.splice(positionkey ,1)
+            }
+          })
+        })
+      });
+    },
+    //指定人员训岗位变动
+    changeDesignated() {
+      if (this.designatedPositions.length > 0) {
+        var designatedId = null;
+        this.designatedPositions.forEach(function (value,key,arr) {
+          if (key != 0) {
+            designatedId = designatedId + "," + value;
+          }else if (key == 0) {
+            designatedId = value;
+          }
+        })
+        this.staffmgrQueryParams.actualposts = designatedId;
+        this.staffmgrQueryParams.leftYear = this.form.year
+        listAllStaffmgr(this.staffmgrQueryParams).then(response => {
+          this.stffmgrOptions = response.rows;
+        });
+
+        let _this = this
+        this.getDicts("ACTUALPOST").then(response => {
+          this.actualpostOptions = response.data;
+          this.designatedPositions.forEach(function (value, key, arr) {
+            _this.actualpostOptions.forEach(function (positionValue, positionkey, arr) {
+              if (positionValue.dictValue === value) {
+                _this.actualpostOptions.splice(positionkey ,1)
+              }
+            })
+          })
+        });
+      }else {
+        this.designatedStaffs = [];
+      }
+    },
+    //是否涉及其他部门变动
+    changeInvolved() {
+      if (this.form.involvedMoc === true) {
+        this.otherPositions = ['28','30','32']
+      }else {
+        this.otherPositions = []
+      }
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        courseCode: null,
+        item: null,
+        actualpostId: null,
+        remarks: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        planTrainingdate: null,
+        actualCompletedate: null,
+        lecturer: null,
+        hour: null,
+        year: null,
+        designatedPosition: null,
+        designatedStaff: null,
+        involvedMoc: null,
+        designatedOther: null,
+        notPlan: null,
+        notTrainingdate: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.submitDisabled = false;
+      this.form.involvedMoc = false
+      this.form.notPlan = true
+      this.actualpostIds = [];
+      this.lecturers = [];
+      this.haveDesignated = false;
+      this.designatedPositions = [];
+      this.otherPositions = [];
+      this.getDicts("ACTUALPOST").then(response => {
+        this.actualpostOptions = response.data;
+      });
+      this.getDicts("ACTUALPOST").then(response => {
+        this.designatedPositionOptions = response.data;
+      });
+      this.title = this.$t('添加') + this.$t('装置') +this.$t('空格') + this.$t('培训计划');
+    },
+    handleAddBatch(){
+      batchAddTraining(null).then(response => {
+        this.getList()
+        this.msgSuccess(response.msg);
+      })
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      let _this = this
+      this.submitDisabled = false;
+      const id = row.id || this.ids
+      getBccregular(id).then(response => {
+        this.form = response.data;
+        if (this.form.actualpostId != null) {
+          this.actualpostIds = this.form.actualpostId.split(',');
+          this.getDicts("ACTUALPOST").then(response => {
+            this.designatedPositionOptions = response.data;
+            this.actualpostIds.forEach(function (value, key, arr) {
+              _this.designatedPositionOptions.forEach(function (positionValue, positionkey, arr) {
+                if (positionValue.dictValue === value) {
+                  _this.designatedPositionOptions.splice(positionkey ,1)
+                }
+              })
+            })
+          });
+        }else {
+          this.getDicts("ACTUALPOST").then(response => {
+            this.designatedPositionOptions = response.data;
+          })
+          this.actualpostIds = [];
+        }
+        if (this.form.designatedPosition != null) {
+          this.designatedPositions = this.form.designatedPosition.split(',');
+          this.getDicts("ACTUALPOST").then(response => {
+            this.actualpostOptions = response.data;
+            this.designatedPositions.forEach(function (value, key, arr) {
+              _this.actualpostOptions.forEach(function (positionValue, positionkey, arr) {
+                if (positionValue.dictValue === value) {
+                  _this.actualpostOptions.splice(positionkey ,1)
+                }
+              })
+            })
+          });
+          this.haveDesignated = true;
+          var designatedId = null;
+          this.designatedPositions.forEach(function (value,key,arr) {
+            if (key != 0) {
+              designatedId = designatedId + "," + value;
+            }else if (key == 0) {
+              designatedId = value;
+            }
+          })
+          this.staffmgrQueryParams.actualposts = designatedId;
+          this.staffmgrQueryParams.leftYear = this.form.year
+          this.$nextTick(() => {
+            listStaffmgr(this.staffmgrQueryParams).then(response => {
+              this.stffmgrOptions = response.rows;
+            });
+          })
+        }else {
+          this.haveDesignated = false;
+          this.designatedPositions = [];
+          this.getDicts("ACTUALPOST").then(response => {
+            this.actualpostOptions = response.data;
+          })
+        }
+        if (this.form.designatedStaff != null) {
+          this.designatedStaffs = this.form.designatedStaff.split(',');
+        }else {
+          this.designatedStaffs = [];
+        }
+        if (this.form.lecturer != null) {
+          this.lecturers = this.form.lecturer.split(',');
+        }else {
+          this.lecturers =[];
+        }
+        if (response.data.involvedMoc === 'true') {
+          this.form.involvedMoc = true
+        }else {
+          this.form.involvedMoc = false
+        }
+
+        //指定其他部门下拉框内容
+        if (this.form.designatedOther != null) {
+          this.otherPositions = this.form.designatedOther.split(',');
+        }else {
+          this.otherPositions = [];
+        }
+
+        if (response.data.notPlan === 'true') {
+          this.form.notPlan = true
+        }else {
+          this.form.notPlan = false
+        }
+        this.open = true;
+        this.title = this.$t('修改') + this.$t('装置') +this.$t('空格') + this.$t('培训计划');
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        this.submitDisabled = true;
+        if (valid) {
+          var id = null;
+          this.actualpostIds.forEach(function (value,key,arr) {
+            if (key != 0) {
+              id = id + "," + value;
+            }else if (key == 0) {
+              id = value;
+            }
+          })
+          this.form.actualpostId = id;
+
+          var designatedId = null;
+          this.designatedPositions.forEach(function (value,key,arr) {
+            if (key != 0) {
+              designatedId = designatedId + "," + value;
+            }else if (key == 0) {
+              designatedId = value;
+            }
+          })
+          // 王子文 2022年4月18日 13点31分 修改
+          // 如果 复选框被选中 将指定人信息存入数据传输对象
+          if (this.haveDesignated === true) {
+            this.form.designatedPosition = designatedId;
+          } else {
+            this.form.designatedPosition = null;
+          }
+          // this.form.designatedPosition = designatedId;
+
+          var designatedOther = null;
+          this.otherPositions.forEach(function (value,key,arr) {
+            if (key != 0) {
+              designatedOther = designatedOther + "," + value;
+            }else if (key == 0) {
+              designatedOther = value;
+            }
+          })
+          this.form.designatedOther = designatedOther;
+
+          var staffId = null;
+          this.designatedStaffs.forEach(function (value,key,arr) {
+            if (key != 0) {
+              staffId = staffId + "," + value;
+            }else if (key == 0) {
+              staffId = value;
+            }
+          })
+          this.form.designatedStaff = staffId;
+
+          var lecturerId = null;
+          this.lecturers.forEach(function (value,key,arr) {
+            if (key != 0) {
+              lecturerId = lecturerId + "," + value;
+            }else if (key == 0) {
+              lecturerId = value;
+            }
+          })
+          this.form.lecturer = lecturerId;
+          if (this.form.id != null) {
+            updateBccregular(this.form).then(response => {
+              this.msgSuccess(this.$t('修改成功'));
+              this.open = false;
+              this.submitDisabled = false;
+              this.getList();
+            });
+          } else {
+            addBccregular(this.form).then(response => {
+              this.msgSuccess(this.$t('新增成功'));
+              this.open = false;
+              this.submitDisabled = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return delBccregular(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm(this.$t('是否确认导出所有装置培训计划数据项?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return exportBccregular(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
+    },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = this.$t('用户导入');
+      this.upload.open = true;
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
+  }
+};
+</script>
+
+<style scoped>
+.colorMark {
+  color: #6f6f6f;
+  text-align: right;
+  font-weight:bold;
+  font-size: 13px;
+  padding-bottom: 5px;
+}
+
+.rectangleLightgreen {
+  width: 40px !important;
+  height: 20px !important;
+}
+.rectangleFlesh {
+  width: 40px !important;
+  height: 20px !important;
+}
+.rectangleYellow {
+  width: 40px !important;
+  height: 20px !important;
+}
+</style>

+ 3 - 1
ui/src/views/training/elearn/paper/list.vue

@@ -161,6 +161,7 @@ export default {
         },
       // 查询参数
       queryParams: {
+        deviceId: null,
         examId: null,
         pageNum: 1,
         examType: 1,
@@ -238,6 +239,7 @@ export default {
   },
   created() {
     this.queryParams.examId = this.$route.params.examId
+    this.queryParams.deviceId = this.$route.params.deviceId
     if (this.queryParams.examId) {
       this.queryParams.examType = null
     }
@@ -294,7 +296,7 @@ export default {
     },
     // 开始考试
     handlePre(examId) {
-      this.$router.push({ name: 'PreExam', params: { examId: examId }})
+      this.$router.push({ name: 'PreExam', params: { examId: examId ,deviceId: this.queryParams.deviceId}})
     },
   }
 };

+ 1 - 0
ui/src/views/training/elearn/paper/preview.vue

@@ -62,6 +62,7 @@ export default {
   },
   created() {
     this.postForm.examId = this.$route.params.examId
+    this.postForm.deviceId = this.$route.params.deviceId
     getExam(this.$route.params.examId).then(response => {
       this.detailData = response.data;
     });

+ 208 - 0
ui/src/views/training/elearn/userBook/device-train.vue

@@ -0,0 +1,208 @@
+<template>
+  <div class="app-container">
+
+    <el-card style="margin-top: 20px">
+
+      <div class="qu-content">
+
+        <p>【{{ getQuType(quData.quType)  }}】{{ quData.content }}</p>
+        <p v-if="quData.image!=null && quData.image!=''">
+          <el-image :src="getUrl(quData.image)" style="max-width:100%;" />
+        </p>
+
+        <div v-if="quData.quType === 1 || quData.quType===3 ">
+          <el-radio-group v-model="answerValues[0]" readonly>
+            <el-radio v-for="an in quData.answerList" :key="an.answerId" :label="an.answerId" readonly>
+              {{ an.abc }}.{{ an.content }}
+              <div v-if="an.image!=null && an.image!=''" style="clear: both">
+                <el-image :src="an.image" style="max-width:100%;" />
+              </div>
+            </el-radio>
+          </el-radio-group>
+        </div>
+
+        <!-- 多选题 -->
+        <div v-if="quData.quType === 2">
+          <el-checkbox-group v-model="answerValues" readonly>
+            <el-checkbox v-for="an in quData.answerList" :key="an.answerId" :label="an.answerId">
+              {{ an.abc }}.{{ an.content }}
+              <div v-if="an.image!=null && an.image!=''" style="clear: both">
+                <el-image :src="an.image" style="max-width:100%;" />
+              </div>
+            </el-checkbox>
+          </el-checkbox-group>
+        </div>
+
+        <div v-if="analysisShow" style="margin-top: 20px; color: #1890ff; font-weight: bold">
+          正确答案:{{ rightTags.join(' ') }}
+        </div>
+
+      </div>
+
+    </el-card>
+
+    <el-card v-if="analysisShow" class="qu-analysis" style="margin-top: 20px">
+      整题解析:
+      <p>{{ quData.analysis }}</p>
+      <p v-if="!quData.analysis">暂无解析内容!</p>
+    </el-card>
+
+    <el-card v-if="analysisShow" class="qu-analysis" style="margin-top: 20px;">
+      选项解析:
+      <div v-for="an in quData.answerList" v-if="an.analysis" class="qu-analysis-line">
+        <p style="color: #555;">{{ an.content }}:</p>
+        <p style="color: #1890ff;">{{ an.analysis }}</p>
+      </div>
+      <p v-if="analysisCount === 0">暂无选项解析</p>
+
+    </el-card>
+
+    <div style="padding-top: 30px">
+      <el-button type="primary" @click="handNext">继续下一题</el-button>
+<!--      <el-button type="info" @click="onCancel">返回</el-button>-->
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getQu , } from '@/api/training/elearn/qu'
+import { nextBookQuDevice, removBookQu} from '@/api/training/elearn/userBook'
+import { addUserQuDevice } from '@/api/training/elearn/userQu'
+
+export default {
+  name: 'BookTrain',
+  data() {
+    return {
+      repoId: null,
+      examId: null,
+      quId: null,
+      tags: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'],
+      analysisShow: false,
+      quData: {
+
+      },
+      answerValues: [],
+      rightValues: [],
+      rightTags: []
+
+    }
+  },
+  created() {
+    this.repoId = this.$route.params.repoId
+    this.deviceId = this.$route.params.deviceId
+    this.fetchNextQu()
+  },
+  methods: {
+    getQuType(data){
+      if (data == 1) {
+        return "单选题"
+      }else if (data == 2){
+        return "多选题"
+      }else if (data == 3){
+        return "判断题"
+      }
+    },
+    // 清理值
+    clearValues() {
+      this.answerValues = []
+      this.rightValues = []
+      this.analysisShow = false
+      this.rightTags = []
+    },
+
+    // 查找试卷详情
+    fetchQuDetail(id) {
+      // 当前赋值
+      this.quId = id
+      this.clearValues()
+
+      getQu(id).then(response => {
+        // 题目信息
+        this.quData = response.data
+
+        // 保存正确答案
+        this.quData.answerList.forEach((an, index) => {
+          an.abc = this.tags[index]
+
+          // 用户选定的
+          if (an.isRight) {
+            this.rightValues.push(an.answerId)
+            this.rightTags.push(an.abc)
+          }
+        })
+      })
+    },
+
+    fetchNextQu() {
+      // 查找下一个
+      nextBookQuDevice({quId: this.quId,deviceId:this.deviceId}).then(response => {
+        this.fetchQuDetail(response.data)
+      })
+    },
+
+    onCancel() {
+      // this.$router.push({ name: 'ListTran' })
+      this.$router.push({ name: 'BookList' })
+    },
+    getUrl(image){
+      return  process.env.VUE_APP_BASE_API + image;
+    },
+    addUserQu(isRight){
+      addUserQuDevice({quId: this.quId,isRight:isRight,deviceId:this.deviceId}).then(response => {
+      })
+    },
+    handNext() {
+      // 直接显示下一个
+      if (this.analysisShow) {
+        // 正确显示下一个
+        this.fetchNextQu()
+      } else {
+        // 直接判断正确性
+        if (this.rightValues.join(',') === this.answerValues.sort((a, b) => a - b).join(',')) {
+          this.$message({
+            message: '回答正确,你好棒哦!',
+            type: 'success'
+          })
+          // 添加正确历史记录
+          this.addUserQu(1)
+          // removBookQu({quId: this.quId}).then(response => {
+          //
+          // })
+          // 正确显示下一个
+          this.fetchNextQu()
+        } else {
+          // 错误显示解析
+          this.analysisShow = true
+          // 添加错误历史记录
+          this.addUserQu(0)
+          this.$message({
+            message: '很遗憾,做错了呢,请参考答案解析!',
+            type: 'error'
+          })
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+  .qu-content div{
+    line-height: 30px;
+  }
+
+  .qu-analysis p{
+    color: #555; font-size: 14px
+  }
+  .qu-analysis-line{
+    margin-top: 20px; border-bottom: #eee 1px solid
+  }
+
+  .el-checkbox-group label,.el-radio-group label{
+    width: 100%;
+  }
+
+</style>
+

+ 45 - 5
ui/src/views/training/matrix/index.vue

@@ -109,8 +109,31 @@
       <el-table-column :label="$t('培训级别')" fixed="left" align="center" prop="trainingLevel" width="150" min-width="55":formatter="trainingLevelFormat" />
       <el-table-column :label="$t('课程名称')" fixed="left" align="center" prop="item" width="250" min-width="55":show-overflow-tooltip="true"/>
       <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" min-width="55":show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('频率')" align="center" prop="frequency" width="300" min-width="55":show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('责任部门')" align="center" prop="responsDept" width="120" min-width="120" :formatter="responsDeptFormat" />
+      <el-table-column :label="$t('频率')" align="center" width="300" min-width="55" :show-overflow-tooltip="true">
+        <template #default="scope">
+          <div>
+            <el-tag
+              v-if="scope.row.isNewstaff == 1"
+              type="success"
+              size="small"
+              class="tag-item"
+            >
+              新员工
+            </el-tag>
+            <!-- 2. fqYear 标签:非空且非 0 时显示 -->
+            <el-tag
+              v-if="scope.row.fqYear && scope.row.fqYear != 0"
+              type="primary"
+              size="small"
+              class="tag-item"
+            >
+              {{ scope.row.fqYear }}年
+            </el-tag>
+            <!-- 3. frequency 标签:始终显示(空值显示占位符) -->
+              {{ scope.row.frequency  }}
+          </div>
+        </template>
+      </el-table-column>      <el-table-column :label="$t('责任部门')" align="center" prop="responsDept" width="120" min-width="120" :formatter="responsDeptFormat" />
       <el-table-column :label="$t('授课人')" align="center" prop="lecturer" width="100" min-width="100" :formatter="lecturerFormat"/>
       <el-table-column :label="$t('课时')" align="center" prop="hour" width="70" min-width="70"  :show-overflow-tooltip="true"/>
       <el-table-column v-for="(item, index) in actualpostIdOptions" width="150" min-width="150" :label="item.dictLabel" :key="index" align="center">
@@ -148,7 +171,7 @@
     />
 
     <!-- 添加或修改培训矩阵对话框 -->
-    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="700px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="130px">
         <el-form-item :label="$t('培训级别')" prop="trainingLevel">
           <el-select v-model="form.trainingLevel" :placeholder="$t('请选择') + $t('培训级别')">
@@ -166,7 +189,22 @@
         <el-form-item :label="$t('课程代码')" prop="courseCode">
           <el-input v-model="form.courseCode" :placeholder="$t('请输入') + $t('课程代码')" />
         </el-form-item>
-        <el-form-item :label="$t('频率')" prop="frequency">
+        <el-form-item label="新员工上岗前" prop="isNewstaff">
+          <el-radio-group v-model="form.isNewstaff">
+            <el-radio label="1" border>是</el-radio>
+            <el-radio label="0" border>否</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="固定频率(年)" prop="fqYear">
+          <el-input-number
+            v-model="form.fqYear"
+            :min="0"
+            :max="10"
+            :placeholder="$t('请输入') + $t('频率')"
+            controls-position="right"
+          />
+        </el-form-item>
+        <el-form-item label="频率描述" prop="frequency">
           <el-input v-model="form.frequency" :placeholder="$t('请输入') + $t('频率')" />
         </el-form-item>
         <el-form-item :label="$t('责任部门')" prop="responsDept">
@@ -507,7 +545,9 @@ export default {
         involvedMoc: null,
         designatedOther: null,
         responsDept: null,
-        trainingLevel: null
+        trainingLevel: null,
+        isNewstaff: 0,
+        fqYear: 0,
       };
       this.resetForm("form");
     },

+ 25 - 2
ui/src/views/training/trainingbcc/deviceList.vue

@@ -10,6 +10,17 @@
         </el-date-picker>
       </el-form-item>
 
+      <el-form-item label="班组" prop="team">
+        <el-select v-model="queryParams.team" placeholder="请选择班组" clearable size="small" style="width: 200px">
+          <el-option
+            v-for="dict in teamOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
       <el-form-item label="学习时长min" prop="learnTime">
         <el-input
           v-model="queryParams.learnTime"
@@ -72,7 +83,7 @@
           <el-tag v-if="scope.row.examState == 1" size="small" type="success">合格</el-tag>
           <el-tag v-else-if="scope.row.examState == 0" size="small" type="info">未完成</el-tag>
           <el-tag v-else-if="scope.row.examState == -1" size="small" type="danger">不合格</el-tag>
-
+          <el-tag v-else-if="scope.row.examState == 3" size="small" type="danger">待订正</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="考试次数" align="center"  prop="examNum" :show-overflow-tooltip="true"/>
@@ -225,6 +236,7 @@ export default {
         staffId: null,
         regularId: null,
         startDate: null,
+        team: null,
         remarks: null,
         createrCode: null,
         createdate: null,
@@ -240,7 +252,9 @@ export default {
       form: {},
       // 表单校验
       rules: {
-      }
+      },
+      // 班组选项
+      teamOptions: []
     };
   },
   watch: {
@@ -257,6 +271,7 @@ export default {
       })
     this.getList();
     this.getTreeselect();
+    this.getTeamOptions();
   },
   methods: {
     /** 查询人员-装置级培训关系列表 */
@@ -274,6 +289,13 @@ export default {
               this.deptOptions = response.data;
           });
      },
+     /** 获取班组选项 */
+     getTeamOptions() {
+          // 获取班组字典数据
+          this.getDicts("TEAM_DIVIDE").then(response => {
+              this.teamOptions = response.data;
+          });
+     },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -286,6 +308,7 @@ export default {
         staffId: null,
         regularId: null,
         startDate: null,
+        team: null,
         remarks: null,
         delFlag: null,
         createrCode: null,

+ 11 - 0
ui/src/views/training/trainingbcc/index.vue

@@ -145,6 +145,17 @@
         </el-button>
         <el-button type="primary" plain @click="selectCourse('16')">事件报告和调查</el-button>
         <el-button type="primary" plain @click="selectCourse('20')">MOC培训</el-button>
+        <el-button type="primary" plain @click="selectCourse('24')">GIS/GSA</el-button>
+        <!--        <el-button type="primary" plain @click="selectCourse('26')">{{ $t('事故信息') }}</el-button>-->
+
+        <el-button type="primary" plain @click="selectCourse('26')">BYC EHS月报</el-button>
+        <el-button type="primary" plain @click="selectCourse('28')">BYC事故信息</el-button>
+        <el-button type="primary" plain @click="selectCourse('30')">CBP EHS季度会</el-button>
+        <el-button type="primary" plain @click="selectCourse('32')">BASF事件分享</el-button>
+        <el-button type="primary" plain @click="selectCourse('34')">Lesson Learnt</el-button>
+        <el-button type="primary" plain @click="selectCourse('36')">职检报告</el-button>
+
+        <el-button type="primary" plain @click="selectCourse('50')">{{ $t('其他') }}</el-button>
       </el-col>
     </el-row>
     <el-table v-loading="loading" :data="trainingList" @selection-change="handleSelectionChange" :cell-style="tableCellStyle" :height="clientHeight" border>