فهرست منبع

LY 特种设备 每週檢查

ly 1 سال پیش
والد
کامیت
1daca7f807
22فایلهای تغییر یافته به همراه2260 افزوده شده و 65 حذف شده
  1. 44 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecDailycheckController.java
  2. 36 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecPersonweekcheckController.java
  3. 21 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecWeekcheckController.java
  4. 43 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/domain/TSpecDailycheck.java
  5. 43 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/domain/TSpecPersonweekcheck.java
  6. 6 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/mapper/TSpecDailycheckMapper.java
  7. 5 0
      master/src/main/java/com/ruoyi/project/sems/safecheck/mapper/TSpecPersonweekcheckMapper.java
  8. 9 8
      master/src/main/java/com/ruoyi/project/sems/safecheck/service/ITSpecDailycheckService.java
  9. 11 0
      master/src/main/java/com/ruoyi/project/system/controller/SysPlantController.java
  10. 54 1
      master/src/main/resources/mybatis/sems/safecheck/TSpecDailycheckMapper.xml
  11. 49 1
      master/src/main/resources/mybatis/sems/safecheck/TSpecPersonweekcheckMapper.xml
  12. BIN
      master/src/main/resources/static/word/sems/check/dailycheck.docx
  13. 25 0
      ui/src/api/sems/safecheck/dailycheck.js
  14. 23 1
      ui/src/api/sems/safecheck/personweekcheck.js
  15. 7 0
      ui/src/api/sems/safecheck/weekcheck.js
  16. 10 0
      ui/src/api/system/plant.js
  17. 36 20
      ui/src/views/approve/approveDetail/semsWeekCheck-detail.vue
  18. 916 0
      ui/src/views/sems/safecheck/agent-dailycheck/index.vue
  19. 623 0
      ui/src/views/sems/safecheck/agent-personweekcheck/index.vue
  20. 155 20
      ui/src/views/sems/safecheck/dailycheck/index.vue
  21. 137 11
      ui/src/views/sems/safecheck/personweekcheck/index.vue
  22. 7 3
      ui/src/views/sems/safecheck/weekcheck/index.vue

+ 44 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecDailycheckController.java

@@ -22,6 +22,8 @@ import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.project.apply.domain.TApplyOfflinevalve;
 import com.ruoyi.project.officeConvert.OfficeConvertController;
+import com.ruoyi.project.sems.safecheck.domain.TSpecPersonweekcheck;
+import com.ruoyi.project.sems.safecheck.mapper.TSpecDailycheckMapper;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.service.ISysUserService;
 import io.jsonwebtoken.lang.Assert;
@@ -55,6 +57,8 @@ public class TSpecDailycheckController extends BaseController {
     private ISysUserService userService;
     @Autowired
     private OfficeConvertController officeConvertController;
+    @Autowired
+    private TSpecDailycheckMapper tSpecDailycheckMapper;
     /**
      * 查询每日安全检查列表
      */
@@ -66,6 +70,20 @@ public class TSpecDailycheckController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询每日安全检查列表
+     */
+    @PreAuthorize("@ss.hasPermi('safecheck:dailycheck:list')")
+    @GetMapping("/myList")
+    public TableDataInfo myList(TSpecDailycheck tSpecDailycheck)
+    {
+        long userId = getUserId();
+        tSpecDailycheck.setCheckerId(userId);
+        startPage();
+        List<TSpecDailycheck> list = tSpecDailycheckMapper.selectMyList(tSpecDailycheck);
+        return getDataTable(list);
+    }
+
     /**
      * 导出每日安全检查列表
      */
@@ -110,6 +128,28 @@ public class TSpecDailycheckController extends BaseController {
         return toAjax(tSpecDailycheckService.updateTSpecDailycheck(tSpecDailycheck));
     }
 
+    /**
+     * 修改每日安全检查
+     */
+    @PreAuthorize("@ss.hasPermi('safecheck:weekcheck:edit')")
+    @Log(title = "每日安全检查确认", businessType = BusinessType.UPDATE)
+    @GetMapping("batchConfirm/{ids}")
+    public AjaxResult batchConfirm(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecDailycheckMapper.batchConfirmByids(ids));
+    }
+
+    /**
+     * 修改每日安全检查
+     */
+    @PreAuthorize("@ss.hasPermi('safecheck:weekcheck:edit')")
+    @Log(title = "每日安全检查确认取消", businessType = BusinessType.UPDATE)
+    @GetMapping("batchCancel/{ids}")
+    public AjaxResult batchCancel(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecDailycheckMapper.batchCancel(ids));
+    }
+
     /**
      * 删除每日安全检查
      */
@@ -235,6 +275,10 @@ public class TSpecDailycheckController extends BaseController {
         } else {
             params.put("checkerName", Texts.of(sysUser.getNickName()).fontSize(10).bold().create());
         }
+        if (!StringUtils.isEmpty(tSpecDailycheck.getAgentName())) {
+            params.put("agentName", Texts.of(" 代 " + tSpecDailycheck.getAgentName()).fontSize(10).bold().create());
+        }
+
         // 渲染文本
         return params;
     }

+ 36 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecPersonweekcheckController.java

@@ -50,6 +50,20 @@ public class TSpecPersonweekcheckController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询每周个人安全检查列表
+     */
+    @PreAuthorize("@ss.hasPermi('safecheck:personweekcheck:list')")
+    @GetMapping("/myList")
+    public TableDataInfo myList(TSpecPersonweekcheck tSpecPersonweekcheck)
+    {
+        long userId = getUserId();
+        tSpecPersonweekcheck.setCheckerId(userId);
+        startPage();
+        List<TSpecPersonweekcheck> list = tSpecPersonweekcheckMapper.selectMyList(tSpecPersonweekcheck);
+        return getDataTable(list);
+    }
+
     /**
      * 查询每周个人安全检查列表
      */
@@ -129,6 +143,28 @@ public class TSpecPersonweekcheckController extends BaseController
         return toAjax(tSpecPersonweekcheckService.updateTSpecPersonweekcheck(tSpecPersonweekcheck));
     }
 
+    /**
+     * 修改每日安全检查
+     */
+    @PreAuthorize("@ss.hasPermi('safecheck:weekcheck:edit')")
+    @Log(title = "每周个人安全检查确认", businessType = BusinessType.UPDATE)
+    @GetMapping("batchConfirm/{ids}")
+    public AjaxResult batchConfirm(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecPersonweekcheckMapper.batchConfirmByids(ids));
+    }
+
+    /**
+     * 修改每日安全检查
+     */
+    @PreAuthorize("@ss.hasPermi('safecheck:weekcheck:edit')")
+    @Log(title = "每周个人安全检查取消", businessType = BusinessType.UPDATE)
+    @GetMapping("batchCancel/{ids}")
+    public AjaxResult batchCancel(@PathVariable Long[] ids)
+    {
+        return toAjax(tSpecPersonweekcheckMapper.batchCancel(ids));
+    }
+
     /**
      * 删除每周个人安全检查
      */

+ 21 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/controller/TSpecWeekcheckController.java

@@ -27,7 +27,10 @@ import com.ruoyi.project.listener.semsWeekCheck.WeekcheckEndFailListener;
 import com.ruoyi.project.listener.semsWeekCheck.WeekcheckEndSuccessListener;
 import com.ruoyi.project.officeConvert.OfficeConvertController;
 import com.ruoyi.project.sems.safecheck.domain.TSpecDailycheck;
+import com.ruoyi.project.system.domain.SysConfig;
 import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.mapper.SysConfigMapper;
+import com.ruoyi.project.system.mapper.SysUserMapper;
 import com.ruoyi.project.system.service.ISysUserService;
 import io.jsonwebtoken.lang.Assert;
 import org.activiti.engine.ProcessEngine;
@@ -49,6 +52,7 @@ import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -74,6 +78,10 @@ public class TSpecWeekcheckController extends BaseController
     private ISysUserService sysUserService;
     @Autowired
     private OfficeConvertController officeConvertController;
+    @Resource
+    private SysConfigMapper configMapper;
+    @Resource
+    private SysUserMapper userMapper;
     /**
      * 查询每周安全排查列表
      */
@@ -86,6 +94,19 @@ public class TSpecWeekcheckController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 根据参数键名查询政府回执
+     */
+    @GetMapping(value = "/getSafeDirUserId")
+    public AjaxResult getSafeDirUserId()
+    {
+        SysConfig config = new SysConfig();
+        config.setConfigKey("sems.weekchek.safedir");
+        SysConfig retConfig = configMapper.selectConfig(config);
+        SysUser sysUser =  userMapper.selectUserByStaffId(retConfig.getConfigValue());
+        return AjaxResult.success(sysUser.getUserId());
+    }
+
     /**
      * 导出每周安全排查列表
      */

+ 43 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/domain/TSpecDailycheck.java

@@ -24,6 +24,8 @@ public class TSpecDailycheck extends BaseEntity
     @Excel(name = "装置名称")
     private String plantCode;
 
+    private String plants;
+
     /** 状态 0 :正常 ;-1:删除 */
     private Long delFlag;
 
