Explorar el Código

PSSR照明、电伴热

wangggziwen hace 7 meses
padre
commit
8b7042ce42

+ 61 - 0
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrApproveController.java

@@ -154,6 +154,9 @@ public class TPssrApproveController extends BaseController {
     @Autowired
     @Autowired
     private ITPssrTorchvocService tPssrTorchvocService;
     private ITPssrTorchvocService tPssrTorchvocService;
 
 
+    @Autowired
+    private ITPssrLightingService tPssrLightingService;
+
     /**
     /**
      * 查询pssr审批管理列表
      * 查询pssr审批管理列表
      */
      */
@@ -301,6 +304,7 @@ public class TPssrApproveController extends BaseController {
                 doDjsbApprove(tPssrSubcontent);
                 doDjsbApprove(tPssrSubcontent);
                 break;
                 break;
             case "zmdbr"://照明、电伴热
             case "zmdbr"://照明、电伴热
+                doZmdbrApprove(tPssrSubcontent);
                 break;
                 break;
             case "jdjdkj"://静电接地、跨接
             case "jdjdkj"://静电接地、跨接
                 doJdjdkjApprove(tPssrSubcontent);
                 doJdjdkjApprove(tPssrSubcontent);
@@ -1328,6 +1332,63 @@ public class TPssrApproveController extends BaseController {
         }
         }
     }
     }
 
 
