合并分支 'dev_third_stage' 到 'master'
Dev third stage 查看合并请求 laws-nio/laws-weilai!54
This commit is contained in:
+22
-11
@@ -35,11 +35,9 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.checkerframework.checker.units.qual.C;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
@@ -516,14 +514,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
}
|
||||
|
||||
List<OSSFile> fileTemplateList = new ArrayList<>();
|
||||
Map<String, String> fileNowPathMap = new HashMap<>();
|
||||
for (ParamsInfoEO paramsInfoEO : paramsInfoEOList) {
|
||||
String fileTemplateConnectId = paramsInfoEO.getFileTemplateConnectId();
|
||||
if (StringUtils.isNotBlank(fileTemplateConnectId)) {
|
||||
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId);
|
||||
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
|
||||
paramsInfoEO.setFileTemplateName(StringUtils.join(fileNameList, ","));
|
||||
if (CollectionUtil.isNotEmpty(ossFileList)) {
|
||||
paramsInfoEO.setFileTemplateName(paramsInfoEO.getNioNumber() + "/" + ossFileList.get(0).getFileName());
|
||||
|
||||
fileTemplateList.addAll(ossFileList);
|
||||
fileNowPathMap.put(ossFileList.get(0).getId(), fileNowPath + File.separator + paramsInfoEO.getNioNumber());
|
||||
fileTemplateList.add(ossFileList.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,7 +591,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
//下载附件模板对应文件
|
||||
if (fileTemplateList != null && !fileTemplateList.isEmpty()) {
|
||||
fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList());
|
||||
downLoadFileList(fileTemplateList,fileNowPath);
|
||||
downLoadFileList(fileTemplateList, fileNowPathMap);
|
||||
}
|
||||
|
||||
return sheetsList;
|
||||
@@ -603,14 +604,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
}
|
||||
|
||||
List<OSSFile> fileTemplateList = new ArrayList<>();
|
||||
Map<String, String> fileNowPathMap = new HashMap<>();
|
||||
for (ParamsInfoEnExport paramsInfoEnExport : paramsInfoEnExportList) {
|
||||
String fileTemplateConnectId = paramsInfoEnExport.getFileTemplateConnectId();
|
||||
if (StringUtils.isNotBlank(fileTemplateConnectId)) {
|
||||
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId);
|
||||
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
|
||||
paramsInfoEnExport.setFileTemplateName(StringUtils.join(fileNameList, ","));
|
||||
if (CollectionUtil.isNotEmpty(ossFileList)) {
|
||||
paramsInfoEnExport.setFileTemplateName(paramsInfoEnExport.getNioNumber() + "/" + ossFileList.get(0).getFileName());
|
||||
|
||||
fileTemplateList.addAll(ossFileList);
|
||||
fileNowPathMap.put(ossFileList.get(0).getId(), fileNowPath + File.separator + paramsInfoEnExport.getNioNumber());
|
||||
fileTemplateList.add(ossFileList.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,14 +681,21 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
//下载附件模板对应文件
|
||||
if (fileTemplateList != null && !fileTemplateList.isEmpty()) {
|
||||
fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList());
|
||||
downLoadFileList(fileTemplateList,fileNowPath);
|
||||
downLoadFileList(fileTemplateList, fileNowPathMap);
|
||||
}
|
||||
|
||||
return sheetsList;
|
||||
}
|
||||
|
||||
private void downLoadFileList(List<OSSFile> fileTemplateList,String fileNowPath) {
|
||||
private void downLoadFileList(List<OSSFile> fileTemplateList,Map<String ,String> fileNowPathMap) {
|
||||
for(OSSFile fileExportDto : fileTemplateList){
|
||||
String fileNowPath = fileNowPathMap.get(fileExportDto.getId());
|
||||
File nowFile = new File(fileNowPath);
|
||||
if (nowFile.exists()){
|
||||
nowFile.delete();
|
||||
}
|
||||
nowFile.mkdirs();
|
||||
|
||||
String oldPath = fileExportDto.getUrl();
|
||||
String newPath = fileNowPath + File.separator + fileExportDto.getFileName();
|
||||
if (CosBootUtil.doesObjectExist(oldPath)){
|
||||
|
||||
+12
@@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -22,6 +23,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -172,4 +174,14 @@ public class LawsMonthlyReportWriteEOController extends JeroController<LawsMonth
|
||||
return super.importExcel(request, response, LawsMonthlyReportWriteEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 月报整合导出zip
|
||||
*/
|
||||
@AutoLog(value = "月报整合导出zip")
|
||||
@ApiOperation(value = "月报整合导出zip", notes = "月报整合导出zip")
|
||||
@RequestMapping(value = "/exportMonthlyReport", method = RequestMethod.GET)
|
||||
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) throws IOException {
|
||||
return lawsMonthlyReportWriteEOService.exportMonthlyReport(lawsMonthlyReportWriteEO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -187,4 +187,8 @@ public class LawsMonthlyReportWriteEO implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String cut;
|
||||
|
||||
//导出
|
||||
@TableField(exist = false)
|
||||
private String ids;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -3,6 +3,7 @@ package com.jero.modules.report.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
@@ -74,4 +75,6 @@ public interface ILawsMonthlyReportWriteEOService extends IService<LawsMonthlyRe
|
||||
Integer pageNo,
|
||||
Integer pageSize,
|
||||
HttpServletRequest req);
|
||||
|
||||
ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO);
|
||||
}
|
||||
|
||||
+83
@@ -18,13 +18,21 @@ import com.jero.modules.report.service.ILawsMonthlyReportTitleTemplateEOService;
|
||||
import com.jero.modules.report.service.ILawsMonthlyReportWriteEOService;
|
||||
import com.jero.modules.report.service.INewOpinionTemplateEOService;
|
||||
import com.jero.modules.report.service.INewStandardTemplateEOService;
|
||||
import com.jero.modules.report.util.WordUtil;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -48,6 +56,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
private ILawsMonthlyReportTitleTemplateEOService lawsMonthlyReportTitleTemplateEOService;
|
||||
@Autowired
|
||||
private SysCategoryServiceImpl sysCategoryService;
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String uploadpath;
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -298,4 +308,77 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
|
||||
ResponseEntity<byte[]> result = null;
|
||||
//获取数据
|
||||
LambdaQueryWrapper<LawsMonthlyReportWriteEO> wrapper = new LambdaQueryWrapper<>();
|
||||
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMonth())){
|
||||
wrapper.eq(LawsMonthlyReportWriteEO::getMonth,lawsMonthlyReportWriteEO.getMonth());
|
||||
}
|
||||
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getIds())){
|
||||
wrapper.in(LawsMonthlyReportWriteEO::getId,StringUtils.join(lawsMonthlyReportWriteEO.getIds(),""));
|
||||
}
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = this.list(wrapper);
|
||||
//月报填写列表所有的章节目录
|
||||
List<String> memoriesChapterList = lawsMonthlyReportWriteEOS.stream()
|
||||
.map(LawsMonthlyReportWriteEO::getMemoriesChapter).distinct().collect(Collectors.toList());
|
||||
|
||||
//所有的章节目录
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOService.list();
|
||||
lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOS.stream()
|
||||
.filter(e -> memoriesChapterList.contains(e.getId())).collect(Collectors.toList());
|
||||
|
||||
String path = uploadpath + "/tempZip";
|
||||
File fileTemp = new File(path);
|
||||
if (fileTemp.exists()) {
|
||||
fileTemp.delete();
|
||||
}
|
||||
fileTemp.mkdirs();
|
||||
createWord(path,lawsMonthlyReportWriteEOS,lawsMonthlyReportTitleTemplateEOS);
|
||||
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param path
|
||||
* @param lawsMonthlyReportWriteEOS 列表数据
|
||||
* @param lawsMonthlyReportTitleTemplateEOS 章节目录
|
||||
*/
|
||||
private void createWord(String path,
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS){
|
||||
//蔚来汽车法规月报-202004-主页面-CN
|
||||
//NIO Monthly Report on Automobile Regulations-202004-Main Page-EN
|
||||
String memoriesChapterCN = path + File.separator +"蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"主页面-CN.docx";
|
||||
String memoriesChapterEN = path + File.separator +"NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-Main Page-EN.docx";
|
||||
|
||||
File wordFile = new File(memoriesChapterCN);
|
||||
if(!wordFile.exists()){
|
||||
try {
|
||||
wordFile.getParentFile().mkdirs();
|
||||
wordFile.createNewFile();
|
||||
} catch (IOException e) {
|
||||
log.error("文件《"+memoriesChapterCN+"》创建失败");
|
||||
}
|
||||
}
|
||||
|
||||
try (XWPFDocument document = new XWPFDocument();
|
||||
FileOutputStream out = new FileOutputStream(wordFile)) {
|
||||
WordUtil.exportWord(document, memoriesChapterCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
log.error("文件创建异常,异常信息为:" + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.jero.modules.report.util;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
||||
|
||||
public class WordUtil {
|
||||
/**
|
||||
* 导出工具示例
|
||||
*
|
||||
* @param document POI文件类
|
||||
* @param text 输出文本
|
||||
* @param textColor 字体颜色
|
||||
* @param align 字体位置,默认居左
|
||||
* @param spaceNum 预留空格数,默认不留空格
|
||||
* @param fontSize 字体大小,默认11
|
||||
* @param isNewline 是否换行,换行后文本失效
|
||||
* @param isBold 是否加粗,默认不加粗
|
||||
* @param fontFamily 字体,默认宋体
|
||||
*/
|
||||
public static void exportWord(XWPFDocument document,
|
||||
String text,
|
||||
String textColor,
|
||||
ParagraphAlignment align,
|
||||
Integer spaceNum,
|
||||
Integer fontSize,
|
||||
Boolean isNewline,
|
||||
Boolean isBold,
|
||||
String fontFamily) {
|
||||
|
||||
document.createParagraph();
|
||||
|
||||
//添加标题
|
||||
XWPFParagraph titleParagraph = document.createParagraph();
|
||||
//设置段落左对齐
|
||||
if (align == null) {
|
||||
titleParagraph.setAlignment(ParagraphAlignment.LEFT);
|
||||
} else {
|
||||
titleParagraph.setAlignment(align);
|
||||
}
|
||||
|
||||
XWPFRun titleParagraphRun = titleParagraph.createRun();
|
||||
if (isNewline) {
|
||||
titleParagraphRun.setText("\r");
|
||||
} else {
|
||||
//封装文字内容
|
||||
StringBuilder newText = new StringBuilder();
|
||||
for (int i = 0; i < spaceNum; i++) {
|
||||
newText.append(" ");
|
||||
}
|
||||
newText.append(text);
|
||||
titleParagraphRun.setText(newText.toString());
|
||||
|
||||
//设置颜色
|
||||
if (StringUtils.isNotEmpty(textColor)) {
|
||||
titleParagraphRun.setColor(textColor);
|
||||
} else {
|
||||
titleParagraphRun.setColor("000000");
|
||||
}
|
||||
//设置文字大小
|
||||
if (ObjectUtil.isNotEmpty(fontSize)) {
|
||||
titleParagraphRun.setFontSize(fontSize);
|
||||
} else {
|
||||
titleParagraphRun.setFontSize(11);
|
||||
}
|
||||
|
||||
//设置加粗
|
||||
if (ObjectUtil.isNotEmpty(isBold)) {
|
||||
titleParagraphRun.setBold(isBold);
|
||||
} else {
|
||||
titleParagraphRun.setBold(false);
|
||||
}
|
||||
|
||||
//设置字体样式
|
||||
if (StringUtils.isNotEmpty(fontFamily)) {
|
||||
titleParagraphRun.setFontFamily(fontFamily);
|
||||
} else {
|
||||
titleParagraphRun.setFontFamily("宋体");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-input class="box-input" style='width: 226px' :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
<a-input class="box-input ant-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
v-model="queryParam[item.db_field_name]"></a-input>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == '2'">
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
<a-input-number class="box-input ant-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == '4'">
|
||||
@@ -90,14 +90,14 @@
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-input class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
<a-input class="box-input" style='width: 264px' :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
v-model="queryParam[item.db_field_name]"></a-input>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == '2'">
|
||||
<div class="title-text" :title="item.db_field_txt">
|
||||
<span>{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
<a-input-number class="box-input" style='width: 264px' :placeholder="$t('PleaseEnter')+item.db_field_txt"
|
||||
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
|
||||
</div>
|
||||
<div class="box-title-text" v-else-if="item.field_show_type == '4'">
|
||||
|
||||
@@ -0,0 +1,754 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<!-- -->
|
||||
<a-table
|
||||
class="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: '100%',y:'calc(100vh - 230px)'}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
sticky
|
||||
:components="components"
|
||||
:columns="columns"
|
||||
:rowClassName="rowClassName"
|
||||
@change="tableOnChange"
|
||||
@onHeaderRow='onHeaderRow'
|
||||
>
|
||||
<span slot="titleName" slot-scope="text,record" :title="text">
|
||||
{{ text }}
|
||||
</span>
|
||||
<div :slot="'titleName'+(index+1)" v-for="(item,index) in content">
|
||||
<span style='padding-right: 20px'>{{ item.db_field_txt }} </span>
|
||||
<a-button @click='onClickSee(item)'>{{$t('See')}}</a-button>
|
||||
</div>
|
||||
|
||||
<!-- <span slot="operationbtn" slot-scope="record">-->
|
||||
<!-- <span v-if='currentPersonRole === "homo"'>-->
|
||||
<!--<!– 认证工程师 –>-->
|
||||
<!-- <span-->
|
||||
<!-- v-if='record.state == "待发起收集" || record.state == "工程接口人退回" || record.state == "变更" || record.state == "Wait Collect" || record.state == "Sdt Back" || record.state == "Change"'>-->
|
||||
<!--<!– <span–>-->
|
||||
<!--<!– @click='ondataValueTobeinitiated(record)'>{{ (record.dataValue == null || record.dataValue == 'undefined')? '--': record.dataValue}}</span>–>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span v-else>-->
|
||||
<!-- <span @click='dataValueTobeinitiated(record)'>{{ (record.dataValue == null || record.dataValue == 'undefined')? '--': record.dataValue}}</span>-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span v-else>-->
|
||||
<!-- <span @click='dataValueTobeinitiated(record)'>{{ (record.dataValue == null || record.dataValue == 'undefined')? '--': record.dataValue}}</span>-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
<span slot="detailClick" slot-scope="text,record">
|
||||
<collection-type :detailDate='text'/>
|
||||
</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"
|
||||
:current="pageNo"
|
||||
:pageSizeOptions='pageSizeOptions'
|
||||
@change="pageOnChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
<!-- 修改工程接口人--->
|
||||
<a-modal v-model="areaVisible" :title="$t('modifyprojectInterfacePerson')" width='620px' :footer="null"
|
||||
@cancel="cancleImports">
|
||||
<a-form-model
|
||||
class='tag-module'
|
||||
ref='ruleForm'
|
||||
:model='Dateline'
|
||||
:rules='rules'
|
||||
:label-col='labelCol'
|
||||
:wrapper-col='wrapperCol'
|
||||
|
||||
>
|
||||
<a-row :gutter='24'>
|
||||
<a-col :span='24'>
|
||||
<a-form-model-item ref='region' :label="$t('engineeringInterfacePerson')" prop='querySdt'>
|
||||
<a-select allowClear :placeholder="$t('PleaseSelect')+$t('engineeringInterfacePerson')"
|
||||
v-model="Dateline.querySdt">
|
||||
<a-select-option v-for="(item, key) in querySdtList" :key="key" :value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.label ">
|
||||
{{ item.label }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
<div class="imports-footer">
|
||||
<div class="imports-footer-wrap">
|
||||
|
||||
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmit">{{$t('preservation')}}
|
||||
</a-button>
|
||||
<a-button class="imports-btn" type="primary" @click="cancleImports">{{$t('cancel')}}</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 配置信息--->
|
||||
<a-modal v-model="areaVisibleView" :title="$t('configurationInformation')" width='550px' :footer="null">
|
||||
<div class="content-text">
|
||||
<div class="text-field">
|
||||
<span class="text-field-left" :title="$t('configurationName')">{{$t('configurationName')}}:</span>
|
||||
<span class="text-field-right"
|
||||
:title="configDetail.configName"
|
||||
>{{configDetail.configName}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-text">
|
||||
<div class="text-field">
|
||||
<span class="text-field-left" :title="$t('Model')">{{$t('Model')}}:</span>
|
||||
<span class="text-field-right" :title="configDetail.carType"
|
||||
>{{configDetail.carType}}</span>
|
||||
</div>
|
||||
<div class="text-field">
|
||||
<span class="text-field-left" :title="$t('electricMachinery')">{{$t('electricMachinery')}}:</span>
|
||||
<span class="text-field-right" :title="configDetail.motor"
|
||||
>{{configDetail.motor}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-text">
|
||||
<div class="text-field">
|
||||
<span class="text-field-left" :title="$t('Version')">{{$t('Version')}}:</span>
|
||||
<span class="text-field-right" :title="configDetail.version"
|
||||
>{{configDetail.version}}</span>
|
||||
</div>
|
||||
<div class="text-field">
|
||||
<span class="text-field-left" :title="$t('Battery')">{{$t('Battery')}}:</span>
|
||||
<span class="text-field-right" :title="configDetail.battery"
|
||||
>{{configDetail.battery}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import CollectionType from '@/components/CollectionType'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import axios from 'axios'
|
||||
import Vue from 'vue'
|
||||
import VueDraggableResizable from 'vue-draggable-resizable'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 详细列表得一条数据
|
||||
paramsManifest: {
|
||||
type: Object,
|
||||
default: {},
|
||||
require: true
|
||||
},
|
||||
formInline: {
|
||||
type: Object,
|
||||
default: true
|
||||
},
|
||||
currentPersonRole: {
|
||||
type: String,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
CollectionType,
|
||||
VueDraggableResizable
|
||||
},
|
||||
data() {
|
||||
this.components = {
|
||||
header: {
|
||||
cell: (h, props, children) => {
|
||||
const { key, ...restProps } = props
|
||||
|
||||
// 此处的this.columns 是定义的table的表头属性变量
|
||||
|
||||
const col = this.columns.find((col) => {
|
||||
const k = col.dataIndex || col.key
|
||||
return k === key
|
||||
})
|
||||
|
||||
if (!col || !col.width) {
|
||||
return h('th', { ...restProps }, [...children])
|
||||
}
|
||||
|
||||
const dragProps = {
|
||||
key: col.dataIndex || col.key,
|
||||
class: 'table-draggable-handle',
|
||||
attrs: {
|
||||
w: 10,
|
||||
x: col.width,
|
||||
z: 1,
|
||||
axis: 'x',
|
||||
draggable: false,
|
||||
resizable: false
|
||||
},
|
||||
on: {
|
||||
dragging: (x, y) => {
|
||||
col.width = Math.max(x, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
const drag = h('vue-draggable-resizable', { ...dragProps })
|
||||
return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag])
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
token: Vue.ls.get(ACCESS_TOKEN),
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
content: [],
|
||||
selectedRowKeys: [],
|
||||
selectedRowrowValue: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
pageSizeOptions: ['10', '20','30', '50'],
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: '',
|
||||
homo: 0, // 认证工程师
|
||||
sdt: 0, // 工程接口人
|
||||
dre: 0, // 填写人
|
||||
areaVisible: false,
|
||||
form: {},
|
||||
rules: {
|
||||
querySdt: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('PleaseSelect') + this.$t('engineeringInterfacePerson'),
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 14 }
|
||||
},
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 }
|
||||
},
|
||||
querySdtList: [], // 工程接口人
|
||||
Dateline: {},
|
||||
getquerySdtId: '', // 当前工程接口人的id
|
||||
areaVisibleView: false, // 查看配置得弹框
|
||||
configDetail: {} // 查看配置得详细信息
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getHeader()
|
||||
},
|
||||
watch: {
|
||||
currentPersonRole: {
|
||||
handler: function() {
|
||||
console.log(123)
|
||||
this.getTableList()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapGetters(['userInfo']),
|
||||
rowClassName(row, index) {
|
||||
if (row.changeFlag == '1') {
|
||||
return 'rowClassRedYellow'
|
||||
}
|
||||
if (row.delFlag == '1') {
|
||||
return 'rowClassRed'
|
||||
}
|
||||
},
|
||||
pageOnChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.$emit('handlePreservation')
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageNo = 1
|
||||
this.pageSize = pageSize
|
||||
this.$emit('handlePreservation')
|
||||
this.getTableList()
|
||||
},
|
||||
// 查看配置详细信息
|
||||
onClickSee(val) {
|
||||
let _this = this
|
||||
this.areaVisibleView = true
|
||||
axios({
|
||||
url: `/jero-boot/params/config/getById?id=${val.db_field_name}`,
|
||||
method: 'get',
|
||||
transformRequest: [function(data) {
|
||||
let ret = ''
|
||||
for (let it in data) {
|
||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||
}
|
||||
return ret
|
||||
}],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-Access-Token': _this.token
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.success) {
|
||||
this.configDetail = res.data.result
|
||||
} else {
|
||||
_this.$message.warning(res.data.result)
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
},
|
||||
// 获取工程接口人
|
||||
getquerySdtList(record) {
|
||||
// 当前工程接口人的id
|
||||
this.getquerySdtId = record.id
|
||||
getAction(this.url.getquerySdtList, {
|
||||
projectId: this.$route.query.projectId,
|
||||
dutyTerritory: record.dutyTerritory
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.querySdtList = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
// 工程接口人 保存
|
||||
handleSubmit(record) {
|
||||
let _this = this
|
||||
let param = { sdt: this.Dateline.querySdt, ids: this.getquerySdtId }
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
axios({
|
||||
url: '/jero-boot/params/collectManifest/updateSdt',
|
||||
method: 'post',
|
||||
data: param,
|
||||
transformRequest: [function(data) {
|
||||
let ret = ''
|
||||
for (let it in data) {
|
||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||
}
|
||||
return ret
|
||||
}],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-Access-Token': _this.token
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.areaVisible = false
|
||||
this.getLoginUserType()
|
||||
} else {
|
||||
_this.$message.warning(_this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 工程接口人 取消
|
||||
cancleImports() {
|
||||
this.areaVisible = false
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
},
|
||||
// 点击工程接口人的详情人员 有权限
|
||||
ondataValueTobeinitiated(record) {
|
||||
this.areaVisible = true
|
||||
// this.$refs.ruleForm.clearValidate()
|
||||
this.$nextTick(() => {
|
||||
this.Dateline = { ...this.Dateline }
|
||||
this.getquerySdtList(record)
|
||||
this.$refs.ruleForm.clearValidate()
|
||||
})
|
||||
},
|
||||
dataValueTobeinitiated() {
|
||||
this.$message.warning(this.$t('certifiedEngineer') + this.$t('and') + this.$t('Statusis') + this.$t('CollectionInitiated') + this.$t('ReturnedPerson') + this.$t('alteration') + this.$t('toHavePermission'))
|
||||
},
|
||||
// 点击工程接口人的详情人员 无权限
|
||||
ondataValueNot() {
|
||||
this.$message.warning(this.$t('operatethisbutton'))
|
||||
},
|
||||
onHeaderRow(column, index) {
|
||||
console.log(column, index)
|
||||
},
|
||||
getLoginUserType() {
|
||||
let params = {
|
||||
paramsManifestId: this.$route.query.id,
|
||||
projectId: this.$route.query.projectId
|
||||
}
|
||||
this.loading = true
|
||||
getAction(this.url.getLoginUserType, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.getAndUserId(res.result)
|
||||
}
|
||||
})
|
||||
},
|
||||
getAndUserId(result) {
|
||||
let query = {
|
||||
paramsManifestId: this.$route.query.id,
|
||||
projectId: this.$route.query.projectId,
|
||||
userId: this.userInfo().id
|
||||
}
|
||||
getAction('/params/userTypeLog/queryCurrentType', query).then((res) => {
|
||||
if (res.success) {
|
||||
if (res.result && res.result.userType) {
|
||||
if (!(result.some(val => val.value == res.result.userType))) {
|
||||
res.result.userType = result[0] ? result[0].value : ''
|
||||
}
|
||||
this.getTableList(res.result.userType)
|
||||
} else {
|
||||
this.getTableList(result[0].value)
|
||||
}
|
||||
this.$emit('LoginUserType', result, this.currentPersonRole, res.result.userType)
|
||||
} else {
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
getHeader() {
|
||||
console.log(this.url.tableHeader)
|
||||
let paramsManifestid
|
||||
let url
|
||||
if (this.$route.query.it === undefined) {
|
||||
// 页面跳转
|
||||
paramsManifestid = this.$route.query.id
|
||||
url = this.url.tableHeader
|
||||
} else {
|
||||
// 历史版本
|
||||
paramsManifestid = this.$route.query.it
|
||||
url = 'params/collectManifestHistory/getHeader'
|
||||
}
|
||||
let params = {
|
||||
paramsManifestId: paramsManifestid,
|
||||
flag: '8'
|
||||
}
|
||||
getAction(url, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
let num = 0
|
||||
this.content = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
// 配置列
|
||||
if (res.type) {
|
||||
this.columns.push({
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort,
|
||||
width: 500
|
||||
})
|
||||
num++
|
||||
this.content.push(res)
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick',
|
||||
title: 'titleName' + num
|
||||
}
|
||||
// 非配置列
|
||||
} else {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort,
|
||||
width: 160
|
||||
})
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'titleName'
|
||||
}
|
||||
if (res.click) {
|
||||
// 工程接口人列表修改
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'operationbtn'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
this.columns = [...this.columns]
|
||||
console.log(this.columns)
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
console.log(pagination, filters, sorter, 'iiiiiiiiiiiiiiiii')
|
||||
},
|
||||
getTableListReset() {
|
||||
let params = {
|
||||
paramsManifestId: this.$route.query.id,
|
||||
userTypes: this.currentPersonRole
|
||||
}
|
||||
this.loading = true
|
||||
this.$emit('listReset', '')
|
||||
getAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
let tt = []
|
||||
if (this.currentPersonRole !== 'dre') {
|
||||
res.result.records.forEach((Obj) => {
|
||||
Object.keys(Obj).forEach((item) => {
|
||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||
Obj[item].list.forEach((itemLi) => {
|
||||
itemLi.isLock = 1
|
||||
if (itemLi.type === 'pull_more') {
|
||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
tt.push(Obj)
|
||||
})
|
||||
} else {
|
||||
res.result.records.forEach((Obj) => {
|
||||
Object.keys(Obj).forEach((item) => {
|
||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||
Obj[item].list.forEach((itemLi) => {
|
||||
if (itemLi.type === 'pull_more') {
|
||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
tt.push(Obj)
|
||||
})
|
||||
}
|
||||
this.dataSource = tt
|
||||
this.total = res.result.total
|
||||
this.selectedRowKeys = []
|
||||
this.$emit('getDataSource', this.dataSource)
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 500)
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
cancleoperationFailed() {
|
||||
this.selectedRowKeys = []
|
||||
},
|
||||
getTableList(currentPersonRole) {
|
||||
console.log(this.url.tableList)
|
||||
let paramsManifestid
|
||||
let url
|
||||
if (this.$route.query.it === undefined) {
|
||||
// 页面跳转
|
||||
paramsManifestid = this.$route.query.id
|
||||
url = this.url.tableList
|
||||
} else {
|
||||
// 历史版本
|
||||
paramsManifestid = this.$route.query.it
|
||||
url = 'params/collectManifestHistory/list'
|
||||
}
|
||||
let params = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
userTypes: this.currentPersonRole || currentPersonRole,
|
||||
paramsManifestId: paramsManifestid,
|
||||
...this.formInline
|
||||
}
|
||||
this.loading = true
|
||||
getAction(url, params).then((res) => {
|
||||
if (res.success) {
|
||||
// console.log(res.result,'res.result')
|
||||
// let tt = []
|
||||
// this.dataSource = []
|
||||
// // 需要转化数据类型
|
||||
// tt = res.result
|
||||
// tt.forEach((Obj) => {
|
||||
// Object.keys(Obj).forEach((item) => {
|
||||
// if(Obj[item] instanceof Object && Obj[item].controlType !== undefined){
|
||||
// Obj[item].list.forEach((itemLi) => {
|
||||
// if(itemLi.type === 'pull_more'){
|
||||
// itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.splice(',')
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
let tt = []
|
||||
if (this.currentPersonRole !== 'dre') {
|
||||
res.result.records.forEach((Obj) => {
|
||||
Object.keys(Obj).forEach((item) => {
|
||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||
Obj[item].list.forEach((itemLi) => {
|
||||
itemLi.isLock = 1
|
||||
if (itemLi.type === 'pull_more') {
|
||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
tt.push(Obj)
|
||||
})
|
||||
} else {
|
||||
res.result.records.forEach((Obj) => {
|
||||
Object.keys(Obj).forEach((item) => {
|
||||
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
|
||||
Obj[item].list.forEach((itemLi) => {
|
||||
if (itemLi.type === 'pull_more') {
|
||||
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
tt.push(Obj)
|
||||
})
|
||||
}
|
||||
this.dataSource = tt
|
||||
this.total = res.result.total
|
||||
this.selectedRowKeys = []
|
||||
this.selectedRowrowValue = []
|
||||
this.$emit('value', this.selectedRowKeys)
|
||||
this.$emit('rowValue', this.selectedRowrowValue)
|
||||
this.$emit('getDataSource', this.dataSource)
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
}, 500)
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
},
|
||||
onSelectChange(value, rowValue) {
|
||||
this.selectedRowKeys = []
|
||||
this.selectedRowrowValue = []
|
||||
this.selectedRowKeys = value
|
||||
this.selectedRowrowValue = rowValue
|
||||
this.$emit('value', this.selectedRowKeys)
|
||||
this.$emit('rowValue', this.selectedRowrowValue)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
// this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
// this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='less'>
|
||||
.imports-footer {
|
||||
.imports-footer-wrap {
|
||||
margin: 20px 0;
|
||||
text-align: center;
|
||||
|
||||
.imports-sub {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.content-text {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.text-field {
|
||||
width: 50%;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
|
||||
.text-field-left {
|
||||
width: 80px;
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
color: #040B29;
|
||||
font-weight: 400;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.text-field-right {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
color: #040B29;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .ant-table-tbody .yellow {
|
||||
background-color: #ffff001f !important;
|
||||
height: 40px !important;
|
||||
border: none !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.resize-table-th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.table-draggable-handle {
|
||||
/* width: 10px !important; */
|
||||
height: 100% !important;
|
||||
left: auto !important;
|
||||
right: -5px;
|
||||
cursor: col-resize;
|
||||
touch-action: none;
|
||||
border: none;
|
||||
position: absolute;
|
||||
transform: none !important;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.rowClassRed {
|
||||
background: #f3d9de;
|
||||
}
|
||||
|
||||
.rowClassRedYellow {
|
||||
background: yellow;
|
||||
}
|
||||
</style>
|
||||
@@ -11,31 +11,34 @@
|
||||
<div class="text-text-right"
|
||||
:class="{ 'null-input':item.checked }">
|
||||
<div class="text-header" @click="titleClick(item)">
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5" >
|
||||
<template slot="title">
|
||||
<span v-html="item.module_type"></span>
|
||||
</template>
|
||||
<span v-html="item.module_type"></span>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
<span style="cursor: pointer" v-html="item.module_type"></span>
|
||||
<template slot="title">
|
||||
<span v-html="item.serial_number"></span>
|
||||
</template>
|
||||
<span style="cursor: pointer"
|
||||
v-html="item.serial_number"></span>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
v-html="item.serial_number"></span>
|
||||
<template slot="title">
|
||||
<span v-html="item.title"></span>
|
||||
</template>
|
||||
<span style="cursor: pointer" v-html="item.title"></span>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-html="item.file_name"></span>
|
||||
</template>
|
||||
<span style="cursor: pointer" v-html="item.file_name"></span>
|
||||
</a-tooltip>
|
||||
<!-- <a-tooltip placement="topLeft" :mouseEnterDelay="0.5">-->
|
||||
|
||||
<!-- </a-tooltip>-->
|
||||
<!-- <a-tooltip placement="topLeft" :mouseEnterDelay="0.5">-->
|
||||
|
||||
<!-- </a-tooltip>-->
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-tooltip placement="topLeft" v-if="!queryParam.selectValue" :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
@@ -262,7 +265,7 @@
|
||||
font-weight: bold;
|
||||
color: #040B29;
|
||||
display: inline-block;
|
||||
max-width: 200px;
|
||||
max-width: 500px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -131,6 +131,7 @@ export default {
|
||||
this.title = '编辑'
|
||||
this.$nextTick(() => {
|
||||
this.formInline = value
|
||||
this.$refs['ruleForm'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
|
||||
@@ -38,11 +38,19 @@
|
||||
<span>{{$t('configure')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="configIds">
|
||||
<j-multi-select-tag class="box-input" v-model="formInline.configIds"
|
||||
:options="dictOptions"
|
||||
:placeholder="$t('PleaseSelect')+$t('configure')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" :dictCode="'cert_category'"/>
|
||||
<!-- <j-multi-select-tag class="box-input" v-model="formInline.configIds"-->
|
||||
<!-- :options="dictOptions"-->
|
||||
<!-- :placeholder="$t('PleaseSelect')+$t('configure')"-->
|
||||
<!-- :type="'select'"-->
|
||||
<!-- :triggerChange="false"/>-->
|
||||
<a-select v-model="formInline.configIds" class="box-input" mode='multiple' :placeholder="$t('PleaseSelect')+$t('configure')">
|
||||
<a-select-option
|
||||
v-for="mode in dictOptions"
|
||||
:key="mode.value"
|
||||
:value="mode.value">
|
||||
{{ mode.label }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -75,10 +83,9 @@
|
||||
<span class="title-text-text"
|
||||
:title="$t('MergeSeparator')">{{$t('MergeSeparator')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="this.disabled == true?'separator':''">
|
||||
<a-form-model-item class="itemModel" :prop="required?'separator':''">
|
||||
<!-- :disabled="disabled"-->
|
||||
<a-input class="box-input"
|
||||
|
||||
v-model="formInline.separator"
|
||||
:placeholder="$t('PleaseEnter')+$t('MergeSeparator')"/>
|
||||
</a-form-model-item>
|
||||
@@ -122,7 +129,6 @@ export default {
|
||||
rules: {
|
||||
separator:[
|
||||
{ required: true, message: this.$t('PleaseEnter')+this.$t('MergeSeparator'), trigger: 'change' },
|
||||
// { min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('MergeSeparator'), trigger: 'blur' },
|
||||
],
|
||||
certCategory:[
|
||||
{ required: true, message: this.$t('PleaseEnter')+this.$t('certificationCategory'), trigger: 'change' },
|
||||
@@ -180,10 +186,8 @@ export default {
|
||||
console.log(value.target.value)
|
||||
if(value.target.value == 2){
|
||||
this.required = true
|
||||
this.disabled = true
|
||||
}else{
|
||||
this.required = false
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
getNameList() {
|
||||
@@ -228,6 +232,7 @@ export default {
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
this.required = false
|
||||
this.$refs.ruleForm.resetFields()
|
||||
},
|
||||
certCategoryName(value){
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<span>{{$t('configure')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="configIds">
|
||||
<a-select v-model="formInline.configIds" class="code-mode-select" :placeholder="$t('PleaseSelect')+$t('configure')">
|
||||
<a-select v-model="formInline.configIds" class="box-input" :placeholder="$t('PleaseSelect')+$t('configure')">
|
||||
<a-select-option
|
||||
v-for="mode in dictOptions"
|
||||
:key="mode.value"
|
||||
|
||||
@@ -89,39 +89,48 @@
|
||||
{{$t('CustomExport')}}
|
||||
</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="titleName" slot-scope="text,record" :title="text">
|
||||
{{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}
|
||||
</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"
|
||||
:current="pageNo"
|
||||
@change="pageOnChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
<div style="width: 100%">
|
||||
<!-- 表格-10控件-->
|
||||
<table-collection ref="CollectionTabel" :url='url' :paramsManifest='paramsManifest' @rowValue='rowValue'
|
||||
:formInline='formInline' :currentPersonRole='currentPersonRole'
|
||||
@getDataSource="getDataSource"
|
||||
@handlePreservation="handlePreservation"
|
||||
@value='value'
|
||||
@listReset='listReset' @LoginUserType='LoginUserType'/>
|
||||
</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="titleName" slot-scope="text,record" :title="text">-->
|
||||
<!-- {{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}-->
|
||||
<!-- </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"-->
|
||||
<!-- :current="pageNo"-->
|
||||
<!-- @change="pageOnChange"-->
|
||||
<!-- @showSizeChange="SizeChange"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<conventionalModel :url="url" ref="conventionalModel"/>
|
||||
<customelModel :url="url" ref="customelModel"/>
|
||||
</a-card>
|
||||
@@ -130,6 +139,7 @@
|
||||
<script>
|
||||
import { getAction,postAction } from '../../../api/manage'
|
||||
import axios from 'axios'
|
||||
import TableCollection from '@/components/tableCollection/index1'
|
||||
import conventionalModel from './commponts/conventionalmodle'
|
||||
import customelModel from './commponts/customexportmodle'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
@@ -140,6 +150,7 @@ export default {
|
||||
components: {
|
||||
conventionalModel,
|
||||
customelModel,
|
||||
TableCollection,
|
||||
PersonnelSelection
|
||||
},
|
||||
data(){
|
||||
@@ -212,7 +223,7 @@ export default {
|
||||
props: {
|
||||
},
|
||||
mounted() {
|
||||
this.Getlist()
|
||||
// this.Getlist()
|
||||
this.getTableList()
|
||||
},
|
||||
methods:{
|
||||
@@ -302,6 +313,82 @@ export default {
|
||||
},
|
||||
onSelectChange() {
|
||||
|
||||
},
|
||||
getDataSource(data) {
|
||||
this.dataSource = data
|
||||
},
|
||||
handlePreservation(num) {
|
||||
let _this = this
|
||||
let postDate = []
|
||||
let data = JSON.parse(JSON.stringify(this.dataSource))
|
||||
let selectedRowKeysValue = []
|
||||
data.forEach(res => {
|
||||
if (res.state == 'Wait Fill' || res.state == '待填写') {
|
||||
selectedRowKeysValue.push(res)
|
||||
}
|
||||
})
|
||||
for (let i = 0; i < selectedRowKeysValue.length; i++) {
|
||||
let postDateobj = {}
|
||||
let itemIn = Object.keys(selectedRowKeysValue[i])
|
||||
for (let j = 0; j < itemIn.length; j++) {
|
||||
if (itemIn[j] !== 'sdt') {
|
||||
if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
|
||||
postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
|
||||
for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
|
||||
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') {
|
||||
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
|
||||
}
|
||||
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
|
||||
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
postDateobj.id = selectedRowKeysValue[i].id
|
||||
postDate.push(postDateobj)
|
||||
}
|
||||
let configDataList = { configDataList: postDate }
|
||||
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
|
||||
if (num && num == 1) {
|
||||
this.textLoading = true
|
||||
}
|
||||
let query = {
|
||||
...configDataList,
|
||||
paramsManifestId: this.paramsManifest.id
|
||||
}
|
||||
postAction('/params/collectManifest/save', query).then((res) => {
|
||||
if (res.success) {
|
||||
if (num && num == 1) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
this.textLoading = false
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (this.currentPersonRole == 'dre') {
|
||||
this.handlePreservation()
|
||||
}
|
||||
}, 10000)
|
||||
} else {
|
||||
if (num && num == 1) {
|
||||
_this.$message.warning(_this.$t('operationFailed'))
|
||||
this.textLoading = false
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (num && num == 1) {
|
||||
this.$message.warning(this.$t('theCurrentListSaved'))
|
||||
}
|
||||
}
|
||||
},
|
||||
LoginUserType(val, currentPersonRole, userType) {
|
||||
this.RoleType = []
|
||||
if (this.currentPersonRole == '') {
|
||||
this.currentPersonRole = currentPersonRole || userType || val[0].value
|
||||
}
|
||||
this.RoleType = val
|
||||
this.formInlineRoleSwitching.roleSwitchingCode = currentPersonRole || userType || val[0].value
|
||||
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
|
||||
},
|
||||
GetgetTableList() {
|
||||
this.$refs.CollectionTabel.getTableList()
|
||||
@@ -326,19 +413,23 @@ export default {
|
||||
},
|
||||
searchQuery() {
|
||||
this.pageNo = 1
|
||||
this.getTableList()
|
||||
this.$refs.CollectionTabel.getTableList()
|
||||
},
|
||||
searchReset() {
|
||||
this.pageNo = 1
|
||||
this.formInline = {}
|
||||
this.$refs.CollectionTabel.getTableListReset()
|
||||
},
|
||||
pageOnChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.$emit('handlePreservation')
|
||||
this.getTableList()
|
||||
},
|
||||
pageOnChange() {
|
||||
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageNo = 1
|
||||
this.pageSize = pageSize
|
||||
this.$emit('handlePreservation')
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -192,7 +192,7 @@ export default {
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: 100,
|
||||
width: 120,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
}
|
||||
],
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
<!-- 错误数据提示-->
|
||||
<a-modal
|
||||
:title="$t('operationFailed')"
|
||||
:width="700"
|
||||
:width="860"
|
||||
v-model="visibleoperationFailed"
|
||||
:maskClosable="false"
|
||||
:footer="null"
|
||||
@@ -330,47 +330,47 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 认证工程师-提示-->
|
||||
<div style='font-size: 16px;color: red;display: flex;justify-content: center' v-if='NoEngineer === 1'>
|
||||
<div style='font-size: 16px;color: red;text-align: center' v-if='NoEngineer === 1'>
|
||||
{{ currentPersonRole =='homo'? $t('certifiedEngineer'): (currentPersonRole =='sdt'?
|
||||
$t('engineeringInterfacePerson'): $t('completedBy')) }}{{$t('Datastatusis')}}
|
||||
<!-- 下发收集时-->
|
||||
<span v-if='jurisdiction === "HOMOZFSJ"'>
|
||||
<span v-if='jurisdiction === "HOMOZFSJ"' class="text-wraning">
|
||||
'{{$t('CollectionInitiated')}}'、'{{$t('ReturnedPerson')}}'{{$t('or')}}'{{$t('alteration')}}'
|
||||
</span>
|
||||
<!-- 同步上报库-->
|
||||
<span v-else-if='jurisdiction === "HOMOTBSBK"'>
|
||||
<span v-else-if='jurisdiction === "HOMOTBSBK"' class="text-wraning">
|
||||
'{{$t('Submitted')}}'{{$t('or')}}'{{$t('alteration')}}'
|
||||
</span>
|
||||
<!-- 截止时间-->
|
||||
<span v-else-if='jurisdiction === "HOMOJZSJ"'>
|
||||
<span v-else-if='jurisdiction === "HOMOJZSJ"' class="text-wraning">
|
||||
'{{$t('CollectionInitiated')}}'
|
||||
</span>
|
||||
<!-- 分配填写人 -->
|
||||
<span v-else-if='jurisdiction === "SDTFPTXR"'>
|
||||
<span v-else-if='jurisdiction === "SDTFPTXR"' class="text-wraning">
|
||||
'{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}'
|
||||
</span>
|
||||
<!-- 引用参数-->
|
||||
<span v-else-if='jurisdiction === "DREYYCS"'>
|
||||
<span v-else-if='jurisdiction === "DREYYCS"' class="text-wraning">
|
||||
'{{$t('completed')}}'{{$t('or')}}'{{$t('ReturnedEngineer')}}'
|
||||
</span>
|
||||
<!-- 退回-->
|
||||
<span v-else-if='jurisdiction === "homoTH"'>
|
||||
<span v-else-if='jurisdiction === "homoTH"' class="text-wraning">
|
||||
{{$t('Submitted')}}
|
||||
</span>
|
||||
<span v-else-if='jurisdiction === "sdtTH"'>
|
||||
<span v-else-if='jurisdiction === "sdtTH"' class="text-wraning">
|
||||
'{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}'
|
||||
</span>
|
||||
<span v-else-if='jurisdiction === "dreTH"'>
|
||||
<span v-else-if='jurisdiction === "dreTH"' class="text-wraning">
|
||||
'{{$t('completed')}}'{{$t('or')}}'{{$t('ReturnedEngineer')}}'
|
||||
</span>
|
||||
<!-- 强制撤回-->
|
||||
<span v-else-if='jurisdiction === "homoQZTH"'>
|
||||
<span v-else-if='jurisdiction === "homoQZTH"' class="text-wraning">
|
||||
'{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}'
|
||||
</span>
|
||||
<span v-else-if='jurisdiction === "sdtQZTH"'>
|
||||
<span v-else-if='jurisdiction === "sdtQZTH"' class="text-wraning">
|
||||
{{$t('completed')}}
|
||||
</span>
|
||||
<span v-else-if='jurisdiction === "dreQZTH"'>
|
||||
<span v-else-if='jurisdiction === "dreQZTH"' class="text-wraning">
|
||||
{{$t('Submitted')}}
|
||||
</span>
|
||||
{{$t('timeoperation')}}
|
||||
@@ -1674,4 +1674,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.text-wraning{
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
@@ -155,14 +155,14 @@
|
||||
title: this.$t('collectionCompletionTime'),
|
||||
align: 'center',
|
||||
dataIndex: 'finishTime',
|
||||
width: 160,
|
||||
width: 180,
|
||||
ellipsis: true,
|
||||
scopedSlots: { customRender: 'collectionCompletionTime' }
|
||||
},
|
||||
{
|
||||
title: this.$t('Version'),
|
||||
align: 'center',
|
||||
width: 50,
|
||||
width: 80,
|
||||
ellipsis: true,
|
||||
dataIndex: 'version'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user