Browse Source

SAI开项申请流程:新增/修改校验、搜索条件、保存驳回原因

wangggziwen 2 years ago
parent
commit
973e56af6c

+ 21 - 0
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -93,6 +93,26 @@ public class TStaffmgrController extends BaseController
     @Autowired
     private ITStPlanService tStPlanService;
 
+    /**
+     * 获取SAI整改负责人列表
+     */
+    @PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
+    @GetMapping("/listSaiExecutors")
+    public AjaxResult listSaiExecutors()
+    {
+        return AjaxResult.success(tStaffmgrService.selectSaiExecutors());
+    }
+
+    /**
+     * 获取SAI验证人列表
+     */
+    @PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
+    @GetMapping("/listSaiInspectors")
+    public AjaxResult listSaiInspectors()
+    {
+        return AjaxResult.success(tStaffmgrService.selectSaiInspectors());
+    }
+
     /**
      * 获取人员管理详细信息
      */
@@ -104,6 +124,7 @@ public class TStaffmgrController extends BaseController
         SysUser sysUser = sysUserService.selectUserById(userId);
         String staffId = sysUser.getStaffId();
         TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(staffId);
+        staffmgr.setUserId(userId.toString());
         return AjaxResult.success(staffmgr);
     }
 

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

@@ -29,6 +29,9 @@ public class TStaffmgr extends BaseEntity
     @Excel(name = "员工编号")
     private String staffid;
 
+    /** 用户编号 */
+    private String userId;
+
     /** 员工姓名 */
     @Excel(name = "员工姓名")
     private String name;
@@ -135,6 +138,14 @@ public class TStaffmgr extends BaseEntity
 
     private String region;
 
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
     public String getRegion() {
         return region;
     }

+ 10 - 0
master/src/main/java/com/ruoyi/project/plant/mapper/TStaffmgrMapper.java

@@ -16,6 +16,16 @@ import java.util.Map;
  */
 public interface TStaffmgrMapper
 {
+    /**
+     * 获取SAI验证人列表
+     */
+    public List<TStaffmgr> selectSaiInspectors();
+
+    /**
+     * 获取SAI整改负责人列表
+     */
+    public List<TStaffmgr> selectSaiExecutors();
+
     /**
      * 查询导师下拉列表
      *

+ 10 - 0
master/src/main/java/com/ruoyi/project/plant/service/ITStaffmgrService.java

@@ -109,4 +109,14 @@ public interface ITStaffmgrService
     List<TStaffmgr> selectTMentorStaffmgrByPost(SysUser sysUser);
 
     int deleteRetireTStaffmgrByIds(Long id);
+
+    /**
+     * 获取SAI验证人列表
+     */
+    public List<TStaffmgr> selectSaiInspectors();
+
+    /**
+     * 获取SAI整改负责人列表
+     */
+    public List<TStaffmgr> selectSaiExecutors();
 }

+ 14 - 0
master/src/main/java/com/ruoyi/project/plant/service/impl/TStaffmgrServiceImpl.java

@@ -26,6 +26,20 @@ public class TStaffmgrServiceImpl implements ITStaffmgrService
         return tStaffmgrMapper.selectMentorList(tStaffmgr);
     }
 