@@ -44,6 +46,9 @@ public class TSpecDailycheck extends BaseEntity
     @Excel(name = "检查日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date checkDate;
 
+    @Excel(name = "确认状态", readConverterExp = "0=未确认,1=已确认")
+    private Integer isConfirm;
+
     /** 查询开始日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date startDate;
@@ -93,6 +98,12 @@ public class TSpecDailycheck extends BaseEntity
     @Excel(name = "说明")
     private String explain;
 
+    /** 被代理人id */
+    private Long agentId;
+
+    /** 被代理人 */
+    private String agentName;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -280,6 +291,38 @@ public class TSpecDailycheck extends BaseEntity
         this.endDate = endDate;
     }
 
+    public Integer getIsConfirm() {
+        return isConfirm;
+    }
+
+    public void setIsConfirm(Integer isConfirm) {
+        this.isConfirm = isConfirm;
+    }
+
+    public Long getAgentId() {
+        return agentId;
+    }
+
+    public void setAgentId(Long agentId) {
+        this.agentId = agentId;
+    }
+
+    public String getPlants() {
+        return plants;
+    }
+
+    public void setPlants(String plants) {
+        this.plants = plants;
+    }
+
+    public String getAgentName() {
+        return agentName;
+    }
+
+    public void setAgentName(String agentName) {
+        this.agentName = agentName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 43 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/domain/TSpecPersonweekcheck.java

@@ -24,6 +24,8 @@ public class TSpecPersonweekcheck extends BaseEntity
     @Excel(name = "装置名称")
     private String plantCode;
 
+    private String plants;
+
     /** 状态 0 :正常 ;-1:删除 */
     private Long delFlag;
 
@@ -50,6 +52,9 @@ public class TSpecPersonweekcheck extends BaseEntity
     @Excel(name = "检查日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date checkDate;
 
+    @Excel(name = "确认状态", readConverterExp = "0=未确认,1=已确认")
+    private Integer isConfirm;
+
     /** 查询开始日期 */
     @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
     private Date startDate;
@@ -85,6 +90,12 @@ public class TSpecPersonweekcheck extends BaseEntity
     @Excel(name = "下周工作重点")
     private String nextWeekWork;
 
+    /** 被代理人id */
+    private Long agentId;
+
+    /** 被代理人 */
+    private String agentName;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -236,6 +247,38 @@ public class TSpecPersonweekcheck extends BaseEntity
         this.endDate = endDate;
     }
 
+    public Integer getIsConfirm() {
+        return isConfirm;
+    }
+
+    public void setIsConfirm(Integer isConfirm) {
+        this.isConfirm = isConfirm;
+    }
+
+    public Long getAgentId() {
+        return agentId;
+    }
+
+    public void setAgentId(Long agentId) {
+        this.agentId = agentId;
+    }
+
+    public String getPlants() {
+        return plants;
+    }
+
+    public void setPlants(String plants) {
+        this.plants = plants;
+    }
+
+    public String getAgentName() {
+        return agentName;
+    }
+
+    public void setAgentName(String agentName) {
+        this.agentName = agentName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 6 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/mapper/TSpecDailycheckMapper.java

@@ -61,4 +61,10 @@ public interface TSpecDailycheckMapper
      * @return 结果
      */
     public int deleteTSpecDailycheckByIds(Long[] ids);
+
+    int batchConfirmByids(Long[] ids);
+
+    int batchCancel(Long[] ids);
+
+    List<TSpecDailycheck> selectMyList(TSpecDailycheck tSpecDailycheck);
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/sems/safecheck/mapper/TSpecPersonweekcheckMapper.java

@@ -64,4 +64,9 @@ public interface TSpecPersonweekcheckMapper
     public int deleteTSpecPersonweekcheckByIds(Long[] ids);
 
 
+    int batchConfirmByids(Long[] ids);
+
+    int batchCancel(Long[] ids);
+
+    List<TSpecPersonweekcheck> selectMyList(TSpecPersonweekcheck tSpecPersonweekcheck);
 }

+ 9 - 8
master/src/main/java/com/ruoyi/project/sems/safecheck/service/ITSpecDailycheckService.java

@@ -5,15 +5,15 @@ import com.ruoyi.project.sems.safecheck.domain.TSpecDailycheck;
 
 /**
  * 每日安全检查Service接口
- * 
+ *
  * @author Li
  * @date 2023-08-17
  */
-public interface ITSpecDailycheckService 
+public interface ITSpecDailycheckService
 {
     /**
      * 查询每日安全检查
-     * 
+     *
      * @param id 每日安全检查ID
      * @return 每日安全检查
      */
@@ -21,7 +21,7 @@ public interface ITSpecDailycheckService
 
     /**
      * 查询每日安全检查列表
-     * 
+     *
      * @param tSpecDailycheck 每日安全检查
      * @return 每日安全检查集合
      */
@@ -29,7 +29,7 @@ public interface ITSpecDailycheckService
 
     /**
      * 新增每日安全检查
-     * 
+     *
      * @param tSpecDailycheck 每日安全检查
      * @return 结果
      */
@@ -37,7 +37,7 @@ public interface ITSpecDailycheckService
 
     /**
      * 修改每日安全检查
-     * 
+     *
      * @param tSpecDailycheck 每日安全检查
      * @return 结果
      */
@@ -45,7 +45,7 @@ public interface ITSpecDailycheckService
 
     /**
      * 批量删除每日安全检查
-     * 
+     *
      * @param ids 需要删除的每日安全检查ID
      * @return 结果
      */
@@ -53,9 +53,10 @@ public interface ITSpecDailycheckService
 
     /**
      * 删除每日安全检查信息
-     * 
+     *
      * @param id 每日安全检查ID
      * @return 结果
      */
     public int deleteTSpecDailycheckById(Long id);
+
 }

+ 11 - 0
master/src/main/java/com/ruoyi/project/system/controller/SysPlantController.java

@@ -84,6 +84,17 @@ public class SysPlantController extends BaseController
         return AjaxResult.success(list);
     }
 
