Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-05-11 18:28:30 +08:00
11 changed files with 902 additions and 159 deletions
@@ -0,0 +1,54 @@
package com.jero.modules.project.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.modules.project.service.INcrTrackService;
import com.jero.modules.project.vo.NcrTrackVO;
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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* @description
* @date 2022/5/11 9:14
* @auth zhn
*/
@Api(tags="项目未符合项跟踪")
@RestController
@RequestMapping("/project/ncrTrackController")
@Slf4j
public class NcrTrackController {
@Autowired
private INcrTrackService iNcrTrackService;
/**
* 分页列表查询
*
* @param ncrTrackVO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "项目未符合项跟踪-分页列表查询")
@ApiOperation(value="项目未符合项跟踪-分页列表查询", notes="项目未符合项跟踪-分页列表查询")
@GetMapping(value = "/queryPage")
public Result<?> queryPage(NcrTrackVO ncrTrackVO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<NcrTrackVO> page = new Page<NcrTrackVO>(pageNo, pageSize);
IPage<NcrTrackVO> pageList = iNcrTrackService.getPageInfo(ncrTrackVO,pageNo, pageSize);
return Result.OK(pageList);
}
}
@@ -0,0 +1,18 @@
package com.jero.modules.project.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.modules.project.vo.NcrTrackVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @description
* @date 2022/5/11 9:25
* @auth zhn
*/
public interface NcrTrackMapper extends BaseMapper<NcrTrackVO> {
List<NcrTrackVO> getInfoList(@Param("inconformity") String inconformity,
@Param("track") String track);
}
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.project.mapper.NcrTrackMapper">
<resultMap id="NcrTrackVOResultMap" type="com.jero.modules.project.vo.NcrTrackVO">
<id column="serial_number" property="serialNumber" />
<result column="title" property="title" />
<result column="duty_territory" property="dutyTerritory" />
<result column="project_name" property="projectName" />
<result column="target_market" property="targetMarket" />
<result column="design_p_id" property="designPId" />
<result column="prehomo_p_id" property="prehomoPId" />
<result column="verify_p_id" property="verifyPId" />
<result column="design_initiator_id" property="designInitiatorId" />
<result column="prehomo_initiator_id" property="prehomoInitiatorId" />
<result column="verify_initiator_id" property="verifyInitiatorId" />
<result column="design_duty_id" property="designDutyId" />
<result column="prehomo_duty_id" property="prehomoDutyId" />
<result column="verify_duty_id" property="verifyDutyId" />
<result column="design_flow_task_status" property="designFlowTaskStatus" />
<result column="prehomo_flow_task_status" property="prehomoFlowTaskStatus" />
<result column="verify_flow_task_status" property="verifyFlowTaskStatus" />
</resultMap>
<select id="getInfoList" resultMap="NcrTrackVOResultMap">
SELECT
pni.project_name,plb.target_market,
pli.serial_number,pli.title,pli.duty_territory,
pti.design_flow_task_status,pti.prehomo_flow_task_status,pti.verify_flow_task_status,pti.design_p_id,pti.prehomo_p_id,pti.verify_p_id,
pli.design_initiator_id,pli.design_duty_id,pli.prehomo_initiator_id,pli.prehomo_duty_id,pli.verify_initiator_id,pli.verify_duty_id
FROM project_task_inventory pti
left join project_laws_inventory pli on pti.project_laws_inventory_id = pli.id
left join project_library_base plb on plb.id = pli.project_library_id
left join project_name_info pni on pni.id = plb.project_name_id
where
design_flow_task_status =#{inconformity} or design_flow_task_status =#{track}
or prehomo_flow_task_status =#{inconformity} or prehomo_flow_task_status =#{track}
or verify_flow_task_status =#{inconformity} or verify_flow_task_status =#{track}
order by pli.create_time desc
</select>
</mapper>
@@ -0,0 +1,17 @@
package com.jero.modules.project.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.project.vo.NcrTrackVO;
/**
* @description
* @date 2022/5/11 9:24
* @auth zhn
*/
public interface INcrTrackService extends IService<NcrTrackVO> {
IPage<NcrTrackVO> getPageInfo(NcrTrackVO ncrTrackVO,
Integer pageNo,
Integer pageSize);
}
@@ -0,0 +1,226 @@
package com.jero.modules.project.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum;
import com.jero.modules.project.enums.ReviewResultEnum;
import com.jero.modules.project.mapper.NcrTrackMapper;
import com.jero.modules.project.service.INcrTrackService;
import com.jero.modules.project.vo.NcrTrackVO;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* @description
* @date 2022/5/11 9:24
* @auth zhn
*/
@Service
public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO> implements INcrTrackService {
@Autowired
private NcrTrackMapper ncrTrackMapper;
@Autowired
private ISysUserService sysUserService;
@Override
public IPage<NcrTrackVO> getPageInfo(NcrTrackVO ncrTrackVO, Integer pageNo, Integer pageSize) {
List<SysUser> sysUserList = sysUserService.list();
List<NcrTrackVO> infoList = ncrTrackMapper.getInfoList(ReviewResultEnum.INCONFORMITY.getValue(), ReviewResultEnum.TO_TRACK.getValue());
List<NcrTrackVO> trackVOList = new ArrayList<>();
String designName = "";
String prehomoName = "";
String verifyName = "";
if(CutEnum.CN.getValue().equals(ncrTrackVO.getCut())){
designName = "设计符合性确认";
prehomoName = "PreHomo确认";
verifyName = "验证符合性确认";
}else{
designName = "Confirm design conformance";
prehomoName = "PreHomo confirmation";
verifyName = "Verify conformance validation";
}
for (NcrTrackVO trackVO : infoList) {
//设计符合性确认
String designPId = trackVO.getDesignPId();
//PreHomo确认
String prehomoPId = trackVO.getPrehomoPId();
//验证符合性确认
String verifyPId = trackVO.getVerifyPId();
//设计问题类型
String designFlowTaskStatus = trackVO.getDesignFlowTaskStatus();
String designFlowTaskStatusName = "";
//pre问题类型
String prehomoFlowTaskStatus = trackVO.getPrehomoFlowTaskStatus();
String prehomoFlowTaskStatusName = trackVO.getPrehomoFlowTaskStatus();
//验证问题类型
String verifyFlowTaskStatus = trackVO.getVerifyFlowTaskStatus();
String verifyFlowTaskStatusName = trackVO.getVerifyFlowTaskStatus();
if (StringUtils.isNotBlank(designFlowTaskStatus)) {
designFlowTaskStatusName = cut(ncrTrackVO, designFlowTaskStatus, designFlowTaskStatusName);
}
if (StringUtils.isNotBlank(prehomoFlowTaskStatus)) {
prehomoFlowTaskStatusName = cut(ncrTrackVO, prehomoFlowTaskStatus, prehomoFlowTaskStatusName);
}
if (StringUtils.isNotBlank(verifyFlowTaskStatus)) {
verifyFlowTaskStatusName = cut(ncrTrackVO, verifyFlowTaskStatus, verifyFlowTaskStatusName);
}
//设计符合性确认
if(StringUtils.isNotBlank(designPId)){
NcrTrackVO ncrTrackVOTemp = entityInfo(trackVO.getSerialNumber(),
trackVO.getTitle(),
trackVO.getDesignPId(),
trackVO.getDutyTerritory(),
trackVO.getProjectName(),
designFlowTaskStatusName,
trackVO.getDesignInitiatorId(),
trackVO.getDesignDutyId(),
designName,
sysUserList);
trackVOList.add(ncrTrackVOTemp);
}
//PreHomo确认
if(StringUtils.isNotBlank(prehomoPId)){
NcrTrackVO ncrTrackVOTemp = entityInfo(trackVO.getSerialNumber(),
trackVO.getTitle(),
trackVO.getPrehomoPId(),
trackVO.getDutyTerritory(),
trackVO.getProjectName(),
prehomoFlowTaskStatusName,
trackVO.getPrehomoInitiatorId(),
trackVO.getPrehomoDutyId(),
prehomoName,
sysUserList);
trackVOList.add(ncrTrackVOTemp);
}
//验证符合性确认
if(StringUtils.isNotBlank(verifyPId)){
NcrTrackVO ncrTrackVOTemp = entityInfo(trackVO.getSerialNumber(),
trackVO.getTitle(),
trackVO.getVerifyPId(),
trackVO.getDutyTerritory(),
trackVO.getProjectName(),
verifyFlowTaskStatusName,
trackVO.getVerifyInitiatorId(),
trackVO.getVerifyDutyId(),
verifyName,
sysUserList);
trackVOList.add(ncrTrackVOTemp);
}
}
if(StringUtils.isNotBlank(ncrTrackVO.getFlowType())){
trackVOList = trackVOList.stream().filter(e->ncrTrackVO.getFlowType().equals(e.getFlowType())).collect(Collectors.toList());
}
Page pages = getPages(pageNo, pageSize, trackVOList);
return pages;
}
private String cut(NcrTrackVO trackVO,String designFlowTaskStatus,String flowTaskStatusName) {
if(CutEnum.CN.getValue().equals(trackVO.getCut())){
if(ReviewResultEnum.INCONFORMITY.getValue().equals(designFlowTaskStatus)){
flowTaskStatusName = ReviewResultEnum.INCONFORMITY.getName();
}else if(ReviewResultEnum.TO_TRACK.getValue().equals(designFlowTaskStatus)){
flowTaskStatusName = ReviewResultEnum.TO_TRACK.getName();
}
}else{
if(ReviewResultEnum.INCONFORMITY.getValue().equals(designFlowTaskStatus)){
flowTaskStatusName = ReviewResultEnum.INCONFORMITY.getValue();
}else if(ReviewResultEnum.TO_TRACK.getValue().equals(designFlowTaskStatus)){
flowTaskStatusName = ReviewResultEnum.TO_TRACK.getValue();
}
}
return flowTaskStatusName;
}
private Page getPages(Integer currentPage, Integer pageSize, List<NcrTrackVO> list){
Page page =new Page();
if(list==null){
return null;
}
int size = list.size();
if(pageSize > size){
pageSize = size;
}
if(pageSize!=0){
//求出最⼤页数,防⽌currentPage越界
int maxPage = size % pageSize ==0? size / pageSize : size / pageSize +1;
if(currentPage > maxPage){
currentPage = maxPage;
}
}
//当前页第⼀条数据的下标
int curIdx = currentPage >1?(currentPage -1)* pageSize :0;
List pageList =new ArrayList();
//将当前页的数据放进pageList
for(int i =0; i < pageSize && curIdx + i < size; i++){
pageList.add(list.get(curIdx + i));
}
page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList);
return page;
}
private NcrTrackVO entityInfo(String serialNumber,
String title,
String flowType,
String dutyTerritory,
String projectName,
String problemType,
String initiator,
String duty,
String name,
List<SysUser> sysUserList){
String initiatorTemp ="";
String dutyTemp ="";
if(StringUtils.isNotBlank(initiator)){
List<SysUser> collect = sysUserList.stream().filter(e -> initiator.equals(e.getId())).collect(Collectors.toList());
if(collect.size() != 0){
initiatorTemp = collect.get(0).getUsername();
}
}
if(StringUtils.isNotBlank(duty)){
List<SysUser> collect = sysUserList.stream().filter(e -> duty.equals(e.getId())).collect(Collectors.toList());
if(collect.size() != 0){
dutyTemp = collect.get(0).getUsername();
}
}
NcrTrackVO ncrTrackVO = new NcrTrackVO();
ncrTrackVO.setSerialNumber(serialNumber);//编号
ncrTrackVO.setTitle(title);//标题
if(StringUtils.isNotBlank(flowType)){
ncrTrackVO.setFlowType(name);//流程类型
}
ncrTrackVO.setDutyTerritory(dutyTerritory);//责任领域
ncrTrackVO.setProjectName(projectName);//相关项目
ncrTrackVO.setProblemType(problemType);//问题类型
ncrTrackVO.setInitiator(initiatorTemp);//发起人
ncrTrackVO.setDuty(dutyTemp);//责任人
return ncrTrackVO;
}
}
@@ -2142,6 +2142,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
} else {
if (dataList.size() != 0) {
this.saveBatch(dataList);
//项目任务清单数据初始化。
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = new ArrayList<>();
for (ProjectLawsInventoryEO projectLawsInventoryEO : dataList) {
ProjectTaskInventoryEO projectTaskInventoryEO = new ProjectTaskInventoryEO();
String projectTaskInventoryId = UUID.randomUUID().toString().replace("-", "");
projectTaskInventoryEO.setId(projectTaskInventoryId);
projectTaskInventoryEO.setProjectLawsInventoryId(projectLawsInventoryEO.getId());
projectTaskInventoryEOList.add(projectTaskInventoryEO);
}
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOList);
}
}
}
@@ -0,0 +1,96 @@
package com.jero.modules.project.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.List;
/**
* @Description: 法规清单评论表
* @Author: jero-boot
* @Date: 2022-04-29
* @Version: V1.0
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class NcrTrackVO implements Serializable {
//中英文切换
private String cut;
//编号
private String serialNumber;
//标题
private String title;
//流程类型
private String flowType;
//责任领域 duty_territory
@Dict(dicCode ="duty_territory")
private String dutyTerritory;
//相关项目
private String projectName;
//目标市场
private String targetMarket;
//问题类型
private String problemType;
//发起人
private String initiator;
//责任人
private String duty;
//设计符合性确认 design_p_id
private String designPId;
//PreHomo确认 prehomo_p_id
private String prehomoPId;
//验证符合性确认 verify_p_id
private String verifyPId;
//设计发起人 design_initiator_id
private String designInitiatorId;
//pre发起人 prehomo_initiator_id
private String prehomoInitiatorId;
//验证发起人 verify_initiator_id
private String verifyInitiatorId;
//设计责任人 design_duty_id
private String designDutyId;
//pre责任人 prehomo_duty_id
private String prehomoDutyId;
//验证责任人 verify_duty_id
private String verifyDutyId;
//设计问题类型 design_flow_task_status
private String designFlowTaskStatus;
//pre问题类型 prehomo_flow_task_status
private String prehomoFlowTaskStatus;
//验证问题类型 verify_flow_task_status
private String verifyFlowTaskStatus;
}
+7
View File
@@ -705,6 +705,13 @@ module.exports = {
uploadTime: 'Upload time',
enclosure: 'enclosure',
// 认证
ParameterLibrary: 'Parameter Library',
referenceparameter: 'reference Parameter',
Assignedby: 'Assignedby',
CompulsoryWithdrawal: 'CompulsoryWithdrawal',
SynchronousReportLibrary: 'Synchronous Report Library',
FreezeConfiguration: 'Freeze Configuration',
distributionAndCollection: 'distribution And Collection',
deleteConfiguration: 'delete Configuration',
addConfiguration: 'add Configuration',
electricMachinery: 'electricMachinery',
+7
View File
@@ -714,6 +714,13 @@ module.exports = {
uploadTime: '上传时间',
enclosure: '附件',
// 认证
ParameterLibrary: '参数库',
referenceparameter: '引用参数',
Assignedby: '分配填写人',
CompulsoryWithdrawal: '强制撤回',
SynchronousReportLibrary: '同步上报库',
FreezeConfiguration: '冻结配置',
distributionAndCollection: '下发收集',
deleteConfiguration: '删除配置',
addConfiguration: '添加配置',
electricMachinery: '电机',
@@ -0,0 +1,330 @@
<template>
<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 ref='region' :label="$t('NiONumber')" prop='region'>
<a-input
v-model='form.paramsTemplateName' :placeholder="$t('pleaseEnter')+$t('NiONumber')" />
</a-form-model-item>
</a-col>
<a-col :span='9'>
<a-form-model-item ref='paramsTemplateName' :label="$t('ParameterName')" prop='paramsTemplateName'>
<a-input
v-model='form.paramsTemplateName' :placeholder="$t('pleaseEnter')+$t('ParameterName')" />
</a-form-model-item>
</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('areaOfResponsibility')" 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('areaOfResponsibility')"
:type="'select'"
:triggerChange='false' :dictCode="'duty_territory'" />
</a-form-model-item>
</a-form-model-item>
</a-col>
<a-col :span='9'>
</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>
</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'
export default {
name: 'diolagArea',
components: {},
data() {
return {
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
columns: [
// {
// title: this.$t('NiONumber'),
// dataIndex: 'region_dictText',
// key: 'showArea',
// align: 'center',
// ellipsis: true
// },
// {
// title: this.$t('ParameterName'),
// align: 'center',
// dataIndex: 'paramsTemplateName',
// ellipsis: true
// },
// {
// title: this.$t('areaOfResponsibility'),
// dataIndex: 'region_dictText',
// key: 'showArea',
// align: 'center',
// ellipsis: true
// }
],
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
rules: {
// templatetitle: [
// { required: true, message: this.$t('enterTitle'), trigger: 'blur' }
// ]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
templatetitle: '',
selectedRowKeys: []
}
},
props: {
},
mounted() {
this.loadData()
},
methods: {
loadData() {
this.loading = true
let params = {
...this.form
}
getAction(`params/collectManifest/paramsInfoList`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result]
this.total = res.result.total
}
}).finally(() => {
this.loading = false
})
},
searchQuery() {
this.loadData()
},
searchReset() {
this.form = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisible', false)
},
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
this.$emit('addselectedRowKeys',this.selectedRowKeys)
},
handleTableChange(val) {
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
//新增
handleSubmit() {
if (this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if (this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
// 新增編輯之前 判断 标题唯一
getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}
&title=${this.templatetitle}`, {})
.then(res => {
if (res.success) {
let postDate = {
title: this.templatetitle,
paramsTemplateId: this.rowId || this.selectedRowKeysDate[0].id,
paramsTemplatePublishVersion: this.version || this.selectedRowKeysDate[0].version,
projectId: this.projectId
}
if (this.rowId) {
//编辑
postAction(`params/manifest/edit`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible', false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
} else {
//新增
postAction(`params/manifest/add`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible', false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
} else {
return false
}
})
}
},
cancelModel() {
this.newVisible = false
this.$refs.ruleForm.resetFields()
},
//删除按钮
deleteArea(val) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: '',
onOk:
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.loadData()
} else {
// this.$message.warning(res.message)
if (res.message == '该展示区域有关联数据无法删除') {
this.$message.warning(this.$t('noDelete'))
} else {
this.$message.warning(this.$t('operationFailed'))
}
}
})
}
})
},
//编辑按钮
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 }
// this.$emit('updateOk',res.result)
}
})
}
},
watch: {
templateTitle(val) {
this.templatetitle = val
},
selectedRowKeyS(val) {
this.selectedRowKeys = val
}
}
}
</script>
<style lang='less' scoped>
@import '~@assets/less/common.less';
.diolag-area {
.table-area {
margin: 20px 0;
.action-edit {
margin-right: 10px;
}
}
.table-del {
color: red;
}
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
</style>
@@ -60,27 +60,71 @@
</a-row>
</div>
<div class="table-operator">
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight">
<template slot="title" id="popconfirm">
<!-- 下发收集 -->
<div @click="handleAdd" class="operator-text-title">
<a-icon type="plus"/>
{{$t('distributionAndCollection')}}
</div>
<!-- 冻结配置-->
<div @click="handleAdd" class="operator-text-title">
<a-icon type="plus"/>
{{$t('FreezeConfiguration')}}
</div>
<!-- 同步上报库 -->
<div @click="handleAdd" class="operator-text-title">
<a-icon type="plus"/>
{{$t('SynchronousReportLibrary')}}
</div>
<!-- 强制撤回-->
<div @click="handleModule" class="operator-text-title">
<a-icon type="bulb"/>
{{$t('CompulsoryWithdrawal')}}
</div>
</template>
<div class="operator-text" style="position: relative">
<span style="position: absolute;left: -13px;top: -4px">...</span>{{ $t('more') }}
</div>
</a-popconfirm>
<!-- 添加-->
<div @click="handleAdd" class="operator-text">
<a-icon type="plus"/>
{{$t('addTo')}}
</div>
<!-- 分配填写人-->
<div @click="handleCody" class="operator-text">
<a-icon type="copy"/>
{{$t('Assignedby')}}
</div>
<!-- 提交-->
<div @click="handleSubmit" class="operator-text">
<a-icon type="plus"/>
{{$t('submit')}}
</div>
<div @click="handleModule" class="operator-text">
<a-icon type="bulb"/>
{{$t('changeExtension')}}
<!-- 退回-->
<div @click="handleAdd" class="operator-text">
<a-icon type="plus"/>
{{$t('sendBack')}}
</div>
<div @click="handleCody" class="operator-text">
<a-icon type="copy"/>
{{$t('copy')}}{{$t('parameter')}}{{ $t('detailedList') }}
<!-- 引用参数-->
<div @click="handleAdd" class="operator-text">
<a-icon type="plus"/>
{{$t('referenceparameter')}}
</div>
<!-- 批量删除-->
<div @click="handleDel" class="operator-text" v-has="'document:deleteBatch'">
<a-icon type="delete"/>
{{$t('BatchDelete')}}
</div>
</div>
<div style="width: 100%">
<!-- 表格-->
<table-collection ref="CollectionTabel" :url='url' :paramsManifest='paramsManifest' @rowValue='rowValue' @value='value'/>
</div>
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null">
<!-- 添加 -->
<a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null">
<parameter-library v-if='areaVisible' @addselectedRowKeys='addselectedRowKeys'/>
</a-modal>
</a-card>
</template>
@@ -88,11 +132,12 @@
<script>
import TableCollection from '@/components/tableCollection/index'
import { getAction,postAction } from '../../../api/manage'
import ParameterLibrary from '@/components/ParameterLibrary/index'
export default {
name: 'ParameterItemCollectionList',
components:{
TableCollection
TableCollection,
ParameterLibrary
},
data(){
return{
@@ -149,7 +194,7 @@ export default {
add: 'params/collectManifest/submit',
// edit: 'params/manifest/edit',
// queryById: 'params/manifest/queryById',
// deleteBatch: 'params/manifest/delete',
deleteBatch: 'params/collectManifest/deleteBatch',
// deleteAll: 'params/manifest/deleteBatch',
// conAdd: 'params/config/addBatch',
// conList: 'params/config/list',
@@ -167,7 +212,6 @@ export default {
rowId: '',
version: 0,
itemId: '',
selectedRowKeys: [],
selectedRowKeysValue: []
}
},
@@ -181,13 +225,24 @@ export default {
mounted() {
},
methods:{
addselectedRowKeys() {
console.log('llll')
},
// 表格所选中得行内容
rowValue(val) {
this.selectedRowKeysValue = val
},
// 表格所选中得id
value(val) {
this.selectedRowKeys = val
this.selectedRowKeys = val,
this.selectedRowKeysArray = val.join(',')
},
// 添加
handleAdd() {
this.areaVisible = true
},
// 提交
handleSubmit() {
let postDate = []
this.selectedRowKeysValue.forEach((item, index) => {
let postDateobj = {}
@@ -199,13 +254,11 @@ export default {
postDateobj.id = item.id
postDate.push(postDateobj)
})
console.log(postDate,'postDatepostDatepostDatepostDate')
if(this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('selectLeastOne'))
}else {
postAction(this.url.add, postDate).then((res) => {
if (res.success) {
console.log(res,'lllll')
this.$message.success(this.$t('OperationSuccessful'))
// _this.getlist()
} else {
@@ -220,164 +273,43 @@ export default {
handleCody() {
},
handleDel() {
},
// paramsManifestClick(item) {
// // let newUrl = this.$router.resolve({
// // path: '/ParameterItemCollection',
// // query: item
// // })
// // window.open(newUrl.href, '_blank')
// },
// deleteLib(val) {
// let _this = this
// this.$confirm({
// content: _this.$t('ConfirmDelete'),
// onOk() {
// // getAction(_this.url.deleteBatch, { id: val.id }).then((res) => {
// // if (res.success) {
// // _this.$message.success(_this.$t('OperationSuccessful'))
// // _this.getlist()
// // } else {
// // _this.$message.warning(_this.$t('operationFailed'))
// // }
// // })
// }
// })
// },
// handleTableChange() {
//
// },
// //
// historicalVersion() {
//
// },
// // 配置
// configure(item) {
// this.itemId = item.id
// this.$refs.configureRef.addModel(item.id)
// },
// handleCancel(val) {
// this.areaVisible = val
// // this.getlist()
// },
searchQuery() {
this.pageNo = 1
// this.getlist()
},
searchReset() {
this.queryParam = {}
// this.pageNo = 1
// this.getlist()
},
// onSelectChange(val) {
// this.selectedRowKeys = val
// this.selectedRowKeysArray = val.join(',')
// },
// edit(edit){
// this.areaVisible = true
// let _this = this
// let query = {
// paramsManifestId: this.paramsManifest.id
// }
// getAction(_this.url.getHeader, query).then((res) => {
// if (res.success) {
// console.log(res,'res..')
// this.templatetitle = res.result.title
// this.selectedRowKeys = res.result.paramsTemplateId.split(',')
// this.rowId = res.result.id
// this.version = res.result.paramsTemplatePublishVersion
// console.log(this.selectedRowKeys,'this.selectedRowKeys')
// console.log(typeof this.version)
// } else {
// }
// })
// },
// handleAdd(){
// this.areaVisible = true
// },
// handleModule(){
//
// },
// handleDel(){
// let param={
// ids: this.selectedRowKeysArray
// }
// if (this.selectedRowKeys.length > 0) {
// let _this = this
// this.$confirm({
// content: _this.$t('ConfirmBatchDeletion'),
// onOk() {
// postAction(_this.url.deleteAll, param).then((res) => {
// if (res.success) {
// _this.$message.success(_this.$t('OperationSuccessful'))
// // _this.getlist()
// } else {
// _this.$message.warning(_this.$t('operationFailed'))
// }
// })
// }
// })
// } else {
// this.$message.warning(this.$t('selectLeastOne'))
// }
// },
// handleCody() {
//
// },
// getPersonnelList(){
//
// },
handleDel(){
let param={
ids: this.selectedRowKeysArray
}
if (this.selectedRowKeys.length > 0) {
let _this = this
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
postAction(_this.url.deleteAll, param).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
// _this.getlist()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
pageOnChange() {
},
SizeChange() {
},
// // getlist() {
// // let query = {
// // paramsManifestId: this.paramsManifest.id,
// // }
// // let flag = {
// // flag: '7'
// // }
// // let getquery = {...query,...flag}
// // console.log(this.paramsManifest,'this.paramsManifestthis.paramsManifestthis.paramsManifest')
// // getAction(this.url.getHeader, getquery).then((res) => {
// // if(res.success) {
// // console.log(res,'头部,,,')
// // // this.total = res.result.total
// // // this.dataSource = res.result.records || []
// // this.loading = false
// // } else {
// // this.loading = false
// // }
// // })
// // // let query = {
// // // pageSize: this.pageSize,
// // // pageNo: this.pageNo,
// // // ...this.queryParam
// // // }
// // // console.log(this.paramsManifest,'this.paramsManifestthis.paramsManifest')
// // // // console.log(this.$route.query,'this.query')
// // getAction(this.url.list, query).then((res) => {
// // if(res.success) {
// // console.log(res,'oooo')
// // // this.total = res.result.total
// // // this.dataSource = res.result.records || []
// // this.loading = false
// // } else {
// // this.loading = false
// // }
// // })
// // }
},
// watch: {
// paramsManifest(newVal, oldVal) {
// this.getlist()
// }
// }
}
}
</script>