Explorar o código

SAI开项申请流程

wangggziwen %!s(int64=2) %!d(string=hai) anos
pai
achega
bffe47ce70

+ 36 - 18
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -26,6 +26,7 @@ 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.activiti.engine.task.TaskQuery;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -138,6 +139,8 @@ public class TSaiApplyController extends BaseController
         Map<String, Object> variables = new HashMap<>();
         // 评估人为张力飞
         variables.put("assessor", "20276");
+        variables.put("executor", "20276");
+        variables.put("inspectors", "20276");
         // 修改状态为待评估
         tSaiApply.setApplyStatus("1");
         //采用key来启动流程定义并设置流程变量,返回流程实例
@@ -146,6 +149,17 @@ public class TSaiApplyController extends BaseController
         logger.info("流程实例id:" + pi.getProcessInstanceId());
         // 新增操作对象processId = 流程实例id
         tSaiApply.setProcessId(pi.getProcessInstanceId());
+        // 获取taksId、TaskName
+        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+        List<Task> list = processEngine.getTaskService()//获取任务service
+                .createTaskQuery()//创建查询对象
+                .taskCandidateOrAssigned("20276").list();
+        for (Task task : list) {
+            if (tSaiApply.getProcessId().equals(task.getProcessInstanceId())) {
+                tSaiApply.setTaskId(task.getId());
+                tSaiApply.setTaskName(task.getName());
+            }
+        }
         // 更新操作
         tSaiApplyService.updateTSaiApply(tSaiApply);
         return AjaxResult.success();
@@ -171,48 +185,40 @@ public class TSaiApplyController extends BaseController
         String processInstancesId = task.getProcessInstanceId();
         // 根据实例名判断当前流程节点
         Map<String, Object> param = new HashMap<>();
-        String isPassAssess  = form.getIsPassAssess();
-        String isPassInspect  = form.getIsPassInspect();
+        String condition = devTask.getCondition();
+        param.put("condition", condition);
         switch (task.getName()) {
             case "评估":
-                if ("1".equals(isPassAssess)) {
+                if ("1".equals(condition)) {
                     // 指定执行人
-                    param.put("executor", form.getExecutor());
+//                    param.put("executor", form.getExecutor());
                     // 修改状态为进行中
                     form.setApplyStatus("2");
                 } else {
                     // 修改状态为已中止
                     form.setApplyStatus("5");
+                    form.setTaskId(null);
+                    form.setTaskName(null);
                 }
                 break;
             case "执行":
                 // 指定验收人
-                param.put("inspectors", form.getInspectors());
+//                param.put("inspectors", form.getInspectors());
                 // 修改状态为待验收
                 form.setApplyStatus("3");
                 break;
             case "验收":
-                if ("1".equals(isPassInspect)) {
+                if ("1".equals(condition)) {
                     // 修改状态为已完成
                     form.setApplyStatus("4");
+                    form.setTaskId(null);
+                    form.setTaskName(null);
                 } 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();
         //认领任务
@@ -220,6 +226,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());
+            }
+        }
+
         //任务完成更新数据
         tSaiApplyService.updateTSaiApply(form);
         return AjaxResult.success();

+ 111 - 2
master/src/main/java/com/ruoyi/project/production/domain/TSaiApply.java

@@ -1,5 +1,7 @@
 package com.ruoyi.project.production.domain;
 
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import com.ruoyi.framework.web.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -9,7 +11,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * SAI开项管理对象 t_sai_apply
  *
  * @author ruoyi