+    /**
+     * 查询装置管理列表
+     */
+    @GetMapping("/allList")
+    public AjaxResult allList(SysPlant sysPlant)
+    {
+            List<SysPlant>  list = sysPlantService.selectSysPlantList(sysPlant);
+        return AjaxResult.success(list);
+    }
+
+
     @RequestMapping(value = "unitList")
     public List<SysPlant> unitList(@RequestBody Map<String, Object> params) {
         List plantIds = (List) params.get("plantIds");

+ 54 - 1
master/src/main/resources/mybatis/sems/safecheck/TSpecDailycheckMapper.xml

@@ -23,11 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="cOpinion"    column="c_opinion"    />
         <result property="cOther"    column="c_other"    />
         <result property="explain"    column="explain"    />
+        <result property="isConfirm"    column="is_confirm"    />
+        <result property="agentId"    column="agent_id"    />
     </resultMap>
 
     <sql id="selectTSpecDailycheckVo">
-        select d.id,s.nick_name as checkerName, d.plant_code, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.check_date, d.checker_id, d.c_person, d.c_device, d.c_safety, d.c_env, d.c_gov, d.c_complaint, d.c_opinion, d.c_other, d.explain  from t_spec_dailycheck d
+        select d.id,s.nick_name as checkerName,s1.nick_name as agentName,d.agent_id,d.is_confirm, d.plant_code, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.check_date, d.checker_id, d.c_person, d.c_device, d.c_safety, d.c_env, d.c_gov, d.c_complaint, d.c_opinion, d.c_other, d.explain  from t_spec_dailycheck d
         left join sys_user s on d.checker_id = s.user_id
+        left join sys_user s1 on d.agent_id = s1.user_id
     </sql>
 
     <select id="selectTSpecDailycheckList" parameterType="TSpecDailycheck" resultMap="TSpecDailycheckResult">
@@ -46,6 +49,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cOpinion != null  and cOpinion != ''"> and c_opinion = #{cOpinion}</if>
             <if test="cOther != null  and cOther != ''"> and c_other = #{cOther}</if>
             <if test="explain != null  and explain != ''"> and explain = #{explain}</if>
+            <if test="isConfirm != null  and isConfirm != ''"> and is_confirm = #{isConfirm}</if>
+            <if test="plants != null  and plants != ''">
+                and
+                d.plant_code in
+                <foreach collection="plants.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -53,6 +65,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by d.check_date desc
     </select>
 
+    <select id="selectMyList" parameterType="TSpecDailycheck" resultMap="TSpecDailycheckResult">
+        <include refid="selectTSpecDailycheckVo"/>
+        <where>
+            <if test="plantCode != null  and plantCode != ''"> and plant_code like concat(concat('%',  #{plantCode}), '%')</if>
+            <if test="checkDate != null "> and check_date = #{checkDate}</if>
+            <if test="startDate != null ">and check_date <![CDATA[>=]]> #{startDate}</if>
+            <if test="endDate != null">and check_date <![CDATA[<=]]>#{endDate}</if>
+            <if test="cPerson != null  and cPerson != ''"> and c_person = #{cPerson}</if>
+            <if test="cDevice != null  and cDevice != ''"> and c_device = #{cDevice}</if>
+            <if test="cSafety != null  and cSafety != ''"> and c_safety = #{cSafety}</if>
+            <if test="cEnv != null  and cEnv != ''"> and c_env = #{cEnv}</if>
+            <if test="cGov != null  and cGov != ''"> and c_gov = #{cGov}</if>
+            <if test="cComplaint != null  and cComplaint != ''"> and c_complaint = #{cComplaint}</if>
+            <if test="cOpinion != null  and cOpinion != ''"> and c_opinion = #{cOpinion}</if>
+            <if test="cOther != null  and cOther != ''"> and c_other = #{cOther}</if>
+            <if test="explain != null  and explain != ''"> and explain = #{explain}</if>
+            <if test="isConfirm != null  and isConfirm != ''"> and is_confirm = #{isConfirm}</if>
+            <if test="checkerId != null  and checkerId != ''"> and checker_id = #{checkerId}</if>
+            and d.del_flag = 0 and d.agent_id is not null
+        </where>
+        order by d.check_date desc
+    </select>
+
     <select id="selectTSpecDailycheckById" parameterType="Long" resultMap="TSpecDailycheckResult">
         <include refid="selectTSpecDailycheckVo"/>
         where id = #{id}
@@ -82,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cOpinion != null">c_opinion,</if>
             <if test="cOther != null">c_other,</if>
             <if test="explain != null">explain,</if>
+            <if test="agentId != null">agent_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -102,6 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cOpinion != null">#{cOpinion},</if>
             <if test="cOther != null">#{cOther},</if>
             <if test="explain != null">#{explain},</if>
+            <if test="agentId != null">#{agentId},</if>
          </trim>
     </insert>
 
@@ -125,6 +162,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cOpinion != null">c_opinion = #{cOpinion},</if>
             <if test="cOther != null">c_other = #{cOther},</if>
             <if test="explain != null">explain = #{explain},</if>
+            <if test="agentId != null">agent_id = #{agentId},</if>
         </trim>
         where id = #{id}
     </update>
@@ -140,4 +178,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </update>
 
+    <update id="batchConfirmByids" parameterType="String">
+        update t_spec_dailycheck set is_confirm = 1 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <update id="batchCancel" parameterType="String">
+        update t_spec_dailycheck set is_confirm = 0 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+
 </mapper>

+ 49 - 1
master/src/main/resources/mybatis/sems/safecheck/TSpecPersonweekcheckMapper.xml

@@ -19,11 +19,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="thisWeekRisk"    column="this_week_risk"    />
         <result property="safeCondition"    column="safe_condition"    />
         <result property="nextWeekWork"    column="next_week_work"    />
+        <result property="isConfirm"    column="is_confirm"    />
+        <result property="agentId"    column="agent_id"    />
     </resultMap>
 
     <sql id="selectTSpecPersonweekcheckVo">
-        select d.id,s.nick_name as checkerName, d.plant_code, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.check_date, d.checker_id, d.week_no, d.last_week_risk, d.this_week_risk, d.safe_condition, d.next_week_work from t_spec_personweekcheck d
+        select d.id,s.nick_name as checkerName, d.agent_id,s1.nick_name as agentName,d.plant_code,d.is_confirm, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.check_date, d.checker_id, d.week_no, d.last_week_risk, d.this_week_risk, d.safe_condition, d.next_week_work from t_spec_personweekcheck d
           left join sys_user s on d.checker_id = s.user_id
+          left join sys_user s1 on d.agent_id = s1.user_id
     </sql>
 
     <select id="selectTSpecPersonweekcheckList" parameterType="TSpecPersonweekcheck" resultMap="TSpecPersonweekcheckResult">
@@ -38,6 +41,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="thisWeekRisk != null  and thisWeekRisk != ''"> and this_week_risk = #{thisWeekRisk}</if>
             <if test="safeCondition != null  and safeCondition != ''"> and safe_condition = #{safeCondition}</if>
             <if test="nextWeekWork != null  and nextWeekWork != ''"> and next_week_work = #{nextWeekWork}</if>
+            <if test="isConfirm != null  and isConfirm != ''"> and is_confirm = #{isConfirm}</if>
+            <if test="plants != null  and plants != ''">
+                and
+                d.plant_code in
+                <foreach collection="plants.split(',')" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
             and d.del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
@@ -45,6 +57,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by d.check_date desc
     </select>
 
+    <select id="selectMyList" parameterType="TSpecPersonweekcheck" resultMap="TSpecPersonweekcheckResult">
+        <include refid="selectTSpecPersonweekcheckVo"/>
+        <where>
+            <if test="plantCode != null  and plantCode != ''"> and plant_code like concat(concat('%',  #{plantCode}), '%')</if>
+            <if test="startDate != null ">and check_date <![CDATA[>=]]> #{startDate}</if>
+            <if test="endDate != null">and check_date <![CDATA[<=]]>#{endDate}</if>
+            <if test="weekNo != null  and weekNo != ''"> and week_no = #{weekNo}</if>
+            <if test="checkDate != null "> and check_date = #{checkDate}</if>
+            <if test="lastWeekRisk != null  and lastWeekRisk != ''"> and last_week_risk = #{lastWeekRisk}</if>
+            <if test="thisWeekRisk != null  and thisWeekRisk != ''"> and this_week_risk = #{thisWeekRisk}</if>
+            <if test="safeCondition != null  and safeCondition != ''"> and safe_condition = #{safeCondition}</if>
+            <if test="nextWeekWork != null  and nextWeekWork != ''"> and next_week_work = #{nextWeekWork}</if>
+            <if test="isConfirm != null  and isConfirm != ''"> and is_confirm = #{isConfirm}</if>
+            <if test="checkerId != null  and checkerId != ''"> and checker_id = #{checkerId}</if>
+            and d.del_flag = 0 and d.agent_id is not null
+        </where>
+        order by d.check_date desc
+    </select>
+
     <select id="selectTSpecPersonweekcheckListByWeek" parameterType="TSpecPersonweekcheck" resultMap="TSpecPersonweekcheckResult">
         <include refid="selectTSpecPersonweekcheckVo"/>
         <where>
@@ -79,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="thisWeekRisk != null">this_week_risk,</if>
             <if test="safeCondition != null">safe_condition,</if>
             <if test="nextWeekWork != null">next_week_work,</if>
+            <if test="agentId != null">agent_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -95,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="thisWeekRisk != null">#{thisWeekRisk},</if>
             <if test="safeCondition != null">#{safeCondition},</if>
             <if test="nextWeekWork != null">#{nextWeekWork},</if>
+            <if test="agentId != null">#{agentId},</if>
          </trim>
     </insert>
 
@@ -114,6 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="thisWeekRisk != null">this_week_risk = #{thisWeekRisk},</if>
             <if test="safeCondition != null">safe_condition = #{safeCondition},</if>
             <if test="nextWeekWork != null">next_week_work = #{nextWeekWork},</if>
+            <if test="agentId != null">agent_id = #{agentId},</if>
         </trim>
         where id = #{id}
     </update>
@@ -129,4 +163,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </update>
 
+    <update id="batchConfirmByids" parameterType="String">
+        update t_spec_personweekcheck set is_confirm = 1 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <update id="batchCancel" parameterType="String">
+        update t_spec_personweekcheck set is_confirm = 0 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
 </mapper>

BIN
master/src/main/resources/static/word/sems/check/dailycheck.docx


+ 25 - 0
ui/src/api/sems/safecheck/dailycheck.js

@@ -9,6 +9,15 @@ export function listDailycheck(query) {
   })
 }
 
+// 查询每日安全检查列表
+export function myListDailycheck(query) {
+  return request({
+    url: '/safecheck/dailycheck/myList',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询每日安全检查详细
 export function getDailycheck(id) {
   return request({
@@ -69,3 +78,19 @@ export function wordView(id) {
     method: 'get',
   })
 }
+
+// 批量确认
+export function batchConfirm(id) {
+  return request({
+    url: '/safecheck/dailycheck/batchConfirm/' + id,
+    method: 'get'
+  })
+}
+
+// 批量确认
+export function batchCancel(id) {
+  return request({
+    url: '/safecheck/dailycheck/batchCancel/' + id,
+    method: 'get'
+  })
+}

+ 23 - 1
ui/src/api/sems/safecheck/personweekcheck.js

@@ -9,7 +9,14 @@ export function listPersonweekcheck(query) {
   })
 }
 
-
+// 查询每周个人安全检查列表
+export function myListPersonweekcheck(query) {
+  return request({
+    url: '/safecheck/personweekcheck/myList',
+    method: 'get',
+    params: query
+  })
+}
 
 // 查询每周个人安全检查详细
 export function getPersonweekcheck(id) {
@@ -53,3 +60,18 @@ export function exportPersonweekcheck(query) {
     params: query
   })
 }
+// 批量确认
+export function batchConfirm(id) {
+  return request({
+    url: '/safecheck/personweekcheck/batchConfirm/' + id,
+    method: 'get'
+  })
+}
+
+// 批量确认
+export function batchCancel(id) {
+  return request({
+    url: '/safecheck/personweekcheck/batchCancel/' + id,
+    method: 'get'
+  })
+}

+ 7 - 0
ui/src/api/sems/safecheck/weekcheck.js

@@ -76,3 +76,10 @@ export function handle(data) {
     data: data
   })
 }
+// 查询安全总监
+export function getSafeDirUserId() {
+  return request({
+    url: '/safecheck/weekcheck/getSafeDirUserId',
+    method: 'get'
+  })
+}

+ 10 - 0
ui/src/api/system/plant.js

@@ -26,6 +26,16 @@ export function mylistPlant(query) {
   })
 }
 