+    /**
+     * 获取SAI验证人列表
+     */
+    public List<TStaffmgr> selectSaiExecutors() {
+        return tStaffmgrMapper.selectSaiExecutors();
+    }
+
+    /**
+     * 获取SAI整改负责人列表
+     */
+    public List<TStaffmgr> selectSaiInspectors() {
+        return tStaffmgrMapper.selectSaiInspectors();
+    }
+
     /**
      * 查询人员管理
      *

+ 60 - 34
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -111,12 +111,12 @@ public class TSaiApplyController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TSaiApply tSaiApply)
     {
-        // 新增操作
         String userId = getUserId().toString();
         tSaiApply.setCreateTime(new Date());
         tSaiApply.setCreateBy(userId);
         tSaiApply.setDeptId(103L);
         tSaiApply.setApplyStatus(0);
+        tSaiApply.setHandler(tSaiApply.getApplicant());
         return toAjax(tSaiApplyService.insertTSaiApply(tSaiApply));
     }
 
@@ -128,28 +128,31 @@ public class TSaiApplyController extends BaseController
     @PutMapping(value = "/submit/{saiApplyId}")
     public AjaxResult submit(@PathVariable("saiApplyId") Long saiApplyId)
     {
-        TSaiApply tSaiApply = tSaiApplyService.selectTSaiApplyById(saiApplyId);
+        // 当前登录用户userId
         String userId = getUserId().toString();
+        // SAI开项管理对象
+        TSaiApply tSaiApply = tSaiApplyService.selectTSaiApplyById(saiApplyId);
+        tSaiApply.setApplyStatus(1);
+        Date date = new Date();
+        date.setDate(date.getDate() + 7);
+        tSaiApply.setEstimateFinishDate(date);
+        tSaiApply.setAssessor("20276");
+        tSaiApply.setHandler("20276");
         // 开始申请流程
         tSaiApply.setApNo(DateUtils.dateTimeNow() + userId);
-        // 流程businessKey = 新增操作对象saiApplyId
-        long businessKey = saiApplyId;
-        //开始工作流、监听
         Authentication.setAuthenticatedUserId(userId);//设置当前申请人
+        // 声明流程变量集合
         Map<String, Object> variables = new HashMap<>();
-        // 评估人为张力飞
         variables.put("assessor", "20276");
-        variables.put("executor", "20276");
-        variables.put("inspectors", "20276");
-        // 修改状态为待评估
-        tSaiApply.setApplyStatus(1);
-        //采用key来启动流程定义并设置流程变量,返回流程实例
+        // 流程businessKey = SAI开项管理对象saiApplyId
+        long businessKey = saiApplyId;
+        // 采用key来启动流程定义并设置流程变量,返回流程实例
         ProcessInstance pi = runtimeService.startProcessInstanceByKey("saiApplyProcess", String.valueOf(businessKey), variables);
         logger.info("流程定义id:" + pi.getProcessDefinitionId());
         logger.info("流程实例id:" + pi.getProcessInstanceId());
-        // 新增操作对象processId = 流程实例id
+        // SAI开项管理对象processId = 流程实例id
         tSaiApply.setProcessId(pi.getProcessInstanceId());
-        // 获取taksId、TaskName
+        // 标记taskId、TaskName
         ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
         List<Task> list = processEngine.getTaskService()//获取任务service
                 .createTaskQuery()//创建查询对象
@@ -178,47 +181,69 @@ public class TSaiApplyController extends BaseController
         //更新数据
         TSaiApply form = devTask.getSaiApply();
         //使用任务服务完成任务(提交任务)
-        String taskId = devTask.getTaskId();
+        String taskId = devTask.getSaiApply().getTaskId();
         // 使用任务id,获取任务对象,获取流程实例id
         Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
         //利用任务对象,获取流程实例id
         String processInstancesId = task.getProcessInstanceId();
-        // 根据实例名判断当前流程节点
+        // 声明流程变量集合
         Map<String, Object> param = new HashMap<>();
         String condition = devTask.getCondition();
         param.put("condition", condition);
+        // 下一任务执行人userId
+        String nextHandler = null;
+        // 审批意见
+        String comment = "";
+        switch (condition) {
+            case "0":
+                comment = "中止";
+                break;
+            case "1":
+                comment = "通过";
+                break;
+            case "2":
+                comment = "驳回";
+                break;
+        }
+        // 根据实例名判断当前流程节点
         switch (task.getName()) {
             case "评估":
                 if ("1".equals(condition)) {
-                    // 指定执行人
-//                    param.put("executor", form.getExecutor());
-                    // 修改状态为进行中
                     form.setApplyStatus(2);
+                    param.put("executor", form.getExecutor());
+                    nextHandler = form.getExecutor();
+                    form.setHandler(form.getExecutor());
                 } else {
-                    // 修改状态为已中止
                     form.setApplyStatus(5);
                     form.setTaskId(null);
                     form.setTaskName(null);
+                    nextHandler = null;
+                    form.setHandler(null);
                 }
                 break;
             case "执行":
-                // 指定验收人
-//                param.put("inspectors", form.getInspectors());
-                // 修改状态为待验收
                 form.setApplyStatus(3);
+                param.put("inspectors", form.getInspectors());
+                nextHandler = form.getInspectors();
+                form.setHandler(form.getInspectors());
                 break;
             case "验收":
                 if ("1".equals(condition)) {
-                    // 修改状态为已完成
                     form.setApplyStatus(4);
                     form.setTaskId(null);
                     form.setTaskName(null);
+                    nextHandler = null;
+                    form.setHandler(null);
                 } else {
-                    // 修改状态为进行中
                     form.setApplyStatus(2);
+                    nextHandler = form.getExecutor();
+                    form.setHandler(form.getExecutor());
                 }
+                // 拼接审批意见字符串
+                comment += "," + form.getRemarks();
                 break;
         }
+        devTask.setComment(comment);
         ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
         TaskService taskService = processEngine.getTaskService();
         //认领任务
@@ -226,18 +251,18 @@ public class TSaiApplyController extends BaseController
                 .claim(taskId, getUserId().toString());
         taskService.addComment(taskId, processInstancesId, devTask.getComment());
         taskService.complete(taskId, param);
-
-        // 获取taksId、TaskName
-        List<Task> list = processEngine.getTaskService()//获取任务service
-                .createTaskQuery()//创建查询对象
-                .taskCandidateOrAssigned("20276").list();
-        for (Task t : list) {
-            if (form.getProcessId().equals(t.getProcessInstanceId())) {
-                form.setTaskId(t.getId());
-                form.setTaskName(t.getName());
+        // 标记taskId、TaskName
+        if (nextHandler != null) {
+            List<Task> list = processEngine.getTaskService()//获取任务service
+                    .createTaskQuery()//创建查询对象
+                    .taskCandidateOrAssigned(nextHandler.indexOf(",") == -1 ? nextHandler: nextHandler.substring(0, nextHandler.indexOf(","))).list();
+            for (Task t : list) {
+                if (form.getProcessId().equals(t.getProcessInstanceId())) {
+                    form.setTaskId(t.getId());
+                    form.setTaskName(t.getName());
+                }
             }
         }
-
         //任务完成更新数据
         tSaiApplyService.updateTSaiApply(form);
         return AjaxResult.success();
@@ -254,6 +279,7 @@ public class TSaiApplyController extends BaseController
         String userId = getUserId().toString();
         tSaiApply.setUpdateBy(userId);
         tSaiApply.setUpdateTime(new Date());
+        tSaiApply.setHandler(tSaiApply.getApplicant());
         return toAjax(tSaiApplyService.updateTSaiApply(tSaiApply));
     }
 

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

@@ -43,6 +43,7 @@ public class TSaiApply extends BaseEntity
     /** 申请人 */
     @Excel(name = "申请人")
     private String applicant;
+    private String applicantName;
 
     /** 评估人 */
     @Excel(name = "评估人")
@@ -51,6 +52,7 @@ public class TSaiApply extends BaseEntity
     /** 执行人 */
     @Excel(name = "执行人")
     private String executor;
+    private String executorName;
 
     /** 验收人 */
     @Excel(name = "验收人")
@@ -59,6 +61,7 @@ public class TSaiApply extends BaseEntity
     /** 登记人部门 */
     @Excel(name = "登记人部门")
     private String applicantDept;
+    private String applicantDeptName;
 
     /** 登记人班组 */
     @Excel(name = "登记人班组")
@@ -84,6 +87,7 @@ public class TSaiApply extends BaseEntity
     /** 当前处理人 */
     @Excel(name = "当前处理人")
     private String handler;
+    private String handlerName;
 
     /** 任务编号 */
     @Excel(name = "任务编号")
@@ -135,6 +139,38 @@ public class TSaiApply extends BaseEntity
     @Excel(name = "VC/VE验证条款", readConverterExp = "其=它")
     private String veItemOther;
 
