Преглед на файлове

-组织保护措施申请流程

jiangbiao преди 2 години
родител
ревизия
77fcc73981

+ 6 - 8
master/src/main/java/com/ruoyi/project/apply/controller/TApplyOfflinevalveController.java

@@ -1,15 +1,12 @@
 package com.ruoyi.project.apply.controller;
 
 import com.deepoove.poi.XWPFTemplate;
-import com.deepoove.poi.data.Pictures;
 import com.deepoove.poi.data.TextRenderData;
 import com.deepoove.poi.data.Texts;
 import com.deepoove.poi.data.style.Style;
 import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.SpringContextUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
-import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -23,7 +20,6 @@ import com.ruoyi.project.approve.damain.DevTask;
 import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.service.ISysUserService;
-import com.ruoyi.project.plant.service.ITStaffmgrService;
 import io.jsonwebtoken.lang.Assert;
 import org.activiti.engine.ProcessEngine;
 import org.activiti.engine.ProcessEngines;
@@ -39,9 +35,10 @@ import org.springframework.web.bind.annotation.*;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 安全阀离线切出申请Controller
@@ -110,7 +107,8 @@ public class TApplyOfflinevalveController extends BaseController {
         tApplyOfflinevalve.setApplicationTime(new Date());
         tApplyOfflinevalve.setCreatedate(new Date());
         tApplyOfflinevalve.setCreaterCode(userId.toString());
-        tApplyOfflinevalve.setRemarks("");
+        if(StringUtils.isNotEmpty(tApplyOfflinevalve.getRemarks())&&(!tApplyOfflinevalve.getRemarks().endsWith(";")||!tApplyOfflinevalve.getRemarks().endsWith(";")))
+            tApplyOfflinevalve.setRemarks(tApplyOfflinevalve.getRemarks()+";");
         tApplyOfflinevalveService.insertTApplyOfflinevalve(tApplyOfflinevalve);
 
         // 开始申请流程

+ 104 - 18
master/src/main/java/com/ruoyi/project/apply/controller/TApplySafetychangeController.java

@@ -10,13 +10,17 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.apply.domain.TApplySafetychange;
 import com.ruoyi.project.apply.service.ITApplySafetychangeService;
+import com.ruoyi.project.approve.damain.DevTask;
 import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.service.ISysUserService;
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngines;
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.TaskService;
 import org.activiti.engine.impl.identity.Authentication;
 import org.activiti.engine.runtime.ProcessInstance;
+import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -34,8 +38,7 @@ import java.util.Map;
  */
 @RestController
 @RequestMapping("/apply/safetychange")
-public class TApplySafetychangeController extends BaseController
-{
+public class TApplySafetychangeController extends BaseController {
     @Autowired
     private ITApplySafetychangeService tApplySafetychangeService;
 
@@ -54,8 +57,7 @@ public class TApplySafetychangeController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('apply:safetychange:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TApplySafetychange tApplySafetychange)
-    {
+    public TableDataInfo list(TApplySafetychange tApplySafetychange) {
         startPage();
         List<TApplySafetychange> list = tApplySafetychangeService.selectTApplySafetychangeList(tApplySafetychange);
         return getDataTable(list);
@@ -67,8 +69,7 @@ public class TApplySafetychangeController extends BaseController
     @PreAuthorize("@ss.hasPermi('apply:safetychange:export')")
     @Log(title = "组织保护措施状态变更申请", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TApplySafetychange tApplySafetychange)
-    {
+    public AjaxResult export(TApplySafetychange tApplySafetychange) {
         List<TApplySafetychange> list = tApplySafetychangeService.selectTApplySafetychangeList(tApplySafetychange);
         ExcelUtil<TApplySafetychange> util = new ExcelUtil<TApplySafetychange>(TApplySafetychange.class);
         return util.exportExcel(list, "safetychange");
@@ -79,8 +80,7 @@ public class TApplySafetychangeController extends BaseController
      */
 //    @PreAuthorize("@ss.hasPermi('apply:safetychange:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tApplySafetychangeService.selectTApplySafetychangeById(id));
     }
 
@@ -90,8 +90,7 @@ public class TApplySafetychangeController extends BaseController
     @PreAuthorize("@ss.hasPermi('apply:safetychange:add')")
     @Log(title = "组织保护措施状态变更申请", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TApplySafetychange tApplySafetychange)
-    {
+    public AjaxResult add(@RequestBody TApplySafetychange tApplySafetychange) {
         String userId = getUserId().toString();
         tApplySafetychange.setApplicant(userId);
         tApplySafetychange.setApplicantName(getNickName());
@@ -100,16 +99,17 @@ public class TApplySafetychangeController extends BaseController
         tApplySafetychange.setCreaterCode(getUserId().toString());
         tApplySafetychange.setConfirmer(tApplySafetychange.getSafaer());
         tApplySafetychange.setConfirmerName(tApplySafetychange.getSafaerName());
+        if(StringUtils.isNotEmpty(tApplySafetychange.getRemarks())&&(!tApplySafetychange.getRemarks().endsWith(";")||!tApplySafetychange.getRemarks().endsWith(";")))
+            tApplySafetychange.setRemarks(tApplySafetychange.getRemarks()+";");
         tApplySafetychangeService.insertTApplySafetychange(tApplySafetychange);
 
         // 开始申请流程
         tApplySafetychange.setApNo(DateUtils.dateTimeNow() + userId);
         long businessKey = tApplySafetychange.getId();
-        String applyUser = userId;
         //开始工作流、监听
-        Authentication.setAuthenticatedUserId(applyUser);//设置当前申请人
+        Authentication.setAuthenticatedUserId(userId);//设置当前申请人
         Map<String, Object> variables = new HashMap<>();
-        variables.put("applyuser", applyUser);
+        variables.put("applyuser", userId);
         variables.put("confirmer", tApplySafetychange.getConfirmer());
         variables.put("executor", tApplySafetychange.getExecutor());
         variables.put("safaer", tApplySafetychange.getSafaer());
@@ -143,14 +143,101 @@ public class TApplySafetychangeController extends BaseController
         return toAjax(1);
     }
 
+    @Log(title = "组织保护措施状态变更申请审核处理", businessType = BusinessType.UPDATE)
+    @PutMapping("/handle")
+    public AjaxResult handle(@RequestBody DevTask devTask) {
+        TApplySafetychange form = devTask.getSafetychange();
+        //使用任务服务完成任务(提交任务)
+        String taskId = devTask.getTaskId();
+        // 使用任务id,获取任务对象,获取流程实例id
+        Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
+        //利用任务对象,获取流程实例id
+        String processInstancesId = task.getProcessInstanceId();
+        TApplySafetychange tApplySafetychange = tApplySafetychangeService.selectTApplySafetychangeById(form.getId());
+        String taskName = task.getName();//实例名
+        // 添加备注
+        String remarks = StringUtils.isEmpty(tApplySafetychange.getRemarks()) ? "" : tApplySafetychange.getRemarks();
+        if (taskName.contains("安全评估人")) {
+            taskName = "安全评估人";
+        }
+        //流程审批意见
+        String symbol = "";
+        String text = "";
+        if (StringUtils.isNotEmpty(form.getRemarks())) {
+            text = form.getRemarks();
+            symbol = ",";
+            form.setRemarks(remarks + taskName + "-" + getNickName() + ":" + form.getRemarks() + ";");
+        } else
+            form.setRemarks("");
+        // 判断流程
+        if ("1".equals(devTask.getCondition())) {
+            devTask.setComment("通过" + symbol + text);
+        } else if ("0".equals(devTask.getCondition())) {
+            devTask.setComment("拒绝" + symbol + text);
+            form.setStatus(1L);
+            form.setApproveStatus("3");
+        } else if ("2".equals(devTask.getCondition())) {
+            devTask.setComment("驳回" + symbol + text);
+        }
+        // 根据实例名判断当前流程节点
+        Map<String, Object> param = new HashMap<>();
+        switch (task.getName()) {
+            case "安全评估人1":
+                form.setSafaTime(new Date());
+                break;
+            case "批准人":
+                form.setApprover(getUserId().toString());
+                form.setApproverName(getNickName());
+                form.setApproveTime(new Date());
+                if ("1".equals(devTask.getCondition()))
+                    form.setApproveStatus("2");
+                break;
+            case "措施执行人":
+                form.setExecutionTime(new Date());
+                break;
+            case "措施确认人":
+                form.setConfirmTime(new Date());
+                break;
+            case "变更执行人":
+                form.setChangeExecutor(getUserId().toString());
+                form.setChangeExecutorName(getNickName());
+                form.setChangeExecutorTime(new Date());
+                break;
+            case "安全评估人2":
+                param.put("resetConfirmer1", form.getResetConfirmer1());
+                break;
+            case "确认人1":
+                param.put("resetConfirmer2", tApplySafetychange.getConfirmer());
+                form.setResetConfirmer1(getUserId().toString());
+                form.setResetConfirmTime1(new Date());
+                form.setResetConfirmerName1(getNickName());
+                break;
+            case "确认人2":
+                form.setResetConfirmer2(getUserId().toString());
+                form.setResetConfirmTime2(new Date());
+                form.setResetConfirmerName2(getNickName());
+                form.setStatus(1L);
+                break;
+        }
+        param.put("condition", devTask.getCondition());
+        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+        TaskService taskService = processEngine.getTaskService();
+        //认领任务
+        processEngine.getTaskService().claim(taskId, getUserId().toString());
+        taskService.addComment(taskId, processInstancesId, devTask.getComment());
+        taskService.complete(taskId, param);
+        // 更新任务
+        tApplySafetychangeService.updateTApplySafetychange(form);
+        return AjaxResult.success();
+    }
+
     /**
      * 修改组织保护措施状态变更申请
      */
     @PreAuthorize("@ss.hasPermi('apply:safetychange:edit')")
     @Log(title = "组织保护措施状态变更申请", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TApplySafetychange tApplySafetychange)
-    {
+    public AjaxResult edit(@RequestBody TApplySafetychange tApplySafetychange) {
         tApplySafetychange.setUpdatedate(new Date());
         tApplySafetychange.setUpdaterCode(getUserId());
         return toAjax(tApplySafetychangeService.updateTApplySafetychange(tApplySafetychange));
@@ -161,9 +248,8 @@ public class TApplySafetychangeController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('apply:safetychange:remove')")
     @Log(title = "组织保护措施状态变更申请", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tApplySafetychangeService.deleteTApplySafetychangeByIds(ids));
     }
 }

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

@@ -2,6 +2,7 @@ package com.ruoyi.project.approve.damain;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
+import com.ruoyi.project.apply.domain.TApplySafetychange;
 import com.ruoyi.project.ehs.domain.TApproveAccident;
 import com.ruoyi.project.ehs.domain.TApproveDanger;
 import com.ruoyi.project.sems.domain.TApprove;
@@ -88,6 +89,16 @@ public class DevTask {
 
     private TApplyOfflinevalve offlinevalve;
 
+    private TApplySafetychange safetychange;
+
+    public TApplySafetychange getSafetychange() {
+        return safetychange;
+    }
+
+    public void setSafetychange(TApplySafetychange safetychange) {
+        this.safetychange = safetychange;
+    }
+
     public TApplyOfflinevalve getOfflinevalve() {
         return offlinevalve;
     }

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

@@ -504,7 +504,7 @@ public class TApproveDangerController extends BaseController {
                     devProcess.setApNo(approve.getApNo());
                     devProcess.setApName(user.getNickName());
                     devProcess.setApproveObject(approve);
-                }  else if (pi.getProcessDefinitionName().equals("安全阀离线/切出申请流程")) {
+                }  else if (pi.getProcessDefinitionName().equals("组织保护措施状态变更申请流程")) {
                     TApplySafetychange approve = tApplySafetychangeService.selectTApplySafetychangeById(Long.parseLong(pi.getBusinessKey()));
                     SysUser user = sysUserService.selectUserById(Long.valueOf(approve.getCreaterCode()));
                     devProcess.setApNo(approve.getApNo());

+ 2 - 2
master/src/main/resources/mybatis/apply/TApplyOfflinevalveMapper.xml

@@ -78,13 +78,13 @@
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="temporaryTime != null "> and temporary_time = #{temporaryTime}</if>
             <if test="executionTime != null "> and execution_time = #{executionTime}</if>
-            <if test="status != null "> and status = #{status}</if>
+            <if test="status != null "> and d.status = #{status}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
             <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="approveStatus != null  and approveStatus != ''"> and approve_status = #{approveStatus}</if>
+            <if test="approveStatus != null  and approveStatus != ''"> and d.approve_status = #{approveStatus}</if>
             <if test="lockConfirmer1Name != null  and lockConfirmer1Name != ''"> and lock_confirmer1_name like concat(concat('%', #{lockConfirmer1Name}), '%')</if>
             <if test="lockConfirmer2Name != null  and lockConfirmer2Name != ''"> and lock_confirmer2_name like concat(concat('%', #{lockConfirmer2Name}), '%')</if>
             <if test="infoConfirmerName != null  and infoConfirmerName != ''"> and info_confirmer_name like concat(concat('%', #{infoConfirmerName}), '%')</if>

+ 3 - 3
master/src/main/resources/mybatis/apply/TApplySafetychangeMapper.xml

@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectTApplySafetychangeList" parameterType="TApplySafetychange" resultMap="TApplySafetychangeResult">
         <include refid="selectTApplySafetychangeVo"/>
         <where>
-            <if test="changeDescribe != null  and changeDescribe != ''"> and change_describe = #{changeDescribe}</if>
+            <if test="changeDescribe != null  and changeDescribe != ''"> and change_describe like concat(concat('%', #{changeDescribe}), '%')</if>
             <if test="changeReason != null  and changeReason != ''"> and change_reason = #{changeReason}</if>
             <if test="applicant != null  and applicant != ''"> and applicant = #{applicant}</if>
             <if test="applicantName != null  and applicantName != ''"> and applicant_name like concat(concat('%', #{applicantName}), '%')</if>
@@ -89,13 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="resetConfirmTime2 != null "> and reset_confirm_time2 = #{resetConfirmTime2}</if>
             <if test="revokeConfirm != null  and revokeConfirm != ''"> and revoke_confirm = #{revokeConfirm}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
-            <if test="status != null "> and status = #{status}</if>
+            <if test="status != null "> and d.status = #{status}</if>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
             <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="approveStatus != null  and approveStatus != ''"> and approve_status = #{approveStatus}</if>
+            <if test="approveStatus != null  and approveStatus != ''"> and d.approve_status = #{approveStatus}</if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->

+ 9 - 1
ui/src/api/apply/safetychange.js

@@ -35,6 +35,14 @@ export function updateSafetychange(data) {
   })
 }
 
+export function handle(data) {
+  return request({
+    url: '/apply/safetychange/handle',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除组织保护措施状态变更申请
 export function delSafetychange(id) {
   return request({
@@ -50,4 +58,4 @@ export function exportSafetychange(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 21 - 0
ui/src/views/apply/offlinevalve/index.vue

@@ -41,6 +41,27 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" @change="handleQuery">
+          <el-option
+            v-for="item in statusList"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="申请状态" prop="approveStatus">
+        <el-select v-model="queryParams.approveStatus" placeholder="请选择申请状态" clearable size="small" @change="handleQuery">
+          <el-option
+            v-for="item in approveStatusList"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>

+ 40 - 17
ui/src/views/apply/safetychange/index.vue

@@ -20,8 +20,23 @@
         />
       </el-form-item>
       <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-          <el-option label="请选择字典生成" value=""/>
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small" @change="handleQuery">
+          <el-option
+            v-for="item in statusList"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="申请状态" prop="approveStatus">
+        <el-select v-model="queryParams.approveStatus" placeholder="请选择申请状态" clearable size="small" @change="handleQuery">
+          <el-option
+            v-for="item in approveStatusList"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          ></el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -154,7 +169,7 @@
             size="mini"
             type="text"
             icon="el-icon-document"
-            @click="todoMethod"
+            @click="openApproveDetail(scope.row)"
           >流转详情
           </el-button>
         </template>
@@ -313,25 +328,26 @@
           {{ this.detail.data.resetConfirm }}
         </el-descriptions-item>
         <el-descriptions-item label="状态恢复,确认人1" :label-style="labelStyle">
-          {{ this.detail.data.infoConfirmerName }}
+          {{ this.detail.data.resetConfirmerName1 }}
         </el-descriptions-item>
         <el-descriptions-item label="确认时间" :label-style="labelStyle">
-          {{ this.detail.data.confirmTime }}
+          {{ this.detail.data.resetConfirmTime1 }}
         </el-descriptions-item>
         <el-descriptions-item label="状态恢复,确认人2" :label-style="labelStyle">
-          {{ this.detail.data.infoConfirmerName }}
+          {{ this.detail.data.resetConfirmerName2 }}
         </el-descriptions-item>
         <el-descriptions-item label="确认时间" :label-style="labelStyle">
-          {{ this.detail.data.confirmTime }}
+          {{ this.detail.data.resetConfirmTime2 }}
         </el-descriptions-item>
         <el-descriptions-item label="状态恢复后,之前采取的安全措施是否已撤销" :span="2" :label-style="labelStyle">
-          {{ this.detail.data.leakConfirm }}
+          {{ this.detail.data.revokeConfirm }}
         </el-descriptions-item>
         <el-descriptions-item label="备注" :span="2" :label-style="labelStyle">
           {{ this.detail.data.remarks }}
         </el-descriptions-item>
       </el-descriptions>
     </el-dialog>
+    <safetychange-detail v-if="safetychangeDetailVisible" ref="safetychangeDetail" @refreshDataList="getList"></safetychange-detail>
   </div>
 </template>
 
@@ -349,11 +365,12 @@ 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 {listPostUser} from "@/api/system/user";
+import {listPostUser, listUserPost} from "@/api/system/user";
+import SafetychangeDetail from "@/views/approve/approveDetail/safetychange-detail";
 
 export default {
   name: "Safetychange",
-  components: {Treeselect},
+  components: {SafetychangeDetail, Treeselect},
   data() {
     return {
       detail: {
@@ -381,6 +398,7 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: false,
+      safetychangeDetailVisible: false,
       // 总条数
       total: 0,
       // 组织保护措施状态变更申请表格数据
@@ -488,10 +506,16 @@ export default {
     this.getDicts("apply_approve_status").then(response => {
       this.approveStatusList = response.data;
     });
-    listPostUser({
-      // postCode: 'gyzj'
+    listUserPost({
+      actualposts:"20,36,10,11,28,30,32,38,15,12,34",
+      deptId:103
     }).then(response => {
       this.executorList = response;
+    });
+    listUserPost({
+      actualposts:"24,26,18,14,16",
+      deptId:103
+    }).then(response => {
       this.safaerList = response;
     });
   },
@@ -552,11 +576,10 @@ export default {
       }
       return <el-tag type={type}>{s}</el-tag>;
     },
-    todoMethod() {
-      this.$confirm('功能开发中......', "", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "info"
+    openApproveDetail(row) {
+      this.safetychangeDetailVisible = true
+      this.$nextTick(() => {
+        this.$refs.safetychangeDetail.init(row.id, '', row.processId, '')
       })
     },
     /** 查询组织保护措施状态变更申请列表 */

+ 99 - 8
ui/src/views/approve/approveDetail/safetychange-detail.vue

@@ -60,12 +60,27 @@
       <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" fixed="left"
                        width="85" :formatter="statusFormat"/>
     </el-table>
-    <el-form ref="form" :model="form" label-position="left" :rules="rules" label-width="140px"
+    <el-form ref="form" :model="form" label-position="left" :rules="rules" label-width="170px"
              style="margin-top: 30px">
       <div v-if="flag">
-        <el-form-item label="审批意见" prop="remarks" v-if="taskName!='申请人提交申请'">
-          <el-input type="textarea" v-model="form.remarks"/>
-        </el-form-item>
+        <div v-if="taskName=='申请人提交申请'">
+          <el-form-item label="组织保护措施变更描述" prop="changeDescribe">
+            <el-input type="textarea" v-model="form.changeDescribe" placeholder="请输入组织保护措施变更描述"/>
+          </el-form-item>
+          <el-form-item label="状态变更的原因" prop="changeReason">
+            <el-input type="textarea" v-model="form.changeReason" placeholder="请输入状态变更的原因"/>
+          </el-form-item>
+        </div>
+        <div v-if="taskName=='安全评估人1'">
+          <el-form-item label="安全评估及临时的安全措施" prop="safa" label-width="190px">
+            <el-input type="textarea" v-model="form.safa" placeholder="请输入安全评估及临时的安全措施"/>
+          </el-form-item>
+        </div>
+        <div v-if="taskName=='变更执行人'">
+          <el-form-item label="组织保护措施状态变更执行" prop="changeExecution" label-width="190px">
+            <el-input type="textarea" v-model="form.changeExecution" placeholder="请输入组织保护措施状态变更执行"/>
+          </el-form-item>
+        </div>
         <div v-if="taskName=='安全评估人2'">
           <el-form-item label="组织保护措施是否已经恢复至变更前的状态" prop="resetConfirm" label-width="310px">
             <el-radio-group v-model="form.resetConfirm">
@@ -92,6 +107,9 @@
             </el-select>
           </el-form-item>
         </div>
+        <el-form-item label="审批意见" prop="remarks" v-if="taskName!='申请人提交申请'">
+          <el-input type="textarea" v-model="form.remarks"/>
+        </el-form-item>
       </div>
     </el-form>
     <span slot="footer" class="dialog-footer">
@@ -126,7 +144,7 @@
 
 <script>
 
-import {getSafetychange} from "@/api/apply/safetychange";
+import {getSafetychange, handle} from "@/api/apply/safetychange";
 import {getHistorylist} from "@/api/ehs/approvedanger";
 import {listUserPost} from "@/api/system/user";
 
@@ -149,6 +167,14 @@ export default {
       rules: {
         resetConfirmer1: [{required: true, message: "请选择确认人", trigger: "blur"}],
         resetConfirm: [{required: true, message: "请选择是/否", trigger: "blur"}],
+        changeExecution: [{required: true, message: "请输入组织保护措施状态变更执行", trigger: "blur"}],
+        safa: [{required: true, message: "请输入安全评估及临时的安全措施", trigger: "blur"}],
+        changeDescribe: [
+          {required: true, message: "请输入组织保护措施变更描述", trigger: "blur"}
+        ],
+        changeReason: [
+          {required: true, message: "请输入状态变更的原因", trigger: "blur"}
+        ],
         revokeConfirm: [{required: true, message: "请选择是/否/NA", trigger: "blur"}]
       },
       dataForm: {
@@ -207,15 +233,25 @@ export default {
   },
   methods: {
     init(id, taskId, processId, taskName, flag) {
+      this.reset();
+      this.devList = [];
+      this.historyList = [];
+      this.dataForm.id = id || 0;
+      this.form.id = id || 0;
       this.submitDisabled = false;
       this.flag = flag;
-      this.devList = [];
       this.visible = true;
-      this.taskForm.taskId = taskId;
       this.taskName = taskName;
+      this.taskForm.taskId = taskId;
+      this.taskForm.businessKey = id;
+      this.dataForm.processId = processId;
       getSafetychange(id).then(res => {
         this.dataForm = res.data;
         this.devList.push(this.dataForm);
+          if (taskName == '申请人提交申请') {
+            this.form.changeReason=this.dataForm.changeReason;
+            this.form.changeDescribe=this.dataForm.changeDescribe;
+          }
       });
       this.getDicts("apply_status").then(response => {
         this.statusList = response.data;
@@ -241,6 +277,54 @@ export default {
       }
       return <el-tag type={type}>{s}</el-tag>;
     },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        changeDescribe: null,
+        changeReason: null,
+        applicant: null,
+        applicantName: null,
+        applicationTime: null,
+        safa: null,
+        safaer: null,
+        safaerName: null,
+        safaTime: null,
+        approver: null,
+        approverName: null,
+        approveTime: null,
+        executor: null,
+        executorName: null,
+        executionTime: null,
+        confirmer: null,
+        confirmerName: null,
+        confirmTime: null,
+        changeExecution: null,
+        changeExecutor: null,
+        changeExecutorName: null,
+        changeExecutorTime: null,
+        resetConfirm: null,
+        resetConfirmer1: null,
+        resetConfirmerName1: null,
+        resetConfirmTime1: null,
+        resetConfirmer2: null,
+        resetConfirmerName2: null,
+        resetConfirmTime2: null,
+        revokeConfirm: null,
+        remarks: null,
+        status: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        approveStatus: null,
+        apNo:null,
+        processId:null,
+      };
+      this.resetForm("form");
+    },
     // 字典翻译
     approveStatusFormat(row, column) {
       let s = this.selectDictLabel(this.approveStatusList, row.approveStatus)
@@ -255,9 +339,16 @@ export default {
       return <el-tag type={type}>{s}</el-tag>;
     },
     dataFormSubmit(val) {
+      this.submitDisabled = true;
       this.$refs["form"].validate(valid => {
         if (valid || val != 1) {
-          this.submitDisabled = true;
+          this.taskForm.condition = val;
+          this.taskForm.safetychange = this.form;
+          handle(this.taskForm).then(res=>{
+            this.msgSuccess("审核成功");
+            this.visible = false;
+            this.$emit('refreshDataList')
+          })
         }
       })
     }