+// 查询装置管理列表
+export function alllistPlant(query) {
+  return request({
+    url: '/system/plant/allList',
+    method: 'get',
+    params: query
+  })
+}
+
+
 // 查询装置管理列表
 export function listUnit(data) {
   return request({

+ 36 - 20
ui/src/views/approve/approveDetail/semsWeekCheck-detail.vue

@@ -9,6 +9,7 @@
         <el-col :span="12">
           <el-form-item  label-width="150px" label="检查日期" prop="checkDate">
             <el-date-picker clearable size="small" style="width: 200px"
+                            :disabled="true"
                             v-model="dataForm.checkDate"
                             type="date"
                             value-format="yyyy-MM-dd"
@@ -18,35 +19,45 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label-width="150px" label="周" prop="weekNo">
-            <el-input v-model="dataForm.weekNo" placeholder="请输入周" />
+            <el-input v-model="dataForm.weekNo" placeholder="请输入周" :disabled="true"/>
           </el-form-item>
         </el-col>
       </el-row>
 
       <el-form-item label-width="150px" label="上周安全风险隐患问题整改核实情况" prop="lastWeekRisk">
-        <el-input v-model="dataForm.lastWeekRisk" type="textarea" placeholder="请输入内容" />
+        <el-input v-model="dataForm.lastWeekRisk" type="textarea" placeholder="请输入内容" :disabled="true"/>
       </el-form-item>
       <el-form-item label-width="150px" label="本周主要安全风险隐患和整改情况" prop="thisWeekRisk">
-        <el-input v-model="dataForm.thisWeekRisk" type="textarea" placeholder="请输入内容" />
+        <el-input v-model="dataForm.thisWeekRisk" type="textarea" placeholder="请输入内容" :disabled="true"/>
       </el-form-item>
       <el-form-item label-width="150px" label="本周安全管理情况评价">
-        <el-radio-group v-model="dataForm.safeCondition">
+        <el-radio-group v-model="dataForm.safeCondition" :disabled="true">
           <el-radio label="安全风险可控,无较大(质量)安全风险隐患">安全风险可控,无较大(质量)安全风险隐患</el-radio>
           <el-radio label="存在安全风险隐患,需尽快采取防范措施">存在安全风险隐患,需尽快采取防范措施</el-radio>
         </el-radio-group>
       </el-form-item>
       <el-form-item label-width="150px" label="下周工作重点" prop="nextWeekWork">
-        <el-input v-model="dataForm.nextWeekWork" type="textarea" placeholder="请输入内容" />
+        <el-input v-model="dataForm.nextWeekWork" type="textarea" placeholder="请输入内容" :disabled="true" />
       </el-form-item>
       <el-form-item label-width="150px" label="安全管理员" prop="safeAdminId">
-        <el-input v-model="dataForm.safeAdminName" placeholder="请输入安全管理员" />
+        <el-input v-model="dataForm.safeAdminName" placeholder="请输入安全管理员" :disabled="true" />
       </el-form-item>
       <el-form-item label-width="150px" label="安全管理员意见" prop="safeAdminSug">
-        <el-input v-model="dataForm.safeAdminSug" type="textarea" placeholder="请输入内容" />
+        <el-input v-model="dataForm.safeAdminSug" type="textarea" placeholder="请输入内容" :disabled="true" />
       </el-form-item>
       <el-form-item label-width="150px" label="安全总监" prop="safeDirId">
-        <el-input v-model="dataForm.safeDirName" placeholder="请输入安全总监" />
+        <el-input v-model="dataForm.safeDirName" placeholder="请输入安全总监" :disabled="true" />
       </el-form-item>
+      <div style="margin-bottom: 20px">
+        <span>{{$t('流转详情')}}</span>
+        <el-table :data="historyList" border v-loading="historyLoading" style="width: 100%;">
+          <el-table-column prop="taskName" header-align="center" align="center" :label="$t('流程进度')"></el-table-column>
+          <el-table-column prop="userName" header-align="center" align="center" :label="$t('姓名')"></el-table-column>
+          <el-table-column prop="taskCreateTime" header-align="center" align="center" :label="$t('开始时间')"></el-table-column>
+          <el-table-column prop="taskEndTime" header-align="center" align="center" :label="$t('结束时间')"></el-table-column>
+          <el-table-column prop="comment" header-align="center" align="center" :label="$t('审批意见')"></el-table-column>
+        </el-table>
+      </div>
       <el-form-item label-width="150px" label="安全总监意见" prop="safeDirSug">
         <el-input v-model="dataForm.safeDirSug" type="textarea" placeholder="请输入内容" />
       </el-form-item>
@@ -60,16 +71,7 @@
       <el-button v-if="!this.taskForm.taskId == ''" type="primary" @click="dataFormSubmit(1)" :disabled="submitDisabled">{{$t('通过')}}</el-button>
       <el-button v-if="!this.taskForm.taskId == ''" type="danger" @click="dataFormSubmit(0)" :disabled="submitDisabled">{{$t('拒绝')}}</el-button>
     </span>
-    <div>
-      <span>{{$t('流转详情')}}</span>
-      <el-table :data="historyList" border v-loading="historyLoading" style="width: 100%;">
-        <el-table-column prop="taskName" header-align="center" align="center" :label="$t('流程进度')"></el-table-column>
-        <el-table-column prop="userName" header-align="center" align="center" :label="$t('姓名')"></el-table-column>
-        <el-table-column prop="taskCreateTime" header-align="center" align="center" :label="$t('开始时间')"></el-table-column>
-        <el-table-column prop="taskEndTime" header-align="center" align="center" :label="$t('结束时间')"></el-table-column>
-        <el-table-column prop="comment" header-align="center" align="center" :label="$t('审批意见')"></el-table-column>
-      </el-table>
-    </div>
+
   </el-dialog>
 </template>
 
@@ -187,7 +189,7 @@ export default {
       getWeekcheck(id).then(response => {
         this.dataForm = response.data;
         if (!this.dataForm.safeDirSug) {
-          this.dataForm.safeDirSug = '已阅'
+          this.dataForm.safeDirSug = '同意'
         }
       });
     },
@@ -251,6 +253,20 @@ export default {
 
 </script>
 
-<style scoped>
+<style>
+.el-textarea.is-disabled .el-textarea__inner {
+  color: #404040;
+}
+.el-input.is-disabled .el-input__inner {
+  color: #404040;
+}
+
+.el-radio__input.is-disabled.is-checked .el-radio__inner {
+  background-color: #404040;
+  border-color: #404040;
+}
+.el-radio__input.is-disabled + span.el-radio__label {
+  color: #404040;
+}
 
 </style>

+ 916 - 0
ui/src/views/sems/safecheck/agent-dailycheck/index.vue

@@ -0,0 +1,916 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="装置名称" prop="plantCode">
+        <el-input
+          v-model="queryParams.plantCode"
+          placeholder="请输入装置名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="检查日期" prop="checkDate">
+        <el-date-picker
+          v-model="chooseDate"
+          @change="handleQuery"
+          type="daterange"
+          style="width: 508px"
+          align="right"
+          unlink-panels
+          :range-separator="$t('至')"
+          :start-placeholder="$t('开始日期')"
+          :end-placeholder="$t('结束日期')"
+          value-format="yyyy-MM-dd"
+          :picker-options="pickerOptions">
+        </el-date-picker>
+      </el-form-item>
+<!--      <el-form-item label="人员" prop="cPerson">-->
+<!--        <el-select v-model="queryParams.cPerson" placeholder="请选择人员" clearable size="small">-->
+<!--          <el-option label="请选择字典生成" value=""/>-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="设备本体" prop="cDevice">-->
+<!--        <el-select v-model="queryParams.cDevice" placeholder="请选择设备本体" clearable size="small">-->
+<!--          <el-option label="√" value="√"/>-->
+<!--          <el-option label="×" value="×"/>-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['safecheck:dailycheck: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="['safecheck:dailycheck: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="['safecheck:dailycheck:remove']"
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+        >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-download"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDownload"
+        >批量下载Word
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-download"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDownloadPdf"
+        >批量下载PDF
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchConfirm"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >批量确认</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchCancel"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >取消确认</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="dailycheckList" @selection-change="handleSelectionChange"
+              :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="装置名称" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
+      <el-table-column label="检查日期" align="center" prop="checkDate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="状态" align="center" prop="isConfirm" :show-overflow-tooltip="true" :formatter="isConfirmFormat"/>
+      <el-table-column label="安全员" align="center" prop="checkerName" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.agentId">{{ scope.row.checkerName}} 代 {{ scope.row.agentName}}</span>
+          <span v-else>{{ scope.row.checkerName}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="人员" align="center" prop="cPerson" :show-overflow-tooltip="true" :formatter="itemFormat">
+
+      </el-table-column>
+      <el-table-column label="设备本体" align="center" prop="cDevice" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="安全附件或安全保护装置" align="center" prop="cSafety" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="政府监督、通报、预警" align="center" prop="cGov" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="投诉举报" align="center" prop="cComplaint" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="舆情信息" align="center" prop="cOpinion" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="其他" align="center" prop="cOther" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="说明" align="center" prop="explain" :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
+            v-if="scope.row.isConfirm == 0"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['safecheck:dailycheck:edit']"
+          >修改
+          </el-button>
+          <el-button
+            v-if="scope.row.isConfirm == 0"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['safecheck:dailycheck:remove']"
+          >删除
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document"
+            @click="wordView(scope.row)"
+          >预览
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document"
+            @click="handleDoc(scope.row)"
+          >附件
+          </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"
+    />
+
+    <!-- 添加或修改每日安全检查对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item :label="$t('装置')" prop="plantCode">
+          <el-select v-model="form.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable size="small"
+          >
+            <el-option
+              v-for="dict in plantOptions"
+              :key="dict.name"
+              :label="dict.name"
+              :value="dict.name"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="检查日期" prop="checkDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.checkDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择检查日期">
+          </el-date-picker>
+        </el-form-item>
+        <div class="checklist-table">
+          <table cellpadding="10" cellspacing="0" border="1" style="width:100%">
+            <tr>
+              <th>序号</th>
+              <th>检查项目</th>
+              <th>检查内容</th>
+              <th>检查结果</th>
+            </tr>
+            <tr>
+              <td>1</td>
+              <td>人员</td>
+              <td>按检查项目细化,如:人员配备、违章作业、安全教育等</td>
+              <td>
+                <el-radio-group v-model="form.cPerson">
+                  <el-radio label="√">√</el-radio>
+                  <el-radio label="×">X</el-radio>
+                </el-radio-group>
+              </td>
+            </tr>
+            <tr>
+              <td>2</td>
+              <td>设备本体</td>
+              <td>设备定期检验、自行检查、设备本体有无事故隐患等</td>
+              <td style="width: 150px;">
+                <div class="radio-group-horizontal">
+                  <el-radio-group v-model="form.cDevice">
+                    <el-radio label="√">√</el-radio>
+                    <el-radio label="×">X</el-radio>
+                  </el-radio-group>
+                </div>
+              </td>
+            </tr>
+            <tr>
+              <td>3</td>
+              <td>安全附件或安全保护装置</td>
+              <td>安全阀、爆破片等</td>
+              <td>
+                <el-radio-group v-model="form.cSafety">
+                  <el-radio label="√">√</el-radio>
+                  <el-radio label="×">X</el-radio>
+                </el-radio-group>
+              </td>
+            </tr>
+            <tr>
+              <td>5</td>
+              <td>政府监督、通报、预警</td>
+              <td>发现不合格项</td>
+              <td>
+                <el-radio-group v-model="form.cGov">
+                  <el-radio label="√">√</el-radio>
+                  <el-radio label="×">X</el-radio>
+                </el-radio-group>
+              </td>
+            </tr>
+            <tr>
+              <td>6</td>
+              <td>投诉举报</td>
+              <td>发现不合格项</td>
+              <td>
+                <el-radio-group v-model="form.cComplaint">
+                  <el-radio label="√">√</el-radio>
+                  <el-radio label="×">X</el-radio>
+                </el-radio-group>
+              </td>
+            </tr>
+            <tr>
+              <td>7</td>
+              <td>舆情信息</td>
+              <td>发现不合格项</td>
+              <td>
+                <el-radio-group v-model="form.cOpinion">
+                  <el-radio label="√">√</el-radio>
+                  <el-radio label="×">X</el-radio>
+                </el-radio-group>
+              </td>
+            </tr>
+            <tr>
+              <td>8</td>
+              <td>其它</td>
+              <td>锅炉、压力容器、压力管道、电梯、起重机械场车六大类特种设备可能危及安全的其它情况</td>
+              <td>
+                <el-radio-group v-model="form.cOther">
+                  <el-radio label="√">√</el-radio>
+                  <el-radio label="×">X</el-radio>
+                </el-radio-group>
+              </td>
+            </tr>
+            <tr>
+              <!--            <td colspan="4">-->
+              <!--              不合格情况说明及采取的防范措施:-->
+              <!--              <el-form-item label="不合格情况说明及采取的防范措施:" prop="explain">-->
+              <!--                <el-input v-model="form.explain" type="textarea" placeholder="请输入内容" />-->
+              <!--              </el-form-item>-->
+              <!--            </td>-->
+            </tr>
+          </table>
+        </div>
+        <el-form-item label="不合格情况说明及采取的防范措施" prop="explain">
+          <el-input v-model="form.explain" :rows="5" type="textarea" placeholder="请输入内容"/>
+        </el-form-item>
+        <el-form-item  label="被代理人" prop="agentId">
+          <el-select v-model="form.agentId" filterable placeholder="被代理人">
+            <el-option
+              v-for="item in userOption"
+              :key="item.userId"
+              :label="item.nickName"
+              :value="item.userId"
+            >
+            </el-option>
+          </el-select>
+        </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-dialog :close-on-click-modal="false" v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)"
+               v-dialogDrag :title="pdf.title"
+               :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
+      <div style="margin-top: -60px;float: right;margin-right: 40px;">
+        <el-button size="mini" type="text" @click="openPdf">{{ $t('新页面打开PDF') }}</el-button>
+      </div>
+      <div style="margin-top: -30px">
+        <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
+                v-if="ppt"></iframe>
+      </div>
+      <div style="padding: 30px; width: 100%; height: 100%;">
+        <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
+                     height="700px" trigger="click" :autoplay="false" indicator-position="outside">
+          <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item">
+            <img :src="item" width="100%" height="100%" object-fit="cover"/>
+          </el-carousel-item>
+        </el-carousel>
+      </div>
+    </el-dialog>
+    <form ref="downloadForm2" :action="downloadWordAction" target="FORMSUBMIT">
+      <input name="id" v-model="downloadForm2.id" hidden/>
+    </form>
+    <form ref="downloadFormPdf" :action="downloadWordActionPdf" target="FORMSUBMIT">
+      <input name="id" v-model="downloadFormPdf.id" hidden/>
+    </form>
+    <Attachment ref="childRef"></Attachment>
+  </div>
+</template>
+
+<script>
+import {
+  wordView,
+  batchConfirm,
+  myListDailycheck,
+  getDailycheck,
+  delDailycheck,
+  addDailycheck,
+  updateDailycheck,
+  exportDailycheck,
+  importTemplate, batchCancel
+} from "@/api/sems/safecheck/dailycheck";
+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 {alllistPlant} from "@/api/system/plant";
+import Attachment from '@/views/components/file/attachment.vue'
+import {listPostUser} from "@/api/system/user";
+
+export default {
+  name: "Dailycheck",
+  components: {Treeselect,Attachment},
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      dataListSelections: [],
+      userOption: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 每日安全检查表格数据
+      dailycheckList: [],
+      // 弹出层标题
+      title: "",
+      pptView: false,
+      ppt: false,
+      loadingFlash: false,
+      // 部门树选项
+      deptOptions: undefined,
+      plantOptions: [],
+      clientHeight: 300,
+      // 是否显示弹出层
+      open: false,
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/safecheck/dailycheck/importData"
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        plantCode: null,
+        checkDate: null,
+        cPerson: null,
+        cDevice: null,
+        cSafety: null,
+        cEnv: null,
+        cGov: null,
+        cComplaint: null,
+        cOpinion: null,
+        cOther: null,
+        explain: null
+      },
+      //日期快速选择
+      pickerOptions: {
+        shortcuts: [{
+          text: this.$t('最近一周'),
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: this.$t('最近一个月'),
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: this.$t('最近三个月'),
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+            picker.$emit('pick', [start, end]);
+          }
+        }]
+      },
+      //日期选择器
+      chooseDate: [],
+      // 表单参数
+      form: {},
+      downloadForm2: {
+        id: '',
+      },
+      downloadWordAction: process.env.VUE_APP_BASE_API + '/safecheck/dailycheck/downloadDailycheck',
+      downloadFormPdf: {
+        id: '',
+      },
+      downloadWordActionPdf: process.env.VUE_APP_BASE_API + '/safecheck/dailycheck/downloadDailycheckPdf',
+      // 表单校验
+      rules: {
+        plantCode: [
+          {required: true, message: "装置名称不能为空", trigger: "blur"}
+        ],
+      }
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
+  created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = document.body.clientHeight - 250
+    })
+    this.getList();
+    this.getTreeselect();
+    let plantParams = {
+      pType: 1
+    }
+    alllistPlant(plantParams).then(response => {
+      this.plantOptions = response.data;
+    });
+    listPostUser(this.queryParams).then(response => {
+      this.userOption = response;
+    });
+  },
+  methods: {
+    /** 查询每日安全检查列表 */
+    getList() {
+      this.loading = true;
+      myListDailycheck(this.queryParams).then(response => {
+        this.dailycheckList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 字典翻译
+    isConfirmFormat(row, column) {
+      let type = 'info';
+      if (row.isConfirm == 0) {
+        let s = '未确认'
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+      if (row.isConfirm == 1) {
+        let s = '已确认'
+        type = 'success';
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+    },
+    itemFormat(row, column, cellValue, index) {
+      let type = 'danger';
+      if (cellValue == '×') {
+        return <el-tag type={type}>{cellValue}</el-tag>;
+      }
+        return cellValue;
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        plantCode: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        checkDate: null,
+        checkerId: null,
+        cPerson: "0",
+        cDevice: "0",
+        cSafety: "0",
+        cEnv: "0",
+        cGov: "0",
+        cComplaint: "0",
+        cOpinion: "0",
+        cOther: "0",
+        explain: null,
+        agentId: null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      if (this.chooseDate == null) {
+        this.chooseDate = []
+      }
+      this.queryParams.startDate = this.chooseDate[0]
+      this.queryParams.endDate = this.chooseDate[1]
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.chooseDate = "";
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+      this.dataListSelections = selection
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加每日安全检查";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法修改", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
+      getDailycheck(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改每日安全检查";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateDailycheck(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDailycheck(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法删除", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
+
+      this.$confirm('是否确认删除?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delDailycheck(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      })
+    },
+    handleDownload() {
+      const ids = this.ids;
+      this.downloadForm2.id = ids.join(',')
+      this.$nextTick(() => {
+        this.$refs['downloadForm2'].submit()
+      })
+    },
+    handleDownloadPdf() {
+      const ids = this.ids;
+      this.downloadFormPdf.id = ids.join(',')
+      this.$nextTick(() => {
+        this.$refs['downloadFormPdf'].submit()
+      })
+
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有每日安全检查数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportDailycheck(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();
+    },
+    wordView(row) {
+      wordView(row.id).then(response => {
+        console.log(response.msg)
+        this.handleSee("每日检查记录", response.msg)
+      });
+    },
+    handleSee(fileName, url) {
+      //office预览
+      this.loadingFlash = true
+      this.pdf.open = true
+      this.pdf.title = fileName
+      this.pdf.pdfUrl = ""
+      this.pptView = false
+      this.ppt = true
+      //如果是PDF等直接可以打开的就不调接口,否则调用接口
+      if (fileName.endsWith('pdf')) {
+        this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + url
+        this.loadingFlash = false
+      } else {
+        const formatDate = new FormData();
+        formatDate.append("filepath", url)
+        //调用文件预览api
+        let res = this.officeConvert.bookConvertCommon(formatDate)
+        //查看接受全局方法的返回结果 console.log(res)
+        //利用.then方法接受Promise对象
+        res.then((result) => {
+          //关闭加载中
+          this.loadingFlash = false
+          if (result.msg.includes("csv")) {
+            this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
+            this.$alert(result.msg, this.$t('检查乱码'), {dangerouslyUseHTMLString: true});
+            //    this.$message({message: result.msg, center: true,type:'warning',  offset:400, });
+          } else if (result.msg.includes("不存在")) {
+            //文件不存在时提示
+            this.pdf.pdfUrl = ""
+            this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
+            //    this.$message({message: result.msg, center: true,type:'warning',  offset:400, });
+            this.pdf.open = false
+          } else if (result.msg.includes("不支持此格式")) {
+            this.pdf.pdfUrl = ""
+            this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
+            //    this.$message({message: result.msg, center: true,type:'warning',  offset:400, });
+            this.pdf.open = false
+          } else {
+            //成功时直接给地址
+            this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
+          }
+        }).catch(result => {
+          //请求失败,关闭loading,pdf地址直接为为空,不显示
+          this.pdf.pdfUrl = ""
+          this.loadingFlash = false;
+        })
+      }
+    },
+    //文件预览
+    openPdf() {
+      //ppt就跳路由预览,office就直接打开文件新页面
+      const didi = {imgs: this.imgs}
+      if (this.pptView == true && this.ppt == false) {
+        let routeUrl = this.$router.resolve({
+          path: "/cpms/index.html#/pptyulan",
+          query: didi
+        });
+        window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
+        console.log(this.imgs)
+      } else {
+        window.open(this.pdf.pdfUrl)
+      }
+    },
+    /** 报告附件按钮操作 */
+    handleDoc(row) {
+      // 通过ref引用子组件
+      const child = this.$refs.childRef;
+      // 调用子组件的方法并传递参数
+      child.handleDoc(row , 'dailycheck');
+    },
+    /** 批量按钮操作 */
+    handleBatchConfirm(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchConfirm(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+    /** 批量按钮操作 */
+    handleBatchCancel(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否取消确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchCancel(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+  }
+};
+</script>
+<style scoped>
+
+.checklist-table {
+  margin-top: 20px;
+  margin-bottom: 20px;
+}
+
+.checklist-table table {
+  width: 100%;
+  border-collapse: collapse;
+}
+
+.checklist-table th,
+.checklist-table td {
+  padding: 10px;
+  border: 1px solid #ccc;
+  text-align: center;
+}
+
+.checklist-table th {
+  background-color: #f5f5f5;
+}
+
+.radio-group-horizontal {
+  display: flex;
+  justify-content: space-around;
+  align-items: center;
+}
+</style>

+ 623 - 0
ui/src/views/sems/safecheck/agent-personweekcheck/index.vue

@@ -0,0 +1,623 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="装置名称" prop="plantCode">
+        <el-input
+          v-model="queryParams.plantCode"
+          placeholder="请输入装置名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="检查日期" prop="checkDate">
+        <el-date-picker
+          v-model="chooseDate"
+          @change="handleQuery"
+          type="daterange"
+          style="width: 508px"
+          align="right"
+          unlink-panels
+          :range-separator="$t('至')"
+          :start-placeholder="$t('开始日期')"
+          :end-placeholder="$t('结束日期')"
+          value-format="yyyy-MM-dd"
+          :picker-options="pickerOptions">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="周" prop="weekNo">
+        <el-input
+          v-model="queryParams.weekNo"
+          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="['safecheck:personweekcheck: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="['safecheck:personweekcheck: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="['safecheck:personweekcheck:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['safecheck:personweekcheck:export']"
+        >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchConfirm"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >批量确认</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchCancel"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >取消确认</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="personweekcheckList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="装置名称" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
+      <el-table-column label="检查日期" align="center" prop="checkDate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="安全员" align="center" prop="checkerName" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.agentId">{{ scope.row.checkerName}} 代 {{ scope.row.agentName}}</span>
+          <span v-else>{{ scope.row.checkerName}}</span>
+        </template>
+      </el-table-column>      <el-table-column label="周" align="center" prop="weekNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="isConfirm" :show-overflow-tooltip="true" :formatter="isConfirmFormat"/>
+      <el-table-column label="上周安全风险隐患问题整改核实情况" align="center" prop="lastWeekRisk" :show-overflow-tooltip="true"/>
+      <el-table-column label="本周主要安全风险隐患和整改情况" align="center" prop="thisWeekRisk" :show-overflow-tooltip="true"/>
+      <el-table-column label="本周安全管理情况评价" align="center" prop="safeCondition" :show-overflow-tooltip="true"/>
+      <el-table-column label="下周工作重点" align="center" prop="nextWeekWork" :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
+            v-if="scope.row.isConfirm == 0"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['safecheck:personweekcheck:edit']"
+          >修改</el-button>
+          <el-button
+            v-if="scope.row.isConfirm == 0"
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['safecheck:personweekcheck:remove']"
+          >删除</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-document"
+            @click="handleDoc(scope.row)"
+          >附件
+          </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"
+    />
+
+    <!-- 添加或修改每周个人安全检查对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="150px">
+        <el-form-item label="装置名称" prop="plantCode">
+          <el-select v-model="form.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable size="small"
+          >
+            <el-option
+              v-for="dict in plantOptions"
+              :key="dict.name"
+              :label="dict.name"
+              :value="dict.name"
+            />
+          </el-select>
+        </el-form-item>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item  label-width="150px" label="检查日期" prop="checkDate">
+              <el-date-picker clearable size="small" style="width: 200px" @change="calculateWeekNumber"
+                              v-model="form.checkDate"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              placeholder="选择检查日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label-width="150px" label="周" prop="weekNo">
+              <el-input v-model="form.weekNo" placeholder="请输入周" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="上周安全风险隐患问题整改核实情况" prop="lastWeekRisk">
+          <el-input v-model="form.lastWeekRisk" placeholder="请输入上周安全风险隐患问题整改核实情况" />
+        </el-form-item>
+        <el-form-item label="本周主要安全风险隐患和整改情况" prop="thisWeekRisk">
+          <el-input v-model="form.thisWeekRisk" placeholder="请输入本周主要安全风险隐患和整改情况" />
+        </el-form-item>
+        <el-form-item label="本周安全管理情况评价" prop="safeCondition">
+          <el-radio-group v-model="form.safeCondition">
+            <el-radio label="安全风险可控,无较大(质量)安全风险隐患">安全风险可控,无较大(质量)安全风险隐患</el-radio>
+            <el-radio label="存在安全风险隐患,需尽快采取防范措施">存在安全风险隐患,需尽快采取防范措施</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="下周工作重点" prop="nextWeekWork">
+          <el-input v-model="form.nextWeekWork" placeholder="请输入下周工作重点" />
+        </el-form-item>
+        <el-form-item  label="被代理人" prop="agentId">
+          <el-select v-model="form.agentId" filterable placeholder="被代理人">
+            <el-option
+              v-for="item in userOption"
+              :key="item.userId"
+              :label="item.nickName"
+              :value="item.userId"
+            >
+            </el-option>
+          </el-select>
+        </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>
+    <Attachment ref="childRef"></Attachment>
+  </div>
+</template>
+
+<script>
+import { batchCancel, batchConfirm,myListPersonweekcheck, getPersonweekcheck, delPersonweekcheck, addPersonweekcheck, updatePersonweekcheck, exportPersonweekcheck, importTemplate} from "@/api/sems/safecheck/personweekcheck";
+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 {alllistPlant, mylistPlant} from "@/api/system/plant";
+import Attachment from '@/views/components/file/attachment.vue'
+import {listPostUser} from "@/api/system/user";
+
+export default {
+  name: "Personweekcheck",
+  components: { Treeselect,Attachment },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      dataListSelections: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // 每周个人安全检查表格数据
+      personweekcheckList: [],
+      userOption: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      plantOptions: [],
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/safecheck/personweekcheck/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        plantCode: null,
+        checkDate: null,
+        weekNo: null,
+        lastWeekRisk: null,
+        thisWeekRisk: null,
+        safeCondition: null,
+        nextWeekWork: null
+      },
+      //日期快速选择
+      pickerOptions: {
+        shortcuts: [{
+          text: this.$t('最近一周'),
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: this.$t('最近一个月'),
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+            picker.$emit('pick', [start, end]);
+          }
+        }, {
+          text: this.$t('最近三个月'),
+          onClick(picker) {
+            const end = new Date();
+            const start = new Date();
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+            picker.$emit('pick', [start, end]);
+          }
+        }]
+      },
+      //日期选择器
+      chooseDate: [],
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    let plantParams = {
+      pType: 1
+    }
+    alllistPlant(plantParams).then(response => {
+      this.plantOptions = response.data;
+    });
+    listPostUser(this.queryParams).then(response => {
+      this.userOption = response;
+    });
+    this.getTreeselect();
+  },
+  methods: {
+    /** 查询每周个人安全检查列表 */
+    getList() {
+      this.loading = true;
+      myListPersonweekcheck(this.queryParams).then(response => {
+        this.personweekcheckList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 字典翻译
+    isConfirmFormat(row, column) {
+      let type = 'info';
+      if (row.isConfirm == 0) {
+        let s = '未确认'
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+      if (row.isConfirm == 1) {
+        let s = '已确认'
+        type = 'success';
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        plantCode: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        checkDate: null,
+        checkerId: null,
+        weekNo: null,
+        lastWeekRisk: '无',
+        thisWeekRisk: '无',
+        safeCondition: '安全风险可控,无较大(质量)安全风险隐患',
+        nextWeekWork: '无'
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      if (this.chooseDate == null) {
+        this.chooseDate = []
+      }
+      this.queryParams.startDate = this.chooseDate[0]
+      this.queryParams.endDate = this.chooseDate[1]
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.chooseDate = "";
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+      this.dataListSelections = selection
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加每周个人安全检查";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法修改", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
+      getPersonweekcheck(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改每周个人安全检查";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updatePersonweekcheck(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addPersonweekcheck(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    calculateWeekNumber() {
+      console.log(this.form.checkDate)
+      if (this.form.checkDate) {
+        const date = new Date(this.form.checkDate);
+        const yearStart = new Date(date.getFullYear(), 0, 1);
+        const days = Math.floor((date - yearStart) / (24 * 60 * 60 * 1000));
+        const weekNumber = Math.ceil((days + yearStart.getDay() + 1) / 7);
+        this.form.weekNo = weekNumber;
+      }
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法删除", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delPersonweekcheck(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有每周个人安全检查数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportPersonweekcheck(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();
+      },
+    /** 报告附件按钮操作 */
+    handleDoc(row) {
+      // 通过ref引用子组件
+      const child = this.$refs.childRef;
+      // 调用子组件的方法并传递参数
+      child.handleDoc(row , 'personweekcheck');
+    },
+    /** 批量按钮操作 */
+    handleBatchConfirm(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchConfirm(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+    /** 批量按钮操作 */
+    handleBatchCancel(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否取消确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchCancel(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+  }
+};
+</script>

+ 155 - 20
ui/src/views/sems/safecheck/dailycheck/index.vue

@@ -1,14 +1,16 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="装置名称" prop="plantCode">
-        <el-input
-          v-model="queryParams.plantCode"
-          placeholder="请输入装置名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="装置名称" prop="plants">
+        <el-select v-model="plantIds"  size="small"  @change="handleCommand" multiple collapse-tags :placeholder="$t('请选择') + $t('装置')">
+          <el-checkbox v-model="checked" @change="selectAll"> ALL</el-checkbox>
+          <el-option
+            v-for="item in plantOptions"
+            :key="item.name"
+            :label="item.name"
+            :value="item.name">
+          </el-option>
+        </el-select>
       </el-form-item>
       <el-form-item label="检查日期" prop="checkDate">
         <el-date-picker
@@ -104,6 +106,26 @@
         >批量下载PDF
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchConfirm"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >批量确认</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchCancel"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >取消确认</el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -116,18 +138,26 @@
           <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="安全员" align="center" prop="checkerName" :show-overflow-tooltip="true"/>
-      <el-table-column label="人员" align="center" prop="cPerson" :show-overflow-tooltip="true"/>
-      <el-table-column label="设备本体" align="center" prop="cDevice" :show-overflow-tooltip="true"/>
-      <el-table-column label="安全附件或安全保护装置" align="center" prop="cSafety" :show-overflow-tooltip="true"/>
-      <el-table-column label="政府监督、通报、预警" align="center" prop="cGov" :show-overflow-tooltip="true"/>
-      <el-table-column label="投诉举报" align="center" prop="cComplaint" :show-overflow-tooltip="true"/>
-      <el-table-column label="舆情信息" align="center" prop="cOpinion" :show-overflow-tooltip="true"/>
-      <el-table-column label="其他" align="center" prop="cOther" :show-overflow-tooltip="true"/>
-      <el-table-column label="说明" align="center" prop="explain" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="isConfirm" :show-overflow-tooltip="true" :formatter="isConfirmFormat"/>
+
+      <el-table-column label="安全员" align="center" prop="checkerName" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.agentId">{{ scope.row.checkerName}} 代 {{ scope.row.agentName}}</span>
+          <span v-else>{{ scope.row.checkerName}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="人员" align="center" prop="cPerson" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="设备本体" align="center" prop="cDevice" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="安全附件或安全保护装置" align="center" prop="cSafety" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="政府监督、通报、预警" align="center" prop="cGov" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="投诉举报" align="center" prop="cComplaint" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="舆情信息" align="center" prop="cOpinion" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="其他" align="center" prop="cOther" :show-overflow-tooltip="true" :formatter="itemFormat"/>
+      <el-table-column label="说明" align="center" prop="explain" :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
+            v-if="scope.row.isConfirm == 0"
             size="mini"
             type="text"
             icon="el-icon-edit"
@@ -136,6 +166,7 @@
           >修改
           </el-button>
           <el-button
+            v-if="scope.row.isConfirm == 0"
             size="mini"
             type="text"
             icon="el-icon-delete"
@@ -360,14 +391,14 @@
 <script>
 import {
   wordView,
-  downloadDailycheck,
+  batchConfirm,
   listDailycheck,
   getDailycheck,
   delDailycheck,
   addDailycheck,
   updateDailycheck,
   exportDailycheck,
-  importTemplate
+  importTemplate, batchCancel
 } from "@/api/sems/safecheck/dailycheck";
 import {treeselect} from "@/api/system/dept";
 import {getToken} from "@/utils/auth";
@@ -385,6 +416,7 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      dataListSelections: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -403,6 +435,7 @@ export default {
       // 部门树选项
       deptOptions: undefined,
       plantOptions: [],
+      plantIds: [],
       clientHeight: 300,
       // 是否显示弹出层
       open: false,
@@ -530,6 +563,27 @@ export default {
         this.deptOptions = response.data;
       });
     },
+    // 字典翻译
+    isConfirmFormat(row, column) {
+      let type = 'info';
+      if (row.isConfirm == 0) {
+        let s = '未确认'
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+      if (row.isConfirm == 1) {
+        let s = '已确认'
+        type = 'success';
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+    },
+    itemFormat(row, column, cellValue, index) {
+      let type = 'danger';
+      if (cellValue == '×') {
+        return <el-tag type={type}>{cellValue}</el-tag>;
+      }
+      return cellValue;
+    },
+    // 取
     // 取消按钮
     cancel() {
       this.open = false;
@@ -567,12 +621,14 @@ export default {
       }
       this.queryParams.startDate = this.chooseDate[0]
       this.queryParams.endDate = this.chooseDate[1]
+      this.queryParams.plants = this.plantIds.join(',')
       this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
       this.chooseDate = "";
+      this.plantIds = [];
       this.handleQuery();
     },
     // 多选框选中数据
@@ -580,6 +636,7 @@ export default {
       this.ids = selection.map(item => item.id)
       this.single = selection.length !== 1
       this.multiple = !selection.length
+      this.dataListSelections = selection
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -591,6 +648,17 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法修改", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
       getDailycheck(id).then(response => {
         this.form = response.data;
         this.open = true;
@@ -620,6 +688,18 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法删除", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
+
       this.$confirm('是否确认删除?', "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -637,7 +717,6 @@ export default {
       this.$nextTick(() => {
         this.$refs['downloadForm2'].submit()
       })
-
     },
     handleDownloadPdf() {
       const ids = this.ids;
@@ -763,6 +842,62 @@ export default {
       // 调用子组件的方法并传递参数
       child.handleDoc(row , 'dailycheck');
     },
+    /** 批量按钮操作 */
+    handleBatchConfirm(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchConfirm(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+    /** 批量按钮操作 */
+    handleBatchCancel(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否取消确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchCancel(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+    selectAll() {
+      this.plantIds = []
+      if (this.checked) {
+        this.plantOptions.map((item) => {
+          this.plantIds.push(item.name)
+        })
+      } else {
+        this.plantIds = []
+      }
+      if (this.plantIds.length == 0) {
+        this.plantIds = ['']
+      }
+    },
+    handleCommand(val) {
+      if (this.plantIds.length == 0) {
+        this.plantIds = ['']
+      }
+      val.forEach((item,index)=>{
+        if(item===''){
+          val.splice(index,1)
+        }
+      })
+      if (val.length === this.plantOptions.length) {
+        this.checked = true
+      } else {
+        this.checked = false
+      }
+    },
   }
 };
 </script>

+ 137 - 11
ui/src/views/sems/safecheck/personweekcheck/index.vue

@@ -1,14 +1,16 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="装置名称" prop="plantCode">
-        <el-input
-          v-model="queryParams.plantCode"
-          placeholder="请输入装置名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="装置名称" prop="plants">
+      <el-select v-model="plantIds"  size="small"  @change="handleCommand" multiple collapse-tags :placeholder="$t('请选择') + $t('装置')">
+        <el-checkbox v-model="checked" @change="selectAll"> ALL</el-checkbox>
+        <el-option
+          v-for="item in plantOptions"
+          :key="item.name"
+          :label="item.name"
+          :value="item.name">
+        </el-option>
+      </el-select>
       </el-form-item>
       <el-form-item label="检查日期" prop="checkDate">
         <el-date-picker
@@ -79,6 +81,26 @@
           @click="handleExport"
           v-hasPermi="['safecheck:personweekcheck:export']"
         >导出</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchConfirm"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >批量确认</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleBatchCancel"
+          v-hasPermi="['safecheck:weekcheck:edit']"
+        >取消确认</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -91,8 +113,13 @@
           <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="安全员" align="center" prop="checkerName" :show-overflow-tooltip="true"/>
-      <el-table-column label="周" align="center" prop="weekNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="安全员" align="center" prop="checkerName" width="120">
+        <template slot-scope="scope">
+          <span v-if="scope.row.agentId">{{ scope.row.checkerName}} 代 {{ scope.row.agentName}}</span>
+          <span v-else>{{ scope.row.checkerName}}</span>
+        </template>
+      </el-table-column>      <el-table-column label="周" align="center" prop="weekNo" :show-overflow-tooltip="true"/>
+      <el-table-column label="状态" align="center" prop="isConfirm" :show-overflow-tooltip="true" :formatter="isConfirmFormat"/>
       <el-table-column label="上周安全风险隐患问题整改核实情况" align="center" prop="lastWeekRisk" :show-overflow-tooltip="true"/>
       <el-table-column label="本周主要安全风险隐患和整改情况" align="center" prop="thisWeekRisk" :show-overflow-tooltip="true"/>
       <el-table-column label="本周安全管理情况评价" align="center" prop="safeCondition" :show-overflow-tooltip="true"/>
@@ -100,6 +127,7 @@
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-if="scope.row.isConfirm == 0"
             size="mini"
             type="text"
             icon="el-icon-edit"
@@ -107,6 +135,7 @@
             v-hasPermi="['safecheck:personweekcheck:edit']"
           >修改</el-button>
           <el-button
+            v-if="scope.row.isConfirm == 0"
             size="mini"
             type="text"
             icon="el-icon-delete"
@@ -220,7 +249,7 @@
 </template>
 
 <script>
-import { listPersonweekcheck, getPersonweekcheck, delPersonweekcheck, addPersonweekcheck, updatePersonweekcheck, exportPersonweekcheck, importTemplate} from "@/api/sems/safecheck/personweekcheck";
+import { batchCancel, batchConfirm,listPersonweekcheck, getPersonweekcheck, delPersonweekcheck, addPersonweekcheck, updatePersonweekcheck, exportPersonweekcheck, importTemplate} from "@/api/sems/safecheck/personweekcheck";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -235,8 +264,10 @@ export default {
     return {
       // 遮罩层
       loading: true,
+      checked:true,
       // 选中数组
       ids: [],
+      dataListSelections: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -252,6 +283,7 @@ export default {
       // 部门树选项
       deptOptions: undefined,
       plantOptions: [],
+      plantIds: [],
       clientHeight:300,
       // 是否显示弹出层
       open: false,
@@ -355,6 +387,19 @@ export default {
               this.deptOptions = response.data;
           });
      },
+    // 字典翻译
+    isConfirmFormat(row, column) {
+      let type = 'info';
+      if (row.isConfirm == 0) {
+        let s = '未确认'
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+      if (row.isConfirm == 1) {
+        let s = '已确认'
+        type = 'success';
+        return <el-tag type={type}>{s}</el-tag>;
+      }
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -388,12 +433,14 @@ export default {
       }
       this.queryParams.startDate = this.chooseDate[0]
       this.queryParams.endDate = this.chooseDate[1]
+      this.queryParams.plants = this.plantIds.join(',')
       this.getList();
     },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
       this.chooseDate = "";
+      this.plantIds = [];
       this.handleQuery();
     },
     // 多选框选中数据
@@ -401,6 +448,7 @@ export default {
       this.ids = selection.map(item => item.id)
       this.single = selection.length!==1
       this.multiple = !selection.length
+      this.dataListSelections = selection
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -412,6 +460,17 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法修改", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
       getPersonweekcheck(id).then(response => {
         this.form = response.data;
         this.open = true;
@@ -451,6 +510,17 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
+      var rows = this.dataListSelections.map(item => {
+        return item
+      })
+      for (let i = 0; i < rows.length; i++) {
+        if (rows[i].isConfirm != 0) {
+          this.$alert("已确认,无法删除", this.$t('提示'), {
+            type: 'warning'
+          })
+          return
+        }
+      }
       this.$confirm('是否确认删除?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -509,6 +579,62 @@ export default {
       // 调用子组件的方法并传递参数
       child.handleDoc(row , 'personweekcheck');
     },
+    /** 批量按钮操作 */
+    handleBatchConfirm(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchConfirm(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+    /** 批量按钮操作 */
+    handleBatchCancel(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否取消确认?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return batchCancel(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("操作成功");
+      })
+    },
+    selectAll() {
+      this.plantIds = []
+      if (this.checked) {
+        this.plantOptions.map((item) => {
+          this.plantIds.push(item.name)
+        })
+      } else {
+        this.plantIds = []
+      }
+      if (this.plantIds.length == 0) {
+        this.plantIds = ['']
+      }
+    },
+    handleCommand(val) {
+      if (this.plantIds.length == 0) {
+        this.plantIds = ['']
+      }
+      val.forEach((item,index)=>{
+        if(item===''){
+          val.splice(index,1)
+        }
+      })
+      if (val.length === this.plantOptions.length) {
+        this.checked = true
+      } else {
+        this.checked = false
+      }
+    },
   }
 };
 </script>

+ 7 - 3
ui/src/views/sems/safecheck/weekcheck/index.vue

@@ -269,7 +269,7 @@
 </template>
 
 <script>
-import {wordView,getWeekcheckByWeek, listWeekcheck, getWeekcheck, delWeekcheck, addWeekcheck, updateWeekcheck, exportWeekcheck, importTemplate} from "@/api/sems/safecheck/weekcheck";
+import {wordView,getWeekcheckByWeek,getSafeDirUserId, listWeekcheck, getWeekcheck, delWeekcheck, addWeekcheck, updateWeekcheck, exportWeekcheck, importTemplate} from "@/api/sems/safecheck/weekcheck";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -406,6 +406,7 @@ export default {
     listPostUser(this.queryParams).then(response => {
       this.userOption = response;
     });
+
   },
   methods: {
     /** 查询每周安全排查列表 */
@@ -425,7 +426,7 @@ export default {
      },
     // 字典翻译
     statusFormat(row, column) {
-      let type = '';
+      let type = 'info';
        if (row.status == 0) {
          let s = '未完成'
          return <el-tag type={type}>{s}</el-tag>;
@@ -517,7 +518,10 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
-      this.form.safeAdminSug = '无'
+      this.form.safeAdminSug = '同意'
+      getSafeDirUserId().then(response => {
+        this.form.safeDirId = response.data;
+      });
       this.title = "添加每周安全排查";
     },
     /** 修改按钮操作 */