+    public String getApplicantName() {
+        return applicantName;
+    }
+
+    public void setApplicantName(String applicantName) {
+        this.applicantName = applicantName;
+    }
+
+    public String getExecutorName() {
+        return executorName;
+    }
+
+    public void setExecutorName(String executorName) {
+        this.executorName = executorName;
+    }
+
+    public String getApplicantDeptName() {
+        return applicantDeptName;
+    }
+
+    public void setApplicantDeptName(String applicantDeptName) {
+        this.applicantDeptName = applicantDeptName;
+    }
+
+    public String getHandlerName() {
+        return handlerName;
+    }
+
+    public void setHandlerName(String handlerName) {
+        this.handlerName = handlerName;
+    }
+
     public void setSaiApplyId(Long saiApplyId)
     {
         this.saiApplyId = saiApplyId;

+ 42 - 1
master/src/main/java/com/ruoyi/project/production/service/impl/TSaiApplyServiceImpl.java

@@ -2,6 +2,10 @@ package com.ruoyi.project.production.service.impl;
 
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.project.system.domain.SysDept;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.mapper.SysDeptMapper;
+import com.ruoyi.project.system.mapper.SysUserMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.production.mapper.TSaiApplyMapper;
@@ -20,6 +24,12 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     @Autowired
     private TSaiApplyMapper tSaiApplyMapper;
 
+    @Autowired
+    private SysDeptMapper sysDeptMapper;
+
+    @Autowired
+    private SysUserMapper sysUserMapper;
+
     /**
      * 查询SAI开项管理
      *
@@ -41,7 +51,38 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     @Override
     public List<TSaiApply> selectTSaiApplyList(TSaiApply tSaiApply)
     {
-        return tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
+        List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
+        for (TSaiApply saiApply : tSaiApplies) {
+            String applicantDept = saiApply.getApplicantDept();
+            String applicant = saiApply.getApplicant();
+            String handler = saiApply.getHandler();
+            String executor = saiApply.getExecutor();
+            if (applicantDept != null) {
+                saiApply.setApplicantDeptName(sysDeptMapper.selectDeptById(Long.parseLong(applicantDept)).getDeptName());
+            }
+            if (applicant != null) {
+                saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());
+            }
+            if (handler != null) {
+                if (handler.indexOf(",") != -1) {
+                    String[] split = handler.split(",");
+                    String handlerName = "";
+                    for (int i = 0; i < split.length; i++) {
+                        handlerName += sysUserMapper.selectUserById(Long.parseLong(split[i])).getNickName();
+                        if (i < split.length - 1) {
+                            handlerName += ",";
+                        }
+                    }
+                    saiApply.setHandlerName(handlerName);
+                } else {
+                    saiApply.setHandlerName(sysUserMapper.selectUserById(Long.parseLong(handler)).getNickName());
+                }
+            }
+            if (executor != null) {
+                saiApply.setExecutorName(sysUserMapper.selectUserById(Long.parseLong(executor)).getNickName());
+            }
+        }
+        return tSaiApplies;
     }
 
     /**

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

@@ -34,6 +34,7 @@
         <result property="leftDate"    column="left_date"    />
         <result property="isRetire"    column="is_retire"    />
         <result property="region"    column="region"    />
+        <result property="userId"    column="user_id"    />
     </resultMap>
 
     <sql id="selectTStaffmgrVo">
@@ -78,7 +79,9 @@
     </select>
 
     <select id="selectTStaffmgrListByDeptAndTeam" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
-        <include refid="selectTStaffmgrVo"/>
+        select u.user_id, d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
+        left join sys_dept s on s.dept_id = d.dept_id
+        inner join sys_user u on d.staffid = u.staffid
         <where>
             <if test="deptId != null and deptId != ''"> and d.dept_id = #{deptId} </if>
             <if test="team != null  and team != ''"> and d.team = #{team} </if>
@@ -86,6 +89,29 @@
         </where>
     </select>
 
+    <select id="selectSaiExecutors" resultMap="TStaffmgrResult">
+        select u.user_id, d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag,
+        d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score,
+        d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
+        left join sys_dept s on s.dept_id = d.dept_id
+        inner join sys_user u on d.staffid = u.staffid
+        inner join SYS_USER_ROLE ur on u.USER_ID = ur.USER_ID
+        inner join SYS_ROLE r on ur.ROLE_ID = r.ROLE_ID
+        where (
+            d.dept_id in (10040, 108)
+            or (d.dept_id = 103 and d.team = 18)
+            or (d.dept_id = 103 and r.ROLE_ID = 20016)
+        )
+        and d.del_flag = 0
+    </select>
+
+    <select id="selectSaiInspectors" resultMap="TStaffmgrResult">
+        select u.user_id, d.id, d.plant_code,d.left_date, d.staffid, d.name, d.photo, d.sex, d.birthday, d.unit, d.team, d.actualpost, d.contact, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.education, d.en_ability, d.accident_num, d.mail, d.skill_score, d.p_id , d.special_duty, d.region, s.dept_name from t_staffmgr d
+        left join sys_dept s on s.dept_id = d.dept_id
+        inner join sys_user u on d.staffid = u.staffid
+        where d.dept_id = 103 and d.team = 18 and d.del_flag = 0
+    </select>
+
     <select id="selectTStaffmgrList" parameterType="TStaffmgr" resultMap="TStaffmgrResult">
         <include refid="selectTStaffmgrVo"/>
         Left join SYS_DICT_DATA s0 on d.UNIT = s0.DICT_VALUE and s0.DICT_TYPE ='STAFF_UNIT'

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

@@ -201,12 +201,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="actualFinishDate != null">actual_finish_date = #{actualFinishDate},</if>
             <if test="isRecorded != null">is_recorded = #{isRecorded},</if>
             <if test="recordNo != null">record_no = #{recordNo},</if>
+            <if test="recordNo == null">record_no = null,</if>
             <if test="reaction != null">reaction = #{reaction},</if>
             <if test="needVe != null">need_ve = #{needVe},</if>
             <if test="veItems != null">ve_items = #{veItems},</if>
+            <if test="veItems == null">ve_items = null,</if>
             <if test="veResult != null">ve_result = #{veResult},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="veItemOther != null">ve_item_other = #{veItemOther},</if>
+            <if test="veItemOther == null">ve_item_other = null,</if>
         </trim>
         where sai_apply_id = #{saiApplyId}
     </update>

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

@@ -1,5 +1,21 @@
 import request from '@/utils/request'
 
+// 获取SAI执行人列表
+export function listSaiInspectors() {
+  return request({
+    url: '/plant/staffmgr/listSaiInspectors',
+    method: 'get',
+  })
+}
+
+// 获取SAI整改负责人列表
+export function listSaiExecutors() {
+  return request({
+    url: '/plant/staffmgr/listSaiExecutors',
+    method: 'get',
+  })
+}
+
 // 获取当前登录员工信息
 export function getLoginStaffInfo() {
   return request({

+ 389 - 101
ui/src/views/approve/approveDetail/sai-apply-detail.vue

@@ -11,74 +11,89 @@
         <h4>申请详情</h4>
         <el-descriptions title="" :column="3" border>
           <el-descriptions-item label="登记人部门">
-            <el-select
-              v-model="dataForm.applicantDept"
-              placeholder="请选择部门">
-              <el-option
-                v-for="dict in applicantDeptOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="applicantDept">
+              <el-select
+                v-model="dataForm.applicantDept"
+                placeholder="请选择部门">
+                <el-option
+                  v-for="dict in applicantDeptOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="登记人班组">
-            <el-select
-              v-model="dataForm.applicantTeam"
-              placeholder="请选择班组">
-              <el-option
-                v-for="dict in applicantTeamOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="applicantTeam">
+              <el-select
+                v-model="dataForm.applicantTeam"
+                placeholder="请选择班组">
+                <el-option
+                  v-for="dict in applicantTeamOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="登记人">
-            <el-select
-              v-model="dataForm.applicant"
-              placeholder="请选择登记人">
-              <el-option
-                v-for="dict in applicantOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="applicant">
+              <el-select
+                v-model="dataForm.applicant"
+                placeholder="请选择登记人">
+                <el-option
+                  v-for="dict in applicantOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="问题描述" :span="3">
-            <el-input v-model="dataForm.description" placeholder="请输入问题描述" type="textarea" autosize/>
-          </el-descriptions-item>
-          <el-descriptions-item label="附件" :span="3">
-
+            <el-form-item prop="description">
+              <el-input v-model="dataForm.description" placeholder="请输入问题描述" type="textarea" :rows="3"/>
+            </el-form-item>
           </el-descriptions-item>
+          <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
           <el-descriptions-item label="隐患" :span="3">
             <el-radio v-model="unsafeChoice" label="1" style="margin-right: 10px;">不安全状态</el-radio>
-            <el-select v-model="dataForm.unsafeStatus" placeholder="请选择不安全状态" style="margin-right: 20px;">
-              <el-option
-                v-for="dict in unsafeStatusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="unsafeStatus" style="display: inline-block;">
+              <el-select v-model="dataForm.unsafeStatus" placeholder="请选择不安全状态" style="margin-right: 20px;" :disabled="unsafeStatusDisabled">
+                <el-option
+                  v-for="dict in unsafeStatusOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
             <el-radio v-model="unsafeChoice" label="2" style="margin-right: 10px;">不安全行为</el-radio>
-            <el-select v-model="dataForm.unsafeAction" placeholder="请选择不安全行为">
-              <el-option
-                v-for="dict in unsafeActionOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="unsafeAction" style="display: inline-block;">
+              <el-select v-model="dataForm.unsafeAction" placeholder="请选择不安全行为" :disabled="unsafeActionDisabled">
+                <el-option
+                  v-for="dict in unsafeActionOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item label="记录日期">
-            <el-date-picker clearable size="small" style="width: 200px"
-                            v-model="dataForm.applyDate"
-                            type="date"
-                            value-format="yyyy-MM-dd"
-                            placeholder="选择记录日期">
-            </el-date-picker>
+          <el-descriptions-item label="登记时间">
+            <el-form-item prop="applyDate">
+              <el-date-picker
+                clearable
+                size="small"
+                style="width: 200px"
+                v-model="dataForm.applyDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择登记时间">
+              </el-date-picker>
+            </el-form-item>
           </el-descriptions-item>
         </el-descriptions>
       </div>
@@ -86,51 +101,97 @@
         <h4>评估详情</h4>
         <el-descriptions title="" :column="3" border>
           <el-descriptions-item label="预计完成时间" :span="3">
-            <el-form-item label="" prop="estimateFinishDate">
-              <el-date-picker clearable size="small" style="width: 200px"
-                              v-model="dataForm.estimateFinishDate"
-                              type="date"
-                              value-format="yyyy-MM-dd"
-                              placeholder="选择预计完成时间">
+            <el-form-item prop="estimateFinishDate">
+              <el-date-picker
+                clearable
+                size="small"
+                style="width: 200px"
+                v-model="dataForm.estimateFinishDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择预计完成时间">
               </el-date-picker>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="是否录入开项系统">
-            <el-form-item label="" prop="isRecorded">
-              <el-input v-model="dataForm.isRecorded" placeholder="请输入是否录入开项系统" />
+            <el-form-item prop="isRecorded">
+              <el-radio v-model="dataForm.isRecorded" label="1" @change="handleIsRecordedChange">是</el-radio>
+              <el-radio v-model="dataForm.isRecorded" label="0" @change="handleIsRecordedChange">否</el-radio>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="开项编号" :span="2">
-            <el-form-item label="" prop="recordNo">
-              <el-input v-model="dataForm.recordNo" placeholder="请输入开项编号" />
+            <el-form-item prop="recordNo">
+              <el-input v-model="dataForm.recordNo" placeholder="请输入开项编号" :disabled="recordNoDisabled" style="width: 200px;"/>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="采取的措施" :span="3">
-            <el-form-item label="" prop="reaction">
-              <el-input v-model="dataForm.reaction" placeholder="请输入采取的措施" />
+            <el-form-item prop="reaction">
+              <el-input v-model="dataForm.reaction" placeholder="请输入采取的措施" type="textarea" :rows="3"/>
             </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item label="整改负责人" :span="3">
-            <el-form-item label="" prop="executor">
-              <el-input v-model="dataForm.executor" placeholder="请输入整改负责人" />
+          <el-descriptions-item label="整改负责人">
+            <el-form-item prop="executor">
+              <el-select
+                clearable
+                v-model="dataForm.executor"
+                placeholder="请选择整改负责人">
+                <el-option
+                  v-for="dict in executorOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item label="验证人" :span="3">
-            <el-form-item label="" prop="inspectors">
-              <el-input v-model="dataForm.inspectors" placeholder="请输入验证人" />
+          <el-descriptions-item label="验证人" :span="2">
+            <el-form-item prop="inspector1" style="display: inline-block;">
+              <el-select
+                clearable
+                v-model="inspector1"
+                placeholder="请选择验证人"
+                style="margin-right: 10px;">
+                <el-option
+                  v-for="dict in inspectorOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item prop="inspector2" style="display: inline-block;">
+              <el-select
+                clearable
+                v-model="inspector2"
+                placeholder="请选择验证人">
+                <el-option
+                  v-for="dict in inspectorOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="是否需要VE验证" :span="3">
-            <el-form-item label="" prop="needVe">
-              <el-input v-model="dataForm.needVe" placeholder="请输入是否需要VE验证" />
+            <el-form-item prop="needVe">
+              <el-radio v-model="dataForm.needVe" label="1" @change="handleNeedVeChange">是</el-radio>
+              <el-radio v-model="dataForm.needVe" label="0" @change="handleNeedVeChange">否</el-radio>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="VE验证条款" :span="3">
-            <el-form-item label="" prop="veItems">
-              <el-input v-model="dataForm.veItems" placeholder="请输入VE验证条款" />
-            </el-form-item>
-            <el-form-item label="" prop="veItemOther">
-              <el-input v-model="dataForm.veItemOther" placeholder="请输入VE验证条款" />
+            <el-form-item prop="veItemsList">
+              <el-checkbox-group v-model="veItemsList" :disabled="veItemsDisabled">
+                <el-checkbox label="Level3、Level4的时间纠正措施"></el-checkbox>
+                <el-checkbox label="HIRA的补充措施"></el-checkbox>
+                <el-checkbox label="整改措施为程序的制定、更新"></el-checkbox>
+                <el-checkbox label="整改措施有关培训"></el-checkbox>
+                <el-checkbox label="整改措施为增加新设备、设施、部件,或对设备、设施进行改造"></el-checkbox><br/>
+                <el-checkbox label="其它" @change="handleVeItemOtherVeChange"></el-checkbox>
+                <el-form-item prop="veItemOther" style="display: inline-block;">
+                  <el-input v-model="dataForm.veItemOther" placeholder="请输入" :disabled="veItemOtherDisabled" style="display: inline-block; width: 200px; margin-left: 10px;"/>
+                </el-form-item>
+              </el-checkbox-group>
             </el-form-item>
           </el-descriptions-item>
         </el-descriptions>
@@ -138,27 +199,24 @@
       <div id="execute-div" v-if="showExecute">
         <h4>执行详情</h4>
         <el-descriptions title="" :column="3" border>
-          <el-descriptions-item label="附件">
-
-          </el-descriptions-item>
+          <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
         </el-descriptions>
       </div>
       <div id="inspect-div" v-if="showInspect">
         <h4>验收详情</h4>
         <el-descriptions title="" :column="3" border>
           <el-descriptions-item label="VC/VE验证成果" :span="3">
-            <el-form-item label="" prop="applicantDept">
-              <el-input v-model="dataForm.veResult" placeholder="请输入VC/VE验证成果" />
+            <el-form-item prop="veResult">
+              <el-radio v-model="dataForm.veResult" label="1">合格</el-radio>
+              <el-radio v-model="dataForm.veResult" label="0">不合格</el-radio>
             </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="备注" :span="3">
-            <el-form-item label="" prop="remarks">
-              <el-input v-model="dataForm.remarks" placeholder="请输入备注" />
+            <el-form-item prop="remarks">
+              <el-input v-model="dataForm.remarks" placeholder="请输入备注" type="textarea" :rows="3"/>
             </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item label="附件" :span="3">
-
-          </el-descriptions-item>
+          <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
         </el-descriptions>
       </div>
     </el-form>
@@ -179,8 +237,8 @@
     </div>
     <!-- 流程操作 -->
     <div slot="footer" class="dialog-footer">
-      <el-button type="success" v-if="taskName != null"@click="dataFormSubmit(1)">{{ $t('通过') }}</el-button>
-      <el-button type="danger" v-if="taskName == '验收'" @click="dataFormSubmit(2)">{{ $t('驳回') }}</el-button>
+      <el-button type="success" v-if="taskName != null && dataForm.veResult != '0'"@click="dataFormSubmit(1)">{{ $t('通过') }}</el-button>
+      <el-button type="danger" v-if="taskName == '验收' && dataForm.veResult == '0'" @click="dataFormSubmit(2)">{{ $t('驳回') }}</el-button>
       <el-button type="info" v-if="taskName == '评估'" @click="dataFormSubmit(0)">{{ $t('中止') }}</el-button>
       <el-button @click="visible = false">{{ $t('返回') }}</el-button>
     </div>
@@ -192,18 +250,94 @@ import { getApply, handleApply } from "@/api/production/apply";
 import { getHistorylist } from "@/api/ehs/approvedanger";
 import { listUserPost } from "@/api/system/user";
 import { treeselect, listDept } from "@/api/system/dept";
-import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
+import { listSaiInspectors, listSaiExecutors, listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
 
 export default {
   name: "sai-apply-detail",
   data() {
+    var validateInspector1 = (rule, value, callback) => {
+      if (this.inspector1 == null) {
+        return callback(new Error('验证人不能为空'));
+      } else {
+        return callback();
+      }
+    };
+    var validateInspector2 = (rule, value, callback) => {
+      if (this.inspector2 == null) {
+        return callback(new Error('验证人不能为空'));
+      } else {
+        return callback();
+      }
+    };
+    var validateVeItemsList = (rule, value, callback) => {
+      if (this.dataForm.needVe == '1') {
+        if (this.veItemsList.length == 0) {
+          return callback(new Error('VE验证条款不能为空'));
+        } else {
+          return callback();
+        }
+      } else {
+        return callback();
+      }
+    };
+    var validateRecordNo = (rule, value, callback) => {
+      if (this.dataForm.isRecorded == '1') {
+        if (this.dataForm.recordNo == null) {
+          return callback(new Error('开项编号不能为空'));
+        } else {
+          return callback();
+        }
+      } else {
+        return callback();
+      }
+    };
     return {
       visible: false,
       //流转列表
       historyList: [],
       historyLoading: true,
       taskName: '',
-      rules: {},
+      rules: {
+        estimateFinishDate: [
+          { required: true, message: this.$t('预计完成时间') + this.$t('不能为空'), trigger: "change" }
+        ],
+        isRecorded: [
+          { required: true, message: this.$t('是否录入开项系统') + this.$t('不能为空'), trigger: "change" }
+        ],
+        reaction: [
+          { required: true, message: this.$t('采取的措施') + this.$t('不能为空'), trigger: "change" }
+        ],
+        executor: [
+          { required: true, message: this.$t('整改负责人') + this.$t('不能为空'), trigger: "change" }
+        ],
+        inspector1: [
+          { required: true, message: this.$t('验证人1') + this.$t('不能为空'), trigger: "change" }
+        ],
+        inspector2: [
+          { required: true, message: this.$t('验证人2') + this.$t('不能为空'), trigger: "change" }
+        ],
+        needVe: [
+          { required: true, message: this.$t('是否需要VE验证') + this.$t('不能为空'), trigger: "change" }
+        ],
+        recordNo: [
+          { validator: validateRecordNo, trigger: 'change' }
+        ],
+        veItemsList: [
+          { validator: validateVeItemsList, trigger: 'change' }
+        ],
+        inspector1: [
+          { validator: validateInspector1, trigger: 'change' }
+        ],
+        inspector2: [
+          { validator: validateInspector2, trigger: 'change' }
+        ],
+        veResult: [
+          { required: true, message: this.$t('VC/VE验证成果') + this.$t('不能为空'), trigger: "change" }
+        ],
+        remarks: [
+          { required: true, message: this.$t('备注') + this.$t('不能为空'), trigger: "change" }
+        ],
+      },
       // SAI开项管理对象
       dataForm: {
         saiApplyId: null,
@@ -250,12 +384,30 @@ export default {
       applicantDeptOptions: [],
       // 登记人列表
       applicantOptions: [],
+      inspectorOptions: [],
+      executorOptions: [],
       // 不安全状态字典
       unsafeStatusOptions: [],
       // 不安全行为字典
       unsafeActionOptions: [],
       // 不安全状态/行为选项
       unsafeChoice: null,
+      // 是否禁用开项编号输入框
+      recordNoDisabled: true,
+      // 是否禁用VE验证条款
+      veItemsDisabled: true,
+      // 是否禁用VE验证条款(其它)
+      veItemOtherDisabled: true,
+      // 是否禁用VE验证条款数组
+      veItemsList: [],
+      // 验证人1
+      inspector1: null,
+      // 验证人2
+      inspector2: null,
+      // 是否禁用不安全状态下拉框
+      unsafeStatusDisabled: false,
+      // 是否禁用不安全行为下拉框
+      unsafeActionDisabled: true,
     }
   },
   methods: {
@@ -263,6 +415,9 @@ export default {
     init(id, taskId, processId, taskName) {
       // 表单重置
       this.reset();
+      this.inspector1 = null;
+      this.inspector2 = null;
+      this.veItemsList = [];
       this.dataForm = {};
       this.historyList = [];
       this.dataForm.saiApplyId = id || 0;
@@ -276,6 +431,28 @@ export default {
       getApply(id).then(response => {
         this.dataForm = response.data;
         this.dataForm.applicantDept = Number(this.dataForm.applicantDept);
+        this.inspector1 = this.dataForm.applicant;
+        if (this.dataForm.inspectors != null) {
+          let inspectors = this.dataForm.inspectors.split(",");
+          this.inspector1 = inspectors[0];
+          this.inspector2 = inspectors[1];
+        }
+        if (this.dataForm.veItems != null) {
+          let veItems = this.dataForm.veItems.split(",");
+          for (let i = 0; i < veItems.length; i++) {
+            this.veItemsList.push(veItems[i]);
+          }
+        }
+        if (this.dataForm.isRecorded != null) {
+          this.dataForm.isRecorded = this.dataForm.isRecorded.toString();
+        }
+        if (this.dataForm.needVe != null) {
+          this.dataForm.needVe = this.dataForm.needVe.toString();
+        }
+        this.handleIsRecordedChange();
+        this.handleNeedVeChange();
+        this.handleVeItemOtherVeChange();
+        this.handleUnsafeChoiceChange();
         if (this.dataForm.unsafeStatus != null && this.dataForm.unsafeStatus != "") {
           this.unsafeChoice = '1';
           this.dataForm.unsafeStatus = this.dataForm.unsafeStatus.toString();
@@ -297,6 +474,7 @@ export default {
             this.showAssess = true;
             this.showExecute = true;
             this.showInspect = true;
+            this.dataForm.veResult = '1';
             break;
           case 4:
             this.showAssess = true;
@@ -321,6 +499,10 @@ export default {
       this.getApplicantDeptOptions();
       // 加载登记人列表
       this.listStaffmgrByDeptAndTeam(null, null);
+      // 加载整改负责人列表
+      this.listSaiInspectors();
+      // 加载执行人列表
+      this.listSaiExecutors();
       // 加载不安全状态字典
       this.getDicts("SAI_UNSAFE_STATUS").then(response => {
         this.unsafeStatusOptions = response.data;
@@ -330,6 +512,53 @@ export default {
         this.unsafeActionOptions = response.data;
       });
     },
+    /** 不安全行为/状态单选按钮值改变事件 */
+    handleUnsafeChoiceChange() {
+      if (this.unsafeChoice == '1') {
+        this.form.unsafeAction = null;
+        this.unsafeStatusDisabled = false;
+        this.unsafeActionDisabled = true;
+      } else if (this.unsafeChoice == '2') {
+        this.form.unsafeStatus = null;
+        this.unsafeStatusDisabled = true;
+        this.unsafeActionDisabled = false;
+      }
+    },
+    /** VE验证条款(其它)单选按钮值改变事件 */
+    handleVeItemOtherVeChange() {
+      let veItemsList = this.veItemsList;
+      let flag = false;
+      for (let i = 0; i < veItemsList.length; i++) {
+        if (veItemsList[i] == '其它') {
+          flag = true;
+        }
+      }
+      if (flag) {
+        this.veItemOtherDisabled = false;
+      } else {
+        this.veItemOtherDisabled = true;
+        this.dataForm.veItemOther = null;
+      }
+    },
+    /** 是否需要VE验证单选按钮值改变事件 */
+    handleNeedVeChange() {
+      if (this.dataForm.needVe == '1') {
+        this.veItemsDisabled = false;
+      } else if (this.dataForm.needVe == '0') {
+        this.veItemsDisabled = true;
+        this.veItemsList = [];
+        this.handleVeItemOtherVeChange();
+      }
+    },
+    /** 是否录入开项系统单选按钮值改变事件 */
+    handleIsRecordedChange() {
+      if (this.dataForm.isRecorded == '1') {
+        this.recordNoDisabled = false;
+      } else if (this.dataForm.isRecorded == '0') {
+        this.recordNoDisabled = true;
+        this.dataForm.recordNo = null;
+      }
+    },
     /** 加载登记人部门列表 */
     getApplicantDeptOptions() {
       listDept(null).then(response => {
@@ -356,12 +585,55 @@ export default {
         for (let i = 0; i < staffList.length; i++) {
           let staffOption = {
             dictLabel: staffList[i].name,
-            dictValue: staffList[i].staffid
+            dictValue: staffList[i].userId
           }
           this.applicantOptions.push(staffOption);
         }
       });
     },
+    /** 加载验证人列表 */
+    listSaiInspectors(applicantDept, applicantTeam) {
+      listSaiInspectors({
+        deptId: applicantDept,
+        team: applicantTeam
+      }).then(response => {
+        let staffList = response.data;
+        this.inspectorOptions = [];
+        for (let i = 0; i < staffList.length; i++) {
+          let staffOption = {
+            dictLabel: staffList[i].name,
+            dictValue: staffList[i].userId
+          }
+          this.inspectorOptions.push(staffOption);
+        }
+      });
+    },
+    /** 加载整改负责人列表 */
+    listSaiExecutors(applicantDept, applicantTeam) {
+      listSaiExecutors({
+        deptId: applicantDept,
+        team: applicantTeam
+      }).then(response => {
+        let staffList = response.data;
+        this.executorOptions = [];
+        for (let i = 0; i < staffList.length; i++) {
+          let staffOption = {
+            dictLabel: staffList[i].name,
+            dictValue: staffList[i].userId
+          }
+          let isRepeated = false;
+          for (let j = 0; j < this.executorOptions.length; j++) {
+            if (this.executorOptions[j].dictValue == staffList[i].userId) {
+              isRepeated = true;
+              break;
+            }
+          }
+          if (isRepeated == false) {
+            this.executorOptions.push(staffOption);
+          }
+        }
+      });
+    },
     // 重置
     reset() {
       this.showAssess = false;
@@ -415,8 +687,20 @@ export default {
      * 处理流程操作按钮点击事件
      */
     dataFormSubmit(condition) {
-      // this.$refs["form"].validate(valid => {
-      //   if (valid) {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 验证人字符串拼接
+          this.dataForm.inspectors = this.inspector1 + "," + this.inspector2;
+          // VE验证条款字符串拼接
+          if (this.veItemsList.length != 0) {
+            this.dataForm.veItems = "";
+            for (let i = 0; i < this.veItemsList.length; i++) {
+              this.dataForm.veItems += this.veItemsList[i];
+              if (i != this.veItemsList.length - 1) {
+                this.dataForm.veItems += ",";
+              }
+            }
+          }
           this.taskForm.saiApply = this.dataForm;
           this.taskForm.condition = condition;
           handleApply(this.taskForm).then(response =>{
@@ -425,8 +709,8 @@ export default {
             // refreshDataList事件:调用父组件getList方法刷新页面
             this.$emit('refreshDataList');
           });
-        // }
-      // })
+        }
+      })
     }
   }
 }