+    // 照明、电伴热流程发起申请
+    public void doZmdbrApprove(TPssrSubcontent sub) {
+        String userId = getUserId().toString();
+        //修改状态
+        TPssrLighting tPssrLighting = new TPssrLighting();
+        tPssrLighting.setApproveStatus(0L);
+        tPssrLighting.setSubId(sub.getId());
+        Set<String> installer = new HashSet<>();
+        Set<String> remover = new HashSet<>();
+        for (TPssrLighting item : tPssrLightingService.selectTPssrLightingList(tPssrLighting)) {
+            item.setApproveStatus(1L);
+            item.setUpdatedate(new Date());
+            item.setUpdaterCode(userId);
+            tPssrLightingService.updateTPssrLighting(item);
+
+            // 安装人员
+            installer.add(item.getConfirm1());
+
+            //拆除人员
+            remover.add(item.getConfirm2());
+        }
+
+        TPssrApprove exist = new TPssrApprove();
+        exist.setSubId(sub.getId());
+        List<TPssrApprove> tPssrApproves = tPssrApproveService.selectTPssrApproveList(exist);
+        if (CollectionUtil.isEmpty(tPssrApproves)) {
+            //新增审批数据
+            TPssrApprove approve = new TPssrApprove();
+            approve.setSubId(sub.getId());
+            approve.setApNo(DateUtils.dateTimeNow() + userId);
+            approve.setApproveStatus(1L);
+            approve.setSubCharge(sub.getConfirm());
+            approve.setCreaterCode(userId);
+            approve.setCreatedate(new Date());
+            tPssrApproveService.insertTPssrApprove(approve);
+
+            pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
+        } else {
+            // 已存在流程时,删除旧流程,重新发起
+            TPssrApprove approve = tPssrApproves.get(0);
+            delProcess(approve.getProcessId(), "pssr2confirm");
+
+            tPssrLighting = new TPssrLighting();
+            tPssrLighting.setApproveStatus(1L);
+            tPssrLighting.setSubId(sub.getId());
+            for (TPssrLighting item : tPssrLightingService.selectTPssrLightingList(tPssrLighting)) {
+                // 安装人员
+                installer.add(item.getConfirm1());
+
+                //拆除人员
+                remover.add(item.getConfirm2());
+            }
+
+            pssr2confirm(approve, new ArrayList<>(installer), new ArrayList<>(remover), sub.getConfirm());
+        }
+    }
+
     // 支吊架流程发起申请
     // 支吊架流程发起申请
     public void doZdjApprove(TPssrSubcontent sub) {
     public void doZdjApprove(TPssrSubcontent sub) {
         String userId = getUserId().toString();
         String userId = getUserId().toString();

+ 160 - 1
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrLightingController.java

@@ -1,6 +1,16 @@
 package com.ruoyi.project.pssr.controller;
 package com.ruoyi.project.pssr.controller;
 
 
-import java.util.List;
+import java.util.*;
+
+import com.ruoyi.project.pssr.domain.TPssrApprove;
+import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.project.pssr.domain.TPssrLighting;
+import com.ruoyi.project.pssr.service.ITPssrApproveService;
+import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
+import org.activiti.engine.ProcessEngine;
+import org.activiti.engine.ProcessEngines;
+import org.activiti.engine.TaskService;
+import org.activiti.engine.task.Task;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -33,6 +43,12 @@ public class TPssrLightingController extends BaseController
     @Autowired
     @Autowired
     private ITPssrLightingService tPssrLightingService;
     private ITPssrLightingService tPssrLightingService;
 
 
+    @Autowired
+    private ITPssrApproveService tPssrApproveService;
+
+    @Autowired
+    private ITPssrSubcontentService tPssrSubcontentService;
+
     /**
     /**
      * 查询照明列表
      * 查询照明列表
      */
      */
@@ -76,6 +92,7 @@ public class TPssrLightingController extends BaseController
     @PostMapping
     @PostMapping
     public AjaxResult add(@RequestBody TPssrLighting tPssrLighting)
     public AjaxResult add(@RequestBody TPssrLighting tPssrLighting)
     {
     {
+        tPssrLighting.setApproveStatus(0L);
         return toAjax(tPssrLightingService.insertTPssrLighting(tPssrLighting));
         return toAjax(tPssrLightingService.insertTPssrLighting(tPssrLighting));
     }
     }
 
 
@@ -100,4 +117,146 @@ public class TPssrLightingController extends BaseController
     {
     {
         return toAjax(tPssrLightingService.deleteTPssrLightingByIds(ids));
         return toAjax(tPssrLightingService.deleteTPssrLightingByIds(ids));
     }
     }
+
+
+
+    /**
+     * 确认照明,电伴热
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:lighting:edit')")
+    @Log(title = "照明,电伴热", businessType = BusinessType.UPDATE)
+    @PutMapping("/confirmLighting")
+    public AjaxResult Lighting(@RequestBody TPssrLighting tPssrLighting) {
+        long queryStatus = 0;
+        long approveStatus = 0;
+        Date date = null;
+        if (tPssrLighting.getTaskType() == 4) {
+            //拆锁确认
+            queryStatus = 1;
+            approveStatus = 3;
+            date = new Date();
+        } else if (tPssrLighting.getTaskType() == 5) {
+            //上锁确认
+            queryStatus = 3;
+            approveStatus = 2;
+            date = new Date();
+        }
+        // 修改状态
+        if (tPssrLighting.getIds() != null && tPssrLighting.getIds().length > 0) {
+            for (Long id : tPssrLighting.getIds()) {
+                TPssrLighting item = tPssrLightingService.selectTPssrLightingById(id);
+                item.setApproveStatus(approveStatus);
+                if (item.getConfirmationDate()==null && queryStatus==3) {
+                    item.setConfirmationDate(date);
+                }
+                tPssrLightingService.updateTPssrLighting(item);
+            }
+        } else {
+            TPssrLighting lock = new TPssrLighting();
+            lock.setSubId(tPssrLighting.getSubId());
+            lock.setApproveStatus(queryStatus);
+            lock.setLightingType(tPssrLighting.getLightingType());
+            for (TPssrLighting item : tPssrLightingService.selectTPssrLightingList(lock)) {
+                if (item.getConfirmationDate()==null && queryStatus==3) {
+                    item.setConfirmationDate(date);
+                }
+                item.setApproveStatus(approveStatus);
+                tPssrLightingService.updateTPssrLighting(item);
+            }
+        }
+        //查询当前待审批的确认人
+        TPssrLighting entity = new TPssrLighting();
+        entity.setSubId(tPssrLighting.getSubId());
+        entity.setApproveStatus(queryStatus);
+        for (TPssrLighting item : tPssrLightingService.selectTPssrLightingList(entity)) {
+            if (tPssrLighting.getTaskType() == 4) {
+                if (item.getConfirm1().equals(getUserId().toString())) {
+                    return AjaxResult.success();
+                }
+            } else if (tPssrLighting.getTaskType() == 5) {
+                if (item.getConfirm2().equals(getUserId().toString())) {
+                    return AjaxResult.success();
+                }
+            }
+        }
+
+        //无待审批任务结束当前用户流程
+        TPssrApprove approve = new TPssrApprove();
+        approve.setSubId(tPssrLighting.getSubId());
+        // 因为流程关系所以approve一定会有且只有一条数据
+        TPssrApprove tPssrApprove = tPssrApproveService.selectTPssrApproveList(approve).get(0);
+        TPssrApproveController.handleConfirmApprove(tPssrApprove, getUserId().toString());
+        return AjaxResult.success();
+
+    }
+
+    /**
+     * 驳回照明,电伴热
+     */
+    @PutMapping("/turnDownLighting")
+    public AjaxResult turnDownLighting(@RequestBody TPssrLighting tPssrLighting) {
+        if (tPssrLighting.getIds() != null) {
+            String userId = getUserId().toString();
+            // 修改已选择数据的状态
+            for (Long id : tPssrLighting.getIds()) {
+                TPssrLighting blind = new TPssrLighting();
+                blind.setId(id);
+                blind.setApproveStatus(1L);
+                blind.setUpdatedate(new Date());
+                blind.setUpdaterCode(getUserId().toString());
+                tPssrLightingService.updateTPssrLighting(blind);
+            }
+            // 查询当前流程
+            TPssrApprove approve = tPssrApproveService.selectTPssrApproveBySubId(tPssrLighting.getSubId());
+
+            ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
+            TaskService taskService = processEngine.getTaskService();
+            Task task = processEngine.getTaskService()//获取任务service
+                    .createTaskQuery()//创建查询对象
+                    .taskAssignee(userId)
+                    .processInstanceId(approve.getProcessId()).singleResult();
+            String taskId = task.getId();
+
+            // 驳回 查询所有待审批的人员
+            TPssrLighting blind = new TPssrLighting();
+            blind.setSubId(tPssrLighting.getSubId());
+            blind.setApproveStatus(1L);
+            Set<String> installer = new HashSet<>();
+            Set<String> remover = new HashSet<>();
+            for (TPssrLighting item : tPssrLightingService.selectTPssrLightingList(blind)) {
+
+                // 安装人员
+                installer.add(item.getConfirm1());
+
+                //拆除人员
+                remover.add(item.getConfirm2());
+            }
+
+
+            //处理流程节点
+            Map<String, Object> param = new HashMap<>();
+            param.put("condition", 1);
+            param.put("confirmUsers1", new ArrayList<>(installer));
+            param.put("confirmUsers2", new ArrayList<>(remover));
+            //认领任务
+            processEngine.getTaskService().claim(taskId, userId);
+            taskService.addComment(taskId, approve.getProcessId(), "驳回至拆除;" + tPssrLighting.getRemarks());
+            taskService.complete(taskId, param);
+
+            // 修改审批表和sub表
+            approve.setApproveStatus(1L);
+            approve.setUpdatedate(new Date());
+            approve.setUpdaterCode(getUserId().toString());
+            tPssrApproveService.updateTPssrApprove(approve);
+
+            TPssrSubcontent subcontent = new TPssrSubcontent();
+            subcontent.setId(approve.getSubId());
+            subcontent.setApproveStatus(1L);
+            subcontent.setUpdatedate(new Date());
+            subcontent.setUpdaterCode(getUserId().toString());
+            tPssrSubcontentService.updateTPssrSubcontent(subcontent);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error();
+    }
 }
 }

+ 54 - 0
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrLighting.java

@@ -96,6 +96,60 @@ public class TPssrLighting extends BaseEntity
     @Excel(name = "审批状态")
     @Excel(name = "审批状态")
     private Long approveStatus;
     private Long approveStatus;
 
 
+    /** 确认人1 */
+    @Excel(name = "确认人1")
+    private String confirm1;
+
+    /** 确认人2 */
+    @Excel(name = "确认人2")
+    private String confirm2;
+
+    private String lightingType;
+
+    private Long[] ids;
+
+    private Long taskType;
+
+    public String getConfirm1() {
+        return confirm1;
+    }
+
+    public void setConfirm1(String confirm1) {
+        this.confirm1 = confirm1;
+    }
+
+    public String getConfirm2() {
+        return confirm2;
+    }
+
+    public void setConfirm2(String confirm2) {
+        this.confirm2 = confirm2;
+    }
+
+    public String getLightingType() {
+        return lightingType;
+    }
+
+    public void setLightingType(String lightingType) {
+        this.lightingType = lightingType;
+    }
+
+    public Long[] getIds() {
+        return ids;
+    }
+
+    public void setIds(Long[] ids) {
+        this.ids = ids;
+    }
+
+    public Long getTaskType() {
+        return taskType;
+    }
+
+    public void setTaskType(Long taskType) {
+        this.taskType = taskType;
+    }
+
     public void setId(Long id)
     public void setId(Long id)
     {
     {
         this.id = id;
         this.id = id;

+ 2 - 2
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrTorchvoc.java

@@ -28,8 +28,8 @@ public class TPssrTorchvoc extends BaseEntity
     @Excel(name = "审批id")
     @Excel(name = "审批id")
     private Long approveId;
     private Long approveId;
 
 
-    /** 类型 */
-    @Excel(name = "类型")
+    /** 类型,1火炬/2VOC */
+    @Excel(name = "类型,1火炬/2VOC")
     private String torchvocType;
     private String torchvocType;
 
 
     /** 投用步骤内容 */
     /** 投用步骤内容 */

+ 16 - 1
master/src/main/resources/mybatis/pssr/TPssrLightingMapper.xml

@@ -23,10 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remarks"    column="remarks"    />
         <result property="remarks"    column="remarks"    />
         <result property="approveStatus"    column="approve_status"    />
         <result property="approveStatus"    column="approve_status"    />
         <result property="deptName" column="dept_name" />
         <result property="deptName" column="dept_name" />
+        <result property="confirm1"    column="confirm1"    />
+        <result property="confirm2"    column="confirm2"    />
+        <result property="lightingType"    column="lighting_type"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectTPssrLightingVo">
     <sql id="selectTPssrLightingVo">
-        select d.id, d.sub_id, d.approve_id, d.check_content, d.check_result, d.check_des, d.change_result, d.confirm, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_lighting d
+        select d.id, d.confirm1, d.confirm2, d.lighting_type, d.sub_id, d.approve_id, d.check_content, d.check_result, d.check_des, d.change_result, d.confirm, d.confirmation_date, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.approve_status ,s.dept_name from t_pssr_lighting d
       left join sys_dept s on s.dept_id = d.dept_id
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
     </sql>
 
 
@@ -48,6 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
             <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
             <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
+            <if test="confirm1 != null  and confirm1 != ''"> and confirm1 = #{confirm1}</if>
+            <if test="confirm2 != null  and confirm2 != ''"> and confirm2 = #{confirm2}</if>
+            <if test="lightingType != null  and lightingType != ''"> and lighting_type = #{lightingType}</if>
             and d.del_flag = 0
             and d.del_flag = 0
         </where>
         </where>
         <!-- 数据范围过滤 -->
         <!-- 数据范围过滤 -->
@@ -82,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
             <if test="remarks != null">remarks,</if>
             <if test="approveStatus != null">approve_status,</if>
             <if test="approveStatus != null">approve_status,</if>
+            <if test="confirm1 != null">confirm1,</if>
+            <if test="confirm2 != null">confirm2,</if>
+            <if test="lightingType != null">lighting_type,</if>
          </trim>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="id != null">#{id},</if>
@@ -101,6 +110,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">#{deptId},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
             <if test="remarks != null">#{remarks},</if>
             <if test="approveStatus != null">#{approveStatus},</if>
             <if test="approveStatus != null">#{approveStatus},</if>
+            <if test="confirm1 != null">#{confirm1},</if>
+            <if test="confirm2 != null">#{confirm2},</if>
+            <if test="lightingType != null">#{lightingType},</if>
          </trim>
          </trim>
     </insert>
     </insert>
 
 
@@ -123,6 +135,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="approveStatus != null">approve_status = #{approveStatus},</if>
             <if test="approveStatus != null">approve_status = #{approveStatus},</if>
+            <if test="confirm1 != null">confirm1 = #{confirm1},</if>
+            <if test="confirm2 != null">confirm2 = #{confirm2},</if>
+            <if test="lightingType != null">lighting_type = #{lightingType},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>

+ 19 - 1
ui/src/api/pssr/lighting.js

@@ -1,5 +1,23 @@
 import request from '@/utils/request'
 import request from '@/utils/request'
 
 
+// 确认照明,电伴热
+export function handleConfirmLighting(data) {
+  return request({
+    url: '/pssr/lighting/confirmLighting',
+    method: 'put',
+    data: data
+  })
+}
+
+// 驳回照明,电伴热
+export function handleTurnDownLighting(data) {
+  return request({
+    url: '/pssr/lighting/turnDownLighting',
+    method: 'put',
+    data: data
+  })
+}
+
 // 查询照明列表
 // 查询照明列表
 export function listLighting(query) {
 export function listLighting(query) {
   return request({
   return request({
@@ -50,4 +68,4 @@ export function exportLighting(query) {
     method: 'get',
     method: 'get',
     params: query
     params: query
   })
   })
-}
+}

+ 313 - 142
ui/src/views/pssr/lighting/index.vue

@@ -1,19 +1,28 @@
 <template>
 <template>
   <div class="app-container">
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="从表id" prop="subId">
+      <!--<el-form-item label="从表id" prop="subId">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.subId"-->
+          <!--placeholder="请输入从表id"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="审批id" prop="approveId">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.approveId"-->
+          <!--placeholder="请输入审批id"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <el-form-item label="检查内容" prop="checkContent">
         <el-input
         <el-input
-          v-model="queryParams.subId"
-          placeholder="请输入从表id"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="审批id" prop="approveId">
-        <el-input
-          v-model="queryParams.approveId"
-          placeholder="请输入审批id"
+          v-model="queryParams.checkContent"
+          placeholder="请输入检查内容"
           clearable
           clearable
           size="small"
           size="small"
           @keyup.enter.native="handleQuery"
           @keyup.enter.native="handleQuery"
@@ -28,84 +37,102 @@
           @keyup.enter.native="handleQuery"
           @keyup.enter.native="handleQuery"
         />
         />
       </el-form-item>
       </el-form-item>
-      <el-form-item label="检查结果异常说明" prop="checkDes">
+      <!--<el-form-item label="检查结果异常说明" prop="checkDes">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.checkDes"-->
+          <!--placeholder="请输入检查结果异常说明"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="整改结果" prop="changeResult">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.changeResult"-->
+          <!--placeholder="请输入整改结果"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="检查人员" prop="confirm">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.confirm"-->
+          <!--placeholder="请输入检查人员"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <el-form-item label="确认人1" prop="confirm1">
         <el-input
         <el-input
-          v-model="queryParams.checkDes"
-          placeholder="请输入检查结果异常说明"
+          v-model="queryParams.confirm1"
+          placeholder="请输入确认人1"
           clearable
           clearable
           size="small"
           size="small"
           @keyup.enter.native="handleQuery"
           @keyup.enter.native="handleQuery"
         />
         />
       </el-form-item>
       </el-form-item>
-      <el-form-item label="整改结果" prop="changeResult">
+      <el-form-item label="确认人2" prop="confirm2">
         <el-input
         <el-input
-          v-model="queryParams.changeResult"
-          placeholder="请输入整改结果"
+          v-model="queryParams.confirm2"
+          placeholder="请输入确认人2"
           clearable
           clearable
           size="small"
           size="small"
           @keyup.enter.native="handleQuery"
           @keyup.enter.native="handleQuery"
         />
         />
       </el-form-item>
       </el-form-item>
-      <el-form-item label="检查人员" prop="confirm">
-        <el-input
-          v-model="queryParams.confirm"
-          placeholder="请输入检查人员"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="检查时间" prop="confirmationDate">
+      <el-form-item label="确认时间" prop="confirmationDate">
         <el-date-picker clearable size="small" style="width: 200px"
         <el-date-picker clearable size="small" style="width: 200px"
           v-model="queryParams.confirmationDate"
           v-model="queryParams.confirmationDate"
           type="date"
           type="date"
           value-format="yyyy-MM-dd"
           value-format="yyyy-MM-dd"
-          placeholder="选择检查时间">
+          placeholder="选择确认时间">
         </el-date-picker>
         </el-date-picker>
       </el-form-item>
       </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.createdate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.updatedate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择修改时间">
-        </el-date-picker>
-      </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="createrCode">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.createrCode"-->
+          <!--placeholder="请输入创建人"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="创建时间" prop="createdate">-->
+        <!--<el-date-picker clearable size="small" style="width: 200px"-->
+          <!--v-model="queryParams.createdate"-->
+          <!--type="date"-->
+          <!--value-format="yyyy-MM-dd"-->
+          <!--placeholder="选择创建时间">-->
+        <!--</el-date-picker>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="修改人" prop="updaterCode">-->
+        <!--<el-input-->
+          <!--v-model="queryParams.updaterCode"-->
+          <!--placeholder="请输入修改人"-->
+          <!--clearable-->
+          <!--size="small"-->
+          <!--@keyup.enter.native="handleQuery"-->
+        <!--/>-->
+      <!--</el-form-item>-->
+      <!--<el-form-item label="修改时间" prop="updatedate">-->
+        <!--<el-date-picker clearable size="small" style="width: 200px"-->
+          <!--v-model="queryParams.updatedate"-->
+          <!--type="date"-->
+          <!--value-format="yyyy-MM-dd"-->
+          <!--placeholder="选择修改时间">-->
+        <!--</el-date-picker>-->
+      <!--</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="remarks">
       <el-form-item label="备注" prop="remarks">
         <el-input
         <el-input
           v-model="queryParams.remarks"
           v-model="queryParams.remarks"
@@ -129,6 +156,7 @@
           size="mini"
           size="mini"
           @click="handleAdd"
           @click="handleAdd"
           v-hasPermi="['pssr:lighting:add']"
           v-hasPermi="['pssr:lighting:add']"
+          v-if="isApprove==0"
         >新增</el-button>
         >新增</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -139,6 +167,7 @@
           :disabled="single"
           :disabled="single"
           @click="handleUpdate"
           @click="handleUpdate"
           v-hasPermi="['pssr:lighting:edit']"
           v-hasPermi="['pssr:lighting:edit']"
+          v-if="isApprove==0"
         >修改</el-button>
         >修改</el-button>
       </el-col>
       </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -149,6 +178,7 @@
           :disabled="multiple"
           :disabled="multiple"
           @click="handleDelete"
           @click="handleDelete"
           v-hasPermi="['pssr:lighting:remove']"
           v-hasPermi="['pssr:lighting:remove']"
+          v-if="isApprove==0"
         >删除</el-button>
         >删除</el-button>
       </el-col>
       </el-col>
         <el-col :span="1.5">
         <el-col :span="1.5">
@@ -158,6 +188,7 @@
                     size="mini"
                     size="mini"
                     @click="handleImport"
                     @click="handleImport"
                     v-hasPermi="['pssr:lighting:edit']"
                     v-hasPermi="['pssr:lighting:edit']"
+                    v-if="isApprove==0"
             >导入</el-button>
             >导入</el-button>
         </el-col>
         </el-col>
       <el-col :span="1.5">
       <el-col :span="1.5">
@@ -167,41 +198,102 @@
           size="mini"
           size="mini"
           @click="handleExport"
           @click="handleExport"
           v-hasPermi="['pssr:lighting:export']"
           v-hasPermi="['pssr:lighting:export']"
+          v-if="isApprove==0"
         >导出</el-button>
         >导出</el-button>
       </el-col>
       </el-col>
+
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-s-promotion"
+          size="mini"
+          @click="handleApprove"
+          v-if="isApprove==0"
+          v-hasPermi="['pssr:lighting:edit']"
+        >发起审批
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-check"
+          size="mini"
+          v-if="isApprove==4||isApprove==5"
+          @click="handleConfirmApprove"
+          v-hasPermi="['pssr:lighting:edit']"
+        >确认
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-refresh-left"
+          size="mini"
+          v-if="isApprove==2"
+          :disabled="multiple"
+          @click="handleTurnDown"
+          v-hasPermi="['pssr:lighting:edit']"
+        >驳回
+        </el-button>
+      </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     </el-row>
 
 
+    <div style="width: 100%;text-align: center;margin-bottom: 15px">
+      <H2 v-if="lightingType == 1">蒸汽裂解装置现场照明检查确认表</H2>
+      <H2 v-if="lightingType == 2">蒸汽裂解装置现场电伴热检查确认表</H2>
+    </div>
+
     <el-table v-loading="loading" :data="lightingList" @selection-change="handleSelectionChange" :height="clientHeight" border>
     <el-table v-loading="loading" :data="lightingList" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="唯一标识ID" align="center" prop="id" :show-overflow-tooltip="true"/>
-      <el-table-column label="从表id" align="center" prop="subId" :show-overflow-tooltip="true"/>
-      <el-table-column label="审批id" align="center" prop="approveId" :show-overflow-tooltip="true"/>
+      <!--<el-table-column label="唯一标识ID" align="center" prop="id" :show-overflow-tooltip="true"/>-->
+      <!--<el-table-column label="从表id" align="center" prop="subId" :show-overflow-tooltip="true"/>-->
+      <!--<el-table-column label="审批id" align="center" prop="approveId" :show-overflow-tooltip="true"/>-->
+      <el-table-column label="审批状态" align="center" prop="approveStatus" :show-overflow-tooltip="true" width="100">
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.approveStatus==0">未审批</el-tag>
+          <el-tag v-if="scope.row.approveStatus==1" type="warning">待确认</el-tag>
+          <el-tag v-if="scope.row.approveStatus==3" type="success">已确认1</el-tag>
+          <el-tag v-if="scope.row.approveStatus==2" type="success">已确认2</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="检查内容" align="center" prop="checkContent" :show-overflow-tooltip="true"/>
       <el-table-column label="检查内容" align="center" prop="checkContent" :show-overflow-tooltip="true"/>
       <el-table-column label="检查结果" align="center" prop="checkResult" :show-overflow-tooltip="true"/>
       <el-table-column label="检查结果" align="center" prop="checkResult" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查结果异常说明" align="center" prop="checkDes" :show-overflow-tooltip="true"/>
-      <el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查人员" align="center" prop="confirm" :show-overflow-tooltip="true"/>
-      <el-table-column label="检查时间" align="center" prop="confirmationDate" width="100">
+      <!--<el-table-column label="检查结果异常说明" align="center" prop="checkDes" :show-overflow-tooltip="true"/>-->
+      <!--<el-table-column label="整改结果" align="center" prop="changeResult" :show-overflow-tooltip="true"/>-->
+      <!--<el-table-column label="检查人员" align="center" prop="confirm" :show-overflow-tooltip="true"/>-->
+      <el-table-column label="确认人1" align="center" prop="confirm1" :show-overflow-tooltip="true"
+                       width="150">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
+          <span>{{ userFormat(scope.row.confirm1) }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+      <el-table-column label="确认人2" align="center" prop="confirm2" :show-overflow-tooltip="true"
+                       width="150">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+          <span>{{ userFormat(scope.row.confirm2) }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+      <el-table-column label="确认时间" align="center" prop="confirmationDate" width="100">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
+      <!--<el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>-->
+      <!--<el-table-column label="创建时间" align="center" prop="createdate" width="100">-->
+        <!--<template slot-scope="scope">-->
+          <!--<span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>-->
+        <!--</template>-->
+      <!--</el-table-column>-->
+      <!--<el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>-->
+      <!--<el-table-column label="修改时间" align="center" prop="updatedate" width="100">-->
+        <!--<template slot-scope="scope">-->
+          <!--<span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>-->
+        <!--</template>-->
+      <!--</el-table-column>-->
+      <!--<el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>-->
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width" v-if="isApprove==0">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-button
           <el-button
             size="mini"
             size="mini"
@@ -232,69 +324,87 @@
     <!-- 添加或修改照明对话框 -->
     <!-- 添加或修改照明对话框 -->
     <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
     <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="从表id" prop="subId">
-          <el-input v-model="form.subId" placeholder="请输入从表id" />
-        </el-form-item>
-        <el-form-item label="审批id" prop="approveId">
-          <el-input v-model="form.approveId" placeholder="请输入审批id" />
-        </el-form-item>
+        <!--<el-form-item label="从表id" prop="subId">-->
+          <!--<el-input v-model="form.subId" placeholder="请输入从表id" />-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="审批id" prop="approveId">-->
+          <!--<el-input v-model="form.approveId" placeholder="请输入审批id" />-->
+        <!--</el-form-item>-->
         <el-form-item label="检查内容">
         <el-form-item label="检查内容">
-          <editor v-model="form.checkContent" :min-height="192"/>
+          <el-input type="textarea" v-model="form.checkContent" :min-height="192"/>
         </el-form-item>
         </el-form-item>
         <el-form-item label="检查结果" prop="checkResult">
         <el-form-item label="检查结果" prop="checkResult">
           <el-input v-model="form.checkResult" placeholder="请输入检查结果" />
           <el-input v-model="form.checkResult" placeholder="请输入检查结果" />
         </el-form-item>
         </el-form-item>
-        <el-form-item label="检查结果异常说明" prop="checkDes">
-          <el-input v-model="form.checkDes" placeholder="请输入检查结果异常说明" />
-        </el-form-item>
-        <el-form-item label="整改结果" prop="changeResult">
-          <el-input v-model="form.changeResult" placeholder="请输入整改结果" />
-        </el-form-item>
-        <el-form-item label="检查人员" prop="confirm">
-          <el-input v-model="form.confirm" placeholder="请输入检查人员" />
-        </el-form-item>
-        <el-form-item label="检查时间" prop="confirmationDate">
-          <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.confirmationDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择检查时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="删除状态" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人" />
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.createdate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人" />
+        <!--<el-form-item label="检查结果异常说明" prop="checkDes">-->
+          <!--<el-input v-model="form.checkDes" placeholder="请输入检查结果异常说明" />-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="整改结果" prop="changeResult">-->
+          <!--<el-input v-model="form.changeResult" placeholder="请输入整改结果" />-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="检查人员" prop="confirm">-->
+          <!--<el-input v-model="form.confirm" placeholder="请输入检查人员" />-->
+        <!--</el-form-item>-->
+        <el-form-item label="确认人1" prop="confirm1">
+        <el-select v-model="form.confirm1" clearable filterable style="width: 100%;"
+                   placeholder="请选择确认人1">
+          <el-option v-for="user in userOptions"
+                     :label="user.nickName"
+                     :value="user.userId+''"
+                     :key="user.userId"/>
+        </el-select>
+      </el-form-item>
+        <el-form-item label="确认人2" prop="confirm2">
+          <el-select v-model="form.confirm2" clearable filterable style="width: 100%;"
+                     placeholder="请选择确认人2">
+            <el-option v-for="user in userOptions"
+                       :label="user.nickName"
+                       :value="user.userId+''"
+                       :key="user.userId"/>
+          </el-select>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
+        <el-form-item label="确认时间" prop="confirmationDate">
           <el-date-picker clearable size="small" style="width: 200px"
           <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.updatedate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择修改时间">
+                          v-model="form.confirmationDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择确认时间">
           </el-date-picker>
           </el-date-picker>
         </el-form-item>
         </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" 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="createrCode">-->
+          <!--<el-input v-model="form.createrCode" placeholder="请输入创建人" />-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="创建时间" prop="createdate">-->
+          <!--<el-date-picker clearable size="small" style="width: 200px"-->
+            <!--v-model="form.createdate"-->
+            <!--type="date"-->
+            <!--value-format="yyyy-MM-dd"-->
+            <!--placeholder="选择创建时间">-->
+          <!--</el-date-picker>-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="修改人" prop="updaterCode">-->
+          <!--<el-input v-model="form.updaterCode" placeholder="请输入修改人" />-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="修改时间" prop="updatedate">-->
+          <!--<el-date-picker clearable size="small" style="width: 200px"-->
+            <!--v-model="form.updatedate"-->
+            <!--type="date"-->
+            <!--value-format="yyyy-MM-dd"-->
+            <!--placeholder="选择修改时间">-->
+          <!--</el-date-picker>-->
+        <!--</el-form-item>-->
+        <!--<el-form-item label="部门编号" prop="deptId">-->
+          <!--<el-input v-model="form.deptId" placeholder="请输入部门编号" />-->
+        <!--</el-form-item>-->
         <el-form-item label="备注" prop="remarks">
         <el-form-item label="备注" prop="remarks">
           <el-input v-model="form.remarks" placeholder="请输入备注" />
           <el-input v-model="form.remarks" placeholder="请输入备注" />
         </el-form-item>
         </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-item label="归属部门" prop="deptId">-->
+              <!--<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />-->
+          <!--</el-form-item>-->
       </el-form>
       </el-form>
       <div slot="footer" class="dialog-footer">
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -335,12 +445,14 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { listLighting, getLighting, delLighting, addLighting, updateLighting, exportLighting, importTemplate} from "@/api/pssr/lighting";
+import { listLighting, getLighting, delLighting, addLighting, updateLighting, exportLighting, importTemplate, handleConfirmLighting, handleTurnDownLighting } from "@/api/pssr/lighting";
 import { treeselect } from "@/api/system/dept";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Editor from '@/components/Editor';
 import Editor from '@/components/Editor';
+import {listUserNoPage} from "@/api/system/user";
+import {doApprove} from "@/api/pssr/approve";
 
 
 export default {
 export default {
   dicts:['pssr_approve_status'],
   dicts:['pssr_approve_status'],
@@ -356,9 +468,14 @@ export default {
       type: Number,
       type: Number,
       default: 0
       default: 0
     },
     },
+    lightingType: {
+      type: Number,
+      default: 0
+    },
   },
   },
   data() {
   data() {
     return {
     return {
+      userOptions: [],
       // 遮罩层
       // 遮罩层
       loading: true,
       loading: true,
       // 选中数组
       // 选中数组
@@ -412,12 +529,15 @@ export default {
         updaterCode: null,
         updaterCode: null,
         updatedate: null,
         updatedate: null,
         deptId: null,
         deptId: null,
-        remarks: null
+        remarks: null,
+        lightingType: this.lightingType,
       },
       },
       // 表单参数
       // 表单参数
       form: {},
       form: {},
       // 表单校验
       // 表单校验
       rules: {
       rules: {
+        confirm1: [{required: true, message: "人员不可为空", trigger: "blur"}],
+        confirm2: [{required: true, message: "人员不可为空", trigger: "blur"}],
       }
       }
     };
     };
   },
   },
@@ -434,6 +554,9 @@ export default {
       })
       })
     this.getList();
     this.getList();
     this.getTreeselect();
     this.getTreeselect();
+    listUserNoPage({}).then(res => {
+      this.userOptions = res.data
+    });
   },
   },
   methods: {
   methods: {
     /** 查询照明列表 */
     /** 查询照明列表 */
@@ -474,7 +597,8 @@ export default {
         updaterCode: null,
         updaterCode: null,
         updatedate: null,
         updatedate: null,
         deptId: null,
         deptId: null,
-        remarks: null
+        remarks: null,
+        lightingType: this.lightingType,
       };
       };
       this.resetForm("form");
       this.resetForm("form");
     },
     },
