Browse Source

ly 特种设备报告

ly 3 months ago
parent
commit
a602ba31ec

+ 10 - 0
master/src/main/java/com/ruoyi/project/common/domain/TCommonfile.java

@@ -24,6 +24,8 @@ public class TCommonfile extends BaseEntity
     @Excel(name = "业务id")
     private Long pId;
 
+    private String[] pIds;
+
     /** 文件名 */
     @Excel(name = "文件名")
     private String fileName;
@@ -211,6 +213,14 @@ public class TCommonfile extends BaseEntity
         this.pDate = pDate;
     }
 
+    public String[] getpIds() {
+        return pIds;
+    }
+
+    public void setpIds(String[] pIds) {
+        this.pIds = pIds;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 3 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TSpecReportController.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.sems.controller;
 
 import java.util.List;
+
+import com.ruoyi.framework.interceptor.annotation.RepeatSubmit;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -76,6 +78,7 @@ public class TSpecReportController extends BaseController
     @PreAuthorize("@ss.hasPermi('sems:specReport:add')")
     @Log(title = "特种设备报告", businessType = BusinessType.INSERT)
     @PostMapping
+    @RepeatSubmit
     public AjaxResult add(@RequestBody TSpecReport tSpecReport, HttpServletResponse response)
     {
         return toAjax(tSpecReportService.insertTSpecReport(tSpecReport,response));

+ 3 - 1
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevYlgdController.java

@@ -263,7 +263,9 @@ public class TSpecdevYlgdController extends BaseController {
         List<TSpecdevYlgd> list = new ArrayList<TSpecdevYlgd>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
-        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
+        SysPlant sysPlant = new SysPlant();
+        sysPlant.setpType(1L);
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(sysPlant);
 
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());

+ 58 - 2
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevYlrqController.java

@@ -4,17 +4,23 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.document.ZipUtil;
 import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.file.FileUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.framework.interceptor.annotation.RepeatSubmit;
 import com.ruoyi.framework.security.LoginUser;
 import com.ruoyi.framework.security.service.TokenService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.common.domain.TCommonfile;
+import com.ruoyi.project.common.service.ITCommonfileService;
 import com.ruoyi.project.sems.domain.ParamData;
 import com.ruoyi.project.sems.domain.TSpecCheck;
 import com.ruoyi.project.sems.domain.TSpecdevYlrq;
@@ -45,11 +51,16 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
 import java.util.*;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
@@ -90,7 +101,8 @@ public class TSpecdevYlrqController extends BaseController {
     private ITAlarmtypeService tAlarmtypeService;
     @Resource
     private SysPlantMapper sysPlantMapper;
-
+    @Autowired
+    private ITCommonfileService tCommonfileService;
     /**
      * 查询特种设备压力容器台账列表
      */
@@ -274,7 +286,9 @@ public class TSpecdevYlrqController extends BaseController {
         List<TSpecdevYlrq> list = new ArrayList<TSpecdevYlrq>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
-        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
+        SysPlant sysPlant = new SysPlant();
+        sysPlant.setpType(1L);
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(sysPlant);
 
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
@@ -832,4 +846,46 @@ public class TSpecdevYlrqController extends BaseController {
         tSpecdevYlrq.setWarnFlag(flag);
         this.tSpecdevYlrqService.updateTSpecdevYlrq(tSpecdevYlrq);
     }
+
+    /**
+     * 批量导入
+     */
+    @PreAuthorize("@ss.hasPermi('sems:specYlrq:add')")
+    @Log(title = "特种设备文件导入", businessType = BusinessType.OTHER)
+    @PostMapping("/importFiles")
+    public AjaxResult importFiles(@RequestParam("file") List<MultipartFile> files,@RequestParam("plantCode") String plantCode,@RequestParam("fileType") String fileType) throws IOException, ParseException {
+        tSpecdevYlrqService.importFiles(files,plantCode,fileType,getUserId().toString());
+
+        return AjaxResult.success();
+    }
+
+    /**
+     * @return
+     * @throws IOException
+     */
+    @RequestMapping("/downloadFileZip")
+    public AjaxResult downloadFileZip(@RequestParam String id, HttpServletRequest request, HttpServletResponse response) throws Exception {
+        String[] stringIds = id.split(",");
+
+        TCommonfile tCommonfile = new TCommonfile();
+        tCommonfile.setpType("sems-ylrq-");
+        tCommonfile.setpIds(stringIds);
+        List<TCommonfile> fileList = tCommonfileService.selectAllFileListFuzzy(tCommonfile);
+
+        OutputStream out = null;
+        out = response.getOutputStream();
+        //存放所有文件路径
+        List<String> urlList = new ArrayList<>();
+        for (TCommonfile t:fileList
+             ) {
+            // 将路径字符串转换为Path对象
+            Path path = Paths.get(t.getFileUrl());
+            // 获取文件名
+            String fileName = path.getFileName().toString();
+            urlList.add(t.getFileUrl().replace("/profile",""));
+        }
+
+        logger.info(JSON.toJSONString(urlList));
+        return ZipUtil.createZip(RuoYiConfig.getProfile(), "",  "特种设备.zip", urlList, response);
+    }
 }

+ 11 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TSpecReport.java

@@ -68,6 +68,9 @@ public class TSpecReport extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    private Date startDate;
+
     private String plantCode;
 
     private Integer devNum;
@@ -205,6 +208,14 @@ public class TSpecReport extends BaseEntity
         this.detail3Url = detail3Url;
     }
 
+    public Date getStartDate() {
+        return startDate;
+    }
+
+    public void setStartDate(Date startDate) {
+        this.startDate = startDate;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 22 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TSpecdevYlrq.java

@@ -244,6 +244,12 @@ public class TSpecdevYlrq extends BaseEntity
     @TableField(exist = false)
     private String wxjl;
 
+    @TableField(exist = false)
+    private String infoNum;
+
+    @TableField(exist = false)
+    private String reportNum;
+
     public Long getHiFlag() {
         return hiFlag;
     }
@@ -751,6 +757,22 @@ public class TSpecdevYlrq extends BaseEntity
         this.ids = ids;
     }
 
+    public String getInfoNum() {
+        return infoNum;
+    }
+
+    public void setInfoNum(String infoNum) {
+        this.infoNum = infoNum;
+    }
+
+    public String getReportNum() {
+        return reportNum;
+    }
+
+    public void setReportNum(String reportNum) {
+        this.reportNum = reportNum;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 2 - 0
master/src/main/java/com/ruoyi/project/sems/mapper/TSpecdevYlrqMapper.java

@@ -85,4 +85,6 @@ public interface TSpecdevYlrqMapper extends BaseMapper<TSpecdevYlrq> {
     void updateTSpecdevYlrqByIds(TSpecdevYlrq tSpecdevYlrq);
 
     List<TSpecdevYlrq> selectTSpecdevYlrqListForPssr(TSpecdevYlrq tSpecdevYlrq);
+
+    List<TSpecdevYlrq> selectTSpecdevYlrqListByDevNo(TSpecdevYlrq param);
 }

+ 3 - 0
master/src/main/java/com/ruoyi/project/sems/service/ITSpecdevYlrqService.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ruoyi.project.sems.domain.TSpecdevYlgd;
 import com.ruoyi.project.sems.domain.TSpecdevYlrq;
 import com.ruoyi.project.sems.his.domain.TSpechiYlrq;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 特种设备压力容器台账Service接口
@@ -67,4 +68,6 @@ public interface ITSpecdevYlrqService extends IService<TSpecdevYlrq>
     int updateTSpecdevYlrqByHi(TSpechiYlrq hientity);
 
     void duplicateTSpecdevYlrq();
+
+    void importFiles(List<MultipartFile> files, String plantCode, String fileType,String userId);
 }

+ 11 - 9
master/src/main/java/com/ruoyi/project/sems/service/impl/TSpecReportServiceImpl.java

@@ -5,6 +5,7 @@ import java.net.URLEncoder;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -116,7 +117,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
             // 替换excel模板数据
             replaceExcel(wb);
             //从下往上渲染
-            replaceExcelByHi(wb);
+            replaceExcelByHi(wb,tSpecReport);
             replaceExcelExpireByThreeMonth(wb);
             replaceExcelExpire(wb);
             //创建明细excel
@@ -134,6 +135,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
             LocalDate currentDate = LocalDate.now();
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
             String dateStr = currentDate.format(formatter);
+            String startDateStr = tSpecReport.getStartDate().toInstant().atZone(ZoneId.systemDefault()).format(formatter);
             String filePath = fileDir + "/" + dateStr + "Report" + tSpecReport.getId() + ".xlsx";
             fos = new FileOutputStream(filePath);
             wb.write(fos);
@@ -142,7 +144,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
             String currentDir = StringUtils.substring(filePath, dirLastIndex);
             String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir;
             tSpecReport.setReportUrl(pathFileName);
-            tSpecReport.setReportName(dateStr + "报告");
+            tSpecReport.setReportName(startDateStr + "_" +dateStr + "报告");
             tSpecReport.setDetailUrl(detailUrl);
             tSpecReport.setDetail3Url(detail3Url);
             tSpecReportMapper.updateTSpecReport(tSpecReport);
@@ -153,7 +155,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
     }
 
     //数量变更说明(基于与上一个月数据对比)渲染
-    private void replaceExcelByHi(SXSSFWorkbook wb) {
+    private void replaceExcelByHi(SXSSFWorkbook wb, TSpecReport tSpecReport) {
         Sheet sheet;
         if (wb instanceof SXSSFWorkbook) {
             SXSSFWorkbook sxssfWorkbook = (SXSSFWorkbook) wb;
@@ -162,7 +164,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
             sheet = wb.getSheetAt(0);
         }
         List<Integer> numArr = new ArrayList<>();
-        List<TSpecReport> ylrqList = tSpecReportMapper.selectExpriedYlrqHi(new TSpecReport());
+        List<TSpecReport> ylrqList = tSpecReportMapper.selectExpriedYlrqHi(tSpecReport);
         numArr.add(ylrqList.size());
         logger.info(JSON.toJSONString(ylrqList));
         Row row = sheet.getRow(13);
@@ -172,35 +174,35 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
         cell.setCellStyle(originalStyle);
         cell.setCellValue(getDevTotal(ylrqList));
 
-        List<TSpecReport> ylgdList = tSpecReportMapper.selectExpriedYlgdHi(new TSpecReport());
+        List<TSpecReport> ylgdList = tSpecReportMapper.selectExpriedYlgdHi(tSpecReport);
         numArr.add(ylgdList.size());
         logger.info(JSON.toJSONString(ylgdList));
         Row row2 = sheet.getRow(13);
         Cell cell2 = row2.getCell(4);
         cell2.setCellValue(getDevTotal(ylgdList));
 
-        List<TSpecReport> glList = tSpecReportMapper.selectExpriedGlHi(new TSpecReport());
+        List<TSpecReport> glList = tSpecReportMapper.selectExpriedGlHi(tSpecReport);
         numArr.add(glList.size());
         logger.info(JSON.toJSONString(glList));
         Row row3 = sheet.getRow(13);
         Cell cell3 = row3.getCell(7);
         cell3.setCellValue(getDevTotal(glList));
 
-        List<TSpecReport> dtList = tSpecReportMapper.selectExpriedDtHi(new TSpecReport());
+        List<TSpecReport> dtList = tSpecReportMapper.selectExpriedDtHi(tSpecReport);
         numArr.add(dtList.size());
         logger.info(JSON.toJSONString(dtList));
         Row row4 = sheet.getRow(13);
         Cell cell4 = row4.getCell(10);
         cell4.setCellValue(getDevTotal(dtList));
 
-        List<TSpecReport> dzsbList = tSpecReportMapper.selectExpriedDzsbHi(new TSpecReport());
+        List<TSpecReport> dzsbList = tSpecReportMapper.selectExpriedDzsbHi(tSpecReport);
         numArr.add(dzsbList.size());
         logger.info(JSON.toJSONString(dzsbList));
         Row row5 = sheet.getRow(13);
         Cell cell5 = row5.getCell(13);
         cell5.setCellValue(getDevTotal(dzsbList));
 
-        List<TSpecReport> ccList = tSpecReportMapper.selectExpriedCcHi(new TSpecReport());
+        List<TSpecReport> ccList = tSpecReportMapper.selectExpriedCcHi(tSpecReport);
         numArr.add(ccList.size());
         logger.info(JSON.toJSONString(ccList));
         Row row6 = sheet.getRow(8);

+ 62 - 1
master/src/main/java/com/ruoyi/project/sems/service/impl/TSpecdevYlrqServiceImpl.java

@@ -1,16 +1,29 @@
 package com.ruoyi.project.sems.service.impl;
 
+import java.io.IOException;
+import java.time.LocalDate;
 import java.util.List;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.project.common.domain.TCommonfile;
+import com.ruoyi.project.common.mapper.TCommonfileMapper;
 import com.ruoyi.project.sems.domain.TSpecdevYlgd;
 import com.ruoyi.project.sems.his.domain.TSpechiYlrq;
 import com.ruoyi.project.sems.mapper.TSpecdevYlgdMapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.sems.mapper.TSpecdevYlrqMapper;
 import com.ruoyi.project.sems.domain.TSpecdevYlrq;
 import com.ruoyi.project.sems.service.ITSpecdevYlrqService;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
 
 /**
  * 特种设备压力容器台账Service业务层处理
@@ -21,9 +34,12 @@ import com.ruoyi.project.sems.service.ITSpecdevYlrqService;
 @Service("tSpecdevYlrqService")
 public class TSpecdevYlrqServiceImpl extends ServiceImpl<TSpecdevYlrqMapper, TSpecdevYlrq> implements ITSpecdevYlrqService
 {
-    @Autowired
+    @Resource
     private TSpecdevYlrqMapper tSpecdevYlrqMapper;
+    @Resource
+    private TCommonfileMapper tCommonfileMapper;
 
+    protected final Logger logger = LoggerFactory.getLogger(TSpecdevYlrqServiceImpl.class);
     /**
      * 查询特种设备压力容器台账
      *
@@ -110,4 +126,49 @@ public class TSpecdevYlrqServiceImpl extends ServiceImpl<TSpecdevYlrqMapper, TSp
     public void duplicateTSpecdevYlrq() {
         tSpecdevYlrqMapper.duplicateTSpecdevYlrq();
     }
+
+    @Override
+    @Transactional
+    public void importFiles(List<MultipartFile> files, String plantCode, String fileType ,String userId) {
+        for (MultipartFile file : files) {
+            if (!file.isEmpty()) {
+                String input = file.getOriginalFilename();
+                int index = input.indexOf('_');
+                String weiHao = (index != -1) ? input.substring(0, index) : input;
+                System.out.println(weiHao); // 输出: 位号
+                TSpecdevYlrq param = new TSpecdevYlrq();
+                param.setDevno(weiHao);
+                param.setPlantCode(plantCode);
+                List<TSpecdevYlrq> list = tSpecdevYlrqMapper.selectTSpecdevYlrqListByDevNo(param);
+                if (list.size() > 0) {
+                    TSpecdevYlrq t  = list.get(0);
+                    Long id = t.getId();
+                    // 获取当前日期
+                    LocalDate currentDate = LocalDate.now();
+                    // 获取年份
+                    int year = currentDate.getYear();
+                    String dir = "/semsylrqfile/" + year;
+                    String url = null;
+                    try {
+                        url = FileUploadUtils.upload(RuoYiConfig.getFilePath(dir), file);
+                    } catch (IOException e) {
+                        e.printStackTrace();
+                    }
+                    long size = file.getSize()/1024;
+                    TCommonfile tCommonfile = new TCommonfile();
+                    tCommonfile.setFileUrl(url);
+                    tCommonfile.setFileName(file.getOriginalFilename());
+                    tCommonfile.setCreaterCode(userId);
+                    tCommonfile.setpId(id);
+                    tCommonfile.setpType("sems-ylrq-"+fileType);
+                    tCommonfile.setFileSize(String.valueOf(size));
+                    tCommonfileMapper.insertTCommonfile(tCommonfile);
+                }else {
+
+                }
+            }
+            // 上传并返回新文件名称
+
+        }
+    }
 }

+ 3 - 1
master/src/main/java/com/ruoyi/project/system/controller/SysLoginController.java

@@ -115,7 +115,9 @@ public class SysLoginController extends BaseController {
         }
 
         if (isSent) {
-            return AjaxResult.success("验证码发送成功");
+            String lastFourDigits = sysUser.getPhonenumber().substring(sysUser.getPhonenumber().length() - 4);
+            System.out.println("手机号的最后四位是:" + lastFourDigits);
+            return AjaxResult.success("验证码发送成功,尾号"+ lastFourDigits);
         } else {
             return AjaxResult.error("验证码发送失败");
         }

+ 8 - 0
master/src/main/resources/mybatis/common/TCommonfileMapper.xml

@@ -70,6 +70,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN SYS_USER u on d.CREATER_CODE = u.USER_ID
         <where>
             <if test="pId != null "> and p_id = #{pId}</if>
+            <if test="pIds != null  and pIds != ''">
+                and
+                d.p_id in
+                <foreach collection="pIds" item="item" index="index"
+                         open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
             <if test="pType != null "> and p_type like concat(concat('%', #{pType}), '%')</if>
             <if test="pValue != null  and pValue != ''"> and p_value = #{pValue}</if>
             <if test="pDate != null "> and p_date = #{pDate}</if>

+ 6 - 6
master/src/main/resources/mybatis/sems/TSpecReportMapper.xml

@@ -123,37 +123,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectExpriedYlrqHi" parameterType="TSpecReport" resultMap="TSpecReportResult">
         SELECT plant_code AS plantCode, COUNT(*) AS devNum, OPER_TYPE AS remarks
         FROM T_SPECHI_YLRQ
-        WHERE OPER_TIME >= TRUNC(ADD_MONTHS(SYSDATE, -1), 'MM') and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
+        WHERE OPER_TIME >= #{startDate} and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
         GROUP BY plant_code,OPER_TYPE
     </select>
     <select id="selectExpriedYlgdHi" parameterType="TSpecReport" resultMap="TSpecReportResult">
         SELECT plant_code AS plantCode, COUNT(*) AS devNum, OPER_TYPE AS remarks
         FROM T_SPECHI_YLGD
-        WHERE OPER_TIME >= TRUNC(ADD_MONTHS(SYSDATE, -1), 'MM') and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
+        WHERE OPER_TIME >=  #{startDate} and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
         GROUP BY plant_code,OPER_TYPE
     </select>
     <select id="selectExpriedGlHi" parameterType="TSpecReport" resultMap="TSpecReportResult">
         SELECT plant_code AS plantCode, COUNT(*) AS devNum, OPER_TYPE AS remarks
         FROM T_SPECHI_GL
-        WHERE OPER_TIME >= TRUNC(ADD_MONTHS(SYSDATE, -1), 'MM') and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
+        WHERE OPER_TIME >=  #{startDate} and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
         GROUP BY plant_code,OPER_TYPE
     </select>
     <select id="selectExpriedDtHi" parameterType="TSpecReport" resultMap="TSpecReportResult">
         SELECT plant_code AS plantCode, COUNT(*) AS devNum, OPER_TYPE AS remarks
         FROM T_SPECHI_DT
-        WHERE OPER_TIME >= TRUNC(ADD_MONTHS(SYSDATE, -1), 'MM')  and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
+        WHERE OPER_TIME >= #{startDate}  and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
         GROUP BY plant_code,OPER_TYPE
     </select>
     <select id="selectExpriedDzsbHi" parameterType="TSpecReport" resultMap="TSpecReportResult">
         SELECT plant_code AS plantCode, COUNT(*) AS devNum, OPER_TYPE AS remarks
         FROM T_SPECHI_DZSB
-        WHERE OPER_TIME >= TRUNC(ADD_MONTHS(SYSDATE, -1), 'MM') and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
+        WHERE OPER_TIME >= #{startDate} and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
         GROUP BY plant_code,OPER_TYPE
     </select>
     <select id="selectExpriedCcHi" parameterType="TSpecReport" resultMap="TSpecReportResult">
         SELECT plant_code AS plantCode, COUNT(*) AS devNum, OPER_TYPE AS remarks
         FROM T_SPECHI_CC
-        WHERE OPER_TIME >= TRUNC(ADD_MONTHS(SYSDATE, -1), 'MM') and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
+        WHERE OPER_TIME >= #{startDate} and OPER_TYPE in ('新增-通过','删除-通过','停用批准','注销批准','报废批准')
         GROUP BY plant_code,OPER_TYPE
     </select>
 

+ 65 - 10
master/src/main/resources/mybatis/sems/TSpecdevYlrqMapper.xml

@@ -109,6 +109,8 @@
                d.year_report_no,
                s.dept_name,
                (SELECT COUNT(1) from T_SPECHI_YLRQ h  where h.DEV_ID = d.id and HI_TYPE = 0 ) as hiFlag,
+               (SELECT COUNT(1) from T_COMMONFILE f  where f.P_ID = d.id and f.P_TYPE= 'sems-ylrq-info' and f.DEL_FLAG = 0 ) as infoNum,
+               (SELECT COUNT(1) from T_COMMONFILE f  where f.P_ID = d.id and f.P_TYPE= 'sems-ylrq-report' and f.DEL_FLAG = 0 ) as reportNum,
                d.is_repeat
         from t_specdev_ylrq d
                  left join sys_dept s on s.dept_id = d.dept_id
@@ -243,16 +245,7 @@
                     #{item}
                 </foreach>
             </if>
-            <!--<if test="unitIds != null  and unitIds != ''">
-                and
-                (
-                d.unit in
-                <foreach collection="unitIds.split(',')" item="item" index="index"
-                         open="(" close=")" separator=",">
-                    #{item}
-                </foreach>
-                )
-            </if>-->
+
             and d.del_flag = 0
         </where>
     </select>
@@ -526,6 +519,68 @@
         where id = #{id}
     </update>
 
+    <select id="selectTSpecdevYlrqListByDevNo" parameterType="TSpecdevYlrq" resultMap="TSpecdevYlrqResult">
+        select d.id,
+        d.plant_code,
+        d.unit,
+        d.devname,
+        d.factory_no,
+        d.devno,
+        d.submitdate,
+        d.status,
+        d.del_flag,
+        d.creater_code,
+        d.createdate,
+        d.updater_code,
+        d.updatedate,
+        d.dept_id,
+        d.remarks,
+        d.remarks2,
+        d.approve_status,
+        d.regno,
+        d.useno,
+        d.warn_date,
+        d.warn_cycle,
+        d.next_warn_date,
+        d.warn_flag,
+        d.plant_maint,
+        d.engineer,
+        d.vessel_type,
+        d.is_key,
+        d.create_unit,
+        d.nation,
+        d.out_size,
+        d.material,
+        d.medium,
+        d.des_pressure,
+        d.des_temp,
+        d.opt_pressure,
+        d.opt_temp,
+        d.check_unit,
+        d.report_no,
+        d.is_danger,
+        d.is_overlife,
+        d.safe_class,
+        d.approve_time,
+        d.change_time,
+        d.des_year,
+        d.year_warn_date,
+        d.check_conclusion,
+        d.year_next_warn_date,
+        d.year_report_no,
+        d.is_repeat
+        from t_specdev_ylrq d
+        <where>
+            <if test="plantCode != null  and plantCode != ''">and plant_code = #{plantCode} </if>
+            <if test="devname != null  and devname != ''">and devname like concat(concat('%', #{devname}), '%')</if>
+            <if test="devno != null  and devno != ''">and devno like concat(concat('%', #{devno}), '%') </if>
+            and DEL_FLAG = 0
+        </where>
+        order by d.id desc
+    </select>
+
+
+
     <select id="selectTSpecdevYlrqListForPssr" parameterType="Integer" resultMap="TSpecdevYlrqResult">
         select d.id,
         d.plant_code,

+ 19 - 0
ui/src/api/sems/specYlrq.js

@@ -80,6 +80,16 @@ export function exportSpecYlrq(query) {
   })
 }
 
+// 导出特种设备压力容器台账
+export function downloadFileZip(query) {
+  return request({
+    url: '/sems/specYlrq/downloadFileZip',
+    method: 'get',
+    params: query,
+    responseType: 'blob' //
+  })
+}
+
 // 导出特种设备压力容器台账
 export function exportSpecList(query) {
   return request({
@@ -98,4 +108,13 @@ export function duplicate(query) {
   })
 }
 
+export function importFiles(data) {
+  return request({
+    url: '/sems/specYlrq/importFiles',
+    method: 'post',
+    data: data
+  })
+}
+
+
 

+ 27 - 3
ui/src/views/sems/specReport/index.vue

@@ -23,7 +23,7 @@
           type="primary"
           icon="el-icon-plus"
           size="mini"
-          @click="handleAdd"
+          @click="handleStart"
           v-hasPermi="['sems:specReport:add']"
         >生成报告</el-button>
       </el-col>
@@ -88,6 +88,24 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+F
+    <!-- 添加或修改特种设备报告对话框 -->
+    <el-dialog title="选择日期" :visible.sync="startOpen" width="500px" append-to-body>
+      <el-form ref="form" :model="form"  label-width="80px">
+        <el-form-item  label-width="150px" label="起始日期" prop="checkDate">
+          <el-date-picker clearable size="small" style="width: 200px"
+                          v-model="form.startDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择起始日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="handleAdd">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
 
     <!-- 添加或修改特种设备报告对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@@ -171,6 +189,7 @@ export default {
       clientHeight:300,
       // 是否显示弹出层
       open: false,
+      startOpen: false,
         // 用户导入参数
         upload: {
             // 是否显示弹出层(用户导入)
@@ -241,6 +260,7 @@ export default {
     // 取消按钮
     cancel() {
       this.open = false;
+      this.startOpen = false
       this.reset();
     },
     // 表单重置
@@ -257,7 +277,8 @@ export default {
         updaterCode: null,
         updatedate: null,
         deptId: null,
-        remarks: null
+        remarks: null,
+        startDate: null
       };
       this.resetForm("form");
     },
@@ -277,11 +298,14 @@ export default {
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
+    handleStart(){
+      this.startOpen = true
+    },
     /** 新增按钮操作 */
     handleAdd() {
       addSpecReport(this.form).then(response => {
         this.msgSuccess("新增成功");
-        this.open = false;
+        this.startOpen = false;
         this.getList();
       });
     },

+ 347 - 28
ui/src/views/sems/specYlrq/index.vue

@@ -182,7 +182,7 @@
           type="info"
           icon="el-icon-upload2"
           size="mini"
-          @click="handleImport"
+          @click="handleImportFile"
           v-hasPermi="['sems:specYlrq:edit']"
         >文件上传
         </el-button>
@@ -192,8 +192,8 @@
           type="warning"
           icon="el-icon-download"
           size="mini"
-          @click="handleExport"
-          v-hasPermi="['sems:specYlrq:export']"
+          :disabled="multiple"
+          @click="handleDownloadZip"
         >文件下载
         </el-button>
       </el-col>
@@ -280,7 +280,40 @@
       <!--      <u-table-column :label="$t('部门编号')" align="center" prop="deptId" :show-overflow-tooltip="true"/>-->
       <u-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <u-table-column :label="$t('备注2')" align="center" prop="remarks2" :render-header="remarksHeader" :show-overflow-tooltip="true"/>
+      <u-table-column label="注册登记资料" align="center" prop="tnNew-score" width="80">
+        <template slot-scope="scope">
+          <el-badge
+            :value="scope.row.infoNum"
+            :hidden="scope.row.infoNum == 0"
+            :type="'primary'"
+            :offset="[-5, 5]"
+          >
+            <el-button
+              size="small"
+              icon="el-icon-folder"
+              style="color:#6e96fa;"
+              @click="handleDoc(scope.row , 'sems-ylrq-info')"
+              circle>
+            </el-button>
+
+          </el-badge>
+        </template>
+      </u-table-column>
+      <u-table-column label="全面检验报告" align="center" prop="tnNew-score" width="80">
+        <template slot-scope="scope">
+          <el-badge
+            :value="scope.row.reportNum"
+            :hidden="scope.row.reportNum == 0"
+            :type="'primary'"
+            :offset="[-5, 5]"
+          >
+          <el-button  icon="el-icon-folder"
+                      size="small"
+               style="color:#6e96fa;" @click="handleDoc(scope.row , 'sems-ylrq-report')" circle></el-button>
 
+          </el-badge>
+        </template>
+      </u-table-column>
 
       <u-table-column :label="$t('操作')" align="center" fixed="right" width="170"
                       class-name="small-padding">
@@ -708,6 +741,9 @@
       <input name="ids" v-model="ids" hidden/>
       <input name="downloadType" v-model="downloadType" hidden/>
     </form>
+    <form ref="downloadForm" :action="downloadZipAction" target="FORMSUBMIT">
+      <input name="id" v-model="downloadForm.id" hidden/>
+    </form>
     <el-dialog  :close-on-click-modal="false" :title="$t('检验更新')" width="30%" :visible.sync="inspectionInformation">
       <el-form ref="dateform" label-width="120px">
         <el-form-item>
@@ -754,55 +790,141 @@
       <el-button type="primary" @click="submitModofyForm">{{ $t('提交') }}</el-button>
     </el-dialog>
     <!-- 文件导入对话框 -->
-    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="uploadFile.title" :visible.sync="uploadFile.open" width="400px" append-to-body>
+      <div style="margin-bottom: 20px;">
+        装  置
+        <el-select v-model="uploadFile.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>
+      </div>
       <div style="margin-bottom: 20px;">
         文件类型
-        <el-select v-model="upload.submitData.wxjl" :placeholder="$t('请选择')+ $t('装置维修经理')" filterable clearable
+        <el-select v-model="uploadFile.fileType" :placeholder="$t('请选择')+ $t('文件类型')" filterable clearable
                    size="small">
           <el-option
-            v-for="dict in wxjlList"
-            :key="dict.userId"
-            :label="dict.nickName"
-            :value="dict.userId"
+            key="info"
+            label="注册登记资料"
+            value="info"
+          />
+          <el-option
+            key="report"
+            label="全面检验报告"
+            value="report"
           />
         </el-select>
       </div>
       <el-upload
-        ref="upload"
-        :limit="1"
-        accept=".xlsx, .xls"
-        :data="upload.submitData"
-        :headers="upload.headers"
-        :action="upload.url + '?updateSupport=' + upload.updateSupport"
-        :disabled="upload.isUploading"
-        :on-progress="handleFileUploadProgress"
-        :on-success="handleFileSuccess"
+        :limit="100"
+        :headers="uploadFile.headers"
+        :action="uploadFile.url"
+        :on-success="handleFileSuccess2"
+        :on-change="handleFileChange"
         :auto-upload="false"
         drag
+        multiple
       >
         <i class="el-icon-upload"></i>
         <div class="el-upload__text">
           {{ $t('将文件拖到此处,或') }}
           <em>{{ $t('点击上传') }}</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">{{ $t('下载模板') }}</el-link>
-        </div>
-        <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
-          <input name="type" :value="upload.type" hidden/>
-        </form>
         <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
-        <div class="el-upload__tip" style="color:red" slot="tip"> Excel单元格式为文本格式 </div>
 
       </el-upload>
       <div slot="footer" class="dialog-footer">
         <a v-if="waitSubmit" style="margin-right: 300px">{{ $t('正在导入...') }}</a>
-        <el-button type="primary" @click="submitFileForm" v-loading.fullscreen.lock="fullscreenLoading">{{
+        <el-button type="primary" @click="submitFileForm2" v-loading.fullscreen.lock="fullscreenLoading">{{
             $t('确定')
           }}
         </el-button>
-        <el-button @click="upload.open = false">{{ $t('取消') }}</el-button>
+        <el-button @click="uploadFile.open = false">{{ $t('取消') }}</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-hasPermi="['training:trainingrecords:file']"
+                 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">
+          {{ $t('将文件拖到此处,或') }}
+          <em>{{ $t('点击上传') }}</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" prop="pDate"  width="150">-->
+        <!--          <template slot-scope="scope">-->
+        <!--            <el-date-picker-->
+        <!--              v-if="scope.row.isEdit"-->
+        <!--              v-model="scope.row.pDate"-->
+        <!--              type="date"-->
+        <!--              value-format="yyyy-MM-dd"-->
+        <!--              placeholder="日期">-->
+        <!--            </el-date-picker>-->
+        <!--            <span v-else>{{ parseTime(scope.row.pDate, '{y}-{m}-{d}') }}</span>-->
+        <!--          </template>-->
+        <!--        </el-table-column>-->
+        <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)"
+            >{{ $t('预览') }}</el-button>
+            <el-button v-hasPermi="['training:trainingrecords:file']"  type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">保存</el-button>
+            <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">取消</el-button>
+            <!--            <el-button v-hasPermi="['training:trainingrecords:file']" v-if="!scope.row.isEdit" @click="edit(scope.row)" icon="el-icon-edit" type="text" size="mini">编辑</el-button>-->
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >{{ $t('下载') }}</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+              v-hasPermi="['training:trainingrecords:file']"
+            >{{ $t('删除') }}</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">{{$t('新页面打开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 type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
+        <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
       </div>
     </el-dialog>
     <add-approve v-if="addAprroveVisible" ref="addApprove" @refreshDataList="getList"></add-approve>
@@ -818,10 +940,12 @@ import {
   exportSpecYlrq,
   getSpecYlrq,
   listSpecYlrq,
+  downloadFileZip,
   updateSpecYlrqPre,
   updateSpecYlrq,
   exportSpecList,
   duplicate,
+  importFiles,
   updateSpecYlrqBatch
 } from "@/api/sems/specYlrq";
 import {treeselect} from "@/api/system/dept";
@@ -835,6 +959,7 @@ import HisApprove from "../approve/tapprove-his"
 import HisCheck from "../check/check"
 import {addModify} from "@/api/sems/his/modify";
 import HisReform from "./specYlrq-hisReform";
+import {allFileList, delCommonfile} from "@/api/common/commonfile";
 
 export default {
   name: "SpecYlrq",
@@ -904,6 +1029,66 @@ export default {
         url: process.env.VUE_APP_BASE_API + "/sems/specYlrq/importData",
         submitData: {wxjl: null}
       },
+      // 报告附件参数
+      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: 'traning'
+        },
+        pType: 'traning',
+        pId: null,
+        form: {}
+      },
+      // 用户导入参数
+      uploadFile: {
+        downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
+        // 是否显示弹出层(用户导入)
+        open: false,
+        type: "specYlrq",
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        fileList: [],
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken(),"Content-Type": "multipart/form-data"},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/sems/specYlrq/importFiles",
+        fileType: null,
+        plantCode: null,
+      },
+      pdf : {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
+      downloadForm: {
+        id: '',
+      },
+      downloadZipAction: process.env.VUE_APP_BASE_API + '/sems/specYlrq/downloadFileZip',
+      fileList: [],
       // 查询参数
       queryParams: {
         searchValue: null,
@@ -1244,6 +1429,108 @@ export default {
     handleImport() {
       this.upload.title = this.$t('用户导入');
       this.upload.open = true;
+    },
+    /** 导入按钮操作 */
+    handleImportFile() {
+      this.uploadFile.title = "文件导入";
+      this.uploadFile.open = true;
+    },
+    /** 报告附件按钮操作 */
+    handleDoc(row , fileType) {
+      var workType = "";
+      if (fileType === "byxworklicense-boiler"){
+        workType = this.$t('裂解(裂化)');
+      }else if (fileType === "byxworklicense-compression"){
+        workType = this.$t('压力容器');
+      }else if (fileType === "byxworklicense-separation"){
+        workType = this.$t('压力管道');
+      }else if (fileType === "byxworklicense-pguaeu"){
+        workType = '';
+      }
+      this.doc.pType = fileType
+      this.doc.queryParams.pType = fileType
+      this.doc.id = row.id;
+      this.doc.title = this.$t('附件') ;
+      this.doc.open = true;
+      this.doc.queryParams.pId = row.id
+      this.doc.pId = row.id
+      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){
+      // window.open(process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl);//path是文件的全路径地址
+      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('删除成功'));
+      })
+    },
+    handleDownloadZip() {
+      const ids = this.ids;
+      this.downloadForm.id = ids.join(',')
+      downloadFileZip(this.downloadForm).then(response => {
+        // 创建临时链接
+        const url = window.URL.createObjectURL(new Blob([response]));
+        const link = document.createElement('a');
+        link.href = url;
+        link.setAttribute('download', '文件.zip'); // 和后端返回的文件名一致
+        document.body.appendChild(link);
+
+        // 模拟点击下载
+        link.click();
+      });
+
+
     },
     /** 下载模板操作 */
     importTemplate() {
@@ -1253,6 +1540,15 @@ export default {
     handleFileUploadProgress(event, file, fileList) {
       this.upload.isUploading = true;
       this.waitSubmit = true;
+    },
+    // 文件上传中处理
+    handleFileUploadProgress2(event, file, fileList) {
+      this.uploadFile.fileList = fileList;
+      this.uploadFile.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess2(response, file, fileList) {
+
     },
     // 文件上传成功处理
     handleFileSuccess(response, file, fileList) {
@@ -1283,6 +1579,29 @@ export default {
       this.$refs.upload.submit();
       this.fullscreenLoading = true
     },
+    handleFileChange(file, fileList) {
+      console.log('文件变动:', file);
+      console.log(fileList)
+      this.fileList = fileList; // 更新文件列表
+      console.log(this.fileList)
+    },
+    // 提交上传文件
+    submitFileForm2() {  // 导入
+      let formData = new FormData();  //  用FormData存放上传文件
+      console.log(this.fileList)
+      this.fileList.forEach(file => {
+        formData.append('file', file.raw)
+      })
+      formData.append("plantCode", this.uploadFile.plantCode)
+      formData.append("fileType", this.uploadFile.fileType)
+      // importCase是上传接口
+      importFiles(formData).then((res) => {
+        //手动上传无法触发成功或失败的钩子函数,因此这里手动调用
+
+      }, (err) => {
+
+      })
+    },
     addAprrove(row, type) {
       var rows = row ? [row] : this.dataListSelections.map(item => {
         return item