@@ -436,4 +720,8 @@ export default {
   h4{
     margin: 20px 0px 10px 0px;
   }
+  .el-checkbox {
+    color: #606266;
+    padding: 5px 0px;
+  }
 </style>

+ 198 - 128
ui/src/views/production/apply/all/index.vue

@@ -2,68 +2,83 @@
   <div class="app-container">
     <!-- 搜索条件 -->
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="登记人部门" prop="xxx">
-        <el-input
-          v-model="queryParams.xxx"
-          placeholder="请输入登记人部门"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="登记人部门" prop="applicantDept">
+        <el-form-item prop="applicantDept">
+          <el-select
+            clearable
+            v-model="queryParams.applicantDept"
+            placeholder="请选择部门">
+            <el-option
+              v-for="dict in applicantDeptOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
       </el-form-item>
-      <el-form-item label="登记人班组" prop="xxx">
-        <el-input
-          v-model="queryParams.xxx"
-          placeholder="请输入登记人班组"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="登记人班组" prop="applicantTeam">
+        <el-form-item prop="applicantTeam">
+          <el-select
+            clearable
+            v-model="queryParams.applicantTeam"
+            placeholder="请选择班组">
+            <el-option
+              v-for="dict in applicantTeamOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
       </el-form-item>
-      <el-form-item label="不安全状态" prop="xxx">
-        <el-input
-          v-model="queryParams.xxx"
-          placeholder="请输入不安全状态"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="不安全状态" prop="unsafeStatus">
+        <el-select v-model="queryParams.unsafeStatus" placeholder="请选择不安全状态" clearable>
+          <el-option
+            v-for="dict in unsafeStatusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          ></el-option>
+        </el-select>
       </el-form-item>
-      <el-form-item label="不安全行为" prop="xxx">
-        <el-input
-          v-model="queryParams.xxx"
-          placeholder="请输入不安全行为"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="不安全行为" prop="unsafeAction">
+        <el-select v-model="queryParams.unsafeAction" placeholder="请选择不安全行为" clearable>
+          <el-option
+            v-for="dict in unsafeActionOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          ></el-option>
+        </el-select>
       </el-form-item>
-      <el-form-item label="问题描述" prop="xxx">
+      <el-form-item label="问题描述" prop="description">
         <el-input
-          v-model="queryParams.xxx"
+          v-model="queryParams.description"
           placeholder="请输入问题描述"
           clearable
           size="small"
-          @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="登记时间" prop="xxx">
-        <el-input
-          v-model="queryParams.xxx"
-          placeholder="请输入登记时间"
-          clearable
+      <el-form-item label="登记时间" prop="applyDate">
+        <el-date-picker
           size="small"
-          @keyup.enter.native="handleQuery"
-        />
+          style="width: 200px"
+          v-model="queryParams.applyDate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择登记时间">
+        </el-date-picker>
       </el-form-item>
-      <el-form-item label="计划完成时间" prop="xxx">
-        <el-input
-          v-model="queryParams.xxx"
-          placeholder="请输入计划完成时间"
-          clearable
+      <el-form-item label="预计完成时间" prop="estimateFinishDate">
+        <el-date-picker
           size="small"
-          @keyup.enter.native="handleQuery"
-        />
+          style="width: 200px"
+          v-model="queryParams.estimateFinishDate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择预计完成时间">
+        </el-date-picker>
       </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -104,24 +119,18 @@
     <!-- 总表 -->
     <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="description" :show-overflow-tooltip="true" width="200"/>
       <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="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" prop="applicantDept" :show-overflow-tooltip="true"/>
-      <el-table-column label="登记人班组" align="center" prop="applicantTeam" :show-overflow-tooltip="true"/>
-      <el-table-column label="问题描述" align="center" prop="description" :show-overflow-tooltip="true"/>
-      <el-table-column label="不安全状态" align="center" prop="unsafeStatus" :show-overflow-tooltip="true"/>
-      <el-table-column label="不安全行为" align="center" prop="unsafeAction" :show-overflow-tooltip="true"/>
-      <el-table-column label="记录日期" align="center" prop="applyDate" width="100">
+      <el-table-column label="登记人部门" align="center" prop="applicantDeptName" :show-overflow-tooltip="true"/>
+      <el-table-column label="登记人班组" align="center" prop="applicantTeam" :show-overflow-tooltip="true" :formatter="teamFormat"/>
+      <el-table-column label="登记人" align="center" prop="applicantName" :show-overflow-tooltip="true"/>
+      <el-table-column label="当前处理人" align="center" prop="handlerName" :show-overflow-tooltip="true"/>
+      <el-table-column label="整改负责人" align="center" prop="executorName" :show-overflow-tooltip="true"/>
+      <el-table-column label="登记时间" align="center" prop="applyDate" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="当前处理人" align="center" prop="handler" :show-overflow-tooltip="true"/>
       <el-table-column label="预计完成时间" align="center" prop="estimateFinishDate" width="100">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.estimateFinishDate, '{y}-{m}-{d}') }}</span>