@@ -583,7 +707,54 @@ export default {
       // 提交上传文件
       // 提交上传文件
       submitFileForm() {
       submitFileForm() {
           this.$refs.upload.submit();
           this.$refs.upload.submit();
+      },
+    /** 确认按钮操作*/
+    handleApprove() {
+      doApprove(this.subId).then(res => {
+        this.msgSuccess("已发起确认流程");
+      })
+    },
+    handleConfirmApprove() {
+      let data = {
+        ids: this.ids,
+        subId: this.subId,
+        taskType: this.isApprove,
+        lightingType: this.lightingType,
+      }
+      handleConfirmLighting(data).then(res => {
+        this.msgSuccess("确认成功");
+        this.getList()
+        this.$emit('refreshHisList');
+      })
+    },
+    handleTurnDown(val) {
+      this.$prompt('请输入驳回原因', '提示', {
+        confirmButtonText: '确认驳回',
+        cancelButtonText: '取消',
+      }).then(({value}) => {
+        let data = {
+          ids: this.ids,
+          subId: this.subId,
+          remarks: value,
+          lightingType: this.lightingType,
+        }
+        handleTurnDownLighting(data).then(res => {
+          this.msgSuccess("驳回成功");
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '取消驳回'
+        });
+      });
+    },
+    userFormat(userId) {
+      for (let item of this.userOptions) {
+        if (item.userId == userId) {
+          return item.nickName
+        }
       }
       }
+    },
   }
   }
 };
 };
 </script>
 </script>

+ 8 - 1
ui/src/views/pssr/subitem/index.vue

@@ -133,7 +133,14 @@
       <gasdetector :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
       <gasdetector :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
     </div>
     </div>
     <div v-if="sn=='zmdbr'">
     <div v-if="sn=='zmdbr'">
-      <lighting :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
+      <el-tabs v-model="activeName" @tab-click="handleClick">
+        <el-tab-pane label="照明" name="first">
+          <lighting :sub-id="Number(si)" :is-approve="Number(isApprove)" :lightingType="1" @refreshHisList="refreshHisList"/>
+        </el-tab-pane>
+        <el-tab-pane label="电伴热" name="second">
+          <lighting :sub-id="Number(si)" :is-approve="Number(isApprove)" :lightingType="2" @refreshHisList="refreshHisList"/>
+        </el-tab-pane>
+      </el-tabs>
     </div>
     </div>
     <div v-if="sn=='djsb'">
     <div v-if="sn=='djsb'">
       <motor :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>
       <motor :sub-id="Number(si)" :is-approve="Number(isApprove)" @refreshHisList="refreshHisList"/>