- * @date 2023-03-16
+ * @date 2023-03-17
  */
 public class TSaiApply extends BaseEntity
 {
@@ -47,7 +49,7 @@ public class TSaiApply extends BaseEntity
     private String isPassInspect;
 
     /** 申请人 */
-    @Excel(name = "登记人")
+    @Excel(name = "申请人")
     private String applicant;
 
     /** 评估人 */
@@ -62,6 +64,53 @@ public class TSaiApply extends BaseEntity
     @Excel(name = "验收人")
     private String inspectors;
 
+    /** 登记人部门 */
+    @Excel(name = "登记人部门")
+    private String applicantDept;
+
+    /** 登记人班组 */
+    @Excel(name = "登记人班组")
+    private String applicantTeam;
+
+    /** 问题描述 */
+    @Excel(name = "问题描述")
+    private String description;
+
+    /** 不安全状态 */
+    @Excel(name = "不安全状态")
+    private Long unsafeStatus;
+
+    /** 不安全行为 */
+    @Excel(name = "不安全行为")
+    private Long unsafeAction;
+
+    /** 记录日期 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "记录日期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date applyDate;
+
+    /** 待办任务ID */
+    private String taskId;
+
+    /** 待办任务name */
+    private String taskName;
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
+    public String getTaskName() {
+        return taskName;
+    }
+
+    public void setTaskName(String taskName) {
+        this.taskName = taskName;
+    }
+
     public void setSaiApplyId(Long saiApplyId)
     {
         this.saiApplyId = saiApplyId;
@@ -170,6 +219,60 @@ public class TSaiApply extends BaseEntity
     {
         return inspectors;
     }
+    public void setApplicantDept(String applicantDept)
+    {
+        this.applicantDept = applicantDept;
+    }
+
+    public String getApplicantDept()
+    {
+        return applicantDept;
+    }
+    public void setApplicantTeam(String applicantTeam)
+    {
+        this.applicantTeam = applicantTeam;
+    }
+
+    public String getApplicantTeam()
+    {
+        return applicantTeam;
+    }
+    public void setDescription(String description)
+    {
+        this.description = description;
+    }
+
+    public String getDescription()
+    {
+        return description;
+    }
+    public void setUnsafeStatus(Long unsafeStatus)
+    {
+        this.unsafeStatus = unsafeStatus;
+    }
+
+    public Long getUnsafeStatus()
+    {
+        return unsafeStatus;
+    }
+    public void setUnsafeAction(Long unsafeAction)
+    {
+        this.unsafeAction = unsafeAction;
+    }
+
+    public Long getUnsafeAction()
+    {
+        return unsafeAction;
+    }
+    public void setApplyDate(Date applyDate)
+    {
+        this.applyDate = applyDate;
+    }
+
+    public Date getApplyDate()
+    {
+        return applyDate;
+    }
 
     @Override
     public String toString() {
@@ -190,6 +293,12 @@ public class TSaiApply extends BaseEntity
             .append("assessor", getAssessor())
             .append("executor", getExecutor())
             .append("inspectors", getInspectors())
+            .append("applicantDept", getApplicantDept())
+            .append("applicantTeam", getApplicantTeam())
+            .append("description", getDescription())
+            .append("unsafeStatus", getUnsafeStatus())
+            .append("unsafeAction", getUnsafeAction())
+            .append("applyDate", getApplyDate())
             .toString();
     }
 }

+ 47 - 2
master/src/main/resources/mybatis/production/TSaiApplyMapper.xml

@@ -21,11 +21,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="assessor"    column="assessor"    />
         <result property="executor"    column="executor"    />
         <result property="inspectors"    column="inspectors"    />
+        <result property="applicantDept"    column="applicant_dept"    />
+        <result property="applicantTeam"    column="applicant_team"    />
+        <result property="description"    column="description"    />
+        <result property="unsafeStatus"    column="unsafe_status"    />
+        <result property="unsafeAction"    column="unsafe_action"    />
+        <result property="applyDate"    column="apply_date"    />
+        <result property="taskId"    column="task_id"    />
+        <result property="taskName"    column="task_name"    />
     </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
+        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, d.applicant_dept, d.applicant_team, d.description,
+        d.unsafe_status, d.unsafe_action, d.apply_date, d.task_id, d.task_name
+        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">
@@ -42,6 +53,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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>
+            <if test="applicantDept != null  and applicantDept != ''"> and applicant_dept = #{applicantDept}</if>
+            <if test="applicantTeam != null  and applicantTeam != ''"> and applicant_team = #{applicantTeam}</if>
+            <if test="description != null  and description != ''"> and description = #{description}</if>
+            <if test="unsafeStatus != null "> and unsafe_status = #{unsafeStatus}</if>
+            <if test="unsafeAction != null "> and unsafe_action = #{unsafeAction}</if>
+            <if test="applyDate != null "> and apply_date = #{applyDate}</if>
+            <if test="taskId != null  and taskId != ''"> and task_id = #{taskId}</if>
+            <if test="taskName != null  and taskName != ''"> and task_name like concat(concat('%', #{taskName}), '%')</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -75,6 +94,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="assessor != null">assessor,</if>
             <if test="executor != null">executor,</if>
             <if test="inspectors != null">inspectors,</if>
+            <if test="applicantDept != null">applicant_dept,</if>
+            <if test="applicantTeam != null">applicant_team,</if>
+            <if test="description != null">description,</if>
+            <if test="unsafeStatus != null">unsafe_status,</if>
+            <if test="unsafeAction != null">unsafe_action,</if>
+            <if test="applyDate != null">apply_date,</if>
+            <if test="taskId != null">task_id,</if>
+            <if test="taskName != null">task_name,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="saiApplyId != null">#{saiApplyId},</if>
@@ -93,6 +120,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="assessor != null">#{assessor},</if>
             <if test="executor != null">#{executor},</if>
             <if test="inspectors != null">#{inspectors},</if>
+            <if test="applicantDept != null">#{applicantDept},</if>
+            <if test="applicantTeam != null">#{applicantTeam},</if>
+            <if test="description != null">#{description},</if>
+            <if test="unsafeStatus != null">#{unsafeStatus},</if>
+            <if test="unsafeAction != null">#{unsafeAction},</if>
+            <if test="applyDate != null">#{applyDate},</if>
+            <if test="taskId != null">#{taskId},</if>
+            <if test="taskName != null">#{taskName},</if>
          </trim>
     </insert>
 
@@ -114,6 +149,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="assessor != null">assessor = #{assessor},</if>
             <if test="executor != null">executor = #{executor},</if>
             <if test="inspectors != null">inspectors = #{inspectors},</if>
+            <if test="applicantDept != null">applicant_dept = #{applicantDept},</if>
+            <if test="applicantTeam != null">applicant_team = #{applicantTeam},</if>
+            <if test="description != null">description = #{description},</if>
+            <if test="unsafeStatus != null">unsafe_status = #{unsafeStatus},</if>
+            <if test="unsafeAction != null">unsafe_action = #{unsafeAction},</if>
+            <if test="applyDate != null">apply_date = #{applyDate},</if>
+            <if test="taskId != null">task_id = #{taskId},</if>
+            <if test="taskId == null">task_id = null,</if>
+            <if test="taskName != null">task_name = #{taskName},</if>
+            <if test="taskName == null">task_name = null,</if>
         </trim>
         where sai_apply_id = #{saiApplyId}
     </update>

+ 42 - 69
master/src/main/resources/processes/sai/saiApply.bpmn

@@ -3,116 +3,89 @@
   <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="executeTask" name="执行" activiti:assignee="#{executor}"></userTask>
     <userTask id="inspectTask" name="验收" activiti:candidateUsers="#{inspectors}"></userTask>
-    <sequenceFlow id="flow5" name="通过" sourceRef="excuteTask" targetRef="inspectTask">
+    <sequenceFlow id="flow5" name="通过" sourceRef="executeTask" 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">
+    <endEvent id="endevent2" name="End"></endEvent>
+    <sequenceFlow id="flow1" sourceRef="startevent" targetRef="assessTask"></sequenceFlow>
+    <sequenceFlow id="flow9" name="通过" sourceRef="assessTask" targetRef="executeTask">
       <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 id="flow10" name="中止" sourceRef="assessTask" targetRef="endevent2">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 0}]]></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">