@@ -134,10 +143,6 @@
       </el-table-column>
       <el-table-column label="是否录入开项系统" align="center" prop="isRecorded" :show-overflow-tooltip="true"/>
       <el-table-column label="开项编号" align="center" prop="recordNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="采取的措施" align="center" prop="reaction" :show-overflow-tooltip="true"/>
-      <el-table-column label="是否需要VE验证" align="center" prop="needVe" :show-overflow-tooltip="true"/>
-      <el-table-column label="VE验证条款" align="center" prop="veItems" :show-overflow-tooltip="true"/>
-      <el-table-column label="VC/VE验证成果" align="center" prop="veResult" :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
@@ -200,77 +205,94 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="0px">
         <el-descriptions title="" :column="3" border>
           <el-descriptions-item label="登记人部门">
-            <el-select
-              v-model="form.applicantDept"
-              @change="handleDeptOrTeamChange"
-              placeholder="请选择部门">
-              <el-option
-                v-for="dict in applicantDeptOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="applicantDept">
+              <el-select
+                clearable
+                v-model="form.applicantDept"
+                @change="handleDeptOrTeamChange"
+                placeholder="请选择部门">
+                <el-option
+                  v-for="dict in applicantDeptOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="登记人班组">
-            <el-select
-              v-model="form.applicantTeam"
-              @change="handleDeptOrTeamChange"
-              :disabled="applicantTeamDisabled"
-              placeholder="请选择班组">
-              <el-option
-                v-for="dict in applicantTeamOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="applicantTeam">
+              <el-select
+                clearable
+                v-model="form.applicantTeam"
+                @change="handleDeptOrTeamChange"
+                :disabled="applicantTeamDisabled"
+                placeholder="请选择班组">
+                <el-option
+                  v-for="dict in applicantTeamOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="登记人">
-            <el-select
-              v-model="form.applicant"
-              placeholder="请选择登记人">
-              <el-option
-                v-for="dict in applicantOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="applicant">
+              <el-select
+                clearable
+                v-model="form.applicant"
+                placeholder="请选择登记人">
+                <el-option
+                  v-for="dict in applicantOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
           <el-descriptions-item label="问题描述" :span="3">
