Browse Source

SAI开项申请流程

wangggziwen 2 years ago
parent
commit
70d116402d

+ 3 - 0
master/src/main/java/com/ruoyi/config/ActivitiConfig.java

@@ -145,6 +145,9 @@ public class ActivitiConfig {
         Resource spec13 = resourceLoader.getResource("classpath:/processes/apply/safetychange.bpmn"); //加载流程图资源文件
         Resource spec13 = resourceLoader.getResource("classpath:/processes/apply/safetychange.bpmn"); //加载流程图资源文件
         deploymentBuilder13.enableDuplicateFiltering().addInputStream(spec13.getFilename(), spec13.getInputStream()).name("组织保护措施状态变更申请流程").deploy();//按流程id部署
         deploymentBuilder13.enableDuplicateFiltering().addInputStream(spec13.getFilename(), spec13.getInputStream()).name("组织保护措施状态变更申请流程").deploy();//按流程id部署
 
 
+        DeploymentBuilder deploymentBuilder14 = repositoryService().createDeployment();
+        Resource spec14 = resourceLoader.getResource("classpath:/processes/sai/saiApply.bpmn"); //加载流程图资源文件
+        deploymentBuilder14.enableDuplicateFiltering().addInputStream(spec14.getFilename(), spec14.getInputStream()).name("SAI开项申请流程").deploy();//按流程id部署
     }
     }
 }
 }
 
 

+ 12 - 0
master/src/main/java/com/ruoyi/project/approve/damain/DevTask.java

@@ -5,6 +5,7 @@ import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
 import com.ruoyi.project.apply.domain.TApplySafetychange;
 import com.ruoyi.project.apply.domain.TApplySafetychange;
 import com.ruoyi.project.ehs.domain.TApproveAccident;
 import com.ruoyi.project.ehs.domain.TApproveAccident;
 import com.ruoyi.project.ehs.domain.TApproveDanger;
 import com.ruoyi.project.ehs.domain.TApproveDanger;
+import com.ruoyi.project.production.domain.TSaiApply;
 import com.ruoyi.project.sems.domain.TApprove;
 import com.ruoyi.project.sems.domain.TApprove;
 import com.ruoyi.project.sems.domain.TApproverFile;
 import com.ruoyi.project.sems.domain.TApproverFile;
 import com.ruoyi.project.sems.his.domain.TApproveSpecModify;
 import com.ruoyi.project.sems.his.domain.TApproveSpecModify;
@@ -91,6 +92,17 @@ public class DevTask {
 
 
     private TApplySafetychange safetychange;
     private TApplySafetychange safetychange;
 
 
+    /** SAI开项申请对象 */
+    private TSaiApply SaiApply;
+
+    public TSaiApply getSaiApply() {
+        return SaiApply;
+    }
+
+    public void setSaiApply(TSaiApply saiApply) {
+        SaiApply = saiApply;
+    }
+
     public TApplySafetychange getSafetychange() {
     public TApplySafetychange getSafetychange() {
         return safetychange;
         return safetychange;
     }
     }

+ 19 - 0
master/src/main/java/com/ruoyi/project/ehs/controller/TApproveDangerController.java

@@ -29,6 +29,8 @@ import com.ruoyi.project.listener.EndSucessListener;
 import com.ruoyi.project.listener.ExecutorTaskCreateListener;
 import com.ruoyi.project.listener.ExecutorTaskCreateListener;
 import com.ruoyi.project.listener.RecorderTaskCreateListener;
 import com.ruoyi.project.listener.RecorderTaskCreateListener;
 import com.ruoyi.project.listener.VerificationTaskCreateListener;
 import com.ruoyi.project.listener.VerificationTaskCreateListener;
+import com.ruoyi.project.production.domain.TSaiApply;
+import com.ruoyi.project.production.service.ITSaiApplyService;
 import com.ruoyi.project.reliability.domain.TKekaoApprove;
 import com.ruoyi.project.reliability.domain.TKekaoApprove;
 import com.ruoyi.project.reliability.service.ITKekaoApproveService;
 import com.ruoyi.project.reliability.service.ITKekaoApproveService;
 import com.ruoyi.project.sems.domain.TApprove;
 import com.ruoyi.project.sems.domain.TApprove;
@@ -120,6 +122,9 @@ public class TApproveDangerController extends BaseController {
     @Autowired
     @Autowired
     private ITApplySafetychangeService tApplySafetychangeService;
     private ITApplySafetychangeService tApplySafetychangeService;
 
 
+    @Autowired
+    private ITSaiApplyService tSaiApplyService;
+
     /**
     /**
      * 任务申请
      * 任务申请
      */
      */
@@ -291,6 +296,10 @@ public class TApproveDangerController extends BaseController {
                         TApplySafetychange approve = tApplySafetychangeService.selectTApplySafetychangeById(Long.parseLong(pi.getBusinessKey()));
                         TApplySafetychange approve = tApplySafetychangeService.selectTApplySafetychangeById(Long.parseLong(pi.getBusinessKey()));
                         devProcess.setApproveObject(approve);
                         devProcess.setApproveObject(approve);
                         devProcess.setApNo(approve.getApNo());
                         devProcess.setApNo(approve.getApNo());
+                    } else if (pi.getProcessDefinitionName().equals("SAI开项申请流程")) {
+                        TSaiApply approve = tSaiApplyService.selectTSaiApplyById(Long.parseLong(pi.getBusinessKey()));
+                        devProcess.setApproveObject(approve);
+                        devProcess.setApNo(approve.getApNo());
                     }
                     }
                 } catch (Exception e) {
                 } catch (Exception e) {
                     logger.error(e.toString());
                     logger.error(e.toString());
@@ -408,6 +417,10 @@ public class TApproveDangerController extends BaseController {
                     TApplySafetychange approve = tApplySafetychangeService.selectTApplySafetychangeById(Long.parseLong(pi.getBusinessKey()));
                     TApplySafetychange approve = tApplySafetychangeService.selectTApplySafetychangeById(Long.parseLong(pi.getBusinessKey()));
                     devTask.setApproveObject(approve);
                     devTask.setApproveObject(approve);
                     devTask.setApNo(approve.getApNo());
                     devTask.setApNo(approve.getApNo());
+                } else if (pi.getProcessDefinitionName().equals("SAI开项申请流程")) {
+                    TSaiApply approve = tSaiApplyService.selectTSaiApplyById(Long.parseLong(pi.getBusinessKey()));
+                    devTask.setApproveObject(approve);
+                    devTask.setApNo(approve.getApNo());
                 }
                 }
                 list.add(devTask);
                 list.add(devTask);
             }
             }