+    <sequenceFlow id="flow11" name="通过" sourceRef="inspectTask" targetRef="endevent1">
       <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 id="flow12" name="驳回" sourceRef="inspectTask" targetRef="executeTask">
+      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${condition == 2}]]></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>
+        <omgdc:Bounds height="35.0" width="35.0" x="60.0" y="112.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>
+        <omgdc:Bounds height="55.0" width="105.0" x="154.0" y="102.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 bpmnElement="executeTask" id="BPMNShape_executeTask">
+        <omgdc:Bounds height="55.0" width="105.0" x="314.0" y="104.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>
+        <omgdc:Bounds height="55.0" width="105.0" x="490.0" y="102.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>
+        <omgdc:Bounds height="35.0" width="35.0" x="670.0" y="112.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>
+        <omgdc:Bounds height="35.0" width="35.0" x="189.0" y="31.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>
+        <omgdi:waypoint x="419.0" y="131.0"></omgdi:waypoint>
+        <omgdi:waypoint x="490.0" y="129.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="32.0" x="482.0" y="325.0"></omgdc:Bounds>
+          <omgdc:Bounds height="16.0" width="32.0" x="419.0" y="131.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 bpmnElement="flow1" id="BPMNEdge_flow1">
+        <omgdi:waypoint x="95.0" y="129.0"></omgdi:waypoint>
+        <omgdi:waypoint x="154.0" y="129.0"></omgdi:waypoint>
       </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:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