-            <el-input v-model="form.description" placeholder="请输入问题描述" type="textarea" autosize/>
-          </el-descriptions-item>
-          <el-descriptions-item label="附件" :span="3">
-
+            <el-form-item prop="description">
+              <el-input v-model="form.description" placeholder="请输入问题描述" type="textarea" :rows="3" />
+            </el-form-item>
           </el-descriptions-item>
+          <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
           <el-descriptions-item label="隐患" :span="3">
             <el-radio v-model="unsafeChoice" label="1" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全状态</el-radio>
-            <el-select v-model="form.unsafeStatus" placeholder="请选择不安全状态" :disabled="unsafeStatusDisabled" style="margin-right: 20px;">
-              <el-option
-                v-for="dict in unsafeStatusOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="unsafeStatus" style="display: inline-block;">
+              <el-select v-model="form.unsafeStatus" placeholder="请选择不安全状态" :disabled="unsafeStatusDisabled" style="margin-right: 20px;" clearable>
+                <el-option
+                  v-for="dict in unsafeStatusOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
             <el-radio v-model="unsafeChoice" label="2" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全行为</el-radio>
-            <el-select v-model="form.unsafeAction" placeholder="请选择不安全行为" :disabled="unsafeActionDisabled">
-              <el-option
-                v-for="dict in unsafeActionOptions"
-                :key="dict.dictValue"
-                :label="dict.dictLabel"
-                :value="dict.dictValue"
-              ></el-option>
-            </el-select>
+            <el-form-item prop="unsafeAction" style="display: inline-block;">
+              <el-select v-model="form.unsafeAction" placeholder="请选择不安全行为" :disabled="unsafeActionDisabled" clearable>
+                <el-option
+                  v-for="dict in unsafeActionOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                ></el-option>
+              </el-select>
+            </el-form-item>
           </el-descriptions-item>
