jiangbiao 7 месяцев назад
Родитель
Сommit
f15317b3ce

+ 1 - 1
master/pom.xml

@@ -6,7 +6,7 @@
     <groupId>com.cpms</groupId>
     <artifactId>cpms</artifactId>
     <version>3.2.0</version>
-    <packaging>war</packaging>
+    <packaging>jar</packaging>
 
     <name>cpms</name>
     <description>cpms管理系统</description>

+ 5 - 1
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrApproveController.java

@@ -505,7 +505,11 @@ public class TPssrApproveController extends BaseController {
             Authentication.setAuthenticatedUserId(userId);//设置当前申请人
             Map<String, Object> variables = new HashMap<>();
             variables.put("applyUser", userId);
-            variables.put("confirmUsers", Arrays.asList(confirmers.split(",")));
+            if(StringUtils.isNotEmpty(confirmers)){
+                variables.put("confirmers", Arrays.asList(confirmers.split(",")));
+            }else {
+                variables.put("confirmUsers", new ArrayList<>());
+            }
             variables.put("chargePerson", sub.getConfirm());
             //采用key来启动流程定义并设置流程变量,返回流程实例
             ProcessInstance pi = runtimeService.startProcessInstanceByKey("pssr1confirm", String.valueOf(businessKey), variables);

+ 103 - 0
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrFileController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.project.pssr.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.project.pssr.domain.TPssrFile;
+import com.ruoyi.project.pssr.service.ITPssrFileService;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.page.TableDataInfo;
+
+/**
+ * PSSR附件Controller
+ *
+ * @author ssy
+ * @date 2024-10-30
+ */
+@RestController
+@RequestMapping("/pssr/file")
+public class TPssrFileController extends BaseController
+{
+    @Autowired
+    private ITPssrFileService tPssrFileService;
+
+    /**
+     * 查询PSSR附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:file:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TPssrFile tPssrFile)
+    {
+        startPage();
+        List<TPssrFile> list = tPssrFileService.selectTPssrFileList(tPssrFile);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出PSSR附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:file:export')")
+    @Log(title = "PSSR附件", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TPssrFile tPssrFile)
+    {
+        List<TPssrFile> list = tPssrFileService.selectTPssrFileList(tPssrFile);
+        ExcelUtil<TPssrFile> util = new ExcelUtil<TPssrFile>(TPssrFile.class);
+        return util.exportExcel(list, "file");
+    }
+
+    /**
+     * 获取PSSR附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:file:query')")
+    @GetMapping(value = "/{fileId}")
+    public AjaxResult getInfo(@PathVariable("fileId") Long fileId)
+    {
+        return AjaxResult.success(tPssrFileService.selectTPssrFileById(fileId));
+    }
+
+    /**
+     * 新增PSSR附件
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:file:add')")
+    @Log(title = "PSSR附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TPssrFile tPssrFile)
+    {
+        return toAjax(tPssrFileService.insertTPssrFile(tPssrFile));
+    }
+
+    /**
+     * 修改PSSR附件
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:file:edit')")
+    @Log(title = "PSSR附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TPssrFile tPssrFile)
+    {
+        return toAjax(tPssrFileService.updateTPssrFile(tPssrFile));
+    }
+
+    /**
+     * 删除PSSR附件
+     */
+    @PreAuthorize("@ss.hasPermi('pssr:file:remove')")
+    @Log(title = "PSSR附件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{fileIds}")
+    public AjaxResult remove(@PathVariable Long[] fileIds)
+    {
+        return toAjax(tPssrFileService.deleteTPssrFileByIds(fileIds));
+    }
+}

+ 222 - 0
master/src/main/java/com/ruoyi/project/pssr/domain/TPssrFile.java

@@ -0,0 +1,222 @@
+package com.ruoyi.project.pssr.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * PSSR附件对象 t_pssr_file
+ *
+ * @author ssy
+ * @date 2024-10-30
+ */
+public class TPssrFile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 附件id */
+    private Long fileId;
+
+    /** 检查内容表id */
+    @Excel(name = "检查内容表id")
+    private Long subId;
+
+    /** 子表id */
+    @Excel(name = "子表id")
+    private Long itemId;
+
+    /** 关联表简称 */
+    @Excel(name = "关联表简称")
+    private String forShort;
+
+    /** 附件名称 */
+    @Excel(name = "附件名称")
+    private String fileName;
+
+    /** 附件地址 */
+    @Excel(name = "附件地址")
+    private String fileUrl;
+
+    /** 附件大小 */
+    @Excel(name = "附件大小")
+    private String fileSize;
+
+    /** 删除状态 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private String updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    public void setFileId(Long fileId)
+    {
+        this.fileId = fileId;
+    }
+
+    public Long getFileId()
+    {
+        return fileId;
+    }
+    public void setSubId(Long subId)
+    {
+        this.subId = subId;
+    }
+
+    public Long getSubId()
+    {
+        return subId;
+    }
+    public void setItemId(Long itemId)
+    {
+        this.itemId = itemId;
+    }
+
+    public Long getItemId()
+    {
+        return itemId;
+    }
+    public void setForShort(String forShort)
+    {
+        this.forShort = forShort;
+    }
+
+    public String getForShort()
+    {
+        return forShort;
+    }
+    public void setFileName(String fileName)
+    {
+        this.fileName = fileName;
+    }
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+    public void setFileUrl(String fileUrl)
+    {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileUrl()
+    {
+        return fileUrl;
+    }
+    public void setFileSize(String fileSize)
+    {
+        this.fileSize = fileSize;
+    }
+
+    public String getFileSize()
+    {
+        return fileSize;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("fileId", getFileId())
+            .append("subId", getSubId())
+            .append("itemId", getItemId())
+            .append("forShort", getForShort())
+            .append("fileName", getFileName())
+            .append("fileUrl", getFileUrl())
+            .append("fileSize", getFileSize())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("deptId", getDeptId())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/pssr/mapper/TPssrFileMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.pssr.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.pssr.domain.TPssrFile;
+
+/**
+ * PSSR附件Mapper接口
+ * 
+ * @author ssy
+ * @date 2024-10-30
+ */
+public interface TPssrFileMapper 
+{
+    /**
+     * 查询PSSR附件
+     * 
+     * @param fileId PSSR附件ID
+     * @return PSSR附件
+     */
+    public TPssrFile selectTPssrFileById(Long fileId);
+
+    /**
+     * 查询PSSR附件列表
+     * 
+     * @param tPssrFile PSSR附件
+     * @return PSSR附件集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TPssrFile> selectTPssrFileList(TPssrFile tPssrFile);
+
+    /**
+     * 新增PSSR附件
+     * 
+     * @param tPssrFile PSSR附件
+     * @return 结果
+     */
+    public int insertTPssrFile(TPssrFile tPssrFile);
+
+    /**
+     * 修改PSSR附件
+     * 
+     * @param tPssrFile PSSR附件
+     * @return 结果
+     */
+    public int updateTPssrFile(TPssrFile tPssrFile);
+
+    /**
+     * 删除PSSR附件
+     * 
+     * @param fileId PSSR附件ID
+     * @return 结果
+     */
+    public int deleteTPssrFileById(Long fileId);
+
+    /**
+     * 批量删除PSSR附件
+     * 
+     * @param fileIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTPssrFileByIds(Long[] fileIds);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/pssr/service/ITPssrFileService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.pssr.service;
+
+import java.util.List;
+import com.ruoyi.project.pssr.domain.TPssrFile;
+
+/**
+ * PSSR附件Service接口
+ * 
+ * @author ssy
+ * @date 2024-10-30
+ */
+public interface ITPssrFileService 
+{
+    /**
+     * 查询PSSR附件
+     * 
+     * @param fileId PSSR附件ID
+     * @return PSSR附件
+     */
+    public TPssrFile selectTPssrFileById(Long fileId);
+
+    /**
+     * 查询PSSR附件列表
+     * 
+     * @param tPssrFile PSSR附件
+     * @return PSSR附件集合
+     */
+    public List<TPssrFile> selectTPssrFileList(TPssrFile tPssrFile);
+
+    /**
+     * 新增PSSR附件
+     * 
+     * @param tPssrFile PSSR附件
+     * @return 结果
+     */
+    public int insertTPssrFile(TPssrFile tPssrFile);
+
+    /**
+     * 修改PSSR附件
+     * 
+     * @param tPssrFile PSSR附件
+     * @return 结果
+     */
+    public int updateTPssrFile(TPssrFile tPssrFile);
+
+    /**
+     * 批量删除PSSR附件
+     * 
+     * @param fileIds 需要删除的PSSR附件ID
+     * @return 结果
+     */
+    public int deleteTPssrFileByIds(Long[] fileIds);
+
+    /**
+     * 删除PSSR附件信息
+     * 
+     * @param fileId PSSR附件ID
+     * @return 结果
+     */
+    public int deleteTPssrFileById(Long fileId);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/pssr/service/impl/TPssrFileServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.pssr.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.pssr.mapper.TPssrFileMapper;
+import com.ruoyi.project.pssr.domain.TPssrFile;
+import com.ruoyi.project.pssr.service.ITPssrFileService;
+
+/**
+ * PSSR附件Service业务层处理
+ *
+ * @author ssy
+ * @date 2024-10-30
+ */
+@Service
+public class TPssrFileServiceImpl implements ITPssrFileService
+{
+    @Autowired
+    private TPssrFileMapper tPssrFileMapper;
+
+    /**
+     * 查询PSSR附件
+     *
+     * @param fileId PSSR附件ID
+     * @return PSSR附件
+     */
+    @Override
+    public TPssrFile selectTPssrFileById(Long fileId)
+    {
+        return tPssrFileMapper.selectTPssrFileById(fileId);
+    }
+
+    /**
+     * 查询PSSR附件列表
+     *
+     * @param tPssrFile PSSR附件
+     * @return PSSR附件
+     */
+    @Override
+    public List<TPssrFile> selectTPssrFileList(TPssrFile tPssrFile)
+    {
+        return tPssrFileMapper.selectTPssrFileList(tPssrFile);
+    }
+
+    /**
+     * 新增PSSR附件
+     *
+     * @param tPssrFile PSSR附件
+     * @return 结果
+     */
+    @Override
+    public int insertTPssrFile(TPssrFile tPssrFile)
+    {
+        return tPssrFileMapper.insertTPssrFile(tPssrFile);
+    }
+
+    /**
+     * 修改PSSR附件
+     *
+     * @param tPssrFile PSSR附件
+     * @return 结果
+     */
+    @Override
+    public int updateTPssrFile(TPssrFile tPssrFile)
+    {
+        return tPssrFileMapper.updateTPssrFile(tPssrFile);
+    }
+
+    /**
+     * 批量删除PSSR附件
+     *
+     * @param fileIds 需要删除的PSSR附件ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPssrFileByIds(Long[] fileIds)
+    {
+        return tPssrFileMapper.deleteTPssrFileByIds(fileIds);
+    }
+
+    /**
+     * 删除PSSR附件信息
+     *
+     * @param fileId PSSR附件ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPssrFileById(Long fileId)
+    {
+        return tPssrFileMapper.deleteTPssrFileById(fileId);
+    }
+}

+ 126 - 0
master/src/main/resources/mybatis/pssr/TPssrFileMapper.xml

@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.pssr.mapper.TPssrFileMapper">
+    
+    <resultMap type="TPssrFile" id="TPssrFileResult">
+        <result property="fileId"    column="file_id"    />
+        <result property="subId"    column="sub_id"    />
+        <result property="itemId"    column="item_id"    />
+        <result property="forShort"    column="for_short"    />
+        <result property="fileName"    column="file_name"    />
+        <result property="fileUrl"    column="file_url"    />
+        <result property="fileSize"    column="file_size"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTPssrFileVo">
+        select d.file_id, d.sub_id, d.item_id, d.for_short, d.file_name, d.file_url, d.file_size, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_pssr_file d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTPssrFileList" parameterType="TPssrFile" resultMap="TPssrFileResult">
+        <include refid="selectTPssrFileVo"/>
+        <where>  
+            <if test="subId != null "> and sub_id = #{subId}</if>
+            <if test="itemId != null "> and item_id = #{itemId}</if>
+            <if test="forShort != null  and forShort != ''"> and for_short = #{forShort}</if>
+            <if test="fileName != null  and fileName != ''"> and file_name like concat(concat('%', #{fileName}), '%')</if>
+            <if test="fileUrl != null  and fileUrl != ''"> and file_url = #{fileUrl}</if>
+            <if test="fileSize != null  and fileSize != ''"> and file_size = #{fileSize}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTPssrFileById" parameterType="Long" resultMap="TPssrFileResult">
+        <include refid="selectTPssrFileVo"/>
+        where file_id = #{fileId}
+    </select>
+        
+    <insert id="insertTPssrFile" parameterType="TPssrFile">
+        <selectKey keyProperty="fileId" resultType="long" order="BEFORE">
+            SELECT seq_t_pssr_file.NEXTVAL as fileId FROM DUAL
+        </selectKey>
+        insert into t_pssr_file
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="fileId != null">file_id,</if>
+            <if test="subId != null">sub_id,</if>
+            <if test="itemId != null">item_id,</if>
+            <if test="forShort != null">for_short,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileSize != null">file_size,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="remarks != null">remarks,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="fileId != null">#{fileId},</if>
+            <if test="subId != null">#{subId},</if>
+            <if test="itemId != null">#{itemId},</if>
+            <if test="forShort != null">#{forShort},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileSize != null">#{fileSize},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="remarks != null">#{remarks},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTPssrFile" parameterType="TPssrFile">
+        update t_pssr_file
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="subId != null">sub_id = #{subId},</if>
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="forShort != null">for_short = #{forShort},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileSize != null">file_size = #{fileSize},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+        </trim>
+        where file_id = #{fileId}
+    </update>
+
+    <update id="deleteTPssrFileById" parameterType="Long">
+        update t_pssr_file set del_flag = 2 where file_id = #{fileId}
+    </update>
+
+    <update id="deleteTPssrFileByIds" parameterType="String">
+        update t_pssr_file set del_flag = 2 where file_id in
+        <foreach item="fileId" collection="array" open="(" separator="," close=")">
+            #{fileId}
+        </foreach>
+    </update>
+    
+</mapper>

+ 53 - 0
ui/src/api/pssr/file.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询PSSR附件列表
+export function listFile(query) {
+  return request({
+    url: '/pssr/file/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询PSSR附件详细
+export function getFile(fileId) {
+  return request({
+    url: '/pssr/file/' + fileId,
+    method: 'get'
+  })
+}
+
+// 新增PSSR附件
+export function addFile(data) {
+  return request({
+    url: '/pssr/file',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改PSSR附件
+export function updateFile(data) {
+  return request({
+    url: '/pssr/file',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除PSSR附件
+export function delFile(fileId) {
+  return request({
+    url: '/pssr/file/' + fileId,
+    method: 'delete'
+  })
+}
+
+// 导出PSSR附件
+export function exportFile(query) {
+  return request({
+    url: '/pssr/file/export',
+    method: 'get',
+    params: query
+  })
+}

+ 547 - 0
ui/src/views/pssr/file/index.vue

@@ -0,0 +1,547 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="检查内容表id" prop="subId">
+        <el-input
+          v-model="queryParams.subId"
+          placeholder="请输入检查内容表id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="子表id" prop="itemId">
+        <el-input
+          v-model="queryParams.itemId"
+          placeholder="请输入子表id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="关联表简称" prop="forShort">
+        <el-input
+          v-model="queryParams.forShort"
+          placeholder="请输入关联表简称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="附件名称" prop="fileName">
+        <el-input
+          v-model="queryParams.fileName"
+          placeholder="请输入附件名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="附件地址" prop="fileUrl">
+        <el-input
+          v-model="queryParams.fileUrl"
+          placeholder="请输入附件地址"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="附件大小" prop="fileSize">
+        <el-input
+          v-model="queryParams.fileSize"
+          placeholder="请输入附件大小"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建人" prop="createrCode">
+        <el-input
+          v-model="queryParams.createrCode"
+          placeholder="请输入创建人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createdate">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.createdate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="修改人" prop="updaterCode">
+        <el-input
+          v-model="queryParams.updaterCode"
+          placeholder="请输入修改人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="修改时间" prop="updatedate">
+        <el-date-picker clearable size="small" style="width: 200px"
+          v-model="queryParams.updatedate"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择修改时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="部门编号" prop="deptId">
+        <el-input
+          v-model="queryParams.deptId"
+          placeholder="请输入部门编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="备注" prop="remarks">
+        <el-input
+          v-model="queryParams.remarks"
+          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="['pssr:file: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="['pssr:file: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="['pssr:file:remove']"
+        >删除</el-button>
+      </el-col>
+        <el-col :span="1.5">
+            <el-button
+                    type="info"
+                    icon="el-icon-upload2"
+                    size="mini"
+                    @click="handleImport"
+                    v-hasPermi="['pssr:file:edit']"
+            >导入</el-button>
+        </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['pssr:file:export']"
+        >导出</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="附件id" align="center" prop="fileId" :show-overflow-tooltip="true"/>
+      <el-table-column label="检查内容表id" align="center" prop="subId" :show-overflow-tooltip="true"/>
+      <el-table-column label="子表id" align="center" prop="itemId" :show-overflow-tooltip="true"/>
+      <el-table-column label="关联表简称" align="center" prop="forShort" :show-overflow-tooltip="true"/>
+      <el-table-column label="附件名称" align="center" prop="fileName" :show-overflow-tooltip="true"/>
+      <el-table-column label="附件地址" align="center" prop="fileUrl" :show-overflow-tooltip="true"/>
+      <el-table-column label="附件大小" align="center" prop="fileSize" :show-overflow-tooltip="true"/>
+      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
+      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
+      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
+      <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['pssr:file:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['pssr:file:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改PSSR附件对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="检查内容表id" prop="subId">
+          <el-input v-model="form.subId" placeholder="请输入检查内容表id" />
+        </el-form-item>
+        <el-form-item label="子表id" prop="itemId">
+          <el-input v-model="form.itemId" placeholder="请输入子表id" />
+        </el-form-item>
+        <el-form-item label="关联表简称" prop="forShort">
+          <el-input v-model="form.forShort" placeholder="请输入关联表简称" />
+        </el-form-item>
+        <el-form-item label="附件名称" prop="fileName">
+          <el-input v-model="form.fileName" placeholder="请输入附件名称" />
+        </el-form-item>
+        <el-form-item label="附件地址" prop="fileUrl">
+          <el-input v-model="form.fileUrl" placeholder="请输入附件地址" />
+        </el-form-item>
+        <el-form-item label="附件大小" prop="fileSize">
+          <el-input v-model="form.fileSize" placeholder="请输入附件大小" />
+        </el-form-item>
+        <el-form-item label="删除状态" prop="delFlag">
+          <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
+        </el-form-item>
+        <el-form-item label="创建人" prop="createrCode">
+          <el-input v-model="form.createrCode" placeholder="请输入创建人" />
+        </el-form-item>
+        <el-form-item label="创建时间" prop="createdate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.createdate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择创建时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="修改人" prop="updaterCode">
+          <el-input v-model="form.updaterCode" placeholder="请输入修改人" />
+        </el-form-item>
+        <el-form-item label="修改时间" prop="updatedate">
+          <el-date-picker clearable size="small" style="width: 200px"
+            v-model="form.updatedate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择修改时间">
+          </el-date-picker>
+        </el-form-item>
+        <el-form-item label="部门编号" prop="deptId">
+          <el-input v-model="form.deptId" placeholder="请输入部门编号" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注" />
+        </el-form-item>
+          <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+          </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+      <!-- 用户导入对话框 -->
+      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+          <el-upload
+                  ref="upload"
+                  :limit="1"
+                  accept=".xlsx, .xls"
+                  :headers="upload.headers"
+                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
+                  :disabled="upload.isUploading"
+                  :on-progress="handleFileUploadProgress"
+                  :on-success="handleFileSuccess"
+                  :auto-upload="false"
+                  drag
+          >
+              <i class="el-icon-upload"></i>
+              <div class="el-upload__text">
+                  将文件拖到此处,或
+                  <em>点击上传</em>
+              </div>
+              <div class="el-upload__tip" slot="tip">
+                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+              </div>
+              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+          </el-upload>
+          <div slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="submitFileForm">确 定</el-button>
+              <el-button @click="upload.open = false">取 消</el-button>
+          </div>
+      </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listFile, getFile, delFile, addFile, updateFile, exportFile, importTemplate} from "@/api/pssr/file";
+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";
+
+export default {
+  name: "File",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // PSSR附件表格数据
+      fileList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/pssr/file/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        subId: null,
+        itemId: null,
+        forShort: null,
+        fileName: null,
+        fileUrl: null,
+        fileSize: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+  },
+  methods: {
+    /** 查询PSSR附件列表 */
+    getList() {
+      this.loading = true;
+      listFile(this.queryParams).then(response => {
+        this.fileList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        fileId: null,
+        subId: null,
+        itemId: null,
+        forShort: null,
+        fileName: null,
+        fileUrl: null,
+        fileSize: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        deptId: null,
+        remarks: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.fileId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加PSSR附件";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const fileId = row.fileId || this.ids
+      getFile(fileId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改PSSR附件";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.fileId != null) {
+            updateFile(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFile(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const fileIds = row.fileId || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delFile(fileIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有PSSR附件数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportFile(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      }
+  }
+};
+</script>

+ 1 - 0
ui/src/views/pssr/lock/index.vue

@@ -105,6 +105,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==4||isApprove==5||isApprove==6"

+ 195 - 9
ui/src/views/pssr/overhaulExchanger/index.vue

@@ -122,6 +122,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"
@@ -130,6 +131,15 @@
         >确认
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-upload"
+          size="mini"
+          @click="handleDoc"
+        >附件
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <div style="width: 100%;text-align: center;margin-bottom: 15px">
@@ -140,21 +150,22 @@
       <el-table-column type="selection" width="55" align="center" :selectable="checkSelectable"/>
       <el-table-column label="审批状态" align="center" prop="approveStatus" :show-overflow-tooltip="true" width="120">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.pssr_approve_status" :value="scope.row.approveStatus" :show-type="getTagType(scope.row.approveStatus)"/>
+          <dict-tag :options="dict.type.pssr_approve_status" :value="scope.row.approveStatus"
+                    :show-type="getTagType(scope.row.approveStatus)"/>
         </template>
       </el-table-column>
       <el-table-column label="位号/管线号" align="center" prop="tagNo" :show-overflow-tooltip="true"/>
       <el-table-column label="设备名称" align="center" prop="equipmentName" :show-overflow-tooltip="true"/>
       <el-table-column label="检修内容" align="center" prop="workDes" :show-overflow-tooltip="true"/>
       <el-table-column label="图号" align="center" prop="pidNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="完成日期" align="center" prop="completionDate" width="100">
+      <el-table-column label="完成日期" align="center" prop="completionDate" >
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="确认人" align="center" prop="confirmedName" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right"
+      <el-table-column label="操作" align="center"
                        v-if="isApprove==0" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -258,6 +269,79 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 附件对话框 -->
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px"
+               append-to-body>
+      <el-upload v-show="isApprove==0"
+                 ref="doc"
+                 :limit="50"
+                 :headers="doc.headers"
+                 :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+                 :disabled="doc.isUploading"
+                 :on-progress="handleFileDocProgress"
+                 :on-success="handleFileDocSuccess"
+                 :auto-upload="true"
+                 drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a class="link-type" @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
+                         width="80"/>
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            >预览
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >下载
+            </el-button>
+            <el-button v-if="isApprove==0"
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
+                 append-to-body>
+        <div style="margin-top: -60px;float: right;margin-right: 40px;">
+          <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>
+        </div>
+        <div style="margin-top: -30px">
+          <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
+        </div>
+      </el-dialog>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="doc.open = false">返 回</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -280,9 +364,10 @@ import {groupList} from "@/api/pssr/region";
 import {listUserNoPage} from "@/api/system/user";
 import {doApprove} from "@/api/pssr/approve";
 import {getSubcontent} from "@/api/pssr/subcontent";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
 
 export default {
-  dicts:['pssr_approve_status'],
+  dicts: ['pssr_approve_status'],
   name: "OverhaulExchanger",
   components: {Treeselect},
   props: {
@@ -297,6 +382,40 @@ export default {
   },
   data() {
     return {
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'pssrJxxm'
+        },
+        pType: 'pssrJxxm',
+        pId: null,
+        form: {}
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
       regionGroupOptions: [],
       unitOptions: [],
       userOptions: [],
@@ -395,12 +514,12 @@ export default {
     })
   },
   methods: {
-    getTagType(val){
-      if (val==0){
+    getTagType(val) {
+      if (val == 0) {
         return ''
-      }else if (val==1){
+      } else if (val == 1) {
         return 'warning'
-      }else if (val==2){
+      } else if (val == 2) {
         return 'success'
       }
     },
@@ -571,7 +690,74 @@ export default {
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
-    }
+    },
+    /** 报告附件按钮操作 */
+    handleDoc(row, fileType) {
+      this.doc.id = row.id;
+      this.doc.title = this.$t('附件');
+      this.doc.open = true;
+      this.doc.queryParams.pId = this.subId
+      this.doc.pId = this.subId
+      this.getFileList()
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      })
+    },
+    getFileList() {
+      allFileList(this.doc.queryParams).then(response => {
+        response.forEach(element => {
+          element["isEdit"] = false
+        });
+        response.forEach(element => {
+          element["isAdd"] = false
+        });
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
+      this.getFileList()
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    openPdf() {
+      window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+    },
+    handleSee(row) {
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
   }
 };
 </script>

+ 186 - 2
ui/src/views/pssr/overhaulFilter/index.vue

@@ -105,6 +105,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"
@@ -113,6 +114,15 @@
         >确认
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-upload"
+          size="mini"
+          @click="handleDoc"
+        >附件
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <div style="width: 100%;text-align: center;margin-bottom: 15px">
@@ -133,14 +143,14 @@
       <el-table-column label="管线号" align="center" prop="isoDwgNo" :show-overflow-tooltip="true"/>
       <el-table-column label="法兰尺寸" align="center" prop="flangeSize" :show-overflow-tooltip="true"/>
       <el-table-column label="QTY数量" align="center" prop="qtyNum" :show-overflow-tooltip="true"/>
-      <el-table-column label="完成日期" align="center" prop="completionDate" width="100">
+      <el-table-column label="完成日期" align="center" prop="completionDate" >
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="负责人" align="center" prop="confirmerName" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right"
+      <el-table-column label="操作" align="center"
                        v-if="isApprove==0" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -266,6 +276,78 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 附件对话框 -->
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px"
+               append-to-body>
+      <el-upload v-show="isApprove==0"
+        ref="doc"
+        :limit="50"
+        :headers="doc.headers"
+        :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+        :disabled="doc.isUploading"
+        :on-progress="handleFileDocProgress"
+        :on-success="handleFileDocSuccess"
+        :auto-upload="true"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a class="link-type" @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
+                         width="80"/>
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            >预览
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >下载
+            </el-button>
+            <el-button
+              size="mini"
+              type="text" v-if="isApprove==0"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
+                 append-to-body>
+        <div style="margin-top: -60px;float: right;margin-right: 40px;">
+          <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>
+        </div>
+        <div style="margin-top: -30px">
+          <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
+        </div>
+      </el-dialog>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="doc.open = false">返 回</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -288,6 +370,7 @@ import {groupList} from "@/api/pssr/region";
 import {getSubcontent} from "@/api/pssr/subcontent";
 import {listUserNoPage} from "@/api/system/user";
 import {doApprove} from "@/api/pssr/approve";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
 
 
 export default {
@@ -306,6 +389,40 @@ export default {
   },
   data() {
     return {
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'pssrJxxm'
+        },
+        pType: 'pssrJxxm',
+        pId: null,
+        form: {}
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
       regionGroupOptions: [],
       unitOptions: [],
       userOptions: [],
@@ -607,6 +724,73 @@ export default {
         this.msgSuccess("已发起确认流程");
       })
     },
+    /** 报告附件按钮操作 */
+    handleDoc(row, fileType) {
+      this.doc.id = row.id;
+      this.doc.title = this.$t('附件');
+      this.doc.open = true;
+      this.doc.queryParams.pId = this.subId
+      this.doc.pId = this.subId
+      this.getFileList()
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      })
+    },
+    getFileList() {
+      allFileList(this.doc.queryParams).then(response => {
+        response.forEach(element => {
+          element["isEdit"] = false
+        });
+        response.forEach(element => {
+          element["isAdd"] = false
+        });
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
+      this.getFileList()
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    openPdf() {
+      window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+    },
+    handleSee(row) {
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
   }
 };
 </script>

+ 1 - 0
ui/src/views/pssr/overhaulPipe/index.vue

@@ -96,6 +96,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"

+ 1 - 0
ui/src/views/pssr/overhaulPump/index.vue

@@ -105,6 +105,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"

+ 186 - 2
ui/src/views/pssr/overhaulTower/index.vue

@@ -106,6 +106,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"
@@ -114,6 +115,15 @@
         >确认
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-upload"
+          size="mini"
+          @click="handleDoc"
+        >附件
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -132,14 +142,14 @@
       <el-table-column label="设备名称" align="center" prop="equipmentName" :show-overflow-tooltip="true"/>
       <el-table-column label="检修内容" align="center" prop="workDes" :show-overflow-tooltip="true"/>
       <el-table-column label="图号" align="center" prop="pidNo" :show-overflow-tooltip="true"/>
-      <el-table-column label="完成日期" align="center" prop="completionDate" width="100">
+      <el-table-column label="完成日期" align="center" prop="completionDate" >
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="确认人" align="center" prop="confirmerName" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
-      <el-table-column label="操作" align="center" fixed="right" v-if="isApprove==0"
+      <el-table-column label="操作" align="center" v-if="isApprove==0"
                        class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -243,6 +253,78 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 附件对话框 -->
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px"
+               append-to-body>
+      <el-upload v-show="isApprove==0"
+        ref="doc"
+        :limit="50"
+        :headers="doc.headers"
+        :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+        :disabled="doc.isUploading"
+        :on-progress="handleFileDocProgress"
+        :on-success="handleFileDocSuccess"
+        :auto-upload="true"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a class="link-type" @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
+                         width="80"/>
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            >预览
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >下载
+            </el-button>
+            <el-button
+              size="mini" v-if="isApprove==0"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
+                 append-to-body>
+        <div style="margin-top: -60px;float: right;margin-right: 40px;">
+          <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>
+        </div>
+        <div style="margin-top: -30px">
+          <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
+        </div>
+      </el-dialog>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="doc.open = false">返 回</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -265,6 +347,7 @@ import {groupList} from "@/api/pssr/region";
 import {listUserNoPage} from "@/api/system/user";
 import {doApprove} from "@/api/pssr/approve";
 import {getSubcontent} from "@/api/pssr/subcontent";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
 
 
 export default {
@@ -283,6 +366,40 @@ export default {
   },
   data() {
     return {
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'pssrJxxm'
+        },
+        pType: 'pssrJxxm',
+        pId: null,
+        form: {}
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
       regionGroupOptions: [],
       unitOptions: [],
       userOptions: [],
@@ -559,6 +676,73 @@ export default {
         this.msgSuccess("已发起确认流程");
       })
     },
+    /** 报告附件按钮操作 */
+    handleDoc(row, fileType) {
+      this.doc.id = row.id;
+      this.doc.title = this.$t('附件');
+      this.doc.open = true;
+      this.doc.queryParams.pId = this.subId
+      this.doc.pId = this.subId
+      this.getFileList()
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      })
+    },
+    getFileList() {
+      allFileList(this.doc.queryParams).then(response => {
+        response.forEach(element => {
+          element["isEdit"] = false
+        });
+        response.forEach(element => {
+          element["isAdd"] = false
+        });
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
+      this.getFileList()
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    openPdf() {
+      window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+    },
+    handleSee(row) {
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
   }
 };
 </script>

+ 184 - 0
ui/src/views/pssr/overhaulValve/index.vue

@@ -103,6 +103,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"
@@ -111,6 +112,15 @@
         >确认
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-upload"
+          size="mini"
+          @click="handleDoc"
+        >附件
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -295,6 +305,78 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
+    <!-- 附件对话框 -->
+    <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px"
+               append-to-body>
+      <el-upload v-show="isApprove==0"
+        ref="doc"
+        :limit="50"
+        :headers="doc.headers"
+        :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+        :disabled="doc.isUploading"
+        :on-progress="handleFileDocProgress"
+        :on-success="handleFileDocSuccess"
+        :auto-upload="true"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a class="link-type" @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
+                         width="80"/>
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            >预览
+            </el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >下载
+            </el-button>
+            <el-button
+              size="mini" v-if="isApprove==0"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >删除
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
+                 append-to-body>
+        <div style="margin-top: -60px;float: right;margin-right: 40px;">
+          <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>
+        </div>
+        <div style="margin-top: -30px">
+          <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
+        </div>
+      </el-dialog>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="doc.open = false">返 回</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -317,6 +399,7 @@ import {groupList} from "@/api/pssr/region";
 import {listUserNoPage} from "@/api/system/user";
 import {getSubcontent} from "@/api/pssr/subcontent";
 import {doApprove} from "@/api/pssr/approve";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
 
 export default {
   dicts:['pssr_approve_status'],
@@ -334,6 +417,40 @@ export default {
   },
   data() {
     return {
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'pssrJxxm'
+        },
+        pType: 'pssrJxxm',
+        pId: null,
+        form: {}
+      },
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
       regionGroupOptions: [],
       unitOptions: [],
       userOptions: [],
@@ -632,6 +749,73 @@ export default {
         this.msgSuccess("已发起确认流程");
       })
     },
+    /** 报告附件按钮操作 */
+    handleDoc(row, fileType) {
+      this.doc.id = row.id;
+      this.doc.title = this.$t('附件');
+      this.doc.open = true;
+      this.doc.queryParams.pId = this.subId
+      this.doc.pId = this.subId
+      this.getFileList()
+      this.$nextTick(() => {
+        this.$refs.doc.clearFiles()
+      })
+    },
+    getFileList() {
+      allFileList(this.doc.queryParams).then(response => {
+        response.forEach(element => {
+          element["isEdit"] = false
+        });
+        response.forEach(element => {
+          element["isAdd"] = false
+        });
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
+      this.getFileList()
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    openPdf() {
+      window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+    },
+    handleSee(row) {
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
   }
 };
 </script>

+ 1 - 0
ui/src/views/pssr/pipe/index.vue

@@ -141,6 +141,7 @@
       </el-col>
       <el-col :span="1.5">
         <el-button
+          type="primary"
           icon="el-icon-check"
           size="mini"
           v-if="isApprove==1"