@@ -507,6 +520,12 @@ public class TApproveDangerController extends BaseController {
                     devProcess.setApNo(approve.getApNo());
                     devProcess.setApNo(approve.getApNo());
                     devProcess.setApName(user.getNickName());
                     devProcess.setApName(user.getNickName());
                     devProcess.setApproveObject(approve);
                     devProcess.setApproveObject(approve);
+                } else if (pi.getProcessDefinitionName().equals("SAI开项申请流程")) {
+                    TSaiApply approve = tSaiApplyService.selectTSaiApplyById(Long.parseLong(pi.getBusinessKey()));
+                    SysUser user = sysUserService.selectUserById(Long.valueOf(approve.getCreateBy()));
+                    devProcess.setApNo(approve.getApNo());
+                    devProcess.setApName(user.getNickName());
+                    devProcess.setApproveObject(approve);
                 } else {
                 } else {
                     TApproveDanger approveDanger = tApproveDangerService.selectTApproveDangerById(Long.parseLong(pi.getBusinessKey()));
                     TApproveDanger approveDanger = tApproveDangerService.selectTApproveDangerById(Long.parseLong(pi.getBusinessKey()));
                     SysUser user = sysUserService.selectUserById(approveDanger.getRecorderId());
                     SysUser user = sysUserService.selectUserById(approveDanger.getRecorderId());

+ 252 - 0
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -0,0 +1,252 @@
+package com.ruoyi.project.production.controller;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.framework.interceptor.annotation.RepeatSubmit;
+import com.ruoyi.project.apply.domain.TApplyLock;
+import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
+import com.ruoyi.project.apply.domain.TApplySafetychange;
+import com.ruoyi.project.approve.damain.DevTask;
+import com.ruoyi.project.listener.apply.change.ChangeEndFailListener;
+import com.ruoyi.project.listener.apply.change.ChangeEndSuccessListener;
+import com.ruoyi.project.listener.apply.change.ChangeFlowListener;
+import com.ruoyi.project.listener.apply.change.ChangeNextTaskListener;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngines;
+import org.activiti.engine.RuntimeService;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.impl.identity.Authentication;
+import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.production.domain.TSaiApply;
+import com.ruoyi.project.production.service.ITSaiApplyService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * SAI开项管理Controller
+ *
+ * @author ruoyi
+ * @date 2023-03-15
+ */
+@RestController
+@RequestMapping("/production/apply")
+public class TSaiApplyController extends BaseController
+{
+    @Autowired
+    private ITSaiApplyService tSaiApplyService;
+
+    @Autowired
+    private RuntimeService runtimeService;
+
+    @Autowired
+    private ISysUserService userService;
+
+    @Autowired
+    private TaskService taskService;
+
+    /**
+     * 查询SAI开项管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TSaiApply tSaiApply)
+    {
+        startPage();
+        List<TSaiApply> list = tSaiApplyService.selectTSaiApplyList(tSaiApply);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出SAI开项管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:export')")
+    @Log(title = "SAI开项管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TSaiApply tSaiApply)
+    {
+        List<TSaiApply> list = tSaiApplyService.selectTSaiApplyList(tSaiApply);
+        ExcelUtil<TSaiApply> util = new ExcelUtil<TSaiApply>(TSaiApply.class);
+        return util.exportExcel(list, "apply");
+    }
+
+    /**
+     * 获取SAI开项管理详细信息
+     */
+//    @PreAuthorize("@ss.hasPermi('production:apply:query')")
+    @GetMapping(value = "/{saiApplyId}")
+    public AjaxResult getInfo(@PathVariable("saiApplyId") Long saiApplyId)
+    {
+        return AjaxResult.success(tSaiApplyService.selectTSaiApplyById(saiApplyId));
+    }
+
+    /**
+     * 新增SAI开项管理
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:add')")
+    @Log(title = "SAI开项管理申请", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TSaiApply tSaiApply)
+    {
+        // 新增操作
+        String userId = getUserId().toString();
+        tSaiApply.setCreateTime(new Date());
+        tSaiApply.setCreateBy(userId);
+        tSaiApply.setDeptId(103L);
+        tSaiApply.setApplyStatus("0");
+        return toAjax(tSaiApplyService.insertTSaiApply(tSaiApply));
+    }
+
+    /**
+     * SAI开项管理提交申请
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:edit')")
+    @Log(title = "SAI开项管理申请", businessType = BusinessType.INSERT)
+    @PutMapping(value = "/submit/{saiApplyId}")
+    public AjaxResult submit(@PathVariable("saiApplyId") Long saiApplyId)
+    {
+        TSaiApply tSaiApply = tSaiApplyService.selectTSaiApplyById(saiApplyId);
+        String userId = getUserId().toString();
+        // 开始申请流程
+        tSaiApply.setApNo(DateUtils.dateTimeNow() + userId);
+        // 流程businessKey = 新增操作对象saiApplyId
+        long businessKey = saiApplyId;
+        //开始工作流、监听
+        Authentication.setAuthenticatedUserId(userId);//设置当前申请人
+        Map<String, Object> variables = new HashMap<>();
+        // 评估人为张力飞
+        variables.put("assessor", "20276");
+        // 修改状态为待评估
+        tSaiApply.setApplyStatus("1");
+        //采用key来启动流程定义并设置流程变量,返回流程实例
+        ProcessInstance pi = runtimeService.startProcessInstanceByKey("saiApplyProcess", String.valueOf(businessKey), variables);
+        logger.info("流程定义id:" + pi.getProcessDefinitionId());
+        logger.info("流程实例id:" + pi.getProcessInstanceId());
+        // 新增操作对象processId = 流程实例id
+        tSaiApply.setProcessId(pi.getProcessInstanceId());
+        // 更新操作
+        tSaiApplyService.updateTSaiApply(tSaiApply);
+        return AjaxResult.success();
+    }
+
+    /**
+     * SAI开项管理申请处理
+     *
+     * @param devTask
+     * @return
+     */
+    @Log(title = "SAI开项管理申请处理", businessType = BusinessType.UPDATE)
+    @RepeatSubmit
+    @PutMapping("/handle")
+    public AjaxResult handle(@RequestBody DevTask devTask) {
+        //更新数据
+        TSaiApply form = devTask.getSaiApply();
+        //使用任务服务完成任务(提交任务)
+        String taskId = devTask.getTaskId();
+        // 使用任务id,获取任务对象,获取流程实例id
+        Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+        //利用任务对象,获取流程实例id
+        String processInstancesId = task.getProcessInstanceId();
+        // 根据实例名判断当前流程节点
+        Map<String, Object> param = new HashMap<>();
+        String isPassAssess  = form.getIsPassAssess();
+        String isPassInspect  = form.getIsPassInspect();
+        switch (task.getName()) {
+            case "评估":
+                if ("1".equals(isPassAssess)) {
+                    // 指定执行人
+                    param.put("executor", form.getExecutor());
+                    // 修改状态为进行中
+                    form.setApplyStatus("2");
+                } else {
+                    // 修改状态为已中止
+                    form.setApplyStatus("5");
+                }
+                break;
+            case "执行":
+                // 指定验收人
+                param.put("inspectors", form.getInspectors());
+                // 修改状态为待验收
+                form.setApplyStatus("3");
+                break;
+            case "验收":
+                if ("1".equals(isPassInspect)) {
+                    // 修改状态为已完成
+                    form.setApplyStatus("4");
+                } else {
+                    // 修改状态为进行中
+                    form.setApplyStatus("2");
+                }
+                break;
+        }
+        //网关判断
+        if (StringUtils.isNotEmpty(isPassAssess) && "1".equals(isPassAssess)) {
+            param.put("isPassAssess", "1");
+        } else if (StringUtils.isNotEmpty(isPassAssess) && !"1".equals(isPassAssess)) {
+            param.put("isPassAssess", "0");
+        }
+        if (StringUtils.isNotEmpty(isPassInspect) && "1".equals(isPassInspect)) {
+            param.put("isPassInspect", "1");
+        } else if (StringUtils.isNotEmpty(isPassInspect) && !"1".equals(isPassInspect)) {
+            param.put("isPassInspect", "0");
+        }
+        param.put("condition", devTask.getCondition());
+        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+        TaskService taskService = processEngine.getTaskService();
+        //认领任务
+        processEngine.getTaskService()
+                .claim(taskId, getUserId().toString());
+        taskService.addComment(taskId, processInstancesId, devTask.getComment());
+        taskService.complete(taskId, param);
+        //任务完成更新数据
+        tSaiApplyService.updateTSaiApply(form);
+        return AjaxResult.success();
+    }
+
+    /**
+     * 修改SAI开项管理
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:edit')")
+    @Log(title = "SAI开项管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TSaiApply tSaiApply)
+    {
+        String userId = getUserId().toString();
+        tSaiApply.setUpdateBy(userId);
+        tSaiApply.setUpdateTime(new Date());
+        return toAjax(tSaiApplyService.updateTSaiApply(tSaiApply));
+    }
+
+    /**
+     * 删除SAI开项管理
+     */
+    @PreAuthorize("@ss.hasPermi('production:apply:remove')")
+    @Log(title = "SAI开项管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{saiApplyIds}")
+    public AjaxResult remove(@PathVariable Long[] saiApplyIds)
+    {
+        return toAjax(tSaiApplyService.deleteTSaiApplyByIds(saiApplyIds));
+    }
+}

+ 195 - 0
master/src/main/java/com/ruoyi/project/production/domain/TSaiApply.java

@@ -0,0 +1,195 @@
+package com.ruoyi.project.production.domain;
+
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * SAI开项管理对象 t_sai_apply
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+public class TSaiApply extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @Excel(name = "主键")
+    private Long saiApplyId;
+
+    /** 删除状态 */
+    private String delFlag;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 申请状态 */
+    @Excel(name = "申请状态")
+    private String applyStatus;
+
+    /** 申请编号 */
+    @Excel(name = "申请编号")
+    private String apNo;
+
+    /** 流程id */
+    @Excel(name = "流程id")
+    private String processId;
+
+    /** 是否通过评估 */
+    @Excel(name = "是否通过评估")
+    private String isPassAssess;
+
+    /** 是否通过验收 */
+    @Excel(name = "是否通过验收")
+    private String isPassInspect;
+
+    /** 申请人 */
+    @Excel(name = "登记人")
+    private String applicant;
+
+    /** 评估人 */
+    @Excel(name = "评估人")
+    private String assessor;
+
+    /** 执行人 */
+    @Excel(name = "执行人")
+    private String executor;
+
+    /** 验收人 */
+    @Excel(name = "验收人")
+    private String inspectors;
+
+    public void setSaiApplyId(Long saiApplyId)
+    {
+        this.saiApplyId = saiApplyId;
+    }
+
+    public Long getSaiApplyId()
+    {
+        return saiApplyId;
+    }
+    public void setDelFlag(String delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setApplyStatus(String applyStatus)
+    {
+        this.applyStatus = applyStatus;
+    }
+
+    public String getApplyStatus()
+    {
+        return applyStatus;
+    }
+    public void setApNo(String apNo)
+    {
+        this.apNo = apNo;
+    }
+
+    public String getApNo()
+    {
+        return apNo;
+    }
+    public void setProcessId(String processId)
+    {
+        this.processId = processId;
+    }
+
+    public String getProcessId()
+    {
+        return processId;
+    }
+    public void setIsPassAssess(String isPassAssess)
+    {
+        this.isPassAssess = isPassAssess;
+    }
+
+    public String getIsPassAssess()
+    {
+        return isPassAssess;
+    }
+    public void setIsPassInspect(String isPassInspect)
+    {
+        this.isPassInspect = isPassInspect;
+    }
+
+    public String getIsPassInspect()
+    {
+        return isPassInspect;
+    }
+    public void setApplicant(String applicant)
+    {
+        this.applicant = applicant;
+    }
+
+    public String getApplicant()
+    {
+        return applicant;
+    }
+    public void setAssessor(String assessor)
+    {
+        this.assessor = assessor;
+    }
+
+    public String getAssessor()
+    {
+        return assessor;
+    }
+    public void setExecutor(String executor)
+    {
+        this.executor = executor;
+    }
+
+    public String getExecutor()
+    {
+        return executor;
+    }
+    public void setInspectors(String inspectors)
+    {
+        this.inspectors = inspectors;
+    }
+
+    public String getInspectors()
+    {
+        return inspectors;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("saiApplyId", getSaiApplyId())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("deptId", getDeptId())
+            .append("applyStatus", getApplyStatus())
+            .append("apNo", getApNo())
+            .append("processId", getProcessId())
+            .append("isPassAssess", getIsPassAssess())
+            .append("isPassInspect", getIsPassInspect())
+            .append("applicant", getApplicant())
+            .append("assessor", getAssessor())
+            .append("executor", getExecutor())
+            .append("inspectors", getInspectors())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TSaiApplyMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TSaiApply;
+
+/**
+ * SAI开项管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-15
+ */
+public interface TSaiApplyMapper 
+{
+    /**
+     * 查询SAI开项管理
+     * 
+     * @param saiApplyId SAI开项管理ID
+     * @return SAI开项管理
+     */
+    public TSaiApply selectTSaiApplyById(Long saiApplyId);
+
+    /**
+     * 查询SAI开项管理列表
+     * 
+     * @param tSaiApply SAI开项管理
+     * @return SAI开项管理集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TSaiApply> selectTSaiApplyList(TSaiApply tSaiApply);
+
+    /**
+     * 新增SAI开项管理
+     * 
+     * @param tSaiApply SAI开项管理
+     * @return 结果
+     */
+    public int insertTSaiApply(TSaiApply tSaiApply);
+
+    /**
+     * 修改SAI开项管理
+     * 
+     * @param tSaiApply SAI开项管理
+     * @return 结果
+     */
+    public int updateTSaiApply(TSaiApply tSaiApply);
+
+    /**
+     * 删除SAI开项管理
+     * 
+     * @param saiApplyId SAI开项管理ID
+     * @return 结果
+     */
+    public int deleteTSaiApplyById(Long saiApplyId);
+
+    /**
+     * 批量删除SAI开项管理
+     * 
+     * @param saiApplyIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTSaiApplyByIds(Long[] saiApplyIds);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/production/service/ITSaiApplyService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TSaiApply;
+
+/**
+ * SAI开项管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-15
+ */
+public interface ITSaiApplyService 
+{
+    /**
+     * 查询SAI开项管理
+     * 
+     * @param saiApplyId SAI开项管理ID
+     * @return SAI开项管理
+     */
+    public TSaiApply selectTSaiApplyById(Long saiApplyId);
+
+    /**
+     * 查询SAI开项管理列表
+     * 
+     * @param tSaiApply SAI开项管理
+     * @return SAI开项管理集合
+     */
+    public List<TSaiApply> selectTSaiApplyList(TSaiApply tSaiApply);
+
+    /**
+     * 新增SAI开项管理
+     * 
+     * @param tSaiApply SAI开项管理
+     * @return 结果
+     */
+    public int insertTSaiApply(TSaiApply tSaiApply);
+
+    /**
+     * 修改SAI开项管理
+     * 
+     * @param tSaiApply SAI开项管理
+     * @return 结果
+     */
+    public int updateTSaiApply(TSaiApply tSaiApply);
+
+    /**
+     * 批量删除SAI开项管理
+     * 
+     * @param saiApplyIds 需要删除的SAI开项管理ID
+     * @return 结果
+     */
+    public int deleteTSaiApplyByIds(Long[] saiApplyIds);
+
+    /**
+     * 删除SAI开项管理信息
+     * 
+     * @param saiApplyId SAI开项管理ID
+     * @return 结果
+     */
+    public int deleteTSaiApplyById(Long saiApplyId);
+}

+ 96 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TSaiApplyServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TSaiApplyMapper;
+import com.ruoyi.project.production.domain.TSaiApply;
+import com.ruoyi.project.production.service.ITSaiApplyService;
+
+/**
+ * SAI开项管理Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-03-15
+ */
+@Service
+public class TSaiApplyServiceImpl implements ITSaiApplyService
+{
+    @Autowired
+    private TSaiApplyMapper tSaiApplyMapper;
+
+    /**
+     * 查询SAI开项管理
+     *
+     * @param saiApplyId SAI开项管理ID
+     * @return SAI开项管理
+     */
+    @Override
+    public TSaiApply selectTSaiApplyById(Long saiApplyId)
+    {
+        return tSaiApplyMapper.selectTSaiApplyById(saiApplyId);
+    }
+
+    /**
+     * 查询SAI开项管理列表
+     *
+     * @param tSaiApply SAI开项管理
+     * @return SAI开项管理
+     */
+    @Override
+    public List<TSaiApply> selectTSaiApplyList(TSaiApply tSaiApply)
+    {
+        return tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
+    }
+
+    /**
+     * 新增SAI开项管理
+     *
+     * @param tSaiApply SAI开项管理
+     * @return 结果
+     */
+    @Override
+    public int insertTSaiApply(TSaiApply tSaiApply)
+    {
+        tSaiApply.setCreateTime(DateUtils.getNowDate());
+        return tSaiApplyMapper.insertTSaiApply(tSaiApply);
+    }
+
+    /**
+     * 修改SAI开项管理
+     *
+     * @param tSaiApply SAI开项管理
+     * @return 结果
+     */
+    @Override
+    public int updateTSaiApply(TSaiApply tSaiApply)
+    {
+        tSaiApply.setUpdateTime(DateUtils.getNowDate());
+        return tSaiApplyMapper.updateTSaiApply(tSaiApply);
+    }
+
+    /**
+     * 批量删除SAI开项管理
+     *
+     * @param saiApplyIds 需要删除的SAI开项管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSaiApplyByIds(Long[] saiApplyIds)
+    {
+        return tSaiApplyMapper.deleteTSaiApplyByIds(saiApplyIds);
+    }
+
+    /**
+     * 删除SAI开项管理信息
+     *
+     * @param saiApplyId SAI开项管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTSaiApplyById(Long saiApplyId)
+    {
+        return tSaiApplyMapper.deleteTSaiApplyById(saiApplyId);
+    }
+}

+ 132 - 0
master/src/main/resources/mybatis/production/TSaiApplyMapper.xml

@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.production.mapper.TSaiApplyMapper">
+    
+    <resultMap type="TSaiApply" id="TSaiApplyResult">
+        <result property="saiApplyId"    column="sai_apply_id"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="applyStatus"    column="apply_status"    />
+        <result property="apNo"    column="ap_no"    />
+        <result property="processId"    column="process_id"    />
+        <result property="isPassAssess"    column="is_pass_assess"    />
+        <result property="isPassInspect"    column="is_pass_inspect"    />
+        <result property="applicant"    column="applicant"    />
+        <result property="assessor"    column="assessor"    />
+        <result property="executor"    column="executor"    />
+        <result property="inspectors"    column="inspectors"    />
+    </resultMap>
+
+    <sql id="selectTSaiApplyVo">
+        select d.sai_apply_id, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time, d.dept_id, d.apply_status, d.ap_no, d.process_id ,d.is_pass_assess, d.is_pass_inspect, d.applicant, d.assessor, d.executor, d.inspectors from t_sai_apply d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTSaiApplyList" parameterType="TSaiApply" resultMap="TSaiApplyResult">
+        <include refid="selectTSaiApplyVo"/>
+        <where>  
+            <if test="saiApplyId != null "> and sai_apply_id = #{saiApplyId}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="applyStatus != null  and applyStatus != ''"> and apply_status = #{applyStatus}</if>
+            <if test="apNo != null  and apNo != ''"> and ap_no = #{apNo}</if>
+            <if test="processId != null  and processId != ''"> and process_id = #{processId}</if>
+            <if test="isPassAssess != null  and isPassAssess != ''"> and is_pass_assess = #{isPassAssess}</if>
+            <if test="isPassInspect != null  and isPassInspect != ''"> and is_pass_inspect = #{isPassInspect}</if>
+            <if test="applicant != null  and applicant != ''"> and applicant = #{applicant}</if>
+            <if test="assessor != null  and assessor != ''"> and assessor = #{assessor}</if>
+            <if test="executor != null  and executor != ''"> and executor = #{executor}</if>
+            <if test="inspectors != null  and inspectors != ''"> and inspectors = #{inspectors}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTSaiApplyById" parameterType="Long" resultMap="TSaiApplyResult">
+        <include refid="selectTSaiApplyVo"/>
+        where sai_apply_id = #{saiApplyId}
+    </select>
+        
+    <insert id="insertTSaiApply" parameterType="TSaiApply">
+        <selectKey keyProperty="saiApplyId" resultType="long" order="BEFORE">
+            SELECT seq_t_sai_apply.NEXTVAL as saiApplyId FROM DUAL
+        </selectKey>
+        insert into t_sai_apply
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="saiApplyId != null">sai_apply_id,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="applyStatus != null">apply_status,</if>
+            <if test="apNo != null">ap_no,</if>
+            <if test="processId != null">process_id,</if>
+            <if test="isPassAssess != null">is_pass_assess,</if>
+            <if test="isPassInspect != null">is_pass_inspect,</if>
+            <if test="applicant != null">applicant,</if>
+            <if test="assessor != null">assessor,</if>
+            <if test="executor != null">executor,</if>
+            <if test="inspectors != null">inspectors,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="saiApplyId != null">#{saiApplyId},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="applyStatus != null">#{applyStatus},</if>
+            <if test="apNo != null">#{apNo},</if>
+            <if test="processId != null">#{processId},</if>
+            <if test="isPassAssess != null">#{isPassAssess},</if>
+            <if test="isPassInspect != null">#{isPassInspect},</if>
+            <if test="applicant != null">#{applicant},</if>
+            <if test="assessor != null">#{assessor},</if>
+            <if test="executor != null">#{executor},</if>
+            <if test="inspectors != null">#{inspectors},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTSaiApply" parameterType="TSaiApply">
+        update t_sai_apply
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="applyStatus != null">apply_status = #{applyStatus},</if>
+            <if test="apNo != null">ap_no = #{apNo},</if>
+            <if test="processId != null">process_id = #{processId},</if>
+            <if test="isPassAssess != null">is_pass_assess = #{isPassAssess},</if>
+            <if test="isPassInspect != null">is_pass_inspect = #{isPassInspect},</if>
+            <if test="applicant != null">applicant = #{applicant},</if>
+            <if test="assessor != null">assessor = #{assessor},</if>
+            <if test="executor != null">executor = #{executor},</if>
+            <if test="inspectors != null">inspectors = #{inspectors},</if>
+        </trim>
+        where sai_apply_id = #{saiApplyId}
+    </update>
+
+    <update id="deleteTSaiApplyById" parameterType="Long">
+        update t_sai_apply set del_flag = 2 where sai_apply_id = #{saiApplyId}
+    </update>
+
+    <update id="deleteTSaiApplyByIds" parameterType="String">
+        update t_sai_apply set del_flag = 2 where sai_apply_id in
+        <foreach item="saiApplyId" collection="array" open="(" separator="," close=")">
+            #{saiApplyId}
+        </foreach>
+    </update>
+    
+</mapper>

+ 118 - 0
master/src/main/resources/processes/sai/saiApply.bpmn

@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
+  <process id="saiApplyProcess" name="SAI开项申请流程" isExecutable="true">
+    <startEvent id="startevent" name="Start"></startEvent>
+    <userTask id="assessTask" name="评估" activiti:assignee="#{assessor}"></userTask>
+    <userTask id="excuteTask" name="执行" activiti:assignee="#{executor}"></userTask>
+    <userTask id="inspectTask" name="验收" activiti:candidateUsers="#{inspectors}"></userTask>
+    <sequenceFlow id="flow5" name="通过" sourceRef="excuteTask" targetRef="inspectTask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent1" name="End"></endEvent>
+    <exclusiveGateway id="isPassInspect" name="判断是否通过验收"></exclusiveGateway>
+    <sequenceFlow id="flow6" name="通过" sourceRef="inspectTask" targetRef="isPassInspect">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow7" name="是" sourceRef="isPassInspect" targetRef="endevent1">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${isPassInspect == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow8" name="否" sourceRef="isPassInspect" targetRef="excuteTask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${isPassInspect == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <exclusiveGateway id="isPassAssess" name="判断是否通过评估"></exclusiveGateway>
+    <sequenceFlow id="flow2" name="通过" sourceRef="assessTask" targetRef="isPassAssess">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow3" name="是" sourceRef="isPassAssess" targetRef="excuteTask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${isPassAssess == 1}]]></conditionExpression>
+    </sequenceFlow>
+    <endEvent id="endevent2" name="End"></endEvent>
+    <sequenceFlow id="flow4" name="否" sourceRef="isPassAssess" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${isPassAssess == 0}]]></conditionExpression>
+    </sequenceFlow>
+    <sequenceFlow id="flow1" sourceRef="startevent" targetRef="assessTask"></sequenceFlow>
+  </process>
+  <bpmndi:BPMNDiagram id="BPMNDiagram_saiApplyProcess">
+    <bpmndi:BPMNPlane bpmnElement="saiApplyProcess" id="BPMNPlane_saiApplyProcess">
+      <bpmndi:BPMNShape bpmnElement="startevent" id="BPMNShape_startevent">
+        <omgdc:Bounds height="35.0" width="35.0" x="465.0" y="50.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="assessTask" id="BPMNShape_assessTask">
+        <omgdc:Bounds height="55.0" width="105.0" x="430.0" y="112.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="excuteTask" id="BPMNShape_excuteTask">
+        <omgdc:Bounds height="55.0" width="105.0" x="430.0" y="270.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="inspectTask" id="BPMNShape_inspectTask">
+        <omgdc:Bounds height="55.0" width="105.0" x="430.0" y="370.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
+        <omgdc:Bounds height="35.0" width="35.0" x="465.0" y="552.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="isPassInspect" id="BPMNShape_isPassInspect">
+        <omgdc:Bounds height="35.0" width="41.0" x="462.0" y="468.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="isPassAssess" id="BPMNShape_isPassAssess">
+        <omgdc:Bounds height="35.0" width="41.0" x="462.0" y="202.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
+        <omgdc:Bounds height="35.0" width="35.0" x="550.0" y="205.0"></omgdc:Bounds>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
+        <omgdi:waypoint x="482.0" y="325.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="370.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="32.0" x="482.0" y="325.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
+        <omgdi:waypoint x="482.0" y="425.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="468.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="32.0" x="482.0" y="425.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
+        <omgdi:waypoint x="482.0" y="503.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="552.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="16.0" x="482.0" y="503.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
+        <omgdi:waypoint x="503.0" y="485.0"></omgdi:waypoint>
+        <omgdi:waypoint x="612.0" y="488.0"></omgdi:waypoint>
+        <omgdi:waypoint x="612.0" y="297.0"></omgdi:waypoint>
+        <omgdi:waypoint x="535.0" y="297.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="16.0" x="502.0" y="471.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
+        <omgdi:waypoint x="482.0" y="167.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="202.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="32.0" x="482.0" y="167.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
+        <omgdi:waypoint x="482.0" y="237.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="270.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="16.0" x="482.0" y="237.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
+        <omgdi:waypoint x="503.0" y="219.0"></omgdi:waypoint>
+        <omgdi:waypoint x="550.0" y="222.0"></omgdi:waypoint>
+        <bpmndi:BPMNLabel>
+          <omgdc:Bounds height="16.0" width="16.0" x="503.0" y="219.0"></omgdc:Bounds>
+        </bpmndi:BPMNLabel>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="482.0" y="85.0"></omgdi:waypoint>
+        <omgdi:waypoint x="482.0" y="112.0"></omgdi:waypoint>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+</definitions>

+ 70 - 0
ui/src/api/production/apply.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 提交申请
+export function submitApply(saiApplyId) {
+  return request({
+    url: '/production/apply/submit/' + saiApplyId,
+    method: 'put',
+  })
+}
+
+// 申请处理
+export function handleApply(data) {
+  return request({
+    url: '/production/apply/handle',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询SAI开项管理列表
+export function listApply(query) {
+  return request({
+    url: '/production/apply/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询SAI开项管理详细
+export function getApply(saiApplyId) {
+  return request({
+    url: '/production/apply/' + saiApplyId,
+    method: 'get'
+  })
+}
+
+// 新增SAI开项管理
+export function addApply(data) {
+  return request({
+    url: '/production/apply',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改SAI开项管理
+export function updateApply(data) {
+  return request({
+    url: '/production/apply',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除SAI开项管理
+export function delApply(saiApplyId) {
+  return request({
+    url: '/production/apply/' + saiApplyId,
+    method: 'delete'
+  })
+}
+
+// 导出SAI开项管理
+export function exportApply(query) {
+  return request({
+    url: '/production/apply/export',
+    method: 'get',
+    params: query
+  })
+}

+ 151 - 0
ui/src/views/approve/approveDetail/sai-apply-detail.vue

@@ -0,0 +1,151 @@
+<template>
+  <el-dialog
+    :title="!this.taskForm.taskId == '' ? $t('处理') : $t('详情')"
+    :close-on-click-modal="false"
+    :visible.sync="visible"
+    :append-to-body="true"
+    width="60%">
+    <!-- SAI开项管理详细 -->
+    <div>
+      taskName: {{taskName}}<br/>
+      主键 dataForm.saiApplyId:{{dataForm.saiApplyId}}<br/>
+      删除状态 dataForm.delFlag:{{dataForm.delFlag}}<br/>
+      部门编号 dataForm.deptId:{{dataForm.deptId}}<br/>
+      申请状态 dataForm.applyStatus:{{dataForm.applyStatus}}<br/>
+      申请编号 dataForm.apNo:{{dataForm.apNo}}<br/>
+      流程id dataForm.processId:{{dataForm.processId}}<br/>
+      归属部门 dataForm.deptId:{{dataForm.deptId}}<br/><br/>
+    </div>
+    <!-- 流转详情 -->
+    <div>
+      <span>{{ $t('流转详情') }}</span>
+      <el-table :data="historyList" border v-loading="historyLoading" style="width: 100%;">
+        <el-table-column prop="taskName" header-align="center" align="center"
+                         :label="$t('流程进度')"></el-table-column>
+        <el-table-column prop="userName" header-align="center" align="center" :label="$t('姓名')"></el-table-column>
+        <el-table-column prop="taskCreateTime" header-align="center" align="center"
+                         :label="$t('开始时间')"></el-table-column>
+        <el-table-column prop="taskEndTime" header-align="center" align="center"
+                         :label="$t('结束时间')"></el-table-column>
+        <el-table-column prop="comment" header-align="center" align="center"
+                         :label="$t('审批意见')"></el-table-column>
+      </el-table>
+    </div>
+    <!-- 流程操作 -->
+    <div slot="footer" class="dialog-footer">
+      <el-button type="success" @click="dataFormSubmit(1)">{{ $t('通过') }}</el-button>
+      <el-button type="danger" v-if="taskName == '验收'" @click="dataFormSubmit(2)">{{ $t('驳回') }}</el-button>
+      <el-button type="info" v-if="taskName == '评估'" @click="dataFormSubmit(3)">{{ $t('中止') }}</el-button>
+      <el-button @click="visible = false">{{ $t('返回') }}</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+
+import { getApply, handleApply } from "@/api/production/apply";
+import { getHistorylist } from "@/api/ehs/approvedanger";
+import { listUserPost } from "@/api/system/user";
+
+export default {
+  name: "sai-apply-detail",
+  data() {
+    return {
+      labelStyle: {'width': '200px'},
+      visible: false,
+      //流转列表
+      historyList: [],
+      historyLoading: true,
+      taskName: '',
+      rules: {},
+      // SAI开项管理对象
+      dataForm: {
+        saiApplyId: null,
+        deptId: null,
+        applyStatus: null,
+        apNo: null,
+        processId: null
+      },
+      taskForm: {
+        comment: '',
+        taskId: '',
+        files: '',
+        govDate: '',
+        govFileList: [],
+        businessKey: '',
+        saiApply: null,
+      },
+    }
+  },
+  methods: {
+    // 初始化
+    init(id, taskId, processId, taskName) {
+      // 表单重置
+      this.reset();
+      this.dataForm = {};
+      this.historyList = [];
+      this.dataForm.saiApplyId = id || 0;
+      this.form.id = id || 0;
+      this.visible = true;
+      this.taskName = taskName;
+      this.taskForm.taskId = taskId;
+      this.taskForm.businessKey = id;
+      this.dataForm.processId = processId;
+      // 查询SAI开项管理详细
+      getApply(id).then(response => {
+        this.dataForm = response.data;
+      });
+      // 查询流转详情
+      getHistorylist({processId: processId}).then(response => {
+        this.historyList = response.rows;
+        this.historyLoading = false
+      });
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        saiApplyId: null,
+        deptId: null,
+        applyStatus: null,
+        apNo: null,
+        processId: null
+      };
+    },
+    /**
+     * 处理流程操作按钮点击事件
+     * @param operation 操作:1通过,2驳回,3中止
+     */
+    dataFormSubmit(operation) {
+      // this.$refs["form"].validate(valid => {
+      //   if (valid) {
+          this.taskForm.saiApply = this.dataForm;
+          this.taskForm.condition = 1;
+          if (this.taskName == '评估') {
+            if (operation == 1) {
+              this.taskForm.saiApply.isPassAssess = 1;
+            } else if (operation == 3) {
+              this.taskForm.saiApply.isPassAssess = 0;
+            }
+          } else if (this.taskName == '验收') {
+            if (operation == 1) {
+              this.taskForm.saiApply.isPassInspect = 1;
+            } else if (operation == 2) {
+              this.taskForm.saiApply.isPassInspect = 0;
+            }
+          }
+          handleApply(this.taskForm).then(response =>{
+            this.msgSuccess("提交成功");
+            this.visible = false;
+            // refreshDataList事件:调用父组件getList方法刷新页面
+            this.$emit('refreshDataList');
+          });
+        // }
+      // })
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 12 - 2
ui/src/views/approve/myapprove/index.vue

@@ -56,6 +56,7 @@
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
     <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
     <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
     <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
     <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
+    <sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -74,12 +75,15 @@
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
   import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
   import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
+  import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
 
 
   export default {
   export default {
     name: "Myapprove",
     name: "Myapprove",
     components: {
     components: {
+      SaiApplyDetail,
       SafetychangeDetail,
       SafetychangeDetail,
-      OfflinevalveDetail, Treeselect,ProcessImg,AddOrUpdate,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail},
+      OfflinevalveDetail,
+      Treeselect,ProcessImg,AddOrUpdate,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail},
     data() {
     data() {
       return {
       return {
         // 遮罩层
         // 遮罩层
@@ -94,6 +98,7 @@
         invoiceDetailVisible:false,
         invoiceDetailVisible:false,
         offlinevalveDetailVisible:false,
         offlinevalveDetailVisible:false,
         safetychangeDetailVisible:false,
         safetychangeDetailVisible:false,
+        saiApplyVisible:false,
         // 选中数组
         // 选中数组
         ids: [],
         ids: [],
         // 非单个禁用
         // 非单个禁用
@@ -232,7 +237,12 @@
           this.$nextTick(() => {
           this.$nextTick(() => {
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
           })
           })
-        }  else {
+        } else if (row.processName == "SAI开项申请流程") {
+          this.saiApplyVisible = true
+          this.$nextTick(() => {
+            this.$refs.saiApplyDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
+          })
+        } else {
           this.approveInfo = row;
           this.approveInfo = row;
           this.infoTaskName = row.taskName;
           this.infoTaskName = row.taskName;
           this.infoprocessName = row.processName;
           this.infoprocessName = row.processName;

+ 10 - 1
ui/src/views/approve/pending/index.vue

@@ -131,6 +131,7 @@
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
     <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
     <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
     <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
     <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
+    <sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -151,10 +152,12 @@
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
   import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
   import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
+  import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
 
 
   export default {
   export default {
     name: "Pending",
     name: "Pending",
     components: {
     components: {
+      SaiApplyDetail,
       SafetychangeDetail,
       SafetychangeDetail,
       OfflinevalveDetail,
       OfflinevalveDetail,
       Treeselect,
       Treeselect,
@@ -184,6 +187,7 @@
         invoiceDetailVisible:false,
         invoiceDetailVisible:false,
         offlinevalveDetailVisible:false,
         offlinevalveDetailVisible:false,
         safetychangeDetailVisible:false,
         safetychangeDetailVisible:false,
+        saiApplyVisible:false,
         // 选中数组
         // 选中数组
         ids: [],
         ids: [],
         // 非单个禁用
         // 非单个禁用
@@ -412,7 +416,12 @@
           this.$nextTick(() => {
           this.$nextTick(() => {
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName,true)
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName,true)
           })
           })
-        }else {
+        } else if (row.processName == "SAI开项申请流程") {
+          this.saiApplyVisible = true
+          this.$nextTick(() => {
+            this.$refs.saiApplyDetail.init(row.approveObject.saiApplyId, row.taskId, row.processId, row.taskName)
+          })
+        } else {
           this.approveInfo = row;
           this.approveInfo = row;
           this.infoTaskName = row.taskName;
           this.infoTaskName = row.taskName;
           this.infoprocessName = row.processName;
           this.infoprocessName = row.processName;

+ 11 - 1
ui/src/views/approve/taskdone/index.vue

@@ -60,6 +60,7 @@
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
     <invoice-detail v-if="invoiceDetailVisible" ref="invoiceDetail" @refreshDataList="getList"></invoice-detail>
     <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
     <offlinevalve-detail v-if="offlinevalveDetailVisible" ref="offlinevalveDetail" @refreshDataList="getList"></offlinevalve-detail>
     <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
     <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
+    <sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -79,9 +80,12 @@
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
   import InvoiceDetail from "@/views/approve/approveDetail/invoice-detail";
   import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   import OfflinevalveDetail from "@/views/approve/approveDetail/offlinevalve-detail";
   import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
   import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
+  import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
+
   export default {
   export default {
     name: "Taskdone",
     name: "Taskdone",
     components: {
     components: {
+      SaiApplyDetail,
       SafetychangeDetail,
       SafetychangeDetail,
       OfflinevalveDetail,
       OfflinevalveDetail,
       Treeselect, AddOrUpdate,ProcessImg,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail
       Treeselect, AddOrUpdate,ProcessImg,SpecModify,SpecTrainingPlan,SpecMaintenance,IntactDetail,KekaoDetail,InvoiceDetail
@@ -100,6 +104,7 @@
         invoiceDetailVisible:false,
         invoiceDetailVisible:false,
         offlinevalveDetailVisible:false,
         offlinevalveDetailVisible:false,
         safetychangeDetailVisible:false,
         safetychangeDetailVisible:false,
+        saiApplyVisible:false,
         // 选中数组
         // 选中数组
         ids: [],
         ids: [],
         // 非单个禁用
         // 非单个禁用
@@ -246,7 +251,12 @@
           this.$nextTick(() => {
           this.$nextTick(() => {
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
           })
           })
-        }else {
+        } else if (row.processName == "SAI开项申请流程") {
+          this.saiApplyVisible = true
+          this.$nextTick(() => {
+            this.$refs.saiApplyDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
+          })
+        } else {
           this.approveInfo = row;
           this.approveInfo = row;
           this.infoTaskName = row.taskName;
           this.infoTaskName = row.taskName;
           this.infoprocessName = row.processName;
           this.infoprocessName = row.processName;

+ 536 - 0
ui/src/views/production/apply/index.vue

@@ -0,0 +1,536 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="主键" prop="saiApplyId">
+        <el-input
+          v-model="queryParams.saiApplyId"
+          placeholder="请输入主键"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="部门编号" prop="deptId">
+        <el-input
+          v-model="queryParams.deptId"
+          placeholder="请输入部门编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="申请状态" prop="applyStatus">
+        <el-select v-model="queryParams.applyStatus" placeholder="请选择申请状态" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="申请编号" prop="apNo">
+        <el-input
+          v-model="queryParams.apNo"
+          placeholder="请输入申请编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="流程id" prop="processId">
+        <el-input
+          v-model="queryParams.processId"
+          placeholder="请输入流程id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否通过评估" prop="isPassAssess">
+        <el-input
+          v-model="queryParams.isPassAssess"
+          placeholder="请输入是否通过评估"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否通过验收" prop="isPassInspect">
+        <el-input
+          v-model="queryParams.isPassInspect"
+          placeholder="请输入是否通过验收"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="登记人" prop="applicant">
+        <el-input
+          v-model="queryParams.applicant"
+          placeholder="请输入登记人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="评估人" prop="assessor">
+        <el-input
+          v-model="queryParams.assessor"
+          placeholder="请输入评估人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="执行人" prop="executor">
+        <el-input
+          v-model="queryParams.executor"
+          placeholder="请输入执行人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="验收人" prop="inspectors">
+        <el-input
+          v-model="queryParams.inspectors"
+          placeholder="请输入验收人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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="['production:apply:add']"
+        >新增</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="['production:apply:edit']"
+        >修改</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="['production:apply:remove']"
+        >删除</el-button>
+      </el-col>
+        <el-col :span="1.5">
+            <el-button
+                    type="info"
+                    icon="el-icon-upload2"
+                    size="mini"
+                    @click="handleImport"
+                    v-hasPermi="['production:apply:edit']"
+            >导入</el-button>
+        </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['production:apply:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="申请状态" align="center" prop="applyStatus" :show-overflow-tooltip="true" :formatter="applyStatusFormat"/>
+      <el-table-column label="申请编号" align="center" prop="apNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="流程id" align="center" prop="processId" :show-overflow-tooltip="true"/>
+      <el-table-column label="是否通过评估" align="center" prop="isPassAssess" :show-overflow-tooltip="true"/>
+      <el-table-column label="是否通过验收" align="center" prop="isPassInspect" :show-overflow-tooltip="true"/>
+      <el-table-column label="登记人" align="center" prop="applicant" :show-overflow-tooltip="true"/>
+      <el-table-column label="评估人" align="center" prop="assessor" :show-overflow-tooltip="true"/>
+      <el-table-column label="执行人" align="center" prop="executor" :show-overflow-tooltip="true"/>
+      <el-table-column label="验收人" align="center" prop="inspectors" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleSubmit(scope.row)"
+            v-hasPermi="['production:apply:edit']"
+            v-if="scope.row.applyStatus == 0"
+          >提交申请</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['production:apply:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['production:apply:remove']"
+          >删除</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"
+    />
+
+    <!-- 添加或修改SAI开项管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="主键" prop="saiApplyId">
+          <el-input v-model="form.saiApplyId" placeholder="请输入主键" />
+        </el-form-item>
+        <el-form-item label="删除状态" prop="delFlag">
+          <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
+        </el-form-item>
+        <el-form-item label="部门编号" prop="deptId">
+          <el-input v-model="form.deptId" placeholder="请输入部门编号" />
+        </el-form-item>
+        <el-form-item label="申请状态">
+          <el-radio-group v-model="form.applyStatus">
+            <el-radio label="1">请选择字典生成</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="申请编号" prop="apNo">
+          <el-input v-model="form.apNo" placeholder="请输入申请编号" />
+        </el-form-item>
+        <el-form-item label="流程id" prop="processId">
+          <el-input v-model="form.processId" placeholder="请输入流程id" />
+        </el-form-item>
+        <el-form-item label="是否通过评估" prop="isPassAssess">
+          <el-input v-model="form.isPassAssess" placeholder="请输入是否通过评估" />
+        </el-form-item>
+        <el-form-item label="是否通过验收" prop="isPassInspect">
+          <el-input v-model="form.isPassInspect" placeholder="请输入是否通过验收" />
+        </el-form-item>
+        <el-form-item label="登记人" prop="applicant">
+          <el-input v-model="form.applicant" placeholder="请输入登记人" />
+        </el-form-item>
+        <el-form-item label="评估人" prop="assessor">
+          <el-input v-model="form.assessor" placeholder="请输入评估人" />
+        </el-form-item>
+        <el-form-item label="执行人" prop="executor">
+          <el-input v-model="form.executor" placeholder="请输入执行人" />
+        </el-form-item>
+        <el-form-item label="验收人" prop="inspectors">
+          <el-input v-model="form.inspectors" placeholder="请输入验收人" />
+        </el-form-item>
+          <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+          </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+      <!-- 用户导入对话框 -->
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+          <el-upload
+                  ref="upload"
+                  :limit="1"
+                  accept=".xlsx, .xls"
+                  :headers="upload.headers"
+                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+              </div>
+              <div class="el-upload__tip" slot="tip">
+                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+              </div>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { submitApply, listApply, getApply, delApply, addApply, updateApply, exportApply, importTemplate} from "@/api/production/apply";
+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: "Apply",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // SAI开项管理表格数据
+      applyList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/production/apply/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        saiApplyId: null,
+        deptId: null,
+        applyStatus: null,
+        apNo: null,
+        processId: null,
+        isPassAssess: null,
+        isPassInspect: null,
+        applicant: null,
+        assessor: null,
+        executor: null,
+        inspectors: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      applyStatusOptions: [],
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+    this.getDicts("SAI_APPLY_STATUS").then(response => {
+      this.applyStatusOptions = response.data;
+    });
+  },
+  methods: {
+    // 申请状态字典翻译
+    applyStatusFormat(row, column) {
+      return this.selectDictLabel(this.applyStatusOptions, row.applyStatus);
+    },
+    /** 查询SAI开项管理列表 */
+    getList() {
+      this.loading = true;
+      listApply(this.queryParams).then(response => {
+        this.applyList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        saiApplyId: null,
+        delFlag: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        deptId: null,
+        applyStatus: "0",
+        apNo: null,
+        processId: null,
+        isPassAssess: null,
+        isPassInspect: null,
+        applicant: null,
+        assessor: null,
+        executor: null,
+        inspectors: 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.saiApplyId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加SAI开项管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const saiApplyId = row.saiApplyId || this.ids
+      getApply(saiApplyId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改SAI开项管理";
+      });
+    },
+    /** 提交申请操作 */
+    handleSubmit(row) {
+      submitApply(row.saiApplyId).then(response => {
+        this.msgSuccess("提交申请成功");
+        this.getList();
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.saiApplyId != null) {
+            updateApply(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addApply(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const saiApplyIds = row.saiApplyId || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delApply(saiApplyIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportApply(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      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, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      }
+  }
+};
+</script>

+ 524 - 0
ui/src/views/production/check/index.vue

@@ -0,0 +1,524 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="评估年度" prop="saiYear">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.saiYear"
+          type="year"
+          value-format="yyyy"
+          placeholder="选择评估年度"
+          @change="handleQuery">
+        </el-date-picker>
+      </el-form-item>
+      <!--<el-form-item label="数据来源" prop="source">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.source"-->
+          <!--placeholder="请输入数据来源"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <el-form-item :label="$t('数据来源')" prop="source">
+        <el-select v-model="queryParams.source" :placeholder="$t('请选择') + $t('数据来源')">
+          <el-option key="公司" label="公司" value="公司"></el-option>
+          <el-option key="装置" label="装置" value="装置"></el-option>
+          <el-option key="督导" label="督导" value="督导"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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="['production:sai:add']"
+        >新增</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="['production:sai:edit']"
+        >修改</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="['production:sai:remove']"
+        >删除</el-button>
+      </el-col>
+        <el-col :span="1.5">
+            <el-button
+                    type="info"
+                    icon="el-icon-upload2"
+                    size="mini"
+                    @click="handleImport"
+                    v-hasPermi="['production:sai:edit']"
+            >导入</el-button>
+        </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['production:sai:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-row class="colorMark">
+      <span style="float:left;">
+        <svg-icon id="score" icon-class="rectangleGreen" class="rectangleGreen"></svg-icon>
+        安全行为指数:{{score}}
+      </span>
+      <svg-icon icon-class="rectangleGreen" class="rectangleGreen"></svg-icon>
+      <span>范围1</span>
+      <svg-icon icon-class="rectangleYellow" class="rectangleYellow"></svg-icon>
+      <span>范围2</span>
+      <svg-icon icon-class="rectanglered" class="rectangleRed"></svg-icon>
+      <span>范围3</span>
+    </el-row>
+
+    <el-table v-loading="loading" :data="saiList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="检查的装置/设施" align="center" prop="plantName" :show-overflow-tooltip="true"/>
+      <el-table-column label="检查日期/时间" align="center" prop="inspectionDate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="识别出的安全问题" align="center" prop="dificiency" :show-overflow-tooltip="true"/>
+      <el-table-column label="级别" align="center" prop="saiLevel" :show-overflow-tooltip="true"/>
+      <el-table-column label="类别" align="center" prop="category" :show-overflow-tooltip="true"/>
+      <el-table-column label="采取或要采取的措施" align="center" prop="actions" :show-overflow-tooltip="true"/>
+      <el-table-column label="用户" align="center" prop="userDeptName" :show-overflow-tooltip="true"/>
+      <el-table-column label="数据来源" align="center" prop="source" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" 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="['production:sai:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['production:sai:remove']"
+          >删除</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"
+    />
+
+    <!-- 添加或修改SAI信息对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="检查的装置/设施" prop="plantId">
+          <treeselect v-model="form.plantId" :options="deptOptions" :show-count="true" placeholder="请选择检查的装置/设施" />
+        </el-form-item>
+        <!--<el-form-item label="检查的装置/设施" prop="plantId">-->
+          <!--<el-input v-model="form.plantId" placeholder="请输入检查的装置/设施" />-->
+        <!--</el-form-item>-->
+        <el-form-item label="检查日期/时间" prop="inspectionDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.inspectionDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择检查日期/时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="识别出的安全问题" prop="dificiency">
+          <el-input v-model="form.dificiency" placeholder="请输入识别出的安全问题" />
+        </el-form-item>
+        <el-form-item label="级别" prop="saiLevel">
+          <el-input v-model="form.saiLevel" placeholder="请输入级别" />
+        </el-form-item>
+        <el-form-item label="类别" prop="category">
+          <el-input v-model="form.category" placeholder="请输入类别" />
+        </el-form-item>
+        <el-form-item label="采取或要采取的措施" prop="actions">
+          <el-input v-model="form.actions" placeholder="请输入采取或要采取的措施" />
+        </el-form-item>
+        <el-form-item label="用户" prop="userDept">
+          <treeselect v-model="form.userDept" :options="deptOptions" :show-count="true" placeholder="请选择用户" />
+        </el-form-item>
+        <!--<el-form-item label="用户" prop="userDept">-->
+          <!--<el-input v-model="form.userDept" placeholder="请输入用户" />-->
+        <!--</el-form-item>-->
+        <el-form-item :label="$t('数据来源')" prop="source">
+          <el-select v-model="form.source" :placeholder="$t('请选择') + $t('数据来源')">
+            <el-option key="公司" label="公司" value="公司"></el-option>
+            <el-option key="装置" label="装置" value="装置"></el-option>
+            <el-option key="督导" label="督导" value="督导"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="归属部门" prop="deptId">
+            <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+          <el-upload
+                  ref="upload"
+                  :limit="1"
+                  accept=".xlsx, .xls"
+                  :headers="upload.headers"
+                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+              </div>
+              <div class="el-upload__tip" slot="tip">
+                  <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
+                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+              </div>
+              <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
+                <input name="type" :value="upload.type" hidden />
+              </form>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listSai, listSaiByYear, getSai, delSai, addSai, updateSai, exportSai, importTemplate} from "@/api/production/sai";
+import { treeselect, alltreeselect } 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: "Sai",
+  components: { Treeselect },
+  data() {
+    return {
+      score: 0,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // SAI信息表格数据
+      saiList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            //下载模板请求地址
+            downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+            //下载模板类型
+            type: 'sai',
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/production/sai/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        saiId: null,
+        plantId: null,
+        inspectionDate: null,
+        dificiency: null,
+        saiLevel: null,
+        category: null,
+        actions: null,
+        userDept: null,
+        source: null,
+        saiYear: null,
+        deptId:null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+    this.setYear();
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    // this.getList();
+    this.getListByYear();
+    this.getTreeselect();
+  },
+  methods: {
+    setYear() {
+      this.queryParams.saiYear = new Date().getFullYear().toString();
+    },
+    /** 查询SAI信息列表 */
+    getListByYear() {
+      this.loading = true;
+      listSaiByYear(this.queryParams).then(response => {
+        this.saiList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    getList() {
+      this.loading = true;
+      listSai(this.queryParams).then(response => {
+        this.saiList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          alltreeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        saiId: null,
+        plantId: null,
+        inspectionDate: null,
+        dificiency: null,
+        saiLevel: null,
+        category: null,
+        actions: null,
+        userDept: null,
+        source: null,
+        delFlag: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getListByYear();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.saiId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加SAI信息";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const saiId = row.saiId || this.ids
+      getSai(saiId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改SAI信息";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.saiId != null) {
+            updateSai(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getListByYear();
+            });
+          } else {
+            addSai(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getListByYear();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const saiIds = row.saiId || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delSai(saiIds);
+        }).then(() => {
+          this.getListByYear();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有SAI信息数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportSai(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+        this.$refs['downloadFileForm'].submit()
+      },
+      // 文件下载处理
+      handleDownload(row) {
+        var name = row.fileName;
+        var url = row.fileUrl;
+        var suffix = url.substring(url.lastIndexOf("."), url.length);
+        const a = document.createElement('a')
+        a.setAttribute('download', name)
+        a.setAttribute('target', '_blank')
+        a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+        a.click()
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+        this.upload.open = false;
+        this.upload.isUploading = false;
+        this.$refs.upload.clearFiles();
+        if (response.data[0] != null) {
+          this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+        }else {
+          this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+        }
+        this.getListByYear();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      }
+  }
+};
+</script>
+
+<style>
+  .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;
+  }
+  .rectangleRed {
+    width: 40px !important;
+    height: 20px !important;
+  }
+  .rectangleGreen {
+    width: 40px !important;
+    height: 20px !important;
+  }
+</style>

+ 2 - 523
ui/src/views/production/sai/index.vue

@@ -1,524 +1,3 @@
-<template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="评估年度" prop="saiYear">
-        <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.saiYear"
-          type="year"
-          value-format="yyyy"
-          placeholder="选择评估年度"
-          @change="handleQuery">
-        </el-date-picker>
-      </el-form-item>
-      <!--<el-form-item label="数据来源" prop="source">-->
-        <!--<el-input-->
-          <!--v-model="queryParams.source"-->
-          <!--placeholder="请输入数据来源"-->
-          <!--clearable-->
-          <!--size="small"-->
-          <!--@keyup.enter.native="handleQuery"-->
-        <!--/>-->
-      <!--</el-form-item>-->
-      <el-form-item :label="$t('数据来源')" prop="source">
-        <el-select v-model="queryParams.source" :placeholder="$t('请选择') + $t('数据来源')">
-          <el-option key="公司" label="公司" value="公司"></el-option>
-          <el-option key="装置" label="装置" value="装置"></el-option>
-          <el-option key="督导" label="督导" value="督导"></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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="['production:sai:add']"
-        >新增</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="['production:sai:edit']"
-        >修改</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="['production:sai:remove']"
-        >删除</el-button>
-      </el-col>
-        <el-col :span="1.5">
-            <el-button
-                    type="info"
-                    icon="el-icon-upload2"
-                    size="mini"
-                    @click="handleImport"
-                    v-hasPermi="['production:sai:edit']"
-            >导入</el-button>
-        </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['production:sai:export']"
-        >导出</el-button>
-      </el-col>
-	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-row class="colorMark">
-      <span style="float:left;">
-        <svg-icon id="score" icon-class="rectangleGreen" class="rectangleGreen"></svg-icon>
-        安全行为指数:{{score}}
-      </span>
-      <svg-icon icon-class="rectangleGreen" class="rectangleGreen"></svg-icon>
-      <span>范围1</span>
-      <svg-icon icon-class="rectangleYellow" class="rectangleYellow"></svg-icon>
-      <span>范围2</span>
-      <svg-icon icon-class="rectanglered" class="rectangleRed"></svg-icon>
-      <span>范围3</span>
-    </el-row>
-
-    <el-table v-loading="loading" :data="saiList" @selection-change="handleSelectionChange" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="检查的装置/设施" align="center" prop="plantName" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查日期/时间" align="center" prop="inspectionDate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="识别出的安全问题" align="center" prop="dificiency" :show-overflow-tooltip="true"/>
-      <el-table-column label="级别" align="center" prop="saiLevel" :show-overflow-tooltip="true"/>
-      <el-table-column label="类别" align="center" prop="category" :show-overflow-tooltip="true"/>
-      <el-table-column label="采取或要采取的措施" align="center" prop="actions" :show-overflow-tooltip="true"/>
-      <el-table-column label="用户" align="center" prop="userDeptName" :show-overflow-tooltip="true"/>
-      <el-table-column label="数据来源" align="center" prop="source" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" 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="['production:sai:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['production:sai:remove']"
-          >删除</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"
-    />
-
-    <!-- 添加或修改SAI信息对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="检查的装置/设施" prop="plantId">
-          <treeselect v-model="form.plantId" :options="deptOptions" :show-count="true" placeholder="请选择检查的装置/设施" />
-        </el-form-item>
-        <!--<el-form-item label="检查的装置/设施" prop="plantId">-->
-          <!--<el-input v-model="form.plantId" placeholder="请输入检查的装置/设施" />-->
-        <!--</el-form-item>-->
-        <el-form-item label="检查日期/时间" prop="inspectionDate">
-          <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.inspectionDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择检查日期/时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="识别出的安全问题" prop="dificiency">
-          <el-input v-model="form.dificiency" placeholder="请输入识别出的安全问题" />
-        </el-form-item>
-        <el-form-item label="级别" prop="saiLevel">
-          <el-input v-model="form.saiLevel" placeholder="请输入级别" />
-        </el-form-item>
-        <el-form-item label="类别" prop="category">
-          <el-input v-model="form.category" placeholder="请输入类别" />
-        </el-form-item>
-        <el-form-item label="采取或要采取的措施" prop="actions">
-          <el-input v-model="form.actions" placeholder="请输入采取或要采取的措施" />
-        </el-form-item>
-        <el-form-item label="用户" prop="userDept">
-          <treeselect v-model="form.userDept" :options="deptOptions" :show-count="true" placeholder="请选择用户" />
-        </el-form-item>
-        <!--<el-form-item label="用户" prop="userDept">-->
-          <!--<el-input v-model="form.userDept" placeholder="请输入用户" />-->
-        <!--</el-form-item>-->
-        <el-form-item :label="$t('数据来源')" prop="source">
-          <el-select v-model="form.source" :placeholder="$t('请选择') + $t('数据来源')">
-            <el-option key="公司" label="公司" value="公司"></el-option>
-            <el-option key="装置" label="装置" value="装置"></el-option>
-            <el-option key="督导" label="督导" value="督导"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="归属部门" prop="deptId">
-            <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 用户导入对话框 -->
-    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-          <el-upload
-                  ref="upload"
-                  :limit="1"
-                  accept=".xlsx, .xls"
-                  :headers="upload.headers"
-                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
-                  :disabled="upload.isUploading"
-                  :on-progress="handleFileUploadProgress"
-                  :on-success="handleFileSuccess"
-                  :auto-upload="false"
-                  drag
-          >
-              <i class="el-icon-upload"></i>
-              <div class="el-upload__text">
-                  将文件拖到此处,或
-                  <em>点击上传</em>
-              </div>
-              <div class="el-upload__tip" slot="tip">
-                  <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
-                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
-              </div>
-              <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
-                <input name="type" :value="upload.type" hidden />
-              </form>
-              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
-          </el-upload>
-          <div slot="footer" class="dialog-footer">
-              <el-button type="primary" @click="submitFileForm">确 定</el-button>
-              <el-button @click="upload.open = false">取 消</el-button>
-          </div>
-      </el-dialog>
-  </div>
+<template >
+  <router-view />
 </template>
 </template>
-
-<script>
-import { listSai, listSaiByYear, getSai, delSai, addSai, updateSai, exportSai, importTemplate} from "@/api/production/sai";
-import { treeselect, alltreeselect } 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: "Sai",
-  components: { Treeselect },
-  data() {
-    return {
-      score: 0,
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: false,
-      // 总条数
-      total: 0,
-      // SAI信息表格数据
-      saiList: [],
-      // 弹出层标题
-      title: "",
-      // 部门树选项
-      deptOptions: undefined,
-      clientHeight:300,
-      // 是否显示弹出层
-      open: false,
-        // 用户导入参数
-        upload: {
-            //下载模板请求地址
-            downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
-            //下载模板类型
-            type: 'sai',
-            // 是否显示弹出层(用户导入)
-            open: false,
-            // 弹出层标题(用户导入)
-            title: "",
-            // 是否禁用上传
-            isUploading: false,
-            // 是否更新已经存在的用户数据
-            updateSupport: 0,
-            // 设置上传的请求头部
-            headers: { Authorization: "Bearer " + getToken() },
-            // 上传的地址
-            url: process.env.VUE_APP_BASE_API + "/production/sai/importData"
-        },
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 20,
-        saiId: null,
-        plantId: null,
-        inspectionDate: null,
-        dificiency: null,
-        saiLevel: null,
-        category: null,
-        actions: null,
-        userDept: null,
-        source: null,
-        saiYear: null,
-        deptId:null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
-    };
-  },
-  watch: {
-        // 根据名称筛选部门树
-        deptName(val) {
-            this.$refs.tree.filter(val);
-        }
-   },
-  created() {
-    this.setYear();
-      //设置表格高度对应屏幕高度
-      this.$nextTick(() => {
-          this.clientHeight = document.body.clientHeight -250
-      })
-    // this.getList();
-    this.getListByYear();
-    this.getTreeselect();
-  },
-  methods: {
-    setYear() {
-      this.queryParams.saiYear = new Date().getFullYear().toString();
-    },
-    /** 查询SAI信息列表 */
-    getListByYear() {
-      this.loading = true;
-      listSaiByYear(this.queryParams).then(response => {
-        this.saiList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    getList() {
-      this.loading = true;
-      listSai(this.queryParams).then(response => {
-        this.saiList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-     /** 查询部门下拉树结构 */
-     getTreeselect() {
-          alltreeselect().then(response => {
-              this.deptOptions = response.data;
-          });
-     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        saiId: null,
-        plantId: null,
-        inspectionDate: null,
-        dificiency: null,
-        saiLevel: null,
-        category: null,
-        actions: null,
-        userDept: null,
-        source: null,
-        delFlag: null,
-        createBy: null,
-        createTime: null,
-        updateBy: null,
-        updateTime: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getListByYear();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.saiId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加SAI信息";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const saiId = row.saiId || this.ids
-      getSai(saiId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改SAI信息";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.saiId != null) {
-            updateSai(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getListByYear();
-            });
-          } else {
-            addSai(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getListByYear();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const saiIds = row.saiId || this.ids;
-      this.$confirm('是否确认删除?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delSai(saiIds);
-        }).then(() => {
-          this.getListByYear();
-          this.msgSuccess("删除成功");
-        })
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有SAI信息数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportSai(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
-    },
-      /** 导入按钮操作 */
-      handleImport() {
-          this.upload.title = "用户导入";
-          this.upload.open = true;
-      },
-      /** 下载模板操作 */
-      importTemplate() {
-        this.$refs['downloadFileForm'].submit()
-      },
-      // 文件下载处理
-      handleDownload(row) {
-        var name = row.fileName;
-        var url = row.fileUrl;
-        var suffix = url.substring(url.lastIndexOf("."), url.length);
-        const a = document.createElement('a')
-        a.setAttribute('download', name)
-        a.setAttribute('target', '_blank')
-        a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
-        a.click()
-      },
-      // 文件上传中处理
-      handleFileUploadProgress(event, file, fileList) {
-          this.upload.isUploading = true;
-      },
-      // 文件上传成功处理
-      handleFileSuccess(response, file, fileList) {
-        this.upload.open = false;
-        this.upload.isUploading = false;
-        this.$refs.upload.clearFiles();
-        if (response.data[0] != null) {
-          this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
-        }else {
-          this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
-        }
-        this.getListByYear();
-      },
-      // 提交上传文件
-      submitFileForm() {
-          this.$refs.upload.submit();
-      }
-  }
-};
-</script>
-
-<style>
-  .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;
-  }
-  .rectangleRed {
-    width: 40px !important;
-    height: 20px !important;
-  }
-  .rectangleGreen {
-    width: 40px !important;
-    height: 20px !important;
-  }
-</style>