Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-05-06 15:43:19 +08:00
18 changed files with 898 additions and 371 deletions
@@ -1297,6 +1297,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
if(StringUtils.isNotBlank(dummyInventoryInfoEO.getIds())){
queryWrapper.in("id",Arrays.asList(dummyInventoryInfoEO.getIds().split(",")));
}
queryWrapper.orderByDesc("create_time");
//导出的数据
dataList = this.list(queryWrapper);
@@ -1365,9 +1366,9 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
correspondingStandardIdList.addAll(Arrays.asList(correspondingStandard.split(",")));
}
}
LambdaQueryWrapper<BussDocumentLibraryEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(BussDocumentLibraryEO::getId,correspondingStandardIdList);
List<BussDocumentLibraryEO> bussDocumentLibraryEOList = iBussDocumentLibraryEOService.list(lambdaQueryWrapper);
// LambdaQueryWrapper<BussDocumentLibraryEO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// lambdaQueryWrapper.in(BussDocumentLibraryEO::getId,correspondingStandardIdList);
// List<BussDocumentLibraryEO> bussDocumentLibraryEOList = iBussDocumentLibraryEOService.list(lambdaQueryWrapper);
for (DummyInventoryInfoEO inventoryInfoEO : dataList) {
String correspondingStandard = inventoryInfoEO.getCorrespondingStandard();
@@ -1376,22 +1377,22 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
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(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();
@@ -59,119 +59,144 @@ public class ProjectLawsInventoryEO implements Serializable {
private String sysOrgCode;
/**项目库id*/
@Excel(name = "项目库id", width = 15)
@ApiModelProperty(value = "项目库id")
private String projectLibraryId;
/**编号*/
@Excel(name = "编号", width = 15)
@Excel(name = "编号", width = 20)
@ApiModelProperty(value = "编号")
private String serialNumber;
/**标题*/
@Excel(name = "标题", width = 15)
@Excel(name = "标题", width = 20)
@ApiModelProperty(value = "标题")
private String title;
/**子标题*/
@Excel(name = "子标题", width = 15)
@Excel(name = "子标题", width = 20)
@ApiModelProperty(value = "子标题")
private String subtitle;
/**清单确认状态*/
@ApiModelProperty(value = "清单确认状态")
private String inventoryAffirmStatus;
@TableField(exist = false)
@Excel(name = "清单确认状态", width = 20)
@ApiModelProperty(value = "清单确认状态名称")
private String inventoryAffirmStatusName;//清单确认状态名称
/**任务确认状态*/
@ApiModelProperty(value = "任务确认状态")
private String taskAffirmStatus;
@TableField(exist = false)
@ApiModelProperty(value = "任务发布状态名称")
@Excel(name = "任务确认状态", width = 20)
private String taskAffirmStatusName;//任务发布状态名称
/**适用地区*/
@ApiModelProperty(value = "适用地区")
@Dict(dicCode ="region")
@Excel(name = "适用地区", width = 15, dicCode = "region")
private java.lang.String region;
/**对应标准*/
@Excel(name = "对应标准", width = 15)
@Excel(name = "对应标准", width = 20)
@ApiModelProperty(value = "对应标准")
private String correspondingStandard;
/**实施类别*/
@Excel(name = "实施类别", width = 15)
@Excel(name = "实施类别", width = 20,dicCode ="implement_type")
@ApiModelProperty(value = "实施类别")
@Dict(dicCode ="implement_type")
private String implementType;
/**新车型实施日期*/
@Excel(name = "新车型实施日期", width = 15, format = "yyyy-MM-dd")
@Excel(name = "新车型实施日期", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "新车型实施日期")
private Date xin1Che1Xing2Shi2Shi1Ri4Qi1;
/**在产车实施日期*/
@Excel(name = "在产车实施日期", width = 15, format = "yyyy-MM-dd")
@Excel(name = "在产车实施日期", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "在产车实施日期")
private Date implementTime;
/**认证类型*/
@Excel(name = "认证类型", width = 15)
@Excel(name = "认证类型", width = 20,dicCode ="attestation_type")
@ApiModelProperty(value = "认证类型")
@Dict(dicCode ="attestation_type")
private String attestationType;
/**认证级别*/
@Excel(name = "认证级别", width = 15)
@Excel(name = "认证级别", width = 20,dicCode ="attestation_rank")
@ApiModelProperty(value = "认证级别")
@Dict(dicCode ="attestation_rank")
private String attestationRank;
/**WVTA ID*/
@Excel(name = "WVTA ID", width = 15)
@Excel(name = "WVTA ID", width = 20)
@ApiModelProperty(value = "WVTA ID")
private String wvtaId;
/**责任领域*/
@Excel(name = "责任领域", width = 15)
@Excel(name = "责任领域", width = 20,dicCode ="duty_territory")
@ApiModelProperty(value = "责任领域")
@Dict(dicCode ="duty_territory")
private String dutyTerritory;
/**法规工程师id*/
@Excel(name = "法规工程师id", width = 15)
@ApiModelProperty(value = "法规工程师id")
private String regulationOwnerId;
@Excel(name = "法规工程师", width = 20)
@TableField(exist = false)
@ApiModelProperty(value = "法规工程师名称")
private String regulationOwnerName;//法规工程师名称
/**认证工程师id*/
@Excel(name = "认证工程师id", width = 15)
@ApiModelProperty(value = "认证工程师id")
private String homologationEngineerId;
@Excel(name = "认证工程师", width = 20)
@TableField(exist = false)
@ApiModelProperty(value = "认证工程师名称")
private String homologationEngineerName;//认证工程师名称
/**工程接口人id*/
@Excel(name = "工程接口人id", width = 15)
@ApiModelProperty(value = "工程接口人id")
private String engineeringInterfacePerson;
@Excel(name = "工程接口人", width = 20)
@TableField(exist = false)
@ApiModelProperty(value = "工程接口人名称")
private String engineeringInterfacePersonName;//工程接口人名称
/**备注*/
@Excel(name = "备注", width = 15)
@Excel(name = "备注", width = 20)
@ApiModelProperty(value = "备注")
private String remark;
/**设计符合性确认-交付物类型*/
@Excel(name = "设计符合性确认-交付物类型", width = 15)
@Excel(name = "设计符合性确认-交付物类型", width = 20,dicCode ="deliverable_template")
@ApiModelProperty(value = "设计符合性确认-交付物类型")
@Dict(dicCode ="deliverable_template")
private String designDeliverableType;
/**设计符合性确认-交付物模板*/
@Excel(name = "设计符合性确认-交付物模板", width = 15)
@ApiModelProperty(value = "设计符合性确认-交付物模板")
private String designDeliverableTemplate;
/**设计符合性确认-交付物模板名称*/
@TableField(exist = false)
@Excel(name = "设计符合性确认-交付物模板", width = 20)
private String designDeliverableTemplateName;
/**设计符合性确认-发起人角色*/
@Excel(name = "设计符合性确认-发起人角色", width = 15)
@ApiModelProperty(value = "设计符合性确认-发起人角色")
@Dict(dicCode ="fa1_qi3_ren2")
private String designInitiator;
@@ -179,12 +204,13 @@ public class ProjectLawsInventoryEO implements Serializable {
/**设计符合性确认-发起人id*/
@ApiModelProperty(value = "设计符合性确认-发起人id")
private String designInitiatorId;
/**设计符合性确认-发起人名称*/
@Excel(name = "设计符合性确认-发起人", width = 20)
@TableField(exist = false)
private String designInitiatorName;
/**设计符合性确认-责任人角色*/
@Excel(name = "设计符合性确认-责任人角色", width = 15)
@ApiModelProperty(value = "设计符合性确认-责任人角色")
@Dict(dicCode ="ze2_ren4_ren2")
private String designDuty;
@@ -192,34 +218,35 @@ public class ProjectLawsInventoryEO implements Serializable {
/**设计符合性确认-责任人id*/
@ApiModelProperty(value = "设计符合性确认-责任人id")
private String designDutyId;
/**设计符合性确认-责任人名称*/
@Excel(name = "设计符合性确认-责任人", width = 20)
@TableField(exist = false)
private String designDutyName;
/**设计符合性确认-截止时间*/
@Excel(name = "设计符合性确认-截止时间", width = 15, format = "yyyy-MM-dd")
@Excel(name = "设计符合性确认-截止时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "设计符合性确认-截止时间")
private Date designDueDate;
/**prehomo确认-交付物类型*/
@Excel(name = "prehomo确认-交付物类型", width = 15)
@Excel(name = "prehomo确认-交付物类型", width = 20,dicCode ="deliverable_template")
@ApiModelProperty(value = "prehomo确认-1")
@Dict(dicCode ="deliverable_template")
private String prehomoDeliverableType;
/**prehomo确认-交付物模板*/
@Excel(name = "prehomo确认-交付物模板", width = 15)
@ApiModelProperty(value = "prehomo确认-交付物模板")
private String prehomoDeliverableTemplate;
/**prehomo确认-交付物模板名称*/
@TableField(exist = false)
@Excel(name = "prehomo确认-交付物模板", width = 20)
private String prehomoDeliverableTemplateName;
/**prehomo确认-发起人角色*/
@Excel(name = "prehomo确认-发起人角色", width = 15)
@ApiModelProperty(value = "prehomo确认-发起人角色")
@Dict(dicCode ="fa1_qi3_ren2")
private String prehomoInitiator;
@@ -227,12 +254,13 @@ public class ProjectLawsInventoryEO implements Serializable {
/**prehomo确认-发起人id*/
@ApiModelProperty(value = "prehomo确认-发起人id")
private String prehomoInitiatorId;
/**prehomo确认-发起人名称*/
@Excel(name = "prehomo确认-发起人", width = 20)
@TableField(exist = false)
private String prehomoInitiatorName;
/**prehomo确认-责任人角色*/
@Excel(name = "prehomo确认-责任人角色", width = 15)
@ApiModelProperty(value = "prehomo确认-责任人角色")
@Dict(dicCode ="ze2_ren4_ren2")
private String prehomoDuty;
@@ -240,34 +268,35 @@ public class ProjectLawsInventoryEO implements Serializable {
/**prehomo确认-责任人id*/
@ApiModelProperty(value = "prehomo确认-责任人id")
private String prehomoDutyId;
/**prehomo确认-责任人名称*/
@Excel(name = "prehomo确认-责任人", width = 20)
@TableField(exist = false)
private String prehomoDutyName;
/**prehomo确认-截止时间*/
@Excel(name = "prehomo确认-截止时间", width = 15, format = "yyyy-MM-dd")
@Excel(name = "prehomo确认-截止时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "prehomo确认-截止时间")
private Date prehomoDueDate;
/**验证符合性确认-交付物类型*/
@Excel(name = "验证符合性确认-交付物类型", width = 15)
@Excel(name = "验证符合性确认-交付物类型", width = 20,dicCode ="deliverable_template")
@ApiModelProperty(value = "验证符合性确认-交付物类型")
@Dict(dicCode ="deliverable_template")
private String verifyDeliverableType;
/**验证符合性确认-交付物模板*/
@Excel(name = "验证符合性确认-交付物模板", width = 15)
@ApiModelProperty(value = "验证符合性确认-交付物模板")
private String verifyDeliverableTemplate;
/**验证符合性确认-交付物模板名称*/
@Excel(name = "验证符合性确认-交付物模板", width = 20)
@TableField(exist = false)
private String verifyDeliverableTemplateName;
/**验证符合性确认-发起人角色*/
@Excel(name = "验证符合性确认-发起人角色", width = 15)
@ApiModelProperty(value = "验证符合性确认-发起人角色")
@Dict(dicCode ="fa1_qi3_ren2")
private String verifyInitiator;
@@ -275,12 +304,13 @@ public class ProjectLawsInventoryEO implements Serializable {
/**验证符合性确认-发起人id*/
@ApiModelProperty(value = "验证符合性确认-发起人id")
private String verifyInitiatorId;
/**验证符合性确认-发起人名称*/
@Excel(name = "验证符合性确认-发起人", width = 20)
@TableField(exist = false)
private String verifyInitiatorName;
/**验证符合性确认-责任人角色*/
@Excel(name = "验证符合性确认-责任人", width = 15)
@ApiModelProperty(value = "验证符合性确认-责任人角色")
@Dict(dicCode ="ze2_ren4_ren2")
private String verifyDuty;
@@ -288,33 +318,19 @@ public class ProjectLawsInventoryEO implements Serializable {
/**验证符合性确认-责任人id*/
@ApiModelProperty(value = "验证符合性确认-责任人id")
private String verifyDutyId;
/**验证符合性确认-责任人名称*/
@Excel(name = "验证符合性确认-责任人", width = 20)
@TableField(exist = false)
private String verifyDutyName;
/**验证符合性确认-截止时间*/
@Excel(name = "验证符合性确认-截止时间", width = 15, format = "yyyy-MM-dd")
@Excel(name = "验证符合性确认-截止时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "验证符合性确认-截止时间")
private Date verifyDueDate;
/**清单确认状态*/
@Excel(name = "清单确认状态", width = 15)
@ApiModelProperty(value = "清单确认状态")
private String inventoryAffirmStatus;
@TableField(exist = false)
@ApiModelProperty(value = "清单确认状态名称")
private String inventoryAffirmStatusName;//清单确认状态名称
/**任务发布状态*/
@Excel(name = "任务发布状态", width = 15)
@ApiModelProperty(value = "任务发布状态")
private String taskAffirmStatus;
@TableField(exist = false)
@ApiModelProperty(value = "任务发布状态名称")
private String taskAffirmStatusName;//任务发布状态名称
@TableField(exist = false)
@ApiModelProperty(value = "角色代码")
@@ -339,14 +355,12 @@ public class ProjectLawsInventoryEO implements Serializable {
private String ids;//文档库id 多个之间用英文逗号拼接
/**清单确认-截止时间*/
@Excel(name = "清单确认-截止时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "清单确认-截止时间")
private Date inventoryAffirmDueDate;
/**任务确认-截止时间*/
@Excel(name = "任务确认-截止时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "任务确认-截止时间")
@@ -39,6 +39,6 @@
<result column="verify_initiator" property="verifyInitiator" />
<result column="verify_duty" property="verifyDuty" />
<result column="verify_due_date" property="verifyDueDate" />
<result column="task_release_status" property="taskReleaseStatus" />
<result column="region" property="region" />
</resultMap>
</mapper>
</mapper>
@@ -1,5 +1,6 @@
package com.jero.modules.project.service.impl;
import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.utils.IOUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -38,6 +39,7 @@ import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysUserMapper;
import com.jero.modules.system.service.ISysAnnouncementService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
@@ -49,8 +51,14 @@ import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.SecurityUtils;
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.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -61,6 +69,8 @@ import org.springframework.web.multipart.MultipartFile;
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.SimpleDateFormat;
@@ -73,6 +83,8 @@ import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
import static com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl.copyFile;
/**
* @Description: 项目库-法规清单表
* @Author: jero-boot
@@ -120,6 +132,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
@Value(value = "${jero.path.upload}")
private String uploadpath;
@Autowired
private SysCategoryServiceImpl sysCategoryService;
/**
* 保存
*
@@ -1496,6 +1511,65 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
@Override
public void exportData(HttpServletResponse response, HttpServletRequest request, ProjectLawsInventoryEO projectLawsInventoryEO) {
List<ProjectLawsInventoryEO> dataList = new ArrayList<>();
QueryWrapper<ProjectLawsInventoryEO> queryWrapper = QueryGenerator.initQueryWrapper(projectLawsInventoryEO,request.getParameterMap());
queryWrapper.in("project_library_id",projectLawsInventoryEO.getProjectLibraryId());
if(StringUtils.isNotBlank(projectLawsInventoryEO.getIds())){
queryWrapper.in("id",Arrays.asList(projectLawsInventoryEO.getIds().split(",")));
}
queryWrapper.orderByDesc("create_time");
//导出的数据
dataList = this.list(queryWrapper);
//文件
List<OSSFile> fileInfos = getOssFiles(dataList);
//所有用户
List<SysUser> sysUserList = sysUserService.list();
//数据转换(文件名称,对应标准)
dataTransition(dataList, fileInfos,sysUserList);
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, ProjectLawsInventoryEO.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(projectLawsInventoryEO.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);
}
}
@@ -1503,4 +1577,247 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
public void importData(MultipartFile file, ProjectLawsInventoryEO projectLawsInventoryEO) {
}
/**
* 获取文件
* @param dataList
* @return
*/
private List<OSSFile> getOssFiles(List<ProjectLawsInventoryEO> dataList) {
List<String> fileIdList = new ArrayList<>();
List<String> design = new ArrayList<>();
List<String> prehomo = new ArrayList<>();
List<String> verify = new ArrayList<>();
for (ProjectLawsInventoryEO projectLawsInventoryEO : dataList) {
if(StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())){
design.add(projectLawsInventoryEO.getDesignDeliverableTemplate());
}
if(StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())){
prehomo.add(projectLawsInventoryEO.getPrehomoDeliverableTemplate());
}
if(StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())){
verify.add(projectLawsInventoryEO.getVerifyDeliverableTemplate());
}
}
if(design.size() != 0){
fileIdList.addAll(design);
}
if(prehomo.size() != 0){
fileIdList.addAll(prehomo);
}
if(verify.size() != 0){
fileIdList.addAll(verify);
}
//查询所有的文件
List<OSSFile> fileInfos = new ArrayList<>();
if(fileIdList.size() != 0){
fileInfos = iOSSFileService.getFileInfos(StringUtils.join(fileIdList, ","));
}
return fileInfos;
}
/**
* 数据转换(文件名称,技术领域,对应标准)
* @param dataList
* @param fileInfos
*/
private void dataTransition(List<ProjectLawsInventoryEO> dataList,
List<OSSFile> fileInfos,
List<SysUser> sysUserList) {
for (ProjectLawsInventoryEO projectLawsInventoryEO : dataList) {
//清单确认状态 inventoryAffirmStatus
if(StringUtils.isNotBlank(projectLawsInventoryEO.getInventoryAffirmStatus())){
String stateName = stateTransition(projectLawsInventoryEO.getInventoryAffirmStatus());
projectLawsInventoryEO.setInventoryAffirmStatusName(stateName);
}
//任务确认状态 taskAffirmStatus
if(StringUtils.isNotBlank(projectLawsInventoryEO.getTaskAffirmStatus())){
String stateName = stateTransition(projectLawsInventoryEO.getTaskAffirmStatus());
projectLawsInventoryEO.setTaskAffirmStatusName(stateName);
}
//法规工程师 regulationOwnerId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getRegulationOwnerId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setRegulationOwnerName(collect.get(0).getUsername());
}
}
//认证工程师 homologationEngineerId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getHomologationEngineerId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setHomologationEngineerName(collect.get(0).getUsername());
}
}
//工程接口人 engineeringInterfacePerson
if(StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getEngineeringInterfacePerson())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setEngineeringInterfacePersonName(collect.get(0).getUsername());
}
}
//设计符合性确认发起人designInitiatorId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignInitiatorId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setDesignInitiatorName(collect.get(0).getUsername());
}
}
//设计符合性确认责任人designDutyId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setDesignDutyName(collect.get(0).getUsername());
}
}
//PreHomo确认发起人prehomoInitiatorId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoInitiatorId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setPrehomoInitiatorName(collect.get(0).getUsername());
}
}
//PreHomo确认责任人prehomoDutyId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoDutyId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setPrehomoDutyName(collect.get(0).getUsername());
}
}
//验证符合性确认发起人verifyInitiatorId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyInitiatorId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setVerifyInitiatorName(collect.get(0).getUsername());
}
}
//验证符合性确认责任人verifyDutyId
if(StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())){
List<SysUser> collect = sysUserList.stream()
.filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).collect(Collectors.toList());
if(collect.size() != 0){
projectLawsInventoryEO.setVerifyDutyName(collect.get(0).getUsername());
}
}
String designDeliverableTemplate = projectLawsInventoryEO.getDesignDeliverableTemplate();
String prehomoDeliverableTemplate = projectLawsInventoryEO.getPrehomoDeliverableTemplate();
String verifyDeliverableTemplate = projectLawsInventoryEO.getVerifyDeliverableTemplate();
//设计交付物模板
if(StringUtils.isNotBlank(designDeliverableTemplate)){
String designDeliverableTemplateName = template(fileInfos, designDeliverableTemplate);
projectLawsInventoryEO.setDesignDeliverableTemplateName(designDeliverableTemplateName);
}
//设计交付物模板
if(StringUtils.isNotBlank(prehomoDeliverableTemplate)){
String prehomoDeliverableTemplateName = template(fileInfos, prehomoDeliverableTemplate);
projectLawsInventoryEO.setPrehomoDeliverableTemplateName(prehomoDeliverableTemplateName);
}
//设计交付物模板
if(StringUtils.isNotBlank(verifyDeliverableTemplate)){
String verifyDeliverableTemplateName = template(fileInfos, verifyDeliverableTemplate);
projectLawsInventoryEO.setVerifyDeliverableTemplateName(verifyDeliverableTemplateName);
}
}
}
private String stateTransition(String state){
String result = "";
if(InventoryAffirmStatusEnum.NOT_STARTED.getValue().equals(state)){
result = InventoryAffirmStatusEnum.NOT_STARTED.getName();
}else if(InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue().equals(state)){
result = InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getName();
}else if(InventoryAffirmStatusEnum.ACCEPTED.getValue().equals(state)){
result = InventoryAffirmStatusEnum.ACCEPTED.getName();
}else if(InventoryAffirmStatusEnum.REJECTED.getValue().equals(state)){
result = InventoryAffirmStatusEnum.REJECTED.getName();
}
return result;
}
/**
* 模板名称转换
* @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;
}
private void exportFile(List<ProjectLawsInventoryEO> dataList,List<OSSFile> fileInfos) throws IOException {
if(fileInfos.size() != 0){
for (ProjectLawsInventoryEO projectLawsInventoryEO : dataList) {
String designDeliverableTemplate = projectLawsInventoryEO.getDesignDeliverableTemplate();
String prehomoDeliverableTemplate = projectLawsInventoryEO.getPrehomoDeliverableTemplate();
String verifyDeliverableTemplate = projectLawsInventoryEO.getVerifyDeliverableTemplate();
String serialNumber = projectLawsInventoryEO.getSerialNumber();
if(StringUtils.isBlank(serialNumber)){
continue;
}
List<OSSFile> designFileList = new ArrayList<>();
List<OSSFile> prehomoFileList = new ArrayList<>();
List<OSSFile> verifyFileList = new ArrayList<>();
List<OSSFile> oSSFileList = new ArrayList<>();
if(StringUtils.isNotBlank(designDeliverableTemplate)){
designFileList = fileInfos.stream().filter(e -> designDeliverableTemplate.contains(e.getId())).collect(Collectors.toList());
oSSFileList.addAll(designFileList);
}
if(StringUtils.isNotBlank(prehomoDeliverableTemplate)){
prehomoFileList = fileInfos.stream().filter(e -> prehomoDeliverableTemplate.contains(e.getId())).collect(Collectors.toList());
oSSFileList.addAll(prehomoFileList);
}
if(StringUtils.isNotBlank(verifyDeliverableTemplate)){
verifyFileList = fileInfos.stream().filter(e -> verifyDeliverableTemplate.contains(e.getId())).collect(Collectors.toList());
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());
}
}
}
}
}
}
+6 -8
View File
@@ -5,9 +5,13 @@
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="handleCancel"
@cancel="visible = false"
>
<template slot="footer">
<a-button key="back" @click="visible = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columns"
@@ -79,12 +83,6 @@
this.pageNo = 1
this.bussLogList()
},
handleOk() {
this.visible = false
},
handleCancel() {
this.visible = false
},
onChange(page, pageSize) {
this.pageNo = page
this.bussLogList()
@@ -227,9 +227,13 @@
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
@@ -239,7 +243,9 @@
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
@@ -351,6 +357,13 @@
getAction('document/bussDocumentLibraryEO/getFileInfos', { id: item.join(',') }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
@@ -74,9 +74,9 @@
:title="$t('scopeOfApplication')">{{$t('scopeOfApplication')}}</span>
</div>
<a-form-model-item class="itemModel">
<!-- <a-input class="box-input"-->
<!-- :disabled="true"-->
<!-- v-model="formInline.shi4Yong4Fan4Wei2_dictText"/>-->
<!-- <a-input class="box-input"-->
<!-- :disabled="true"-->
<!-- v-model="formInline.shi4Yong4Fan4Wei2_dictText"/>-->
<j-multi-select-tag class="box-input" v-model="formInline.shi4Yong4Fan4Wei2"
@input="handleInput('shi4Yong4Fan4Wei2')"
:placeholder="$t('PleaseSelect')+$t('scopeOfApplication')"
@@ -521,7 +521,29 @@
return {
visible: false,
confirmLoading: false,
rules: {},
rules: {
subtitle: [
{
max: 100,
message: this.$t('subtitle') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
wvtaId: [
{
max: 100,
message: 'WVTA ID' + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
remark: [
{
max: 300,
message: this.$t('remarks') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
},
formInline: {},
disabled: false,
CategoryTreeList: []
@@ -545,7 +567,7 @@
this.$nextTick(() => {
this.formInline = item || {}
this.formInline.technologyTerritory = this.formInline.technologyTerritory ? this.formInline.technologyTerritory.split(',') : []
console.log(this.formInline.technologyTerritory)
this.$refs.ruleForm.clearValidate()
})
},
clickButtonToUpload(item) {
@@ -576,22 +598,26 @@
this.visible = false
},
handleSubmit() {
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
this.confirmLoading = true
postAction(this.url.editModel, formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('editModelList')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
this.$refs.ruleForm.validate(valid => {
if (valid) {
let formInline = JSON.parse(JSON.stringify(this.formInline))
Object.keys(formInline).forEach(res => {
if (formInline[res] && formInline[res] instanceof Array) {
formInline[res] = formInline[res].join(',')
}
})
this.confirmLoading = true
postAction(this.url.editModel, formInline).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.confirmLoading = false
this.$emit('editModelList')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
}
})
},
@@ -184,9 +184,13 @@
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
@@ -196,7 +200,8 @@
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
<a class="text" @click="pdfPreview(record)" :disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
@@ -336,8 +341,8 @@
title: 'WVTA ID',
align: 'center',
dataIndex: 'wvtaId',
width: 100,
ellipsis: true
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('certificationType'),
@@ -366,8 +371,8 @@
{
title: this.$t('remarks'),
align: 'center',
ellipsis: true,
dataIndex: 'remark'
dataIndex: 'remark',
scopedSlots: { customRender: 'titleName' }
},
{
@@ -568,7 +573,7 @@
},
//模板下载
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('VirtualList')+this.$t('importTemplate')+'.xls', {})
downloadFile(this.url.exportTemplate, this.$t('VirtualList') + this.$t('importTemplate') + '.xls', {})
},
//导出
handleExport() {
@@ -579,7 +584,7 @@
ids: selectedRowKeys.join(','),
dummyInventoryBaseId: this.$route.query.id
}
downloadFile(this.url.exportData, this.$route.query.name + this.$t('VirtualList')+'.zip', query, this.Deselect)
downloadFile(this.url.exportData, this.$route.query.name + this.$t('VirtualList') + '.zip', query, this.Deselect)
},
Deselect() {
this.selectedRowKeys = []
@@ -737,6 +742,13 @@
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
@@ -30,9 +30,13 @@
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
@@ -42,8 +46,10 @@
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
{{ $t('See') }}
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
@@ -146,6 +152,13 @@
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
@@ -43,10 +43,14 @@
:title="$t('deliverableTemplate')"
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
:maskClosable="false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
@@ -56,8 +60,10 @@
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
{{ $t('See') }}
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
@@ -232,6 +238,13 @@
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
@@ -51,8 +51,10 @@
:columns="columns"
>
<div slot="standardInformation" slot-scope="text,result" class="box-left">
<a class="box-content">GB-7258-2017</a><br/>
<a>及东盟火车大师傅但是</a>
<div class="content">
<a class="box-content">GB-7258-2017</a><br/>
<a>及东盟火车大师傅但是</a>
</div>
</div>
<div slot="areaOfResponsibility" slot-scope="text,result" class="box-left">
<span class="box-content">1212sdfdsf</span><br/>
@@ -8,7 +8,7 @@
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.certificationType"></a-input>
v-model="queryParam.title"></a-input>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
@@ -49,7 +49,18 @@
</span>
</a-table>
</div>
<a-modal v-model="areaVisible">
<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>
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null">
<parameter-template v-if='areaVisible'></parameter-template>
</a-modal>
</a-card>
@@ -58,6 +69,8 @@
<script>
import ImportFile from '@/components/ImportFile/index'
import ParameterTemplate from '../dialog/ParameterTemplate'
import { getAction } from '../../../api/manage'
export default {
name: 'TaskParameterCollection',
components:{
@@ -75,32 +88,32 @@
{
title: this.$t('status'),
align: 'center',
dataIndex: 'title',
dataIndex: 'state',
},
{
title: this.$t('parameterTemplateName'),
align: 'center',
dataIndex: 'ParameterDescription',
dataIndex: 'paramsTemplateName',
},
{
title: this.$t('collectionCompletionTime'),
align: 'center',
dataIndex: 'title',
dataIndex: 'finishTime',
},
{
title: this.$t('Version'),
align: 'center',
dataIndex: 'title',
dataIndex: 'version',
},
{
title: this.$t('creator'),
align: 'center',
dataIndex: 'title',
dataIndex: 'createBy',
},
{
title: this.$t('createTime'),
align: 'center',
dataIndex: 'title',
dataIndex: 'createTime',
},
{
title: this.$t('operation'),
@@ -112,20 +125,33 @@
],
selectedRowKeys: [],
queryParam: {},
url: {},
url: {
list: 'params/manifest/page',
add: 'params/manifest/add',
edit: 'params/manifest/edit',
deleteBatch: 'params/manifest/delete',
deleteAll: 'params/manifest/deleteBatch',
},
loading: false,
dataSource: [],
areaVisible: false, // 弹框的控制
pageNo: 1,
pageSize: 10,
total: 0,
}
},
mounted() {
this.getlist()
},
methods:{
searchQuery() {
this.pageNo = 1
this.getlist()
},
searchReset() {
this.queryParam = {}
this.pageNo = 1
this.getlist()
},
onSelectChange() {
@@ -148,6 +174,29 @@
getPersonnelList(){
},
pageOnChange() {
},
SizeChange() {
},
getlist() {
let query = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.queryParam
}
console.log(this.$route.query,'this.query')
getAction(this.url.list, query).then((res) => {
if(res.success) {
this.total = res.result.total
this.dataSource = res.result.records || []
this.loading = false
} else {
this.loading = false
}
})
}
},
}
</script>
@@ -187,6 +187,7 @@
<script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name: 'addModel',
@@ -271,6 +272,7 @@
this.getNameList()
},
methods: {
...mapGetters(['userInfo']),
getNameList() {
getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) {
@@ -284,6 +286,8 @@
this.visible = true
this.title = '新增'
this.formInline = {}
this.formInline.studioEngineerName = this.userInfo().username
this.formInline.studioEngineer = this.userInfo().id
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
@@ -5,9 +5,13 @@
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOk"
@cancel="handleCancel"
@cancel="visible = false"
>
<template slot="footer">
<a-button key="back" @click="visible = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columns"
@@ -48,7 +52,7 @@
title: this.$t('finalizationTime'),
dataIndex: 'createTime',
align: 'center',
ellipsis: true,
ellipsis: true
},
{
title: this.$t('operation'),
@@ -66,12 +70,6 @@
this.visible = true
this.historicalList()
},
handleOk() {
this.visible = false
},
handleCancel() {
this.visible = false
},
historicalList() {
let query = {
projectLibraryId: this.$route.query.id
@@ -176,8 +176,9 @@
<span class="title-text-text"
:title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
</div>
<a-form-model-item class="itemModel" prop="areaOfResponsibility">
<a-form-model-item class="itemModel" prop="dutyTerritory">
<j-multi-select-tag class="box-input" v-model="formInline.dutyTerritory"
@change="dutyTerritoryChange"
:disabled="formInline.roleCode == 0 ? false : true"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
@@ -653,6 +654,29 @@
visible: false,
confirmLoading: false,
rules: {},
rulesData: {
subtitle: [
{
max: 100,
message: this.$t('subtitle') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
wvtaId: [
{
max: 100,
message: 'WVTA ID' + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur'
}
],
remark: [
{
max: 300,
message: this.$t('remarks') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
},
formInline: {},
regulatoryEngineerList: [],
engineeringInterfacePersonList: [],
@@ -669,17 +693,26 @@
mounted() {
},
methods: {
dutyTerritoryChange(event) {
this.formInline.regulationOwnerId = undefined
this.formInline.engineeringInterfacePerson = undefined
this.formInline.homologationEngineerId = undefined
this.queryPersonByProject(event)
},
queryPersonByProject(row) {
let query = {
projectId: this.$route.query.id,
dutyTerritory: row.dutyTerritory
dutyTerritory: row.dutyTerritory || row
}
getAction(this.url.queryPersonByProject, query).then((res) => {
if (res.success) {
this.regulatoryEngineerList = res.result.lawEngineerList //法规工程师
this.engineeringInterfacePersonList = res.result.engineeringInterfacePersonList //工程接口人
this.certificationEngineerList = res.result.certificationEngineerList //认证工程师
this.getData(row, res)
if (row.dutyTerritory) {
this.getData(row, res)
}
}
})
},
@@ -796,27 +829,29 @@
}
this.$nextTick(() => {
this.rules = {}
this.$refs.ruleForm.clearValidate()
switch (item.roleCode) {
case 0:
case '0':
this.studioLogic()
break
case 1:
case '1':
this.statuteLogic()
break
case 2:
case '2':
this.authenticationLogic()
break
case 3:
case '3':
this.engineeringLogic()
break
case 4:
case '4':
this.authenticationOrengineerLogic()
break
}
})
},
studioLogic() {
this.rules = {
let rules = {
...this.rulesData,
attestationRank: [
{
required: true,
@@ -824,6 +859,13 @@
trigger: 'change'
}
],
dutyTerritory: [
{
required: true,
message: this.$t('areaOfResponsibility') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
homologationEngineerId: [
{
required: true,
@@ -846,12 +888,16 @@
}
]
}
this.$set(this, 'rules', rules)
console.log(this.rules)
},
statuteLogic() {
let rules = { ...this.rulesData }
this.$set(this, 'rules', rules)
},
authenticationLogic() {
this.rules = {
let rules = {
...this.rulesData,
attestationRank: [
{
required: true,
@@ -860,12 +906,15 @@
}
]
}
this.$set(this, 'rules', rules)
},
engineeringLogic() {
let rules = { ...this.rulesData }
this.$set(this, 'rules', rules)
},
authenticationOrengineerLogic() {
let rules = { ...this.rulesData }
this.$set(this, 'rules', rules)
},
clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc()
@@ -147,7 +147,7 @@
</a>
</span>
<span slot="titleName" slot-scope="text,record" :title="text">
{{ text && text.length > 20 ? text.slice(0, 19) + '...' : text }}
{{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}
</span>
<span slot="designDeliverableTemplateName" slot-scope="text,record">
<span>{{ record.designDeliverableType_dictText }}</span><br v-if="record.designDeliverableType_dictText">
@@ -230,9 +230,13 @@
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
@@ -242,8 +246,10 @@
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
{{ $t('See') }}
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
@@ -368,7 +374,8 @@
title: 'WVTA ID',
align: 'center',
dataIndex: 'wvtaId',
ellipsis: true
width: 180,
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('areaOfResponsibility'),
@@ -397,8 +404,8 @@
{
title: this.$t('remarks'),
align: 'center',
ellipsis: true,
dataIndex: 'remark'
dataIndex: 'remark',
scopedSlots: { customRender: 'titleName' }
},
{
title: this.$t('confirmationOfDesignConformity'),
@@ -1017,6 +1024,13 @@
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []
@@ -1,261 +1,245 @@
<template>
<div class="diolag-area">
<div class="table-operator">
<div class="operator-text">
{{$t('parameterTemplate')}}
</div>
</div>
<a-spin :spinning="spinLoading">
<a-form-model
class="tag-module"
ref="ruleForm"
:model="form"
:rules="rules"
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item :label="$t('Module')" prop="isModel">
<j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" :placeholder="$t('PleaseSelectModule')" />
</a-form-model-item>
<a-form-model-item ref="showArea" :label="$t('DisplayArea')" prop="showArea">
<a-input
v-model="form.showArea"
@blur="
() => {
$refs.showArea.onFieldBlur();
}
"
/>
</a-form-model-item>
<a-form-model-item ref="enName" :label="$t('enName')" prop="enName">
<a-input
v-model="form.enName"
@blur="
() => {
$refs.enName.onFieldBlur();
}
"
/>
</a-form-model-item>
<a-form-model-item ref="sort" :label="$t('SortNumber')" prop="sort">
<a-input-number
style="width:100%"
v-model="form.sort"
:min="1"
:formatter="limitNumber"
:parser="limitNumber"
@blur="
() => {
$refs.sort.onFieldBlur();
}
"
/>
</a-form-model-item>
</a-form-model>
</a-spin>
<div class='diolag-area'>
<a-spin :spinning='spinLoading'>
<a-form-model
class='tag-module'
ref='ruleForm'
:model='form'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='9'>
<a-form-model-item :label="$t('title')" prop='title'>
<a-input style='width: 420px'
v-model='title' />
</a-form-model-item>
</a-col>
<a-col :span='9'>
</a-col>
<a-col :span='6'>
<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>
</a-row>
<a-row :gutter='24'>
<a-col :span='9'>
<a-form-model-item ref='region' :label="$t('zoneOfApplication')" prop='region'>
<a-form-model-item class="itemModel" prop="region">
<j-dict-select-tag class="box-input" v-model="form.region"
:placeholder="$t('PleaseSelect')+$t('zoneOfApplication')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</a-form-model-item>
</a-form-model-item>
</a-col>
<a-col :span='9'>
<a-form-model-item ref='paramsTemplateName' :label="$t('parameterTemplate')" prop='paramsTemplateName'>
<a-input
v-model='form.paramsTemplateName' />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<a-table
class="table-area"
ref="table"
size="middle"
rowKey="id"
:columns="columns"
:dataSource="areaTable"
:pagination="false"
:loading="loading"
:scroll="{x: 600}"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange">
<a slot="name" slot-scope="text">{{ text }}</a>
<span slot="action" slot-scope="text, record">
<a class="action-edit" @click="editArea(record.id)" v-has="'area:edit'" >{{$t('edit')}}</a>
<a style="color:red" href="javascript:;" @click=" deleteArea(record.id)" v-has="'area:delete'">{{$t('delete')}}</a>
class='table-area'
ref='table'
size='middle'
rowKey='id'
:columns='columns'
:dataSource='areaTable'
:pagination='false'
:loading='loading'
:scroll='{x: 600}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<a slot='name' slot-scope='text'>{{ text }}</a>
<span slot='action' slot-scope='text, record'>
<a class='action-edit' @click='editArea(record.id)' v-has="'area:edit'">{{ $t('edit') }}</a>
<a style='color:red' href='javascript:;' @click=' deleteArea(record.id)'
v-has="'area:delete'">{{ $t('delete') }}</a>
</span>
</a-table>
<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>
</div>
</template>
<script>
import { putAction,postAction,getAction,deleteAction } from '@/api/manage'
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
export default {
name: 'diolagArea',
components:{
},
data(){
return{
title:this.$t('add'),
queryParams:{
pageNo:1,
pageSize:10
},
total:0,
components: {},
data() {
return {
title: this.$t('add'),
total: 0,
selectedRowKeys: [],
loading: false,
ipagination:true,
editId:'',
ipagination: true,
editId: '',
columns: [
{
title: this.$t('zoneOfApplication'),
dataIndex: 'showArea',
dataIndex: 'region_dictText',
key: 'showArea',
align: "center",
ellipsis: true,
align: 'center',
ellipsis: true
},
{
title: this.$t('parameterTemplate'),
align: "center",
dataIndex: 'enName',
ellipsis: true,
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true
}
],
newVisible:false,
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 },
},
form: {
isModel:'1',
showArea:'',
enName:'',
sort:''
sm: { span: 14 }
},
form: {},
rules: {
isModel:[
{ required: true, message: this.$t('PleaseSelectModule'), trigger: 'change' },
],
enName:[
{ max: 100, message: this.$t('CannotExceed100characters'), trigger: 'blur' },
],
showArea:[
{ required: true, message: this.$t('enterDisplayArea'), trigger: 'blur' },
{ min:1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' },
],
sort:[
{ required: true, message: this.$t('enterSortingNumber'), trigger: 'change' },
title: [
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' },
{ min: 1, max: 50, message: this.$t('charactersLength'), trigger: 'blur' }
]
},
areaTable:[],
flag:false, //表单提交标识
spinLoading:false,
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false
}
},
props:{
// areaTable:Array
},
props: {},
mounted() {
this.loadData()
},
methods:{
loadData(){
this.loading=true
let params={
...this.queryParams
methods: {
loadData() {
this.loading = true
let params = {
...this.form
}
postAction(`tag/onlCgformArea/page`,params).then(res=>{
if(res.success){
this.areaTable=[...res.result.records]
this.total=res.result.total
getAction(`params/manifest/getParamsTemplateList`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result]
this.total = res.result.total
}
}).finally(()=>{
this.loading=false
}).finally(() => {
this.loading = false
})
},
searchQuery() {
this.loadData()
},
searchReset() {
this.form = {}
this.loadData()
},
handleCancel() {
},
handleSubmit() {
},
onSelectChange(selectedRowKeys) {
// console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
this.selectedRowKeys = selectedRowKeys
},
handleTableChange(){
handleTableChange() {
},
showModal() {
this.title=this.$t('add')
this.newVisible = true;
this.form={
}
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
//新增
hideModal() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag=true
this.spinLoading=true
this.flag = true
this.spinLoading = true
//编辑
if(this.form.id){
putAction(`tag/onlCgformArea/edit`,this.form).then((res)=>{
if(res.success){
this.$message.success(this.$t('OperationSuccessful'));
if (this.form.id) {
putAction(`tag/onlCgformArea/edit`, this.form).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loadData()
this.form={
isModel:'',
showArea:'',
enName:'',
sort:''
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
}else{
} else {
this.$message.warning(res.message)
this.form={
isModel:'',
showArea:'',
enName:'',
sort:''
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
}
}).finally(()=>{
this.flag=false
this.spinLoading=false
this.newVisible = false;
this.form={
isModel:'',
showArea:'',
enName:'',
sort:''
}).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
})
}else{
} else {
//新增
postAction(`/tag/onlCgformArea/add`,this.form).then(res=>{
if(res.success){
this.$message.success( this.$t('OperationSuccessful'));
postAction(`/tag/onlCgformArea/add`, this.form).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loadData()
this.form={
isModel:'',
showArea:'',
enName:'',
sort:''
this.form = {
isModel: '',
showArea: '',
enName: '',
sort: ''
}
}else{
} else {
// this.$message.warning(this.$t('operationFailed'))
this.$message.warning(res.message)
}
}
).finally(()=>{
this.flag=false
this.spinLoading=false
this.newVisible = false;
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
}
} else {
// console.log('error submit!!');
return false;
return false
}
});
})
},
cancelModel(){
this.newVisible=false
this.$refs.ruleForm.resetFields();
cancelModel() {
this.newVisible = false
this.$refs.ruleForm.resetFields()
},
//删除按钮
deleteArea(val){
deleteArea(val) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: '',
@@ -263,17 +247,17 @@ export default {
async () => {
getAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'));
if(this.areaTable.length==1&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1
this.$message.success(this.$t('OperationSuccessful'))
if (this.areaTable.length == 1 && this.queryParams.pageNo != 1) {
this.queryParams.pageNo = this.queryParams.pageNo - 1
}
this.loadData()
}else{
} else {
// this.$message.warning(res.message)
if(res.message=='该展示区域有关联数据,无法删除!'){
if (res.message == '该展示区域有关联数据,无法删除!') {
this.$message.warning(this.$t('noDelete'))
}else{
this.$message.warning(this.$t('operationFailed'));
} else {
this.$message.warning(this.$t('operationFailed'))
}
}
})
@@ -281,29 +265,29 @@ export default {
})
},
//编辑按钮
editArea(val){
this.title=this.$t('edit')
this.newVisible = true;
let params={
id:val
editArea(val) {
this.title = this.$t('edit')
this.newVisible = true
let params = {
id: val
}
getAction(`tag/onlCgformArea/queryById`, params).then((res) => {
if(res.success){
this.form={...res.result}
if (res.success) {
this.form = { ...res.result }
// this.$emit('updateOk',res.result)
}
})
},
//点击页数
onChangePage(page,pageSize){
onChangePage(page, pageSize) {
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
SizeChange(page, pageSize) {
this.queryParams.pageSize = pageSize
this.queryParams.pageNo=1
this.queryParams.pageNo = 1
this.loadData()
},
//正则替换小数点
@@ -320,31 +304,38 @@ export default {
}
</script>
<style lang="less" scoped>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.diolag-area{
.table-area{
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit{
.action-edit {
margin-right: 10px;
}
}
.table-del{
.table-del {
color: red;
}
}
</style>
<style lang="less">
.area-module{
.ant-modal-wrap{
.ant-modal{
.ant-modal-content{
.ant-modal-footer{
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
</style>
@@ -95,9 +95,13 @@
:width="600"
:visible="visibleFile"
:maskClosable="false"
@ok="visibleFile = false"
@cancel="visibleFile = false"
>
<template slot="footer">
<a-button key="back" @click="visibleFile = false">
{{$t('cancel')}}
</a-button>
</template>
<a-table
class="table"
:columns="columnsFile"
@@ -107,8 +111,10 @@
:loading="loading"
>
<span slot="fileOperation" slot-scope="record">
<a class="text" @click="pdfPreview(record)">
{{ $t('See') }}
<a class="text" @click="pdfPreview(record)"
:disabled="record.fileSuffix == '.pdf' || record.fileSuffix == '.docx'
|| record.fileSuffix == '.xlsx' || record.fileSuffix == '.xls' ? false : true">
{{$t('See')}}
</a>
<a class="text" @click="download(record)">
{{ $t('download') }}
@@ -492,6 +498,13 @@
getAction('sys/common/getFileInfos', { id: item }).then((res) => {
if (res.success) {
this.dataSourceFile = res.result
this.dataSourceFile.forEach((val) => {
let fileName = val.fileName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
val.fileSuffix = fileSuffix
})
this.loading = false
} else {
this.dataSourceFile = []