+        <omgdi:waypoint x="259.0" y="129.0"></omgdi:waypoint>
+        <omgdi:waypoint x="314.0" y="131.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="16.0" x="502.0" y="471.0"></omgdc:Bounds>
+          <omgdc:Bounds height="16.0" width="32.0" x="259.0" y="129.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:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
+        <omgdi:waypoint x="206.0" y="102.0"></omgdi:waypoint>
+        <omgdi:waypoint x="206.0" y="66.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="32.0" x="482.0" y="167.0"></omgdc:Bounds>
+          <omgdc:Bounds height="16.0" width="32.0" x="206.0" y="86.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:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
+        <omgdi:waypoint x="595.0" y="129.0"></omgdi:waypoint>
+        <omgdi:waypoint x="670.0" y="129.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="16.0" x="482.0" y="237.0"></omgdc:Bounds>
+          <omgdc:Bounds height="16.0" width="32.0" x="595.0" y="129.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:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
+        <omgdi:waypoint x="542.0" y="157.0"></omgdi:waypoint>
+        <omgdi:waypoint x="542.0" y="214.0"></omgdi:waypoint>
+        <omgdi:waypoint x="455.0" y="214.0"></omgdi:waypoint>
+        <omgdi:waypoint x="366.0" y="214.0"></omgdi:waypoint>
+        <omgdi:waypoint x="366.0" y="159.0"></omgdi:waypoint>
         <bpmndi:BPMNLabel>
-          <omgdc:Bounds height="16.0" width="16.0" x="503.0" y="219.0"></omgdc:Bounds>
+          <omgdc:Bounds height="16.0" width="32.0" x="542.0" y="157.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>

+ 21 - 28
ui/src/views/approve/approveDetail/sai-apply-detail.vue

@@ -6,19 +6,9 @@
     :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>
@@ -33,9 +23,9 @@
     </div>
     <!-- 流程操作 -->
     <div slot="footer" class="dialog-footer">