-          <el-descriptions-item label="记录日期">
-            <el-date-picker clearable size="small" style="width: 200px"
-                            v-model="form.applyDate"
-                            type="date"
-                            value-format="yyyy-MM-dd"
-                            placeholder="选择记录日期">
-            </el-date-picker>
+          <el-descriptions-item label="登记时间">
+            <el-form-item prop="applyDate">
+              <el-date-picker
+                size="small"
+                style="width: 200px"
+                v-model="form.applyDate"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择登记时间">
+              </el-date-picker>
+            </el-form-item>
           </el-descriptions-item>
         </el-descriptions>
       </el-form>
@@ -330,6 +352,28 @@ export default {
   name: "Apply",
   components: { Treeselect, SaiApplyDetail, ProcessImg },
   data() {
+    var validateUnsafeStatus = (rule, value, callback) => {
+      if (this.unsafeChoice == '1') {
+        if (this.form.unsafeStatus == null) {
+          return callback(new Error('不安全状态不能为空'));
+        } else {
+          return callback();
+        }
+      } else {
+        return callback();
+      }
+    };
+    var validateUnsafeAction = (rule, value, callback) => {
+      if (this.unsafeChoice == '2') {
+        if (this.form.unsafeAction == null) {
+          return callback(new Error('不安全行为不能为空'));
+        } else {
+          return callback();
+        }
+      } else {
+        return callback();
+      }
+    };
     return {
       // 遮罩层
       loading: true,
@@ -403,6 +447,27 @@ export default {
       form: {},
       // 表单校验
       rules: {
+        description: [
+          { required: true, message: this.$t('问题描述') + this.$t('不能为空'), trigger: "change" }
+        ],
+        applicantDept: [
+          { required: true, message: this.$t('登记人部门') + this.$t('不能为空'), trigger: "change" }
+        ],
+        applicantTeam: [
+          { required: true, message: this.$t('登记人班组') + this.$t('不能为空'), trigger: "change" }
+        ],
+        applicant: [
+          { required: true, message: this.$t('登记人') + this.$t('不能为空'), trigger: "change" }
+        ],
+        applyDate: [
+          { required: true, message: this.$t('记录日期') + this.$t('不能为空'), trigger: "change" }
+        ],
+        unsafeStatus: [
+          { validator: validateUnsafeStatus, trigger: 'change' }
+        ],
+        unsafeAction: [
+          { validator: validateUnsafeAction, trigger: 'change' }
+        ],
       },
       // 申请状态字典
       applyStatusOptions: [],
@@ -474,7 +539,7 @@ export default {
           if (staff.deptId == '103') {
             this.form.applicantTeam = staff.team;
           }
-          this.form.applicant = staff.staffid;
+          this.form.applicant = staff.userId;
         }
       });
     },
@@ -519,7 +584,7 @@ export default {
         for (let i = 0; i < staffList.length; i++) {
           let staffOption = {
             dictLabel: staffList[i].name,
-            dictValue: staffList[i].staffid
+            dictValue: staffList[i].userId
           }
           this.applicantOptions.push(staffOption);
         }
@@ -568,6 +633,10 @@ export default {
     applyStatusFormat(row, column) {
       return this.selectDictLabel(this.applyStatusOptions, row.applyStatus);
     },
+    // 班组字典翻译
+    teamFormat(row, column) {
+      return this.selectDictLabel(this.applicantTeamOptions, row.applicantTeam);
+    },
     /** 查询SAI开项管理列表 */
     getList() {
       this.loading = true;
@@ -649,6 +718,7 @@ export default {
       this.title = "添加SAI开项申请";
       // 加载当前登录员工信息
       this.getLoginStaffInfo();
+      this.applicantTeamDisabled = false;
     },
     /** 修改按钮操作 */
     handleUpdate(row) {