Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
caoyang
2022-04-21 19:06:23 +08:00
34 changed files with 1542 additions and 216 deletions
@@ -139,6 +139,8 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/opensso/**", "anon"); //单点登录
filterChainDefinitionMap.put("/project/projectLawsInventoryEO/processCall", "anon"); // 项目库-法规清单 工作流处理数据接口排除
// 添加自己的过滤器并且取名为jwt
Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
//如果cloudServer为空 则说明是单体 需要加载跨域配置
@@ -57,7 +57,7 @@ public class ParamsTemplateEOController extends JeroController<ParamsTemplateEO,
// QueryWrapper<ParamsTemplateEO> queryWrapper = QueryGenerator.initQueryWrapper(paramsTemplateEO, req.getParameterMap());
LambdaQueryWrapper<ParamsTemplateEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(StringUtils.isNotEmpty(paramsTemplateEO.getParamsTemplateName()), ParamsTemplateEO::getParamsTemplateName, paramsTemplateEO.getParamsTemplateName())
.like(StringUtils.isNotEmpty(paramsTemplateEO.getDescription()), ParamsTemplateEO::getDescription, paramsTemplateEO.getDescription())
.eq(StringUtils.isNotEmpty(paramsTemplateEO.getRegion()), ParamsTemplateEO::getRegion, paramsTemplateEO.getRegion())
.eq(StringUtils.isNotEmpty(paramsTemplateEO.getState()), ParamsTemplateEO::getState, paramsTemplateEO.getState())
.orderByDesc(ParamsTemplateEO::getUpdateTime);
Page<ParamsTemplateEO> page = new Page<ParamsTemplateEO>(pageNo, pageSize);
@@ -1,8 +1,11 @@
package com.jero.modules.message.websocket;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArraySet;
import com.alibaba.fastjson.JSONObject;
import com.jero.boot.starter.redis.client.JeroRedisClient;
import com.jero.common.base.BaseMap;
import com.jero.common.constant.WebsocketConst;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import javax.websocket.OnClose;
@@ -11,15 +14,10 @@ import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
import com.jero.boot.starter.redis.client.JeroRedisClient;
import com.jero.common.base.BaseMap;
import com.jero.common.constant.WebsocketConst;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* @Author scott
@@ -78,7 +76,7 @@ public class WebSocket {
if (session != null && session.isOpen()) {
try {
log.info("【websocket消息】 单点消息:" + message);
session.getAsyncRemote().sendText(message);
session.getBasicRemote().sendText(message);
} catch (Exception e) {
e.printStackTrace();
}
@@ -90,7 +88,14 @@ public class WebSocket {
*/
public void pushMessage(String message) {
try {
webSockets.forEach(ws -> ws.session.getAsyncRemote().sendText(message));
for (WebSocket ws : webSockets) {
try {
ws.session.getBasicRemote().sendText(message);
} catch (IOException e) {
e.printStackTrace();
continue;
}
}
} catch (Exception e) {
e.printStackTrace();
}
@@ -1,13 +1,10 @@
package com.jero.modules.dummy.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.dummy.entity.DummyInventoryInfoEO;
import com.jero.modules.dummy.service.IDummyInventoryInfoEOService;
import io.swagger.annotations.Api;
@@ -146,16 +143,17 @@ public class DummyInventoryInfoEOController extends JeroController<DummyInventor
return Result.OK(dummyInventoryInfoEO);
}
/**
* 导出excel
*
* @param request
* @param dummyInventoryInfoEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, DummyInventoryInfoEO dummyInventoryInfoEO) {
return super.exportXls(request, dummyInventoryInfoEO, DummyInventoryInfoEO.class, "虚拟清单详情表");
}
// /**
// * 导出excel
// *
// * @param request
// * @param dummyInventoryInfoEO
// */
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, DummyInventoryInfoEO dummyInventoryInfoEO) {
// return super.exportXls(request, dummyInventoryInfoEO, DummyInventoryInfoEO.class, "虚拟清单详情表");
// }
/**
* 通过excel导入数据
@@ -175,11 +173,23 @@ public class DummyInventoryInfoEOController extends JeroController<DummyInventor
* @param request
* @param dummyInventoryInfoEO
*/
@GetMapping(value = "/exportData")
@GetMapping(value = "/exportXls")
public ModelAndView exportDate(HttpServletRequest request, DummyInventoryInfoEO dummyInventoryInfoEO) {
return super.exportXls(request, dummyInventoryInfoEO, DummyInventoryInfoEO.class, "虚拟清单详情表");
}
/**
* 导出数据
* @param request
* @param dummyInventoryInfoEO
*/
@RequestMapping(value = "/exportData")
public void exportData(HttpServletResponse response,
HttpServletRequest request,
DummyInventoryInfoEO dummyInventoryInfoEO) {
dummyInventoryInfoEOService.exportData(response,request, dummyInventoryInfoEO);
}
/**
* 导入数据
*
@@ -190,11 +200,7 @@ public class DummyInventoryInfoEOController extends JeroController<DummyInventor
@RequestMapping(value = "/importData", method = RequestMethod.POST)
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
DummyInventoryInfoEO dummyInventoryInfoEO) {
try {
dummyInventoryInfoEOService.importData(file,dummyInventoryInfoEO);
} catch (Exception e) {
return Result.error("导入失败");
}
dummyInventoryInfoEOService.importData(file,dummyInventoryInfoEO);
return Result.OK("导入成功");
}
@@ -1,22 +1,20 @@
package com.jero.modules.dummy.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
@@ -39,7 +37,6 @@ public class DummyInventoryInfoEO implements Serializable {
private java.lang.String id;
/**法规清单基础表id*/
@Excel(name = "法规清单基础表id", width = 15)
@ApiModelProperty(value = "法规清单基础表id")
private java.lang.String dummyInventoryBaseId;
@@ -78,7 +75,7 @@ public class DummyInventoryInfoEO implements Serializable {
private java.lang.String title;
/**适用范围*/
@Excel(name = "适用范围", width = 15)
@Excel(name = "适用范围", width = 15, dicCode = "apply_scope")
@ApiModelProperty(value = "适用范围")
@Dict(dicCode ="apply_scope")
private java.lang.String shi4Yong4Fan4Wei2;
@@ -86,10 +83,11 @@ public class DummyInventoryInfoEO implements Serializable {
/**适用地区*/
@ApiModelProperty(value = "适用地区")
@Dict(dicCode ="region")
@Excel(name = "适用地区", width = 15, dicCode = "region")
private java.lang.String region;
/**状态*/
@Excel(name = "状态", width = 15)
@Excel(name = "状态", width = 15,dicCode ="state")
@ApiModelProperty(value = "状态")
@Dict(dicCode ="state")
private java.lang.String state;
@@ -103,14 +101,14 @@ public class DummyInventoryInfoEO implements Serializable {
private java.lang.String technologyTerritoryName;
/**新车型实施日期*/
@Excel(name = "新车型实施日期", width = 15)
@Excel(name = "新车型实施日期", width = 15,format = "yyyy-MM-dd")
@ApiModelProperty(value = "新车型实施日期")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date xin1Che1Xing2Shi2Shi1Ri4Qi1;
/**在产车实施日期*/
@Excel(name = "在产车实施日期", width = 15)
@Excel(name = "在产车实施日期", width = 15,format = "yyyy-MM-dd")
@ApiModelProperty(value = "在产车实施日期")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@@ -134,25 +132,25 @@ public class DummyInventoryInfoEO implements Serializable {
private java.lang.String subtitle;
/**实施类别*/
@Excel(name = "实施类别", width = 15)
@Excel(name = "实施类别", width = 15,dicCode ="implement_type")
@ApiModelProperty(value = "实施类别")
@Dict(dicCode ="implement_type")
private java.lang.String implementType;
/**认证类型*/
@Excel(name = "认证类型", width = 15)
@Excel(name = "认证类型", width = 15,dicCode ="attestation_type")
@ApiModelProperty(value = "认证类型")
@Dict(dicCode ="attestation_type")
private java.lang.String attestationType;
/**认证级别*/
@Excel(name = "认证级别", width = 15)
@Excel(name = "认证级别", width = 15,dicCode ="attestation_rank")
@ApiModelProperty(value = "认证级别")
@Dict(dicCode ="attestation_rank")
private java.lang.String attestationRank;
/**责任领域*/
@Excel(name = "责任领域", width = 15)
@Excel(name = "责任领域", width = 15,dicCode ="duty_territory")
@ApiModelProperty(value = "责任领域")
@Dict(dicCode ="duty_territory")
private java.lang.String dutyTerritory;
@@ -163,79 +161,82 @@ public class DummyInventoryInfoEO implements Serializable {
private java.lang.String remark;
/**设计符合性确认-交付物类型*/
@Excel(name = "设计符合性确认-交付物类型", width = 15)
@Excel(name = "交付物类型", width = 15,dicCode ="deliverable_template")
@ApiModelProperty(value = "设计符合性确认-交付物类型")
@Dict(dicCode ="deliverable_template")
private java.lang.String designDeliverableType;
/**设计符合性确认-交付物模板*/
@Excel(name = "设计符合性确认-交付物模板", width = 15)
@ApiModelProperty(value = "设计符合性确认-交付物模板")
private java.lang.String designDeliverableTemplate;
@TableField(exist = false)
@Excel(name = "交付物模板", width = 15)
private java.lang.String designDeliverableTemplateName;
/**设计符合性确认-发起人*/
@Excel(name = "设计符合性确认-发起人", width = 15)
@Excel(name = "发起人", width = 15,dicCode ="fa1_qi3_ren2")
@ApiModelProperty(value = "设计符合性确认-发起人")
@Dict(dicCode ="fa1_qi3_ren2")
private java.lang.String designInitiator;
/**设计符合性确认-责任人*/
@Excel(name = "设计符合性确认-责任人", width = 15)
@Excel(name = "责任人", width = 15,dicCode ="ze2_ren4_ren2")
@ApiModelProperty(value = "设计符合性确认-责任人")
@Dict(dicCode ="ze2_ren4_ren2")
private java.lang.String designDuty;
/**prehomo确认-交付物类型*/
@Excel(name = "prehomo确认-交付物类型", width = 15)
@Excel(name = "交付物类型", width = 15,dicCode ="deliverable_template")
@ApiModelProperty(value = "prehomo确认-交付物类型")
@Dict(dicCode ="deliverable_template")
private java.lang.String prehomoDeliverableType;
/**prehomo确认-交付物模板*/
@Excel(name = "prehomo确认-交付物模板", width = 15)
@ApiModelProperty(value = "prehomo确认-交付物模板")
private java.lang.String prehomoDeliverableTemplate;
@TableField(exist = false)
@Excel(name = "交付物模板", width = 15)
private java.lang.String prehomoDeliverableTemplateName;
/**prehomo确认-发起人*/
@Excel(name = "prehomo确认-发起人", width = 15)
@Excel(name = "发起人", width = 15,dicCode ="fa1_qi3_ren2")
@ApiModelProperty(value = "prehomo确认-发起人")
@Dict(dicCode ="fa1_qi3_ren2")
private java.lang.String prehomoInitiator;
/**prehomo确认-责任人*/
@Excel(name = "prehomo确认-责任人", width = 15)
@Excel(name = "责任人", width = 15,dicCode ="ze2_ren4_ren2")
@ApiModelProperty(value = "prehomo确认-责任人")
@Dict(dicCode ="ze2_ren4_ren2")
private java.lang.String prehomoDuty;
/**验证符合性确认-交付物类型*/
@Excel(name = "验证符合性确认-交付物类型", width = 15)
@Excel(name = "交付物类型", width = 15,dicCode ="deliverable_template")
@ApiModelProperty(value = "验证符合性确认-交付物类型")
@Dict(dicCode ="deliverable_template")
private java.lang.String verifyDeliverableType;
/**验证符合性确认-交付物模板*/
@Excel(name = "验证符合性确认-交付物模板", width = 15)
@ApiModelProperty(value = "验证符合性确认-交付物模板")
private java.lang.String verifyDeliverableTemplate;
@TableField(exist = false)
@Excel(name = "交付物模板", width = 15)
private java.lang.String verifyDeliverableTemplateName;
/**验证符合性确认-发起人*/
@Excel(name = "验证符合性确认-发起人", width = 15)
@Excel(name = "发起人", width = 15,dicCode ="fa1_qi3_ren2")
@ApiModelProperty(value = "验证符合性确认-发起人")
@Dict(dicCode ="fa1_qi3_ren2")
private java.lang.String verifyInitiator;
/**验证符合性确认-责任人*/
@Excel(name = "验证符合性确认-责任人", width = 15)
@Excel(name = "责任人", width = 15,dicCode ="ze2_ren4_ren2")
@ApiModelProperty(value = "验证符合性确认-责任人")
@Dict(dicCode ="ze2_ren4_ren2")
private java.lang.String verifyDuty;
@@ -243,7 +244,6 @@ public class DummyInventoryInfoEO implements Serializable {
@TableField(exist = false)
private String cut;
/**文档库id*/
@TableField(exist = false)
private String ids;
@@ -89,4 +89,15 @@ public interface IDummyInventoryInfoEOService extends IService<DummyInventoryInf
* @param dummyInventoryInfoEO
*/
void importData(MultipartFile file, DummyInventoryInfoEO dummyInventoryInfoEO);
/**
* 数据导出
* @param response
* @param request
* @param dummyInventoryInfoEO
*/
void exportData(HttpServletResponse response,
HttpServletRequest request,
DummyInventoryInfoEO dummyInventoryInfoEO);
}
@@ -1,5 +1,6 @@
package com.jero.modules.dummy.service.impl;
import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSON;
import com.aliyuncs.utils.IOUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -40,6 +41,11 @@ import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.aspectj.util.FileUtil;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -51,6 +57,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.text.DateFormat;
@@ -66,6 +73,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl.copyFile;
/**
* @Description: 虚拟清单详情表
* @Author: jero-boot
@@ -297,15 +306,16 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
String titleOne = "";
String titleTwo = "";
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){
titleOne = "编号,标题,子标题,适用范围,状态,对应标准,实施类别,新车实施日期,在产车实施日期,WVTA ID,认证类型," +
titleOne = "编号,标题,子标题,适用范围,状态,对应标准,实施类别," +
"新车实施日期,在产车实施日期,WVTA ID,认证类型," +
"认证级别,技术领域," +
"责任领域,适用地区,备注," +
"设计符合性确认,Pre-homo确认,验证符合性确认";
titleTwo = "交付物类型,交付物模板,发起人,责任人,交付物类型,交付物模板,发起人,责任人,交付物类型,交付物模板,发起人,责任人";
}else{
titleOne = "serial number,title,subtitle,scope of application,state,corresponding standard,implementation category," +
"certification level,technical field," +
"new car implementation date,on the production vehicle implementation date,WVTA ID,certification type," +
"certification level,technical field," +
"area of responsibility,zone of application,remarks," +
"design compliance check,pre-homo check,validation compliance chech";
titleTwo = "type of deliverables,deliverable template,initiator,person liable," +
@@ -766,6 +776,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
private void importDatas(List<DummyInventoryInfoEO> dataList,
List<SysCategory> categoryList,
List<SysDictItem> dictItemList,
@@ -1278,4 +1289,224 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
}
return false;
}
/**
* 数据导出
* @param response
* @param request
* @param dummyInventoryInfoEO
*/
@SneakyThrows
@Override
public void exportData(HttpServletResponse response, HttpServletRequest request, DummyInventoryInfoEO dummyInventoryInfoEO) {
List<DummyInventoryInfoEO> dataList = new ArrayList<>();
QueryWrapper<DummyInventoryInfoEO> queryWrapper = QueryGenerator.initQueryWrapper(dummyInventoryInfoEO,request.getParameterMap());
if(StringUtils.isNotBlank(dummyInventoryInfoEO.getIds())){
queryWrapper.in("id",Arrays.asList(dummyInventoryInfoEO.getIds().split(",")));
}
//导出的数据
dataList = this.list(queryWrapper);
//文件
List<OSSFile> fileInfos = getOssFiles(dataList);
//数据转换(文件名称,技术领域,对应标准)
dataTransition(dataList, fileInfos);
OutputStream os = null;
try {
response.setContentType("application/force-download");
Workbook workbook = new XSSFWorkbook();
String path = uploadpath + "/tempZip";
File fileTemp = new File(path);
if (fileTemp.exists()) {
fileTemp.delete();
}
fileTemp.mkdirs();
//文件
exportFile(dataList,fileInfos);
//excel
OutputStream excelOS = new FileOutputStream(path + File.separator + "虚拟清单.xlsx");
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams, DummyInventoryInfoEO.class, dataList);
workbook.write(excelOS);
excelOS.flush();
ZipUtil.zip(path, path + ".zip");
//文件
FileInputStream fis = new FileInputStream(path + ".zip");
os = response.getOutputStream();
int len = 0;
while ((len = fis.read()) != -1) {
os.write(len);
}
os.flush();
fis.close();
} catch (IOException e) {
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){
throw new JeroBootException("下载文件失败");
}else{
throw new JeroBootException("Failed to download file");
}
} finally {
IOUtils.closeQuietly(os);
File file = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(file);
}
}
/**
* 数据转换(文件名称,技术领域,对应标准)
* @param dataList
* @param fileInfos
*/
private void dataTransition(List<DummyInventoryInfoEO> dataList, List<OSSFile> fileInfos) {
//技术领域
List<SysCategory> sysCategoryList = sysCategoryService.list();
//文档库数据
List<String> correspondingStandardIdList = new ArrayList<>();
for (DummyInventoryInfoEO inventoryInfoEO : dataList) {
String correspondingStandard = inventoryInfoEO.getCorrespondingStandard();
if(StringUtils.isNotBlank(correspondingStandard)){
correspondingStandardIdList.addAll(Arrays.asList(correspondingStandard.split(",")));
}
}
LambdaQueryWrapper<BussDocumentLibraryEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(BussDocumentLibraryEO::getId,correspondingStandardIdList);
List<BussDocumentLibraryEO> bussDocumentLibraryEOList = iBussDocumentLibraryEOService.list(lambdaQueryWrapper);
for (DummyInventoryInfoEO inventoryInfoEO : dataList) {
String correspondingStandard = inventoryInfoEO.getCorrespondingStandard();
String technologyTerritory = inventoryInfoEO.getTechnologyTerritory();
String designDeliverableTemplate = inventoryInfoEO.getDesignDeliverableTemplate();
String prehomoDeliverableTemplate = inventoryInfoEO.getPrehomoDeliverableTemplate();
String verifyDeliverableTemplate = inventoryInfoEO.getVerifyDeliverableTemplate();
//对应标准
if(StringUtils.isNotBlank(correspondingStandard)){
StringBuilder sb = new StringBuilder();
for (String s : correspondingStandard.split(",")) {
List<BussDocumentLibraryEO> collect = bussDocumentLibraryEOList.stream()
.filter(e -> s.equals(e.getId())).collect(Collectors.toList());
if(collect.size() != 0){
sb.append(collect.get(0).getSerialNumber() + ",");
}else{
sb.append(s + ",");
}
}
if(StringUtils.isNotBlank(sb)){
String substring = sb.substring(0, sb.length() - 1);
inventoryInfoEO.setCorrespondingStandard(substring);
}
}
//技术领域
if(StringUtils.isNotBlank(technologyTerritory)){
StringBuilder sb = new StringBuilder();
for (String s : technologyTerritory.split(",")) {
List<SysCategory> collect = sysCategoryList.stream()
.filter(e -> s.equals(e.getId())).collect(Collectors.toList());
if(collect.size() != 0){
sb.append(collect.get(0).getName()+",");
}
}
if(StringUtils.isNotBlank(sb)){
String substring = sb.substring(0, sb.length() - 1);
inventoryInfoEO.setTechnologyTerritory(substring);
}
}
//设计交付物模板
if(StringUtils.isNotBlank(designDeliverableTemplate)){
String designDeliverableTemplateName = template(fileInfos, designDeliverableTemplate);
inventoryInfoEO.setDesignDeliverableTemplateName(designDeliverableTemplateName);
}
//设计交付物模板
if(StringUtils.isNotBlank(prehomoDeliverableTemplate)){
String prehomoDeliverableTemplateName = template(fileInfos, prehomoDeliverableTemplate);
inventoryInfoEO.setPrehomoDeliverableTemplateName(prehomoDeliverableTemplateName);
}
//设计交付物模板
if(StringUtils.isNotBlank(verifyDeliverableTemplate)){
String verifyDeliverableTemplateName = template(fileInfos, verifyDeliverableTemplate);
inventoryInfoEO.setVerifyDeliverableTemplateName(verifyDeliverableTemplateName);
}
}
}
/**
* 模板名称转换
* @param fileInfos
* @param value
* @return
*/
private String template(List<OSSFile> fileInfos, String value) {
StringBuilder sb = new StringBuilder();
for (String s : value.split(",")) {
List<OSSFile> collect = fileInfos.stream().filter(e -> s.equals(e.getId())).collect(Collectors.toList());
if(collect.size() != 0){
sb.append(collect.get(0).getFileName()+",");
}
}
String substring = "";
if(StringUtils.isNotBlank(sb)){
substring = sb.substring(0, sb.length() - 1);
}
return substring;
}
/**
* 获取文件
* @param dataList
* @return
*/
private List<OSSFile> getOssFiles(List<DummyInventoryInfoEO> dataList) {
List<String> fileIdList = new ArrayList<>();
List<String> design = dataList.stream().map(DummyInventoryInfoEO::getDesignDeliverableTemplate).collect(Collectors.toList());
List<String> prehomo = dataList.stream().map(DummyInventoryInfoEO::getPrehomoDeliverableTemplate).collect(Collectors.toList());
List<String> verify = dataList.stream().map(DummyInventoryInfoEO::getVerifyDeliverableTemplate).collect(Collectors.toList());
fileIdList.addAll(design);
fileIdList.addAll(prehomo);
fileIdList.addAll(verify);
//查询所有的文件
List<OSSFile> fileInfos = new ArrayList<>();
if(fileIdList.size() != 0){
fileInfos = iOSSFileService.getFileInfos(StringUtils.join(fileIdList, ","));
}
return fileInfos;
}
private void exportFile(List<DummyInventoryInfoEO> dataList,List<OSSFile> fileInfos) throws IOException {
if(fileInfos.size() != 0){
for (DummyInventoryInfoEO inventoryInfoEO : dataList) {
String designDeliverableTemplate = inventoryInfoEO.getDesignDeliverableTemplate();
String prehomoDeliverableTemplate = inventoryInfoEO.getPrehomoDeliverableTemplate();
String verifyDeliverableTemplate = inventoryInfoEO.getVerifyDeliverableTemplate();
String serialNumber = inventoryInfoEO.getSerialNumber();
if(StringUtils.isBlank(serialNumber)){
continue;
}
List<OSSFile> designFileList = fileInfos.stream().filter(e -> designDeliverableTemplate.contains(e.getId())).collect(Collectors.toList());
List<OSSFile> prehomoFileList = fileInfos.stream().filter(e -> prehomoDeliverableTemplate.contains(e.getId())).collect(Collectors.toList());
List<OSSFile> verifyFileList = fileInfos.stream().filter(e -> verifyDeliverableTemplate.contains(e.getId())).collect(Collectors.toList());
List<OSSFile> oSSFileList = new ArrayList<>();
oSSFileList.addAll(designFileList);
oSSFileList.addAll(prehomoFileList);
oSSFileList.addAll(verifyFileList);
if(oSSFileList.size() != 0){
String fileNowPath = uploadpath + "/tempZip/" + serialNumber;
File file = new File(fileNowPath);
if (file.exists()) {
file.delete();
}
file.mkdirs();
for (OSSFile ossFile : oSSFileList) {
String url = ossFile.getUrl();
copyFile(url, fileNowPath + File.separator + ossFile.getFileName());
}
}
}
}
}
}
@@ -5,6 +5,8 @@ import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
@@ -192,4 +194,16 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
return this.projectLawsInventoryEOService.matchRelevantPeople(params);
}
/**
* 流程调用接口
* @param jsonObject
* @return
*/
@AutoLog(value = "项目库-法规清单表-流程调用")
@ApiOperation(value="项目库-法规清单表-流程调用", notes="项目库-法规清单表-流程调用")
@PostMapping(value = "/processCall")
public Result<?> processCall(@RequestBody JSONObject jsonObject){
return this.projectLawsInventoryEOService.processCall(jsonObject);
}
}
@@ -16,6 +16,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -70,7 +71,7 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
@AutoLog(value = "项目库基础表-添加")
@ApiOperation(value="项目库基础表-添加", notes="项目库基础表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) {
public Result<?> add(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
projectLibraryBaseService.add(projectLibraryBase);
return Result.OK("添加成功!");
}
@@ -68,9 +68,9 @@ public class ProjectTaskPlanningController extends JeroController<ProjectTaskPla
@AutoLog(value = "法规,认证任务计划 (各阶段确认进度) 表-列表查询")
@ApiOperation(value="法规,认证任务计划 (各阶段确认进度) 表-列表查询", notes="法规,认证任务计划 (各阶段确认进度) 表-列表查询")
@GetMapping(value = "/list")
public Result<List<ProjectTaskPlanning>> queryList() {
List<ProjectTaskPlanning> list = projectTaskPlanningService.queryList();
return Result.OK(list);
public Result<ProjectTaskPlanning> queryList(@RequestParam(name="projectId",required=true) String projectId) {
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningService.queryList(projectId);
return Result.OK(projectTaskPlanning);
}
/**
@@ -137,8 +137,8 @@ public class ProjectTaskPlanningController extends JeroController<ProjectTaskPla
*/
@AutoLog(value = "法规,认证任务计划 (各阶段确认进度) 表-通过projectId查询")
@ApiOperation(value="法规,认证任务计划 (各阶段确认进度) 表-通过projectId查询", notes="法规,认证任务计划 (各阶段确认进度) 表-通过projectId查询")
@GetMapping(value = "/queryByprojectId")
public Result<?> queryById(@RequestParam(name="id",required=true) String projectId) {
@GetMapping(value = "/queryByProjectId")
public Result<?> queryByProjectId(@RequestParam(name="projectId",required=true) String projectId) {
List<TimeNodeVO> projectTaskPlanning = projectTaskPlanningService.queryByProjectId(projectId);
if(projectTaskPlanning==null) {
return Result.error("未找到对应数据");
@@ -326,12 +326,12 @@ public class ProjectLawsInventoryEO implements Serializable {
/**法规工程师提交状态 :0通过 1驳回 */
@ApiModelProperty(value = "法规工程师提交状态")
@TableField(updateStrategy = FieldStrategy.IGNORED)
// @TableField(updateStrategy = FieldStrategy.IGNORED)
private String regulationOwnerSubmitStatus;
//这两个只要有一个是拒绝 那么该数据的清单确认状态就为拒绝
/**认证工程师提交状态 :0通过 1驳回 */
@ApiModelProperty(value = "认证工程师提交状态")
@TableField(updateStrategy = FieldStrategy.IGNORED)
// @TableField(updateStrategy = FieldStrategy.IGNORED)
private String homologationEngineerSubmitStatus;
@TableField(exist = false)
@@ -6,6 +6,14 @@ package com.jero.modules.project.enums;
public enum OperatorTypeEnum {
INVENTORY_AFFIRM("清单确认,studio工程师发起","0"),
SUBMIT_OR_REJECTED("法规、认证工程师提交或拒绝","1"),
/**
* 工作流调用后台操作类型
*/
ADD("添加","add"),
UPDATE_STATUS("修改状态","updateStatus"),
DELETE("删除","delete"),
QUERY("查询","query"),
;
String name;
@@ -0,0 +1,43 @@
package com.jero.modules.project.enums;
/**
* 请求来源枚举类
*/
public enum RequestSourceEnum {
WORK_FLOW("工作流后台","workFlow"),
;
String name;
String value;
private RequestSourceEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static String getTextByValue(String value) {
RequestSourceEnum[] values = values();
for (RequestSourceEnum requestSourceEnum : values) {
if (requestSourceEnum.value.equals(value)) {
return requestSourceEnum.name;
}
}
return null;
}
}
@@ -78,7 +78,7 @@ public class InventoryAffirmJob implements Job {
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectName());
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
List<String> threeDaysUserIdList = new ArrayList<>();
@@ -1,5 +1,6 @@
package com.jero.modules.project.service;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.api.vo.Result;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -78,4 +79,11 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
* @return
*/
Result<?> matchRelevantPeople(Map<String, Object> params);
/**
* 流程调用
* @param jsonObject
* @return
*/
Result<?> processCall(JSONObject jsonObject);
}
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.project.entity.ProjectLibraryBase;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
@@ -21,7 +22,7 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
* @param projectLibraryBase
* @return
*/
void add(ProjectLibraryBase projectLibraryBase);
void add(ProjectLibraryBase projectLibraryBase) throws ParseException;
/**
* 更新
@@ -59,5 +59,5 @@ public interface IProjectTaskPlanningService extends IService<ProjectTaskPlannin
*
* @return
*/
List<ProjectTaskPlanning> queryList();
ProjectTaskPlanning queryList(String projectId);
}
@@ -571,7 +571,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectName());
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
//消息内容
@@ -865,4 +865,41 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
return resultUserId;
}
/**
* 流程调用
* @param jsonObject
* @return
*/
@Override
public Result<?> processCall(JSONObject jsonObject) {
String requestSource = jsonObject.getString("requestSource");
if(StringUtils.isEmpty(requestSource)){
throw new JeroBootException("请求来源不能为空!");
}
if(!StringUtils.equals(requestSource,RequestSourceEnum.WORK_FLOW.getValue())){
throw new JeroBootException("来源有误,没有权限调用该接口!");
}
String operatorType = jsonObject.getString("operatorType");
if(StringUtils.isEmpty(operatorType)){
throw new JeroBootException("操作类型不能为空!");
}
if(StringUtils.equals(operatorType,OperatorTypeEnum.UPDATE_STATUS.getValue())){
ProjectLawsInventoryEO projectLawsInventoryEO = JSONObject.parseObject(jsonObject.toString(), ProjectLawsInventoryEO.class);
this.baseMapper.updateById(projectLawsInventoryEO);
}
if(StringUtils.equals(operatorType,OperatorTypeEnum.ADD.getValue())){
}
if(StringUtils.equals(operatorType,OperatorTypeEnum.DELETE.getValue())){
}
if(StringUtils.equals(operatorType,OperatorTypeEnum.QUERY.getValue())){
}
return new Result<>().success("调用成功!");
}
}
@@ -18,6 +18,7 @@ import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@@ -40,6 +41,8 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
@Autowired
private ProjectRelatedPersonnelServiceImpl projectRelatedPersonnelService;
@Autowired
private ProjectTaskPlanningServiceImpl projectTaskPlanningService;
/**
* 保存
@@ -48,7 +51,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
* @return
*/
@Override
public void add(ProjectLibraryBase projectLibraryBase) {
public void add(ProjectLibraryBase projectLibraryBase) throws ParseException {
Date now = new Date();
projectLibraryBase.setCreateTime(now);
@@ -66,7 +69,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
projectRelatedPersonnelService.setDutyTerritoryValue(sysDictItemValue,projectLibraryBase.getId());
}
}
projectTaskPlanningService.setProjectTaskPlanning(projectLibraryBase.getId());
}
/**
@@ -7,10 +7,12 @@ import com.jero.modules.project.enums.ProjectTaskPlanningNameEnum;
import com.jero.modules.project.mapper.ProjectTaskPlanningMapper;
import com.jero.modules.project.service.IProjectTaskPlanningService;
import com.jero.modules.project.vo.TimeNodeVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@@ -92,40 +94,49 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningMapper.getByProjectId(projectId);
List<TimeNodeVO> timeNodeVOS = new ArrayList<>();
TimeNodeVO listConfirmationVO = new TimeNodeVO();
listConfirmationVO.setName(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getName());
listConfirmationVO.setTime(projectTaskPlanning.getListConfirmation());
timeNodeVOS.add(listConfirmationVO);
TimeNodeVO legalTaskConfirmationVO = new TimeNodeVO();
legalTaskConfirmationVO.setName(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getName());
legalTaskConfirmationVO.setTime(projectTaskPlanning.getLegalTaskConfirmation());
timeNodeVOS.add(legalTaskConfirmationVO);
TimeNodeVO designDeadlineVO = new TimeNodeVO();
designDeadlineVO.setName(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getName());
designDeadlineVO.setTime(projectTaskPlanning.getDesignDeadline());
timeNodeVOS.add(designDeadlineVO);
TimeNodeVO prehomoDeadlineVO = new TimeNodeVO();
prehomoDeadlineVO.setName(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getName());
prehomoDeadlineVO.setTime(projectTaskPlanning.getPrehomoDeadline());
timeNodeVOS.add(prehomoDeadlineVO);
TimeNodeVO attestationStartTimeVO = new TimeNodeVO();
attestationStartTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getName());
attestationStartTimeVO.setTime(projectTaskPlanning.getAttestationStartTime());
timeNodeVOS.add(attestationStartTimeVO);
TimeNodeVO attestationEndTimeVO = new TimeNodeVO();
attestationEndTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getName());
attestationEndTimeVO.setTime(projectTaskPlanning.getAttestationEndTime());
timeNodeVOS.add(attestationEndTimeVO);
TimeNodeVO verifyDeadlineVO = new TimeNodeVO();
verifyDeadlineVO.setName(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getName());
verifyDeadlineVO.setTime(projectTaskPlanning.getVerifyDeadline());
timeNodeVOS.add(verifyDeadlineVO);
if(StringUtils.isNotBlank(projectTaskPlanning.getListConfirmation().toString())) {
listConfirmationVO.setName(ProjectTaskPlanningNameEnum.LIST_CONFIRMATION.getName());
listConfirmationVO.setTime(projectTaskPlanning.getListConfirmation());
timeNodeVOS.add(listConfirmationVO);
}
if(!StringUtils.isEmpty(projectTaskPlanning.getLegalTaskConfirmation().toString())) {
TimeNodeVO legalTaskConfirmationVO = new TimeNodeVO();
legalTaskConfirmationVO.setName(ProjectTaskPlanningNameEnum.LEGAL_TASK_CONFIRMATION.getName());
legalTaskConfirmationVO.setTime(projectTaskPlanning.getLegalTaskConfirmation());
timeNodeVOS.add(legalTaskConfirmationVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getDesignDeadline().toString())) {
TimeNodeVO designDeadlineVO = new TimeNodeVO();
designDeadlineVO.setName(ProjectTaskPlanningNameEnum.DESIGN_DEADLINE.getName());
designDeadlineVO.setTime(projectTaskPlanning.getDesignDeadline());
timeNodeVOS.add(designDeadlineVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getPrehomoDeadline().toString())) {
TimeNodeVO prehomoDeadlineVO = new TimeNodeVO();
prehomoDeadlineVO.setName(ProjectTaskPlanningNameEnum.PREHOMO_DEADLINE.getName());
prehomoDeadlineVO.setTime(projectTaskPlanning.getPrehomoDeadline());
timeNodeVOS.add(prehomoDeadlineVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getAttestationStartTime().toString())) {
TimeNodeVO attestationStartTimeVO = new TimeNodeVO();
attestationStartTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_START_TIME.getName());
attestationStartTimeVO.setTime(projectTaskPlanning.getAttestationStartTime());
timeNodeVOS.add(attestationStartTimeVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getAttestationEndTime().toString())) {
TimeNodeVO attestationEndTimeVO = new TimeNodeVO();
attestationEndTimeVO.setName(ProjectTaskPlanningNameEnum.ATTESTATION_END_TIME.getName());
attestationEndTimeVO.setTime(projectTaskPlanning.getAttestationEndTime());
timeNodeVOS.add(attestationEndTimeVO);
}
if(StringUtils.isNotBlank(projectTaskPlanning.getVerifyDeadline().toString())) {
TimeNodeVO verifyDeadlineVO = new TimeNodeVO();
verifyDeadlineVO.setName(ProjectTaskPlanningNameEnum.VERIFY_DEADLINE.getName());
verifyDeadlineVO.setTime(projectTaskPlanning.getVerifyDeadline());
timeNodeVOS.add(verifyDeadlineVO);
}
// 排序
Collections.sort(timeNodeVOS, listConfirmationVO);
@@ -138,7 +149,22 @@ public class ProjectTaskPlanningServiceImpl extends ServiceImpl<ProjectTaskPlann
* @return
*/
@Override
public List<ProjectTaskPlanning> queryList() {
return list();
public ProjectTaskPlanning queryList(String projectId) {
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningMapper.getByProjectId(projectId);
return projectTaskPlanning;
}
public void setProjectTaskPlanning(String projectId) throws ParseException {
ProjectTaskPlanning projectTaskPlanning=new ProjectTaskPlanning();
projectTaskPlanning.setProjectId(projectId);
Date now = new Date();
projectTaskPlanning.setListConfirmation(now);
projectTaskPlanning.setLegalTaskConfirmation(now);
projectTaskPlanning.setDesignDeadline(now);
projectTaskPlanning.setPrehomoDeadline(now);
projectTaskPlanning.setAttestationStartTime(now);
projectTaskPlanning.setAttestationEndTime(now);
projectTaskPlanning.setVerifyDeadline(now);
add(projectTaskPlanning);
}
}
+7
View File
@@ -701,4 +701,11 @@ module.exports = {
regulatoryTaskConfirmation:'Regulatory task confirmation',
certificationStart:'Certification start',
certificationEnd:'Certification end',
directoryName:'Directory name',
batch:'batch',
uploadTime:'Upload time',
enclosure:'enclosure',
// 认证
parameterTemplate: 'parameter Template',
contentDescription: 'content Description'
}
+7
View File
@@ -706,4 +706,11 @@ module.exports = {
regulatoryTaskConfirmation:'法规任务确认',
certificationStart:'认证开始',
certificationEnd:'认证结束',
directoryName:'目录名称',
batch:'批次',
uploadTime:'上传时间',
enclosure:'附件',
// 认证
parameterTemplate: '参数模板',
contentDescription: '内容说明'
}
+9 -5
View File
@@ -4,8 +4,8 @@
class="upload-text"
:multiple="false" :headers="tokenHeader"
:action="importUrl+'?cut='+cut"
@change="handleImportZip"
accept=".zip">
@change="handleImport"
:accept="accept">
<a-icon type="import" :rotate="270"/>
{{$t('import')}}
</a-upload>
@@ -28,12 +28,16 @@
isTrue:{
type: Boolean,
default: false
}
},
accept:{
type: String,
default: ''
},
},
data() {
return {
tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
importUrl: window._CONFIG['domianURL'] + this.url.importZipUrl,
importUrl: window._CONFIG['domianURL'] +'/'+ this.url.importZipUrl,
cut: '',
}
},
@@ -47,7 +51,7 @@
}
},
methods: {
handleImportZip(info) {
handleImport(info) {
this.spinning = true
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList)
@@ -25,7 +25,7 @@
{{$t('templateDownload')}}
</div>
<div class="operator-text" v-has="'document:importZip'">
<ImportFile :url="url"/>
<ImportFile :url="url" :isTrue="false" :accept="'.zip'"/>
</div>
<div @click="handleAdd" class="operator-text" v-has="'document:getInfoById'">
<a-icon type="plus"/>
@@ -49,7 +49,7 @@
<span>{{$t('standard')}}</span>
</div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.standard"></j-input>
v-model="queryParam.serialNumber"></j-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
@@ -88,7 +88,7 @@
{{$t('DocumentStandard')}}
</div>
<div class="operator-text" v-has="'document:importZip'" v-if="isTrue">
<ImportFile :url="url"/>
<ImportFile :url="url" :isTrue="true" @getList="getPersonnelList" :accept="'.zip'"/>
</div>
<!-- 模板下载-->
<div @click="handleModule" class="operator-text" v-if="isTrue">
@@ -304,7 +304,7 @@
title: this.$t('correspondingStandard'),
align: 'center',
ellipsis: true,
dataIndex: 'correspondingStandard_dictText'
dataIndex: 'correspondingStandardName'
},
{
title: this.$t('zoneOfApplication'),
@@ -455,14 +455,14 @@
// fieldList | array |✔| 需要查询的列集合示例如下,type类型有:date/datetime/string/int/number
fieldList: [
{
type: 'date',
type: '',
value: 'shi4Yong4Fan4Wei2',
text: this.$t('scopeOfApplication'),
dictCode: 'apply_scope'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
{
type: 'date',
value: 'status',
type: '',
value: 'state',
text: this.$t('status'),
dictCode: 'state'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
@@ -472,13 +472,13 @@
text: this.$t('correspondingStandard')
},
{
type: 'date',
type: '',
value: 'region',
text: this.$t('zoneOfApplication'),
dictCode: 'region'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
},
{
type: 'date',
type: '',
value: 'implementType',
text: this.$t('implementationCategory'),
dictCode: 'implement_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
@@ -622,6 +622,9 @@
}
})
},
getPersonnelList(){
this.getList()
},
batSettingList() {
this.getList()
},
@@ -0,0 +1,309 @@
<template>
<a-drawer
:title="title"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('parameterTemplate')">{{$t('parameterTemplate')}}</span>
</div>
<a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline.paramsTemplateName"
:placeholder="$t('PleaseEnter')+$t('parameterTemplate')"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('status')">{{$t('status')}}</span>
</div>
<a-form-model-item class="itemModel" prop="status">
<j-dict-select-tag class="box-input" v-model="formInline.status"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
:triggerChange="false" :dictCode="'params_template_state'"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('zoneOfApplication')">{{$t('zoneOfApplication')}}</span>
</div>
<a-form-model-item class="itemModel" prop="region">
<j-dict-select-tag class="box-input" v-model="formInline.region"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('zoneOfApplication')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('contentDescription')">{{$t('contentDescription')}}</span>
</div>
<a-form-model-item class="itemModel" prop="description">
<a-input class="box-input"
type="textarea"
:disabled="disabled"
v-model="formInline.description"
:placeholder="$t('PleaseEnter')+$t('contentDescription')"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
export default {
name: 'addModel',
components: {
PersonnelSelection
},
props: ['url'],
data() {
return {
formInline: {},
confirmLoading: false,
visible: false,
rules: {
paramsTemplateName: [
{ required: true, message: this.$t('pleaseEnter')+ this.$t('parameterTemplate'),trigger: 'change'},
{ max: 50, message: this.$t('cantExeed')+ 50 + this.$t('characters'),trigger: 'change'},
],
status: [
{ required: true, message: this.$t('PleaseSelect')+ this.$t('status'),trigger: 'change'},
],
region: [
{ required: true, message: this.$t('PleaseSelect')+ this.$t('zoneOfApplication'),trigger: 'change'},
],
description: [
{ max: 300, message: this.$t('cantExeed')+ 300 + this.$t('characters'),trigger: 'change'},
]
},
disabled: false,
projectNameList: [],
title: ''
}
},
mounted() {
this.getNameList()
},
methods: {
getNameList() {
getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) {
this.projectNameList = res.result || []
} else {
this.projectNameList = []
}
})
},
addModel() {
this.visible = true
this.title = '新增'
this.formInline = {}
},
editModel(value) {
this.visible = true
this.title = '编辑'
this.$nextTick(() => {
this.formInline = value
})
},
handleCancel() {
this.visible = false
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
let Action
if (this.formInline.id) {
url = this.url.edit
Action = putAction
} else {
url = this.url.add
Action = postAction
}
let query = JSON.parse(JSON.stringify(this.formInline))
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
this.confirmLoading = true
Action(url, query).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.$emit('addModelList')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
}
})
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
projectNameChange(value){
console.log(value)
},
}
}
</script>
<style>
.formAdd .ant-form-item-label {
width: 130px;
}
.formAdd .ant-form-item-control-wrapper {
display: inline-block;
width: calc(100% - 130px);
}
/*.formAdd .ant-form-item {*/
/* margin-bottom: 20px;*/
/*}*/
.itemModel .ant-form-item-control-wrapper {
width: 100%;
}
.box-input .ant-select-selection--single {
height: 38px;
}
.box-input .ant-select-selection--multiple {
height: 38px;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
margin-top: 6px;
}
.box-input .ant-calendar-picker {
line-height: 38px;
height: 38px;
}
.box-input .ant-calendar-picker-input {
height: 38px;
}
.box-input .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
</style>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
<style>
.ant-input-disabled {
color: rgba(0, 0, 0, 0.65) !important;
}
</style>
+396
View File
@@ -0,0 +1,396 @@
<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('zoneOfApplication')">
<span>{{$t('zoneOfApplication')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.region"
:placeholder="$t('PleaseSelect')+$t('zoneOfApplication')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('parameterTemplate')">
<span>{{$t('parameterTemplate')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('parameterTemplate')"
v-model="queryParam.paramsTemplateName"></a-input>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.status"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
:triggerChange="false" :dictCode="'params_template_state'"/>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</div>
<div class="table-operator">
<div @click="handleAdd" class="operator-text" v-has="'document:getInfoById'">
<a-icon type="plus"/>
{{$t('add')}}
</div>
<div @click="handleCode" class="operator-text" v-has="'document:getInfoById'">
<a-icon type="copy"/>
{{$t('copy')}}
</div>
<div @click="handleDel" class="operator-text" v-has="'document:deleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div>
<a-table
ref="table"
size="middle"
:loading="loading"
:pagination="false"
:scroll="{x: true}"
rowKey="id"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
<span slot="projectName" slot-scope="text,record">
<a @click="entryNameClick(record)">{{text}}</a>
</span>
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span>
</a-table>
</div>
<div class="page">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
</a-card>
</template>
<script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import addModel from './components/addModel'
export default {
name: 'index',
components: {
addModel
},
data() {
return {
loading: false,
toggleSearchStatus: false,
selectedRowKeys: [],
formInline: {},
rules: {},
visible: false,
dataSource: [],
confirmLoading: false,
url: {
list: 'params/template/list',
add: 'params/template/add',
edit: 'params/template/edit',
deleteBatch: 'params/template/delete',
deleteAll: 'params/template/deleteBatch'
},
total: 0,
pageSize: 10,
pageNo: 1,
title: '新增',
columns: [
{
title: this.$t('zoneOfApplication'),
align: 'center',
dataIndex: 'region_dictText',
// width: 10%,
},
{
title: this.$t('parameterTemplate'),
align: 'center',
dataIndex: 'paramsTemplateName',
scopedSlots: { customRender: 'projectName' },
// width: 10%,
},
{
title: this.$t('contentDescription'),
align: 'center',
dataIndex: 'description',
// width: 10%
},
{
title: this.$t('status'),
align: 'center',
dataIndex: 'state_dictText'
},
{
title: this.$t('createTime'),
align: 'center',
dataIndex: 'createTime'
},
{
title: this.$t('updateTime'),
align: 'center',
dataIndex: 'updateTime'
},
{
title: this.$t('operation'),
align: 'center',
fixed: 'right',
width: 200,
scopedSlots: { customRender: 'operation' }
}
],
queryParam: {}
}
},
mounted() {
this.getList()
},
methods: {
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
onSelectChange(value) {
this.selectedRowKeys = value
},
//添加
handleAdd() {
this.$refs.addModelRef.addModel()
},
// 复制
handleCode() {
},
//批量删除
handleDel() {
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
deleteAction(_this.url.deleteAll, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
//编辑
edit(item) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item)))
},
//删除
deleteLib(val) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmDelete'),
onOk() {
deleteAction(_this.url.deleteBatch, { id: val.id }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.getList()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
},
//虚拟清单名称事件
entryNameClick(item) {
// let newUrl = this.$router.resolve({
// path: '/ProjectDetails',
// query: item
// })
// window.open(newUrl.href, '_blank')
},
searchQuery() {
this.pageNo = 1
this.getList()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.getList()
},
pageOnChange(page, pageSize) {
this.pageNo = page
this.getList()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getList()
},
addModelList() {
this.pageNo = 1
this.getList()
},
PersonnelSelectionChange(value, id) {
this.queryParam[value] = id
this.queryParam = { ...this.queryParam }
},
getList() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
console.log(res.result)
if (res.result.current > 1 && res.result.records.length == 0) {
this.pageNo = res.result.current - 1
this.getList()
return
}
this.dataSource = res.result || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
/*margin-top: 2px;*/
}
.text-operation {
margin-right: 8px;
}
.page {
text-align: right;
margin-top: 20px;
}
.box-title-text-add {
line-height: 1.4;
display: flex;
}
.title-text-add {
width: 114px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 42px;
margin-top: 3px;
}
.box-input-add {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
@@ -90,65 +90,17 @@
<div class="process-content">
<div style="display: flex;justify-content: space-between">
<div class="process-content-content">
<div class="process-content-content" v-for="(item,index) in regulatoryCertificationTaskPlanList" :key="index">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认打扫房间十大科技孵化开具收费电视</div>
<div class="process-content-right-button">2021-10-13</div>
</div>
</div>
<div class="process-content-content">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认</div>
<div class="process-content-right-button">2021-10-13</div>
</div>
</div>
<div class="process-content-content">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认</div>
<div class="process-content-right-button">2021-10-13</div>
</div>
</div>
<div class="process-content-content">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认</div>
<div class="process-content-right-button">2021-10-13</div>
</div>
</div>
<div class="process-content-content">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认</div>
<div class="process-content-right-button">2021-10-13</div>
</div>
</div>
<div class="process-content-content">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认</div>
<div class="process-content-right-button">2021-10-13</div>
</div>
</div>
<div class="process-content-content">
<img src="../../../assets/wancheng.png" class="process-content-left" alt="">
<div class="process-content-right">
<div class="process-content-right-top">法规清单确认</div>
<div class="process-content-right-button">2021-10-13</div>
<div class="process-content-right-top">{{item.name}}</div>
<div class="process-content-right-button">{{item.time}}</div>
</div>
</div>
</div>
<div class="process-content-right-xian"></div>
</div>
<a-tabs default-active-key="1" class="ant-tabs">
<a-tabs style="margin-top: 20px" default-active-key="1" class="ant-tabs">
<a-tab-pane key="1" :tab="$t('DeliverableStatus')">
<div class="box-content">
<div class="box-content-left">
@@ -171,7 +123,7 @@
</a-tabs>
<listOfRelevantPersonnel ref="listOfRelevantPersonnelRef"/>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<settingList :url="url" ref="settingListRef"/>
<settingList :url="url" ref="settingListRef" @settingListForm="settingListForm"/>
</div>
</template>
@@ -196,8 +148,12 @@
queryById: 'project/projectLibraryBase/queryById',
add: 'project/projectLibraryBase/add',
edit: 'project/projectLibraryBase/edit',
queryByprojectId:'project/projectTaskPlanning/queryByprojectId',
}
queryByProjectId: 'project/projectTaskPlanning/queryByProjectId',
addSettingUrl: 'project/projectTaskPlanning/add',
editSettingUrl: 'project/projectTaskPlanning/edit',
settingQueryForm: '/project/projectTaskPlanning/list'
},
regulatoryCertificationTaskPlanList: []
}
},
mounted() {
@@ -215,15 +171,18 @@
}
})
},
getSetting(){
getAction(this.url.queryByprojectId, { id: this.$route.query.id }).then((res) => {
getSetting() {
getAction(this.url.queryByProjectId, { projectId: this.$route.query.id }).then((res) => {
if (res.success) {
console.log(res)
this.regulatoryCertificationTaskPlanList = res.result || []
} else {
this.regulatoryCertificationTaskPlanList = []
}
})
},
settingListForm() {
this.getSetting()
},
mainEcharts() {
var myChart = echarts.init(document.getElementById('main'))
myChart.setOption({
@@ -258,9 +217,9 @@
addModelList() {
this.getForm()
},
settingClick(){
this.$refs.settingListRef.edit()
},
settingClick() {
this.$refs.settingListRef.edit()
}
}
}
</script>
@@ -315,7 +274,6 @@
.process-content {
margin-top: 4px;
height: 60px;
position: relative;
.process-content-content {
@@ -335,13 +293,14 @@
font-size: 14px;
font-weight: 400;
color: #040B29;
max-width: 94px;
max-width: 155px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.process-content-right-button {
max-width: 155px;
font-size: 12px;
font-weight: 400;
color: #6F7385;
@@ -360,7 +319,7 @@
}
.process-content-right-xian {
height: 1px;
height: 2px;
width: calc(100% - 27px);
background: #E6E6E9;
position: absolute;
@@ -395,8 +354,13 @@
.process-content-right-top {
max-width: 70px !important;
white-space: inherit !important;
overflow: hidden !important;
}
.process-content-right-button {
max-width: 70px !important;
}
}
.text-field-right-color {
@@ -53,12 +53,17 @@
>
</a-table>
</div>
<certificationDirectory :url="url" ref="certificationDirectoryRef"/>
</a-card>
</template>
<script>
import certificationDirectory from './certificationDirectory'
export default {
name: 'TaskList',
components:{
certificationDirectory
},
data() {
return {
columns: [
@@ -191,7 +196,7 @@
},
CertificationDirectory() {
this.$refs.certificationDirectoryRef.addModel()
}
}
}
@@ -29,7 +29,7 @@
{{$t('templateDownload')}}
</div>
<div class="operator-text" v-has="'document:importZip'">
<ImportFile :url="url"/>
<ImportFile :url="url" :isTrue="true" @getList="getPersonnelList" :accept="'.zip'"/>
</div>
<div @click="handleDel" class="operator-text">
<a-icon type="delete"/>
@@ -145,6 +145,9 @@
},
handleDel(){
},
getPersonnelList(){
},
},
}
@@ -0,0 +1,220 @@
<template>
<div>
<a-drawer
:title="$t('CertificationDirectory')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px">
<div class="table-operator">
<div class="operator-text">
<a-icon type="plus"/>
{{$t('add')}}
</div>
</div>
<a-table
:columns="columns"
:scroll="{x: 800}"
:data-source="dataList"
:pagination="false"
:loading="loading">
<span slot="operation" slot-scope="text,record">
<a class="text" @click="edit(record)">
{{ $t('edit') }}
</a>
</span>
</a-table>
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => $t('total')+`${total}`+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'certificationDirectory',
components: {},
props: ['url'],
data() {
return {
visible: false,
queryParam: {},
confirmLoading: false,
selectedRowKeys: [],
columns: [
{
title: this.$t('directoryName'),
dataIndex: 'directoryName',
align: 'center',
ellipsis: true
},
{
title: this.$t('batch'),
dataIndex: 'batch',
align: 'center',
ellipsis: true
},
{
title: this.$t('uploadTime'),
dataIndex: 'uploadTime',
align: 'center',
ellipsis: true
},
{
title: this.$t('enclosure'),
dataIndex: 'enclosure',
align: 'center',
ellipsis: true
},
{
title: this.$t('operation'),
align: 'center',
width: 130,
scopedSlots: { customRender: 'operation' }
}
],
dataList: [],
content: [],
loading: false,
pageNo: 1,
pageSize: 10,
total: 0
}
},
mounted() {
},
methods: {
addModel() {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.replacePage()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.replacePage()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam
}
this.loading = true
postAction(this.url.addModelList, query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
handleCancel() {
this.visible = false
},
handleSubmit() {
this.visible = false
},
edit() {
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.page {
text-align: right;
margin-top: 20px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 20%;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
height: 38px;
margin-top: 2px;
}
.box-button {
height: 38px;
}
.table-operator{
text-align: right;
margin-bottom: 20px;
}
</style>
@@ -65,7 +65,7 @@
</div>
<div style="float: right;margin-top: 1px" v-if="isDisplay">
<div class="operator-text" v-has="'document:importZip'">
<ImportFile :url="url"/>
<ImportFile :url="url" :isTrue="true" :accept="'.xls'" @getList="getPersonnelList"/>
</div>
<div @click="handleModule" class="operator-text">
<a-icon type="download"/>
@@ -519,7 +519,7 @@ export default {
text: this.$t('correspondingStandard')
},
{
type: 'date',
type: '',
value: 'implementType',
text: this.$t('implementationCategory'),
dictCode: 'implement_type'//只要 dictCode 有值,无论 type 是什么,都显示为字典下拉框
@@ -701,6 +701,9 @@ export default {
}
})
},
getPersonnelList(){
this.getList()
},
initiateListConfirmationcClick() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
@@ -18,7 +18,7 @@
{{$t('export')}}
</div>
<div class="operator-text">
<ImportFile :url="url" :isTrue="true" @getList="getPersonnelList"/>
<ImportFile :url="url" :isTrue="true" :accept="'.xls'" @getList="getPersonnelList"/>
</div>
</div>
<a-table
@@ -245,7 +245,8 @@
url: {
list: '/project/projectRelatedPersonnel/list',
edit: '/project/projectRelatedPersonnel/edit',
exportData: '/project/projectRelatedPersonnel/exportXls'
exportData: '/project/projectRelatedPersonnel/exportXls',
importZipUrl:'/project/projectRelatedPersonnel/importExcel',
},
selectedRowKeys: []
}
@@ -331,8 +332,8 @@
handleExport() {
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
let query = {
ids: selectedRowKeys.join(','),
projectId: this.$route.query.id
id: selectedRowKeys.join(','),
// projectId: this.$route.query.id
}
downloadFile(this.url.exportData, this.$t('ListOfRelevantPersonnel') + '.xls', query, this.Deselect)
},
@@ -135,7 +135,7 @@
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import { getAction, postAction, putAction } from '@/api/manage'
import moment from 'moment'
export default {
@@ -153,26 +153,40 @@
mounted() {
},
methods: {
edit(data) {
edit() {
this.visible = true
this.$nextTick(() => {
this.ids = data || []
this.formInline = {}
this.settingQueryForm()
},
settingQueryForm() {
getAction(this.url.settingQueryForm, { projectId: this.$route.query.id }).then((res) => {
if (res.success) {
this.$nextTick(() => {
this.formInline = res.result || {}
})
}
})
},
handleOk() {
let ids = JSON.parse(JSON.stringify(this.ids))
let query = {
ids: ids.join(','),
...this.formInline
...this.formInline,
projectId: this.$route.query.id
}
let url = ''
let Action
if (this.formInline.id) {
url = this.url.editSettingUrl
Action = putAction
} else {
url = this.url.addSettingUrl
Action = postAction
}
this.confirmLoading = true
postAction(this.url.setBatch, query).then((res) => {
Action(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('batSettingList')
this.$emit('settingListForm')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
@@ -183,12 +197,6 @@
this.formInline = {}
this.visible = false
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
dateChange(item) {
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : ''
}