-      <el-button type="success" @click="dataFormSubmit(1)">{{ $t('通过') }}</el-button>
+      <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="info" v-if="taskName == '评估'" @click="dataFormSubmit(3)">{{ $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>
   </el-dialog>
@@ -110,29 +100,32 @@ export default {
         apNo: null,
         processId: null
       };
+      this.dataForm =  {
+        saiApplyId: null,
+        deptId: null,
+        applyStatus: null,
+        apNo: null,
+        processId: null
+      };
+      this.taskForm =  {
+        comment: '',
+        taskId: '',
+        files: '',
+        govDate: '',
+        govFileList: [],
+        businessKey: '',
+        saiApply: null,
+      };
     },
     /**
      * 处理流程操作按钮点击事件
      * @param operation 操作:1通过,2驳回,3中止
      */
-    dataFormSubmit(operation) {
+    dataFormSubmit(condition) {
       // 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;
-            }
-          }
+          this.taskForm.condition = condition;
           handleApply(this.taskForm).then(response =>{
             this.msgSuccess("提交成功");
             this.visible = false;

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

@@ -238,9 +238,10 @@
             this.$refs.safetychangeDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
           })
         } else if (row.processName == "SAI开项申请流程") {
+          console.log(row)
           this.saiApplyVisible = true
           this.$nextTick(() => {
-            this.$refs.saiApplyDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
+            this.$refs.saiApplyDetail.init(row.approveObject.saiApplyId, row.taskId, row.processId, row.taskName)
           })
         } else {
           this.approveInfo = row;

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

@@ -254,7 +254,7 @@
         } else if (row.processName == "SAI开项申请流程") {
           this.saiApplyVisible = true
           this.$nextTick(() => {
-            this.$refs.saiApplyDetail.init(row.approveObject.id, row.taskId, row.processId, row.taskName)
+            this.$refs.saiApplyDetail.init(row.approveObject.saiApplyId, row.taskId, row.processId, row.taskName)
           })
         } else {
           this.approveInfo = row;

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

@@ -0,0 +1,489 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+
+      <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="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" 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">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <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="handleDetail(scope.row)"
+            icon="el-icon-edit-outline"
+            v-if="scope.row.applyStatus != 0 && scope.row.applyStatus != 4 && scope.row.applyStatus != 5"
+          >处理</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-view"
+            @click="handleDetail(scope.row)"
+            v-if="scope.row.applyStatus == 4 || scope.row.applyStatus == 5"
+          >详情</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="processImg(scope.row.processId)"
+            v-if="scope.row.applyStatus != 0"
+          >{{ $t('流程图') }}</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleSubmit(scope.row)"
+            v-hasPermi="['production:apply:edit']"
+            icon="el-icon-s-claim"
+            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']"
+            v-if="scope.row.applyStatus == 0"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-if="scope.row.applyStatus == 0"
+            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="0px">
+        <el-descriptions title="" direction="vertical" :column="3" border>
+          <el-descriptions-item label="登记人部门">
+            <el-form-item label="" prop="applicantDept">
+              <el-input v-model="form.applicantDept" placeholder="请输入登记人部门" />
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="登记人班组">
+            <el-form-item label="" prop="applicantTeam">
+              <el-input v-model="form.applicantTeam" placeholder="请输入登记人班组" />
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="登记人">
+            <el-form-item label="" prop="applicant">
+              <el-input v-model="form.applicant" placeholder="请输入登记人" />
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="问题描述" :span="3">
+            <el-form-item label="" prop="description">
+              <el-input v-model="form.description" placeholder="请输入问题描述" />
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="附件" :span="3"></el-descriptions-item>
+          <el-descriptions-item label="隐患" :span="3">
+            <el-form-item label="">
+              <el-input v-model="form.unsafeStatus" placeholder="请输入不安全状态" />
+            </el-form-item>
+            <el-form-item label="" prop="unsafeAction">
+              <el-input v-model="form.unsafeAction" placeholder="请输入不安全行为" />
+            </el-form-item>
+          </el-descriptions-item>
+          <el-descriptions-item label="记录日期">
+            <el-form-item label="" prop="applyDate">
+              <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-form-item>
+          </el-descriptions-item>
+        </el-descriptions>
+      </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>
+
+    <!-- SAI开项管理流转详情对话框 -->
+    <sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>
+
+    <!-- 流程图对话框 -->
+    <process-img v-if="processImgVisible" ref="processImg" @refreshDataList="getList"></process-img>
+  </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";
+import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
+import ProcessImg from '@/views/approve/processImg/index';
+
+export default {
+  name: "Apply",
+  components: { Treeselect, SaiApplyDetail, ProcessImg },
+  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: [],
+      // 是否显示SAI开项申请详情对话框
+      saiApplyVisible: false,
+      // 是否显示流程图对话框
+      processImgVisible: null,
+    };
+  },
+  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: {
+    /** 流程图 */
+    processImg (processId) {
+      this.processImgVisible = true;
+      this.$nextTick(() => {
+        this.$refs.processImg.init(processId);
+      })
+    },
+    /** 处理/详情操作 */
+    handleDetail(row) {
+      this.saiApplyVisible = true;
+      this.$nextTick(() => {
+        this.$refs.saiApplyDetail.init(row.saiApplyId, row.taskId, row.processId, row.taskName);
+      });
+    },
+    /** 提交申请操作 */
+    handleSubmit(row) {
+      this.$confirm('是否确认提交申请?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return submitApply(row.saiApplyId);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("提交申请成功");
+      })
+    },
+    // 申请状态字典翻译
+    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开项申请";
+      });
+    },
+    /** 提交按钮 */
+    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>

+ 45 - 519
ui/src/views/production/apply/index.vue

@@ -1,536 +1,62 @@
 <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>
+    <el-tabs type="border-card"v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane label="待处理" name="first">
+        <!--<all item="1" typename="" v-if="isFirst"></all>-->
+      </el-tab-pane>
+      <el-tab-pane label="与我相关" name="second">
+        <!--<all item="2" typename="" v-if="isSecond"></all>-->
+      </el-tab-pane>
+      <el-tab-pane label="总数据" name="third">
+        <all item="3" typename="" v-if="isThird"></all>
+      </el-tab-pane>
+    </el-tabs>
   </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";
+  import All from '@/views/production/apply/all/index.vue'
 
 export default {
   name: "Apply",
-  components: { Treeselect },
+  components: { All },
   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;
-    });
+      // 默认第一个Tab
+      activeName: 'first',
+      isFirst: true,
+      isSecond: false,
+      isThird: false,
+    }
   },
   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();
+    handleClick(tab) {
+      if (tab.name === 'first') {
+        this.isFirst = true
+        this.isSecond = false
+        this.isThird = false
+      } else if (tab.name === 'second') {
+        this.isFirst = false
+        this.isSecond = true
+        this.isThird = false
+      }else if (tab.name === 'third') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = true
+      }else if (tab.name === 'fourth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+      }else if (tab.name === 'fifth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
+      }else if (tab.name === 'sixth') {
+        this.isFirst = false
+        this.isSecond = false
+        this.isThird = false
       }
+    },
   }
 };
 </script>