销售订单审批页面
This commit is contained in:
parent
2b7e17375a
commit
95fe6a10dc
@ -0,0 +1,16 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.model.checkItem.CheckItemEntity;
|
||||
|
||||
/**
|
||||
* qaCheckItemBase
|
||||
* 版本: V3.5
|
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组
|
||||
* 日期: 2025-09-25
|
||||
*/
|
||||
public interface CheckItemMapper extends BaseMapper<CheckItemEntity> {
|
||||
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.entity.ExampleOrderEntity;
|
||||
import jnpf.model.order.ExampleOrderEntity;
|
||||
|
||||
/**
|
||||
* 业务订单 Mapper
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
|
||||
/**
|
||||
* qa_scheme_base
|
||||
* 版本: V3.5
|
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组
|
||||
* 日期: 2024-10-19
|
||||
*/
|
||||
public interface InspPlanItemMapper extends BaseMapper<InspPlanItemEntity> {
|
||||
|
||||
}
|
||||
@ -2,7 +2,7 @@ package jnpf.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.model.order.OrderItemWithOrderPagination;
|
||||
import jnpf.model.order.OrderItemWithOrderVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.entity.ShiftConfigEntity;
|
||||
import jnpf.model.shift.ShiftConfigEntity;
|
||||
|
||||
/**
|
||||
* 班次配置 Mapper
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.entity.ShiftResultEntity;
|
||||
import jnpf.model.shiftresult.ShiftResultEntity;
|
||||
|
||||
/**
|
||||
* 排班结果 Mapper
|
||||
|
||||
@ -0,0 +1,39 @@
|
||||
package jnpf.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.model.checkItem.CheckItemEntity;
|
||||
import jnpf.model.checkItem.CheckItemForm;
|
||||
import jnpf.model.checkItem.CheckItemPagination;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* qaCheckItemBase
|
||||
* 版本: V3.5
|
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组
|
||||
* 日期: 2025-09-25
|
||||
*/
|
||||
public interface CheckItemService extends IService<CheckItemEntity> {
|
||||
List<CheckItemEntity> getList(CheckItemPagination qaCheckItemBasePagination);
|
||||
|
||||
List<CheckItemEntity> getTypeList(CheckItemPagination qaCheckItemBasePagination,String dataType);
|
||||
|
||||
CheckItemEntity getInfo(String id);
|
||||
|
||||
void delete(CheckItemEntity entity);
|
||||
|
||||
void create(CheckItemEntity entity);
|
||||
|
||||
boolean update(String id, CheckItemEntity entity);
|
||||
|
||||
//子表方法
|
||||
//副表数据方法
|
||||
String checkForm(CheckItemForm form, int i);
|
||||
|
||||
void saveOrUpdate(CheckItemForm checkItemForm,String id, boolean isSave) throws Exception;
|
||||
|
||||
List<CheckItemEntity> queryList(CheckItemPagination checkItemPagination);
|
||||
}
|
||||
@ -2,7 +2,7 @@ package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.base.entity.DictionaryDataEntity;
|
||||
import jnpf.entity.ExampleOrderEntity;
|
||||
import jnpf.model.order.ExampleOrderEntity;
|
||||
import jnpf.model.order.ExampleOrderForm;
|
||||
import jnpf.model.order.ExampleOrderPagination;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* qa_scheme_base
|
||||
* 版本: V3.5
|
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组
|
||||
* 日期: 2024-10-19
|
||||
*/
|
||||
public interface InspPlanItemService extends IService<InspPlanItemEntity> {
|
||||
|
||||
//统计itemID
|
||||
Long getCountByItemID(Integer itemID);
|
||||
|
||||
List<InspPlanItemEntity> getInspPlanItemList(String id);
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.model.order.OrderItemWithOrderPagination;
|
||||
import jnpf.model.order.OrderItemWithOrderVO;
|
||||
import jnpf.model.orderdetail.OrderDetailForm;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.entity.ShiftConfigEntity;
|
||||
import jnpf.model.shift.ShiftConfigEntity;
|
||||
import jnpf.model.shift.ShiftConfigForm;
|
||||
import jnpf.model.shift.ShiftConfigPagination;
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.entity.ShiftResultEntity;
|
||||
import jnpf.model.shiftresult.ShiftResultEntity;
|
||||
import jnpf.model.shiftresult.ShiftResultForm;
|
||||
import jnpf.model.shiftresult.ShiftResultPagination;
|
||||
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
package jnpf.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.exception.DataException;
|
||||
import jnpf.mapper.CheckItemMapper;
|
||||
import jnpf.model.checkItem.CheckItemEntity;
|
||||
|
||||
import jnpf.model.checkItem.CheckItemForm;
|
||||
import jnpf.model.checkItem.CheckItemPagination;
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
import jnpf.service.CheckItemService;
|
||||
|
||||
import jnpf.service.InspPlanItemService;
|
||||
import jnpf.util.GeneraterSwapUtil;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* qaCheckItemBase
|
||||
* 版本: V3.5
|
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组
|
||||
* 日期: 2025-09-25
|
||||
*/
|
||||
@Service
|
||||
public class CheckItemServiceImpl extends ServiceImpl<CheckItemMapper, CheckItemEntity> implements CheckItemService {
|
||||
|
||||
@Autowired
|
||||
private InspPlanItemService inspPlanItemService;
|
||||
|
||||
|
||||
@Override
|
||||
public List<CheckItemEntity> getList(CheckItemPagination CheckItemPagination){
|
||||
return getTypeList(CheckItemPagination,CheckItemPagination.getDataType());
|
||||
}
|
||||
/** 列表查询 */
|
||||
@Override
|
||||
public List<CheckItemEntity> getTypeList(CheckItemPagination CheckItemPagination,String dataType){
|
||||
QueryWrapper<CheckItemEntity> qaRawMaterialCheckQueryWrapper=new QueryWrapper<>();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(CheckItemPagination.getKeyword())){
|
||||
qaRawMaterialCheckQueryWrapper.lambda().like(CheckItemEntity::getItemName, CheckItemPagination.getKeyword());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(CheckItemPagination.getSchemeType())){
|
||||
qaRawMaterialCheckQueryWrapper.lambda().like(CheckItemEntity::getItemType, CheckItemPagination.getSchemeType());
|
||||
}else{
|
||||
return new ArrayList<>();
|
||||
}
|
||||
Page<CheckItemEntity> page=new Page<>(CheckItemPagination.getCurrentPage(), CheckItemPagination.getPageSize());
|
||||
IPage<CheckItemEntity> userIPage=this.page(page, qaRawMaterialCheckQueryWrapper);
|
||||
return CheckItemPagination.setData(userIPage.getRecords(),userIPage.getTotal());
|
||||
}
|
||||
@Override
|
||||
public CheckItemEntity getInfo(String id){
|
||||
QueryWrapper<CheckItemEntity> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(CheckItemEntity::getId,id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
@Override
|
||||
public void create(CheckItemEntity entity){
|
||||
this.save(entity);
|
||||
}
|
||||
@Override
|
||||
public boolean update(String id, CheckItemEntity entity){
|
||||
return this.updateById(entity);
|
||||
}
|
||||
@Override
|
||||
public void delete(CheckItemEntity entity) {
|
||||
if (entity != null) {
|
||||
// 建议是否被使用
|
||||
Long countByItemID = inspPlanItemService.getCountByItemID(entity.getId());
|
||||
if (countByItemID > 0) {
|
||||
throw new DataException("该检验标准已做质检方案,不允许删除,请确认。");
|
||||
}
|
||||
this.removeById(entity.getId());
|
||||
}
|
||||
}
|
||||
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
|
||||
@Override
|
||||
public String checkForm(CheckItemForm form, int i) {
|
||||
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
|
||||
String id="";
|
||||
String countRecover = "";
|
||||
if (isUp){
|
||||
id = form.getId();
|
||||
}
|
||||
LambdaQueryWrapper<CheckItemEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CheckItemEntity::getItemType, form.getItemType());
|
||||
wrapper.eq(CheckItemEntity::getItemName, form.getItemName());
|
||||
wrapper.isNull(CheckItemEntity::getDeleteMark);
|
||||
if (isUp){
|
||||
wrapper.ne(CheckItemEntity::getId, id);
|
||||
}
|
||||
String itemType ="";
|
||||
if ("1".equals(form.getItemType())){
|
||||
itemType="原材料";
|
||||
}else if ("2".equals(form.getItemType())){
|
||||
itemType="半成品";
|
||||
}else{
|
||||
itemType="成品";
|
||||
}
|
||||
countRecover = this.count(wrapper) > 0 ? "适用类型"+itemType+"内已存在检验名称为"+form.getItemName() + "的检验项,请确认!" : "";
|
||||
//主表字段验证
|
||||
return countRecover;
|
||||
}
|
||||
/**
|
||||
* 新增修改数据(事务回滚)
|
||||
* @param id
|
||||
* @param CheckItemForm
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void saveOrUpdate(CheckItemForm CheckItemForm,String id, boolean isSave) throws Exception{
|
||||
CheckItemEntity entity = JsonUtil.getJsonToBean(CheckItemForm, CheckItemEntity.class);
|
||||
|
||||
if(isSave){
|
||||
|
||||
}else{
|
||||
}
|
||||
this.saveOrUpdate(entity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckItemEntity> queryList(CheckItemPagination CheckItemPagination) {
|
||||
QueryWrapper<CheckItemEntity> qaRawMaterialCheckQueryWrapper=new QueryWrapper<>();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(CheckItemPagination.getItemType())){
|
||||
qaRawMaterialCheckQueryWrapper.lambda().eq(CheckItemEntity::getItemType, CheckItemPagination.getItemType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(CheckItemPagination.getItemNo())){
|
||||
qaRawMaterialCheckQueryWrapper.lambda().like(CheckItemEntity::getItemNo, CheckItemPagination.getItemNo());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(CheckItemPagination.getItemName())){
|
||||
qaRawMaterialCheckQueryWrapper.lambda().like(CheckItemEntity::getItemName, CheckItemPagination.getItemName());
|
||||
}
|
||||
qaRawMaterialCheckQueryWrapper.lambda().orderByDesc(CheckItemEntity::getId);
|
||||
Page<CheckItemEntity> page=new Page<>(CheckItemPagination.getCurrentPage(), CheckItemPagination.getPageSize());
|
||||
IPage<CheckItemEntity> userIPage=this.page(page, qaRawMaterialCheckQueryWrapper);
|
||||
return CheckItemPagination.setData(userIPage.getRecords(),userIPage.getTotal()); }
|
||||
|
||||
|
||||
}
|
||||
@ -10,8 +10,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.base.entity.DictionaryDataEntity;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.entity.ExampleOrderEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.model.order.ExampleOrderEntity;
|
||||
import jnpf.mapper.ExampleOrderMapper;
|
||||
import jnpf.model.order.ExampleOrderForm;
|
||||
import jnpf.model.order.ExampleOrderPagination;
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
package jnpf.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import jnpf.mapper.InspPlanItemMapper;
|
||||
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
|
||||
import jnpf.service.InspPlanItemService;
|
||||
import jnpf.util.GeneraterSwapUtil;
|
||||
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* qa_scheme_base
|
||||
* 版本: V3.5
|
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组
|
||||
* 日期: 2024-10-19
|
||||
*/
|
||||
@Service
|
||||
public class InspPlanItemServiceImpl extends ServiceImpl<InspPlanItemMapper, InspPlanItemEntity> implements InspPlanItemService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long getCountByItemID(Integer itemID) {
|
||||
QueryWrapper<InspPlanItemEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(InspPlanItemEntity::getItemId, itemID);
|
||||
return this.count(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InspPlanItemEntity> getInspPlanItemList(String id) {
|
||||
QueryWrapper<InspPlanItemEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(InspPlanItemEntity::getSchemeId, id);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
}
|
||||
@ -6,19 +6,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.mapper.InspPlanMapper;
|
||||
import jnpf.model.inspplan.InspPlanEntity;
|
||||
import jnpf.model.inspplan.InspPlanForm;
|
||||
import jnpf.model.inspplan.InspPlanPagination;
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.service.InspPlanItemService;
|
||||
import jnpf.service.InspPlanService;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import jnpf.util.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 质检方案表 ServiceImpl
|
||||
@ -28,6 +34,8 @@ public class InspPlanServiceImpl extends ServiceImpl<InspPlanMapper, InspPlanEnt
|
||||
|
||||
@Resource
|
||||
private UserProvider userProvider;
|
||||
@Resource
|
||||
private InspPlanItemService inspPlanItemService;
|
||||
|
||||
@Override
|
||||
public List<InspPlanEntity> getList(InspPlanPagination inspPlanPagination) {
|
||||
@ -57,7 +65,6 @@ public class InspPlanServiceImpl extends ServiceImpl<InspPlanMapper, InspPlanEnt
|
||||
wrapper.like(InspPlanEntity::getExecStandard, inspPlanPagination.getExecStandard());
|
||||
}
|
||||
|
||||
wrapper.eq(InspPlanEntity::getDeleteMark, 0);
|
||||
wrapper.orderByDesc(InspPlanEntity::getId);
|
||||
|
||||
if ("0".equals(inspPlanPagination.getDataType())) {
|
||||
@ -104,30 +111,109 @@ public class InspPlanServiceImpl extends ServiceImpl<InspPlanMapper, InspPlanEnt
|
||||
id = form.getId();
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(form.getSchemeNo())) {
|
||||
LambdaQueryWrapper<InspPlanEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(InspPlanEntity::getSchemeNo, form.getSchemeNo());
|
||||
if (isUpdate) {
|
||||
wrapper.ne(InspPlanEntity::getId, id);
|
||||
if (ObjectUtil.isNotEmpty(form.getSchemeName())){
|
||||
LambdaQueryWrapper<InspPlanEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(InspPlanEntity::getSchemeName, form.getSchemeName());
|
||||
|
||||
if (isUpdate){
|
||||
queryWrapper.ne(InspPlanEntity::getId, id);
|
||||
}
|
||||
long count = this.count(wrapper);
|
||||
if (count > 0) {
|
||||
countRecover += "质检方案编号已存在,请重新输入!";
|
||||
if (this.count(queryWrapper) > 0){
|
||||
return "质检方案'"+form.getSchemeName()+"'已存在,请确认!";
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(form.getSchemeNo())){
|
||||
LambdaQueryWrapper<InspPlanEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(InspPlanEntity::getSchemeNo, form.getSchemeNo());
|
||||
if (isUpdate){
|
||||
queryWrapper.ne(InspPlanEntity::getId, id);
|
||||
}
|
||||
queryWrapper.isNull(InspPlanEntity::getDeleteMark);
|
||||
if (this.count(queryWrapper) > 0){
|
||||
return "质检方案编号'"+form.getSchemeNo()+"'已存在,请确认!";
|
||||
}
|
||||
}
|
||||
// 子表字段验证
|
||||
if ( ObjectUtil.isNotEmpty(form.getInspPlanItemList()) ) {
|
||||
List<InspPlanItemEntity> list = form.getInspPlanItemList();
|
||||
Set<Integer> seqNoSet = new HashSet<>();
|
||||
|
||||
for (int j = 0; j < list.size(); j ++) {
|
||||
InspPlanItemEntity item = list.get(j);
|
||||
Integer seqNo = item.getSeqNo();
|
||||
|
||||
// 校验空值
|
||||
if (seqNo == null ) {
|
||||
return "展示顺序不能为空";
|
||||
}
|
||||
|
||||
// 校验重复
|
||||
if (!seqNoSet.add(seqNo)) {
|
||||
return "展示顺序不能重复";
|
||||
}
|
||||
}
|
||||
}
|
||||
return countRecover;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(InspPlanForm inspPlanForm, String id, boolean isSave) throws Exception {
|
||||
InspPlanEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new InspPlanEntity();
|
||||
UserInfo userInfo = userProvider.get();
|
||||
|
||||
InspPlanEntity entity = JsonUtil.getJsonToBean(inspPlanForm, InspPlanEntity.class);
|
||||
|
||||
if (isSave) {
|
||||
String mainId = RandomUtil.uuId();
|
||||
entity.setCreatorUserId(userInfo.getUserId());
|
||||
entity.setCreatorTime(DateUtil.getNowDate());
|
||||
entity.setId(mainId);
|
||||
} else {
|
||||
entity.setCreatorUserId(userInfo.getUserId());
|
||||
entity.setCreatorTime(DateUtil.getNowDate());
|
||||
}
|
||||
BeanUtils.copyProperties(inspPlanForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
if ( ObjectUtil.isNotEmpty(inspPlanForm.getInspPlanItemList())) {
|
||||
List<InspPlanItemEntity> twModelList = inspPlanForm.getInspPlanItemList();
|
||||
List<InspPlanItemEntity> collect = twModelList.stream()
|
||||
.filter(model -> StringUtil.isEmpty(model.getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
boolean updated = false;
|
||||
if (ObjectUtil.isNotEmpty(collect)) {
|
||||
for (InspPlanItemEntity model : collect) {
|
||||
LambdaQueryWrapper<InspPlanItemEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(InspPlanItemEntity::getSchemeId, entity.getId());
|
||||
wrapper.eq(InspPlanItemEntity::getItemId, model.getItemId());
|
||||
wrapper.last("limit 1");
|
||||
InspPlanItemEntity one = inspPlanItemService.getOne(wrapper);
|
||||
if (ObjectUtil.isNotEmpty(one)) {
|
||||
model.setId(one.getId());
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (updated) {
|
||||
inspPlanForm.setInspPlanItemList(twModelList);
|
||||
}
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<InspPlanItemEntity> qaSchemeBaseTwEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
qaSchemeBaseTwEntityLambdaQueryWrapper.eq(InspPlanItemEntity::getSchemeId, entity.getId());
|
||||
inspPlanItemService.remove(qaSchemeBaseTwEntityLambdaQueryWrapper);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(inspPlanForm.getInspPlanItemList())) {
|
||||
List<InspPlanItemEntity> tableField114 = JsonUtil.getJsonToList(inspPlanForm.getInspPlanItemList(), InspPlanItemEntity.class);
|
||||
for (InspPlanItemEntity entitys : tableField114) {
|
||||
String entitysId = entitys.getId();
|
||||
if (StringUtil.isEmpty(entitysId)) {
|
||||
entitys.setId(RandomUtil.uuId());
|
||||
}
|
||||
entitys.setSchemeId(entity.getId());
|
||||
inspPlanItemService.saveOrUpdate(entitys);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -138,7 +224,6 @@ public class InspPlanServiceImpl extends ServiceImpl<InspPlanMapper, InspPlanEnt
|
||||
wrapper.like(InspPlanEntity::getSchemeNo, selectKey).or()
|
||||
.like(InspPlanEntity::getSchemeName, selectKey);
|
||||
}
|
||||
wrapper.eq(InspPlanEntity::getDeleteMark, 0);
|
||||
wrapper.orderByDesc(InspPlanEntity::getId);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package jnpf.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.mapper.OrderDetailMapper;
|
||||
import jnpf.model.order.OrderItemWithOrderPagination;
|
||||
import jnpf.model.order.OrderItemWithOrderVO;
|
||||
|
||||
@ -3,8 +3,8 @@ package jnpf.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.entity.ExampleOrderEntity;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.order.ExampleOrderEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.mapper.ProOrderMapper;
|
||||
import jnpf.model.order.*;
|
||||
import jnpf.model.orderdetail.OrderDetailForm;
|
||||
|
||||
@ -7,12 +7,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.entity.ShiftConfigEntity;
|
||||
import jnpf.model.shift.ShiftConfigEntity;
|
||||
import jnpf.mapper.ShiftConfigMapper;
|
||||
import jnpf.model.shift.ShiftConfigForm;
|
||||
import jnpf.model.shift.ShiftConfigPagination;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.permission.service.UserService;
|
||||
import jnpf.service.ShiftConfigService;
|
||||
import jnpf.util.*;
|
||||
@ -20,7 +18,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@ -6,14 +6,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.entity.ShiftConfigEntity;
|
||||
import jnpf.entity.ShiftResultEntity;
|
||||
import jnpf.model.shift.ShiftConfigEntity;
|
||||
import jnpf.model.shiftresult.ShiftResultEntity;
|
||||
import jnpf.mapper.ShiftConfigMapper;
|
||||
import jnpf.mapper.ShiftResultMapper;
|
||||
import jnpf.model.shiftresult.ShiftResultForm;
|
||||
import jnpf.model.shiftresult.ShiftResultPagination;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.permission.service.UserService;
|
||||
import jnpf.service.ShiftResultService;
|
||||
import jnpf.util.*;
|
||||
|
||||
@ -0,0 +1,246 @@
|
||||
package jnpf.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.entity.DictionaryDataEntity;
|
||||
import jnpf.base.service.DictionaryDataService;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
|
||||
import jnpf.model.checkItem.CheckItemEntity;
|
||||
import jnpf.model.checkItem.CheckItemForm;
|
||||
import jnpf.model.checkItem.CheckItemPagination;
|
||||
import jnpf.permission.service.UserService;
|
||||
|
||||
import jnpf.service.CheckItemService;
|
||||
import jnpf.util.GeneraterSwapUtil;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* qaCheckItemBase
|
||||
* @版本: V3.5
|
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组
|
||||
* @日期: 2025-09-25
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Tag(name = "qaCheckItemBase" , description = "example")
|
||||
@RequestMapping("/api/example/CheckItem")
|
||||
public class CheckItemController {
|
||||
|
||||
@Autowired
|
||||
private GeneraterSwapUtil generaterSwapUtil;
|
||||
|
||||
@Autowired
|
||||
private UserProvider userProvider;
|
||||
|
||||
@Autowired
|
||||
private CheckItemService qaCheckItemBaseService;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private DictionaryDataService dictionaryDataService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param CheckItemPagination
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取列表")
|
||||
@PostMapping("/getList")
|
||||
public ActionResult list(@RequestBody CheckItemPagination CheckItemPagination)throws IOException{
|
||||
List<CheckItemEntity> list= qaCheckItemBaseService.getList(CheckItemPagination);
|
||||
List<Map<String, Object>> realList=new ArrayList<>();
|
||||
for (CheckItemEntity entity : list) {
|
||||
Map<String, Object> qaCheckItemBaseMap=JsonUtil.entityToMap(entity);
|
||||
qaCheckItemBaseMap.put("id", qaCheckItemBaseMap.get("id"));
|
||||
//副表数据
|
||||
if (ObjectUtil.isNotEmpty(entity.getNature())){
|
||||
qaCheckItemBaseMap.put("nature", "1".equals(entity.getNature())?"定性":"定量");
|
||||
}
|
||||
//子表数据
|
||||
realList.add(qaCheckItemBaseMap);
|
||||
}
|
||||
//数据转换
|
||||
// realList = generaterSwapUtil.swapDataList(realList, QaCheckItemBaseConstant.getFormData(), QaCheckItemBaseConstant.getColumnData(), CheckItemPagination.getModuleId(),false);
|
||||
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO();
|
||||
vo.setList(realList);
|
||||
PaginationVO page = JsonUtil.getJsonToBean(CheckItemPagination, PaginationVO.class);
|
||||
vo.setPagination(page);
|
||||
return ActionResult.success(vo);
|
||||
}
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param CheckItemPagination
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "获取列表")
|
||||
@PostMapping("/queryList")
|
||||
public ActionResult queryList(@RequestBody CheckItemPagination CheckItemPagination){
|
||||
List<CheckItemEntity> list= qaCheckItemBaseService.queryList(CheckItemPagination);
|
||||
List<Map<String, Object>> realList=new ArrayList<>();
|
||||
List<DictionaryDataEntity> dictionaryDataEntities1= dictionaryDataService.getList("816930383386918149", false);
|
||||
|
||||
List<DictionaryDataEntity> dictionaryDataEntities3= dictionaryDataService.getList("816930292873837829", false);
|
||||
for (CheckItemEntity entity : list) {
|
||||
Map<String, Object> qaCheckItemBaseMap=JsonUtil.entityToMap(entity);
|
||||
qaCheckItemBaseMap.put("id", qaCheckItemBaseMap.get("id"));
|
||||
//副表数据
|
||||
if (ObjectUtil.isNotEmpty(entity.getNature())){
|
||||
qaCheckItemBaseMap.put("nature", "1".equals(entity.getNature())?"定性":"定量");
|
||||
}
|
||||
if ("1".equals(entity.getItemType())){
|
||||
DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities1.stream().filter(t -> t.getEnCode().equals(entity.getItemClass())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotEmpty(dictionaryDataEntity)) {
|
||||
qaCheckItemBaseMap.put("tiemClass",dictionaryDataEntity.getFullName());
|
||||
}
|
||||
}else if ("3".equals(entity.getItemType())){
|
||||
DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities3.stream().filter(t -> t.getEnCode().equals(entity.getItemClass())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotEmpty(dictionaryDataEntity)) {
|
||||
qaCheckItemBaseMap.put("tiemClass",dictionaryDataEntity.getFullName());
|
||||
}
|
||||
}else{
|
||||
qaCheckItemBaseMap.put("tiemClass","");
|
||||
}
|
||||
//子表数据
|
||||
realList.add(qaCheckItemBaseMap);
|
||||
}
|
||||
//数据转换
|
||||
// realList = generaterSwapUtil.swapDataList(realList, QaCheckItemBaseConstant.getFormData(), QaCheckItemBaseConstant.getColumnData(), CheckItemPagination.getModuleId(),false);
|
||||
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO();
|
||||
vo.setList(realList);
|
||||
PaginationVO page = JsonUtil.getJsonToBean(CheckItemPagination, PaginationVO.class);
|
||||
vo.setPagination(page);
|
||||
return ActionResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param CheckItemForm
|
||||
* @return
|
||||
*/
|
||||
@PostMapping()
|
||||
@Operation(summary = "创建")
|
||||
public ActionResult create(@RequestBody @Valid CheckItemForm CheckItemForm) {
|
||||
String b = qaCheckItemBaseService.checkForm(CheckItemForm,0);
|
||||
if (StringUtil.isNotEmpty(b)){
|
||||
return ActionResult.fail(b );
|
||||
}
|
||||
try{
|
||||
qaCheckItemBaseService.saveOrUpdate(CheckItemForm, null ,true);
|
||||
}catch(Exception e){
|
||||
return ActionResult.fail("新增数据失败");
|
||||
}
|
||||
return ActionResult.success("创建成功");
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
* @param id
|
||||
* @param CheckItemForm
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
@Operation(summary = "更新")
|
||||
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid CheckItemForm CheckItemForm,
|
||||
@RequestParam(value = "isImport", required = false) boolean isImport){
|
||||
CheckItemForm.setId(id);
|
||||
if (!isImport) {
|
||||
String b = qaCheckItemBaseService.checkForm(CheckItemForm,1);
|
||||
if (StringUtil.isNotEmpty(b)){
|
||||
return ActionResult.fail(b );
|
||||
}
|
||||
}
|
||||
CheckItemEntity entity= qaCheckItemBaseService.getInfo(id);
|
||||
if(entity!=null){
|
||||
try{
|
||||
qaCheckItemBaseService.saveOrUpdate(CheckItemForm,id,false);
|
||||
}catch(Exception e){
|
||||
return ActionResult.fail("修改数据失败");
|
||||
}
|
||||
return ActionResult.success("更新成功");
|
||||
}else{
|
||||
return ActionResult.fail("更新失败,数据不存在");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "删除")
|
||||
@DeleteMapping("/{id}")
|
||||
@DSTransactional
|
||||
public ActionResult delete(@PathVariable("id") String id){
|
||||
CheckItemEntity entity= qaCheckItemBaseService.getInfo(id);
|
||||
if(entity!=null){
|
||||
//主表数据删除
|
||||
qaCheckItemBaseService.delete(entity);
|
||||
}
|
||||
return ActionResult.success("删除成功");
|
||||
}
|
||||
/**
|
||||
* 表单信息(详情页)
|
||||
* 详情页面使用-转换数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "表单信息(详情页)")
|
||||
@GetMapping("/detail/{id}")
|
||||
public ActionResult detailInfo(@PathVariable("id") String id){
|
||||
CheckItemEntity entity= qaCheckItemBaseService.getInfo(id);
|
||||
if(entity==null){
|
||||
return ActionResult.fail("表单数据不存在!");
|
||||
}
|
||||
Map<String, Object> qaCheckItemBaseMap=JsonUtil.entityToMap(entity);
|
||||
qaCheckItemBaseMap.put("id", qaCheckItemBaseMap.get("id"));
|
||||
//副表数据
|
||||
//子表数据
|
||||
|
||||
return ActionResult.success(qaCheckItemBaseMap);
|
||||
}
|
||||
/**
|
||||
* 获取详情(编辑页)
|
||||
* 编辑页面使用-不转换数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "信息")
|
||||
@GetMapping("/{id}")
|
||||
public ActionResult info(@PathVariable("id") String id){
|
||||
CheckItemEntity entity= qaCheckItemBaseService.getInfo(id);
|
||||
if(entity==null){
|
||||
return ActionResult.fail("表单数据不存在!");
|
||||
}
|
||||
Map<String, Object> qaCheckItemBaseMap=JsonUtil.entityToMap(entity);
|
||||
qaCheckItemBaseMap.put("id", qaCheckItemBaseMap.get("id"));
|
||||
//副表数据
|
||||
//子表数据
|
||||
return ActionResult.success(qaCheckItemBaseMap);
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,9 +6,6 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.xuyanwu.spring.file.storage.FileInfo;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -16,20 +13,17 @@ import jnpf.base.ActionResult;
|
||||
|
||||
import jnpf.base.UserInfo;
|
||||
import jnpf.base.entity.DictionaryDataEntity;
|
||||
import jnpf.base.model.ColumnDataModel;
|
||||
import jnpf.base.service.DictionaryDataService;
|
||||
import jnpf.base.util.VisualUtils;
|
||||
import jnpf.base.vo.DownloadVO;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
|
||||
import jnpf.config.ConfigValueUtil;
|
||||
import jnpf.entity.ExampleOrderEntity;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.order.ExampleOrderEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.model.order.ExampleOrderForm;
|
||||
import jnpf.model.order.ExampleOrderPagination;
|
||||
|
||||
import jnpf.model.visualJson.config.HeaderModel;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.permission.service.UserService;
|
||||
import jnpf.service.ExampleOrderService;
|
||||
@ -39,7 +33,6 @@ import lombok.Cleanup;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -1,13 +1,22 @@
|
||||
package jnpf.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.entity.DictionaryDataEntity;
|
||||
import jnpf.base.service.DictionaryDataService;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.model.inspplan.InspPlanEntity;
|
||||
import jnpf.model.inspplan.InspPlanForm;
|
||||
import jnpf.model.inspplan.InspPlanPagination;
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
import jnpf.permission.entity.UserEntity;
|
||||
import jnpf.permission.service.UserService;
|
||||
import jnpf.service.InspPlanItemService;
|
||||
import jnpf.service.InspPlanService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
@ -29,6 +38,13 @@ public class InspPlanController {
|
||||
|
||||
@Autowired
|
||||
private InspPlanService inspPlanService;
|
||||
@Autowired
|
||||
private DictionaryDataService dictionaryDataService;
|
||||
@Autowired
|
||||
private InspPlanItemService inspPlanItemService;
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
|
||||
@Operation(summary = "获取质检方案列表")
|
||||
@PostMapping("/getList")
|
||||
@ -56,16 +72,77 @@ public class InspPlanController {
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获取质检方案详情")
|
||||
/**
|
||||
* 表单信息(详情页)
|
||||
* 详情页面使用-转换数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "表单信息(详情页)")
|
||||
@GetMapping("/detail/{id}")
|
||||
public ActionResult detailInfo(@PathVariable("id") String id) {
|
||||
InspPlanEntity entity = inspPlanService.getInfo(id);
|
||||
if (entity == null) {
|
||||
return ActionResult.fail("表单数据不存在!");
|
||||
}
|
||||
Map<String, Object> InspPlanMap = JsonUtil.entityToMap(entity);
|
||||
InspPlanMap.put("id", InspPlanMap.get("id"));
|
||||
//副表数据
|
||||
List<DictionaryDataEntity> dictionaryDataEntities = dictionaryDataService.getList("816941613849787909", false);
|
||||
DictionaryDataEntity dictionaryDataEntity = dictionaryDataEntities.stream().filter(t -> t.getEnCode().equals(entity.getTiemClass())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotEmpty(dictionaryDataEntity)) {
|
||||
InspPlanMap.put("tiemClass", dictionaryDataEntity.getFullName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(entity.getCreatorUserId())){
|
||||
UserEntity userEntity = userService.getById(entity.getCreatorUserId());
|
||||
if (ObjectUtil.isNotEmpty(userEntity)){
|
||||
InspPlanMap.put("creatorUserId", userEntity.getRealName());
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(entity.getCreatorTime())){
|
||||
InspPlanMap.put("creatorTime", DateUtil.format(entity.getCreatorTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
//子表数据
|
||||
List<InspPlanItemEntity> inspPlanItemList = inspPlanItemService.getInspPlanItemList(entity.getId());
|
||||
InspPlanMap.put("InspPlanItemList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(inspPlanItemList)));
|
||||
return ActionResult.success(InspPlanMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情(编辑页)
|
||||
* 编辑页面使用-不转换数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "信息")
|
||||
@GetMapping("/{id}")
|
||||
public ActionResult info(@PathVariable("id") String id) {
|
||||
InspPlanEntity entity = inspPlanService.getInfo(id);
|
||||
if (entity != null) {
|
||||
return ActionResult.success(JsonUtil.entityToMap(entity));
|
||||
if (entity == null) {
|
||||
return ActionResult.fail("表单数据不存在!");
|
||||
}
|
||||
return ActionResult.fail("数据不存在");
|
||||
Map<String, Object> InspPlanMap = JsonUtil.entityToMap(entity);
|
||||
InspPlanMap.put("id", InspPlanMap.get("id"));
|
||||
if (ObjectUtil.isNotEmpty(entity.getSchemeType())) {
|
||||
InspPlanMap.put("schemeType", entity.getSchemeType().toString());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(entity.getCreatorUserId())){
|
||||
UserEntity userEntity = userService.getById(entity.getCreatorUserId());
|
||||
if (ObjectUtil.isNotEmpty(userEntity)){
|
||||
InspPlanMap.put("creatorUserId", userEntity.getRealName());
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(entity.getCreatorTime())){
|
||||
InspPlanMap.put("creatorTime", DateUtil.format(entity.getCreatorTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
//副表数据
|
||||
//子表数据
|
||||
List<InspPlanItemEntity> inspPlanItemList = inspPlanItemService.getInspPlanItemList(entity.getId());
|
||||
InspPlanMap.put("InspPlanItemList", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(inspPlanItemList)));
|
||||
return ActionResult.success(InspPlanMap);
|
||||
}
|
||||
|
||||
@Operation(summary = "新建质检方案")
|
||||
@PostMapping
|
||||
public ActionResult create(@RequestBody @Valid InspPlanForm inspPlanForm) {
|
||||
@ -116,5 +193,25 @@ public class InspPlanController {
|
||||
}
|
||||
return ActionResult.fail("删除失败,数据不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param inspPlanForm
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/verifyNumber")
|
||||
@Operation(summary = "校验")
|
||||
public ActionResult verifyNumber(@RequestBody InspPlanForm inspPlanForm) {
|
||||
if (ObjectUtil.isNotEmpty(inspPlanForm.getSchemeNo())) {
|
||||
LambdaQueryWrapper<InspPlanEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(InspPlanEntity::getSchemeNo, inspPlanForm.getSchemeNo());
|
||||
if (ObjectUtil.isNotEmpty(inspPlanForm.getId())) {
|
||||
queryWrapper.ne(InspPlanEntity::getId, inspPlanForm.getId());
|
||||
}
|
||||
if (inspPlanService.count(queryWrapper) > 0) {
|
||||
return ActionResult.fail("质检方案编号" + inspPlanForm.getSchemeNo() + "已存在,请确认!");
|
||||
}
|
||||
}
|
||||
return ActionResult.success(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import jnpf.base.vo.ListVO;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.constant.MsgCode;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.model.order.OrderItemWithOrderPagination;
|
||||
import jnpf.model.order.OrderItemWithOrderVO;
|
||||
import jnpf.model.orderdetail.OrderDetailForm;
|
||||
|
||||
@ -6,8 +6,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.entity.ShiftConfigEntity;
|
||||
import jnpf.model.machine.MachineForm;
|
||||
import jnpf.model.shift.ShiftConfigEntity;
|
||||
import jnpf.model.shift.ShiftConfigForm;
|
||||
import jnpf.model.shift.ShiftConfigPagination;
|
||||
import jnpf.service.ShiftConfigService;
|
||||
|
||||
@ -5,8 +5,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.entity.ShiftResultEntity;
|
||||
import jnpf.model.shift.ShiftConfigForm;
|
||||
import jnpf.model.shiftresult.ShiftResultEntity;
|
||||
import jnpf.model.shiftresult.ShiftResultForm;
|
||||
import jnpf.model.shiftresult.ShiftResultPagination;
|
||||
import jnpf.service.ShiftResultService;
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package jnpf.model.checkItem;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 检验项目表
|
||||
*
|
||||
* @版本: V3.5
|
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组
|
||||
* @日期: 2025-09-25
|
||||
*/
|
||||
@Data
|
||||
@TableName("tba_check_item")
|
||||
public class CheckItemEntity {
|
||||
@TableId(value ="ID" ,type = IdType.AUTO )
|
||||
private Integer id;
|
||||
@TableField(value = "ITEM_NO" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private String itemNo;
|
||||
@TableField(value = "ITEM_NAME" , updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String itemName;
|
||||
@TableField(value = "NATURE" , updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String nature;
|
||||
@TableField(value = "UNIT_NAME", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String unitName;
|
||||
@TableField(value = "CHECK_METHOD", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String checkMethod;
|
||||
@TableField(value = "REMARK", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String remark;
|
||||
@TableField(value = "ITEM_TYPE", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String itemType;
|
||||
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
|
||||
private Date creatorTime;
|
||||
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
|
||||
private String creatorUserId;
|
||||
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
|
||||
private Date lastModifyTime;
|
||||
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
|
||||
private String lastModifyUserId;
|
||||
@TableField(value = "f_delete_time" , fill = FieldFill.UPDATE)
|
||||
private Date deleteTime;
|
||||
@TableField(value = "f_delete_user_id" , fill = FieldFill.UPDATE)
|
||||
private String deleteUserId;
|
||||
@TableField(value = "f_delete_mark" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer deleteMark;
|
||||
@TableField("F_FLOW_ID")
|
||||
private String flowId;
|
||||
@TableField("F_FLOW_TASK_ID")
|
||||
private String flowTaskId;
|
||||
@TableField(value = "ITEM_CLASS", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String itemClass;
|
||||
@TableField(value = "ITEM_VALUE_TYPE", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String itemValueType;
|
||||
@TableField(value = "ITEM_CONTENT", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String itemContent;
|
||||
@TableField(value = "TEST_NUM", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Integer testNum;
|
||||
@TableField(value = "FLOAT_NUM", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private Integer floatNum;
|
||||
@TableField(value = "print_avg_values", updateStrategy = FieldStrategy.ALWAYS)
|
||||
private String printAvgValues;
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package jnpf.model.checkItem;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* qaCheckItemBase
|
||||
* @版本: V3.5
|
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组
|
||||
* @日期: 2025-10-05
|
||||
*/
|
||||
@Data
|
||||
public class CheckItemForm {
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 编号 **/
|
||||
@JsonProperty("itemNo")
|
||||
private String itemNo;
|
||||
/** 名称 **/
|
||||
@JsonProperty("itemName")
|
||||
private String itemName;
|
||||
/** 性质 **/
|
||||
@JsonProperty("nature")
|
||||
private String nature;
|
||||
/** 单位 **/
|
||||
@JsonProperty("unitName")
|
||||
private String unitName;
|
||||
/** 检验值类型 **/
|
||||
@JsonProperty("itemValueType")
|
||||
private Object itemValueType;
|
||||
/** 适用类型 **/
|
||||
@JsonProperty("itemType")
|
||||
private Object itemType;
|
||||
/** 检验值数量 **/
|
||||
@JsonProperty("testNum")
|
||||
private String testNum;
|
||||
/** 绑定值 **/
|
||||
@JsonProperty("itemContent")
|
||||
private String itemContent;
|
||||
/** 是否取平均值 **/
|
||||
@JsonProperty("printAvgValues")
|
||||
private String printAvgValues;
|
||||
/** 小数位数 **/
|
||||
@JsonProperty("floatNum")
|
||||
private String floatNum;
|
||||
/** 检验大类 **/
|
||||
@JsonProperty("itemClass")
|
||||
private Object itemClass;
|
||||
/** 检验方法 **/
|
||||
@JsonProperty("checkMethod")
|
||||
private String checkMethod;
|
||||
/** 备注 **/
|
||||
@JsonProperty("remark")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package jnpf.model.checkItem;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jnpf.base.Pagination;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* qaCheckItemBase
|
||||
* @版本: V3.5
|
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组
|
||||
* @日期: 2025-10-05
|
||||
*/
|
||||
@Data
|
||||
public class CheckItemPagination extends Pagination {
|
||||
/** 查询key */
|
||||
private String[] selectKey;
|
||||
/** json */
|
||||
private String json;
|
||||
/** 数据类型 0-当前页,1-全部数据 */
|
||||
private String dataType;
|
||||
/** 高级查询 */
|
||||
private String superQueryJson;
|
||||
/** 功能id */
|
||||
private String moduleId;
|
||||
/** 菜单id */
|
||||
private String menuId;
|
||||
/** 适用类型 */
|
||||
@JsonProperty("itemType")
|
||||
private Object itemType;
|
||||
/** 编号 */
|
||||
@JsonProperty("itemNo")
|
||||
private Object itemNo;
|
||||
/** 检验名称 */
|
||||
@JsonProperty("itemName")
|
||||
private Object itemName;
|
||||
@JsonProperty("schemeType")
|
||||
private Object schemeType;
|
||||
}
|
||||
@ -1,10 +1,13 @@
|
||||
package jnpf.model.inspplan;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jnpf.model.inspplanitem.InspPlanItemEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 质检方案表 Form
|
||||
@ -72,4 +75,8 @@ public class InspPlanForm {
|
||||
|
||||
@Schema(description = "打印模板名称")
|
||||
private String printName;
|
||||
/** 子表数据 **/
|
||||
@JsonProperty("InspPlanItemList")
|
||||
private List<InspPlanItemEntity> InspPlanItemList;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package jnpf.model.inspplanitem;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 质检方案表
|
||||
*
|
||||
* @版本: V3.5
|
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组
|
||||
* @日期: 2024-10-19
|
||||
*/
|
||||
@Data
|
||||
@TableName("tba_insp_plan_item")
|
||||
public class InspPlanItemEntity {
|
||||
@TableId(value ="ID" )
|
||||
private String id;
|
||||
@TableField("SCHEME_ID")
|
||||
private String schemeId;
|
||||
@TableField(value = "ITEM_ID" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private String itemId;
|
||||
@TableField(value = "UNIT" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private String unit;
|
||||
@TableField(value = "STANDARD_VALUE" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private String standardValue;
|
||||
@TableField(value = "UPPER_LIMIT" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal upperLimit;
|
||||
@TableField(value = "LOWER_LIMIT" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal lowerLimit;
|
||||
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
|
||||
private String remark;
|
||||
@TableField(value = "f_creator_time" , fill = FieldFill.INSERT)
|
||||
private Date creatorTime;
|
||||
@TableField(value = "f_creator_user_id" , fill = FieldFill.INSERT)
|
||||
private String creatorUserId;
|
||||
@TableField(value = "f_last_modify_time" , fill = FieldFill.INSERT_UPDATE)
|
||||
private Date lastModifyTime;
|
||||
@TableField(value = "f_last_modify_user_id" , fill = FieldFill.INSERT_UPDATE)
|
||||
private String lastModifyUserId;
|
||||
@TableField("F_DELETE_USER_ID")
|
||||
private String deleteUserId;
|
||||
@TableField("F_DELETE_TIME")
|
||||
private Date deleteTime;
|
||||
@TableField("F_DELETE_MARK")
|
||||
private Integer deleteMark;
|
||||
@TableField("F_FLOW_ID")
|
||||
private String flowId;
|
||||
@TableField("F_FLOW_TASK_ID")
|
||||
private String flowTaskId;
|
||||
@TableField("item_name")
|
||||
private String itemName;
|
||||
@TableField("seq_no")
|
||||
private Integer seqNo;
|
||||
@TableField("print_merge_yn")
|
||||
private String printMergeYn;
|
||||
@TableField("print_item")
|
||||
private String printItem;
|
||||
@TableField("print_num")
|
||||
private String printNum;
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package jnpf.entity;
|
||||
package jnpf.model.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
@ -2,7 +2,7 @@ package jnpf.model.order;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jnpf.entity.OrderDetailEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailEntity;
|
||||
import jnpf.model.orderdetail.OrderDetailForm;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package jnpf.entity;
|
||||
package jnpf.model.orderdetail;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
@ -1,4 +1,4 @@
|
||||
package jnpf.entity;
|
||||
package jnpf.model.shift;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
@ -1,10 +1,8 @@
|
||||
package jnpf.model.shift;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jnpf.entity.ShiftConfigEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package jnpf.entity;
|
||||
package jnpf.model.shiftresult;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
184
jnpf-java-boot/jnpf-web/src/views/example/checkitem/Detail.vue
Normal file
184
jnpf-java-boot/jnpf-web/src/views/example/checkitem/Detail.vue
Normal file
@ -0,0 +1,184 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="编号"
|
||||
prop="itemNo" >
|
||||
<p>{{dataForm.itemNo}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="名称"
|
||||
prop="itemName" >
|
||||
<p>{{dataForm.itemName}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="性质"
|
||||
prop="nature" >
|
||||
<p>{{ dataForm.nature }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="单位"
|
||||
prop="unitName" >
|
||||
<p>{{dataForm.unitName}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="检验值类型"
|
||||
prop="itemValueType" >
|
||||
<p>{{ dataForm.itemValueType }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="适用类型"
|
||||
prop="itemType" >
|
||||
<p>{{ dataForm.itemType }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="检验值数量"
|
||||
prop="testNum" >
|
||||
<p>{{dataForm.testNum}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="绑定值"
|
||||
prop="itemContent" >
|
||||
<p>{{dataForm.itemContent}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="是否取平均值" label-width="120px"
|
||||
prop="printAvgValues" >
|
||||
<p>{{ dataForm.printAvgValues }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="小数位数"
|
||||
prop="floatNum" >
|
||||
<p>{{dataForm.floatNum}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="检验大类"
|
||||
prop="itemClass" >
|
||||
<p>{{dataForm.itemClass}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label="检验方法"
|
||||
prop="checkMethod" >
|
||||
<p>{{dataForm.checkMethod}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label="备注"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
</span>
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: { Detail},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
|
||||
dataForm: {
|
||||
id :'',
|
||||
itemNo : '',
|
||||
itemName : '',
|
||||
nature : '',
|
||||
unitName : '',
|
||||
itemValueType : "",
|
||||
itemType : "",
|
||||
testNum : '',
|
||||
itemContent : '',
|
||||
printAvgValues : '',
|
||||
floatNum : '',
|
||||
itemClass : "",
|
||||
checkMethod : '',
|
||||
remark : '',
|
||||
},
|
||||
natureOptions:[{"fullName":"定性","id":"1"},{"fullName":"定量","id":"2"}],
|
||||
natureProps:{"label":"fullName","value":"id" },
|
||||
itemValueTypeOptions:[{"fullName":"数字","id":"I"},{"fullName":"文本","id":"T"}],
|
||||
itemValueTypeProps:{"label":"fullName","value":"id" },
|
||||
itemTypeOptions:[{"fullName":"原材料","id":"1"},{"fullName":"半成品","id":"2"},{"fullName":"成品","id":"3"}],
|
||||
itemTypeProps:{"label":"fullName","value":"id" },
|
||||
printAvgValuesOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
|
||||
printAvgValuesProps:{"label":"fullName","value":"id" },
|
||||
itemClassProps:{"label":"fullName","value":"enCode" },
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/QaCheckItemBase/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
685
jnpf-java-boot/jnpf-web/src/views/example/checkitem/form.vue
Normal file
685
jnpf-java-boot/jnpf-web/src/views/example/checkitem/form.vue
Normal file
@ -0,0 +1,685 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="800px"
|
||||
>
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataForm.itemType==3?dataRule:dataRule1" size="small" label-width="100px"
|
||||
label-position="right" :validate-on-rule-change="false"
|
||||
:key="dataForm.itemType"
|
||||
>
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="编号" prop="itemNo"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.itemNo" @change="changeData('itemNo',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="名称" prop="itemName"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.itemName" @change="changeData('itemName',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="性质" prop="nature"
|
||||
>
|
||||
<JnpfRadio v-model="dataForm.nature" @change="changeData('nature',-1)"
|
||||
optionType="default" direction="horizontal" size="small" :options="natureOptions"
|
||||
:props="natureProps"
|
||||
>
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="单位" prop="unitName"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.unitName" @change="changeData('unitName',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="检验值类型" prop="itemValueType"
|
||||
>
|
||||
<JnpfSelect v-model="dataForm.itemValueType" @change="changeData1"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :options="itemValueTypeOptions"
|
||||
:props="itemValueTypeProps"
|
||||
>
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="适用类型" prop="itemType"
|
||||
>
|
||||
<JnpfSelect v-model="dataForm.itemType" @change="changeData2"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :options="itemTypeOptions"
|
||||
:props="itemTypeProps"
|
||||
>
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="检验值数量" prop="testNum"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.testNum" @change="changeData('testNum',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="绑定值" prop="itemContent"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.itemContent" @change="changeData('itemContent',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="是否取平均值" label-width="120px" prop="printAvgValues"
|
||||
>
|
||||
<JnpfRadio v-model="dataForm.printAvgValues" @change="changeData('printAvgValues',-1)"
|
||||
optionType="default" direction="horizontal" size="small" :options="printAvgValuesOptions"
|
||||
:props="printAvgValuesProps"
|
||||
>
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="小数位数" prop="floatNum"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.floatNum" @change="changeData('floatNum',-1)"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<jnpf-form-tip-item
|
||||
label="检验大类" prop="itemClass"
|
||||
>
|
||||
<JnpfSelect v-model="dataForm.itemClass" @change="changeData('itemClass',-1)"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :options="itemClassOptions"
|
||||
:props="itemClassProps" v-if="dataForm.itemType==3"
|
||||
>
|
||||
</JnpfSelect>
|
||||
<JnpfSelect v-model="dataForm.itemClass" @change="changeData('itemClass',-1)"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :options="itemClass1Options"
|
||||
:props="itemClass1Props" v-if="dataForm.itemType==1"
|
||||
>
|
||||
</JnpfSelect>
|
||||
<JnpfSelect v-model="dataForm.itemClass" @change="changeData('itemClass',-1)"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}' :options="itemClass1Options"
|
||||
:props="itemClass1Props" v-if="dataForm.itemType==2 ||!dataForm.itemType" disabled
|
||||
>
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item
|
||||
label="检验方法" prop="checkMethod"
|
||||
>
|
||||
<JnpfTextarea v-model="dataForm.checkMethod" @change="changeData('checkMethod',-1)"
|
||||
placeholder="请输入" :style='{"width":"100%"}' true type="textarea"
|
||||
:autosize='{"minRows":5,"maxRows":10}'
|
||||
>
|
||||
</JnpfTextarea>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item
|
||||
label="备注" prop="remark"
|
||||
>
|
||||
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark',-1)"
|
||||
placeholder="请输入" :style='{"width":"100%"}' true type="textarea"
|
||||
:autosize='{"minRows":5,"maxRows":10}'
|
||||
>
|
||||
</JnpfTextarea>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
|
||||
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"
|
||||
/>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
||||
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
||||
import {
|
||||
getDateDay,
|
||||
getLaterData,
|
||||
getBeforeData,
|
||||
getBeforeTime,
|
||||
getLaterTime
|
||||
} from '@/components/Generator/utils/index.js'
|
||||
import { thousandsFormat } from '@/components/Generator/utils/index'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {},
|
||||
//可选范围默认值
|
||||
ableAll: {},
|
||||
tableRows: {},
|
||||
Vmodel: '',
|
||||
currVmodel: '',
|
||||
dataForm: {
|
||||
itemNo: undefined,
|
||||
itemName: undefined,
|
||||
nature: undefined,
|
||||
unitName: undefined,
|
||||
itemValueType: undefined,
|
||||
itemType: undefined,
|
||||
testNum: undefined,
|
||||
itemContent: undefined,
|
||||
printAvgValues: "N",
|
||||
floatNum: undefined,
|
||||
itemClass: undefined,
|
||||
checkMethod: undefined,
|
||||
remark: undefined,
|
||||
printItem:"1"
|
||||
},
|
||||
tableRequiredData: {},
|
||||
flag:false,
|
||||
dataRule:
|
||||
{
|
||||
itemName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
nature: [
|
||||
{
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
itemType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
itemContent: [
|
||||
{
|
||||
pattern: /^[\w\u4e00-\u9fa5]+(,[\w\u4e00-\u9fa5]+)*$/,
|
||||
message: '格式错误',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
itemClass: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
},
|
||||
dataRule1:
|
||||
{
|
||||
itemName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
nature: [
|
||||
{
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
itemType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
itemContent: [
|
||||
{
|
||||
pattern: /^[\w\u4e00-\u9fa5]+(,[\w\u4e00-\u9fa5]+)*$/,
|
||||
message: '格式错误',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
},
|
||||
natureOptions: [{ 'fullName': '定性', 'id': '1' }, { 'fullName': '定量', 'id': '2' }],
|
||||
natureProps: { 'label': 'fullName', 'value': 'id' },
|
||||
itemValueTypeOptions: [{ 'fullName': '数字', 'id': 'I' }, { 'fullName': '文本', 'id': 'T' }],
|
||||
itemValueTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
itemTypeOptions: [{ 'fullName': '原材料', 'id': '1' }, { 'fullName': '半成品', 'id': '2' }, {
|
||||
'fullName': '成品',
|
||||
'id': '3'
|
||||
}],
|
||||
itemTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
printAvgValuesOptions: [{ 'fullName': '是', 'id': 'Y' }, { 'fullName': '否', 'id': 'N' }],
|
||||
printAvgValuesProps: { 'label': 'fullName', 'value': 'id' },
|
||||
itemClassOptions: [],
|
||||
itemClassProps: { 'label': 'fullName', 'value': 'enCode' },
|
||||
itemClass1Options: [],
|
||||
itemClass1Props: { 'label': 'fullName', 'value': 'enCode' },
|
||||
printItemOptions:[],
|
||||
printItemProps:{'label': 'fullName', 'value': 'enCode' },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
itemNo: [],
|
||||
itemName: [],
|
||||
nature: [],
|
||||
unitName: [],
|
||||
itemValueType: [],
|
||||
itemType: [],
|
||||
testNum: [],
|
||||
itemContent: [],
|
||||
printAvgValues: [],
|
||||
floatNum: [],
|
||||
itemClass: [],
|
||||
checkMethod: [],
|
||||
remark: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
this.nextDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index]
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
changeData2(){
|
||||
// this.dataForm.itemClass=''
|
||||
this.$set(this.dataForm, 'itemClass', "");
|
||||
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
this.prevDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index]
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/example/CheckItem/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
})
|
||||
},
|
||||
changeData1(row){
|
||||
console.log(row)
|
||||
if (row=='I'){
|
||||
this.dataForm.floatNum=2
|
||||
}else {
|
||||
this.dataForm.floatNum=''
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split('-')
|
||||
let faceMode = ''
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i]
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options'
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
this.getitemClassOptions()
|
||||
this.getitemClass1Options()
|
||||
},
|
||||
getitemClassOptions() {
|
||||
getDictionaryDataSelector('816930292873837829').then(res => {
|
||||
this.itemClassOptions = res.data.list
|
||||
})
|
||||
},
|
||||
getitemClass1Options() {
|
||||
getDictionaryDataSelector('816930383386918149').then(res => {
|
||||
this.itemClass1Options = res.data.list
|
||||
})
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/CheckItem/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
if (this.dataForm.itemValueType == 'I' && this.dataForm.itemContent != null && this.dataForm.itemContent !== '') {
|
||||
this.$message({
|
||||
message:'检验值类型为数字类型,绑定值必须为空,请确认',
|
||||
type: 'error',
|
||||
duration: 3000,
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.dataForm.itemValueType == 'T' && this.dataForm.floatNum != null && this.dataForm.floatNum !== '') {
|
||||
this.$message({
|
||||
message: '检验值类型为文本类型,小数位数必须为空,请确认',
|
||||
type: 'error',
|
||||
duration: 3000,
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.dataForm.itemValueType == 'I' && (this.dataForm.floatNum == null ||this.dataForm.floatNum === '')) {
|
||||
this.$message({
|
||||
message: '检验值类型为数字类型,小数位数必须输入,请确认',
|
||||
type: 'error',
|
||||
duration: 3000,
|
||||
})
|
||||
return
|
||||
}
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/CheckItem',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/CheckItem/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
openSelectDialog(key) {
|
||||
this.currTableConf = this.addTableConf[key]
|
||||
this.currVmodel = key
|
||||
this.selectDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectDialog.init()
|
||||
})
|
||||
},
|
||||
addForSelect(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let t = data[i]
|
||||
if (this['get' + this.currVmodel]) {
|
||||
this['get' + this.currVmodel](t)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = ''
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = ''
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeDataValue
|
||||
},
|
||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||
let timeDataValue = null
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = ''
|
||||
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = ''
|
||||
previousDate = getLaterTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
}
|
||||
}
|
||||
return timeDataValue
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
this.childIndex = -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
525
jnpf-java-boot/jnpf-web/src/views/example/checkitem/index.vue
Normal file
525
jnpf-java-boot/jnpf-web/src/views/example/checkitem/index.vue
Normal file
@ -0,0 +1,525 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="适用类型">
|
||||
<JnpfSelect v-model="query.itemType" placeholder="请选择" clearable
|
||||
:options="itemTypeOptions"
|
||||
:props="itemTypeProps"
|
||||
>
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="编号">
|
||||
<el-input v-model="query.itemNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="检验名称">
|
||||
<el-input v-model="query.itemName" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip content="高级查询" placement="top" v-if="true">
|
||||
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
|
||||
@click="openSuperQuery()"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="initData()"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change="sortChange"
|
||||
:span-method="arraySpanMethod" border
|
||||
|
||||
>
|
||||
|
||||
<el-table-column
|
||||
prop="itemName"
|
||||
label="名称" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="性质" prop="nature" align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.nature }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="tiemClass"
|
||||
label="检验大类" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="unitName"
|
||||
label="单位" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="checkMethod"
|
||||
label="检验方法" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="适用类型" prop="itemType" align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.itemType==1?"原材料":scope.row.itemType==2?"半成品":"成品"}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="检验值类型" prop="itemValueType" align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.itemValueType==''||scope.row.itemValueType==null?"":scope.row.itemValueType=='T'?"文本":"数字" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="testNum"
|
||||
label="检验值数量" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="itemContent"
|
||||
label="绑定值" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="floatNum"
|
||||
label="小数位数" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="itemNo"
|
||||
label="编号" align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作"
|
||||
fixed="right" width="150" align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<!-- <el-button type="text" v-has="'btn_detail'"-->
|
||||
<!-- @click="goDetail(scope.row.id)"-->
|
||||
<!-- >详情-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
|
||||
|
||||
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false"/>
|
||||
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
|
||||
@superQuery="superQuery"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './form'
|
||||
import Detail from './Detail'
|
||||
import ExportBox from '@/components/ExportBox'
|
||||
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
|
||||
import columnList from './columnList'
|
||||
import { thousandsFormat } from '@/components/Generator/utils/index'
|
||||
import SuperQuery from '@/components/SuperQuery'
|
||||
import superQueryJson from './superQueryJson'
|
||||
|
||||
export default {
|
||||
name: 'qacheckitembase',
|
||||
components: {
|
||||
JNPFForm,
|
||||
Detail,
|
||||
ExportBox, ToFormDetail, SuperQuery
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
keyword: '',
|
||||
expandsTree: true,
|
||||
refreshTree: true,
|
||||
toFormDetailVisible: false,
|
||||
expandObj: {},
|
||||
columnOptions: [],
|
||||
mergeList: [],
|
||||
exportList: [],
|
||||
columnList,
|
||||
|
||||
superQueryVisible: false,
|
||||
superQueryJson,
|
||||
uploadBoxVisible: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
itemType: undefined,
|
||||
itemNo: undefined,
|
||||
itemName: undefined
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id',
|
||||
isLeaf: 'isLeaf'
|
||||
},
|
||||
list: [],
|
||||
listLoading: false,
|
||||
total: 0,
|
||||
queryData: {},
|
||||
listQuery: {
|
||||
superQueryJson: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
formVisible: false,
|
||||
flowVisible: false,
|
||||
flowListVisible: false,
|
||||
flowList: [],
|
||||
exportBoxVisible: false,
|
||||
natureOptions: [{ 'fullName': '定性', 'id': '1' }, { 'fullName': '定量', 'id': '2' }],
|
||||
natureProps: { 'label': 'fullName', 'value': 'id' },
|
||||
itemValueTypeOptions: [{ 'fullName': '数字', 'id': 'I' }, { 'fullName': '文本', 'id': 'T' }],
|
||||
itemValueTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
itemTypeOptions: [{ 'fullName': '原材料', 'id': '1' }, { 'fullName': '半成品', 'id': '2' }, {
|
||||
'fullName': '成品',
|
||||
'id': '3'
|
||||
}],
|
||||
itemTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
printAvgValuesOptions: [{ 'fullName': '是', 'id': 'Y' }, { 'fullName': '否', 'id': 'N' }],
|
||||
printAvgValuesProps: { 'label': 'fullName', 'value': 'id' },
|
||||
itemClassOptions: [],
|
||||
itemClassProps: { 'label': 'fullName', 'value': 'enCode' },
|
||||
interfaceRes: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getColumnList(),
|
||||
this.initSearchDataAndListData()
|
||||
this.queryData = JSON.parse(JSON.stringify(this.query))
|
||||
},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.toFormDetailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
toggleTreeExpand(expands) {
|
||||
this.refreshTree = false
|
||||
this.expandsTree = expands
|
||||
this.$nextTick(() => {
|
||||
this.refreshTree = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.treeBox.setCurrentKey(null)
|
||||
})
|
||||
})
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data[this.treeProps.label].indexOf(value) !== -1
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const nodeData = node.data
|
||||
const config = {
|
||||
treeInterfaceId: '',
|
||||
treeTemplateJson: []
|
||||
}
|
||||
if (config.treeInterfaceId) {
|
||||
//这里是为了拿到参数中关联的字段的值,后端自行拿
|
||||
if (config.treeTemplateJson && config.treeTemplateJson.length) {
|
||||
for (let i = 0; i < config.treeTemplateJson.length; i++) {
|
||||
const element = config.treeTemplateJson[i]
|
||||
element.defaultValue = nodeData[element.relationField] || ''
|
||||
}
|
||||
}
|
||||
//参数
|
||||
let query = {
|
||||
paramList: config.treeTemplateJson || []
|
||||
}
|
||||
//接口
|
||||
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
|
||||
let data = res.data
|
||||
if (Array.isArray(data)) {
|
||||
resolve(data)
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getColumnList() {
|
||||
// 没有开启权限
|
||||
this.columnOptions = this.transformColumnList(this.columnList)
|
||||
},
|
||||
transformColumnList(columnList) {
|
||||
let list = []
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i]
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e)
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0]
|
||||
let label = e.label.split('-')[0]
|
||||
let vModel = e.prop.split('-')[1]
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
jnpfKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
children: []
|
||||
}
|
||||
e.vModel = vModel
|
||||
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
|
||||
if (!list.some(o => o.prop === prop)) list.push(newItem)
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.getMergeList(list)
|
||||
this.getExportList(list)
|
||||
return list
|
||||
},
|
||||
arraySpanMethod({ column }) {
|
||||
for (let i = 0; i < this.mergeList.length; i++) {
|
||||
if (column.property == this.mergeList[i].prop) {
|
||||
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
|
||||
}
|
||||
}
|
||||
},
|
||||
getMergeList(list) {
|
||||
let newList = JSON.parse(JSON.stringify(list))
|
||||
newList.forEach(item => {
|
||||
if (item.children && item.children.length) {
|
||||
let child = {
|
||||
prop: item.prop + '-child-first'
|
||||
}
|
||||
item.children.unshift(child)
|
||||
}
|
||||
})
|
||||
newList.forEach(item => {
|
||||
if (item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
this.mergeList.push({
|
||||
prop: child.prop,
|
||||
rowspan: 1,
|
||||
colspan: item.children.length
|
||||
})
|
||||
} else {
|
||||
this.mergeList.push({
|
||||
prop: child.prop,
|
||||
rowspan: 0,
|
||||
colspan: 0
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.mergeList.push({
|
||||
prop: item.prop,
|
||||
rowspan: 1,
|
||||
colspan: 1
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getExportList(list) {
|
||||
let exportList = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].jnpfKey === 'table') {
|
||||
for (let j = 0; j < list[i].children.length; j++) {
|
||||
exportList.push(list[i].children[j])
|
||||
}
|
||||
} else {
|
||||
exportList.push(list[i])
|
||||
}
|
||||
}
|
||||
this.exportList = exportList
|
||||
},
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
async initSearchDataAndListData() {
|
||||
await this.initSearchData()
|
||||
// this.initData()
|
||||
},
|
||||
//初始化查询的默认数据
|
||||
async initSearchData() {
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
keyword: this.keyword,
|
||||
dataType: 0,
|
||||
menuId: this.menuId,
|
||||
moduleId: '744564040646276229',
|
||||
type: 1
|
||||
}
|
||||
request({
|
||||
url: `/api/example/CheckItem/queryList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = res.data.list
|
||||
this.list = _list.map(o => ({
|
||||
...o,
|
||||
...this.expandObj
|
||||
}))
|
||||
this.total = res.data.pagination.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/example/CheckItem/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handelUpload() {
|
||||
this.uploadBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.UploadBox.init('', 'example/QaCheckItemBase')
|
||||
})
|
||||
},
|
||||
openSuperQuery() {
|
||||
this.superQueryVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.SuperQuery.init()
|
||||
})
|
||||
},
|
||||
superQuery(queryJson) {
|
||||
this.listQuery.superQueryJson = queryJson
|
||||
this.listQuery.currentPage = 1
|
||||
this.initData()
|
||||
},
|
||||
addOrUpdateHandle(row, isDetail) {
|
||||
let id = row ? row.id : ''
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail, this.list)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.exportList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/QaCheckItemBase/Actions/Export`,
|
||||
method: 'post',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = 'desc'
|
||||
this.listQuery.sidx = ''
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.search()
|
||||
},
|
||||
reset() {
|
||||
this.query = JSON.parse(JSON.stringify(this.queryData))
|
||||
this.search()
|
||||
},
|
||||
colseFlow(isrRefresh) {
|
||||
this.flowVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
230
jnpf-java-boot/jnpf-web/src/views/example/inspplan/Detail.vue
Normal file
230
jnpf-java-boot/jnpf-web/src/views/example/inspplan/Detail.vue
Normal file
@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1500px" @close="goBack">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="编号"
|
||||
prop="schemeNo" >
|
||||
<p>{{dataForm.schemeNo}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="名称"
|
||||
prop="schemeName" >
|
||||
<p>{{dataForm.schemeName}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="适用类型"
|
||||
prop="schemeType" >
|
||||
<p>{{dataForm.schemeType==1?"原材料":dataForm.schemeType==2?"半成品":"成品"}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="产品大类"
|
||||
prop="tiemClass" >
|
||||
<p>{{tiemClassLabel}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="表单编号"
|
||||
prop="formCode" >
|
||||
<p>{{dataForm.formCode}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="执行标准"
|
||||
prop="execStandard" >
|
||||
<p>{{dataForm.execStandard}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="检验值数量"
|
||||
prop="testNum" >
|
||||
<p>{{dataForm.testNum}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="描述"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="模板编码"
|
||||
prop="printName" >
|
||||
<p>{{dataForm.printName}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="创建人"
|
||||
prop="creatorUserId" >
|
||||
<p>{{dataForm.creatorUserId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<jnpf-form-tip-item label="创建时间"
|
||||
prop="creatorTime" >
|
||||
<p>{{dataForm.creatorTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2>质检方案明细</h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.InspPlanItemList" size='mini' >
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column prop="itemName" label="检验项目" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.itemName}}</p>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unit" label="单位" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.unit}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="standardValue" label="标准值" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.standardValue}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="upperLimit" label="上限值" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.upperLimit}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lowerLimit" label="下限值" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.lowerLimit}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="printMergeYn" label="打印是否合并" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.printMergeYn=='Y'?"是":"否"}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.remark}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="printItem" label="打印是否传送标准" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.printItem=='Y'?"是":"否"}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="printNum" label="模板检测值数量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.printNum}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="seqNo" label="展示顺序" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p>{{scope.row.seqNo}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="goBack"> 取 消</el-button>
|
||||
</span>
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: { Detail},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
tiemClassOptions: [],
|
||||
|
||||
dataForm: {
|
||||
id :'',
|
||||
schemeNo : '',
|
||||
schemeName : '',
|
||||
schemeType : '',
|
||||
remark : '',
|
||||
creatorUserId : "",
|
||||
creatorTime : "",
|
||||
qa_scheme_base_twList:[],
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tiemClassLabel() {
|
||||
const item = this.tiemClassOptions.find(o => o.enCode === this.dataForm.tiemClass)
|
||||
return item ? item.fullName : this.dataForm.tiemClass || ''
|
||||
},
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
getDictionaryDataSelector('816941613849787909').then(res => {
|
||||
this.tiemClassOptions = res.data.list
|
||||
})
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/inspplan/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
1017
jnpf-java-boot/jnpf-web/src/views/example/inspplan/form.vue
Normal file
1017
jnpf-java-boot/jnpf-web/src/views/example/inspplan/form.vue
Normal file
File diff suppressed because it is too large
Load Diff
505
jnpf-java-boot/jnpf-web/src/views/example/inspplan/index.vue
Normal file
505
jnpf-java-boot/jnpf-web/src/views/example/inspplan/index.vue
Normal file
@ -0,0 +1,505 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="query.schemeName" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="适用类型">
|
||||
<JnpfSelect v-model="query.schemeType" placeholder="请选择适用类型" clearable :options="options" :props="props"> </JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="6">-->
|
||||
<!-- <el-form-item label="编号">-->
|
||||
<!-- <el-input v-model="query.schemeNo" placeholder="请输入" clearable> </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">新增 </el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<!-- <el-tooltip content="高级查询" placement="top" v-if="true">-->
|
||||
<!-- <el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false" @click="openSuperQuery()" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- <el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">-->
|
||||
<!-- <el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false" @click="initData()" />-->
|
||||
<!-- </el-tooltip>-->
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change="sortChange" :span-method="arraySpanMethod" border>
|
||||
<el-table-column prop="schemeName" label="名称" align="center"> </el-table-column>
|
||||
<el-table-column prop="schemeType" label="适用类型" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.schemeType == '1'">原材料</el-tag>
|
||||
<el-tag v-else-if="scope.row.schemeType == '2'">半成品</el-tag>
|
||||
<el-tag v-else-if="scope.row.schemeType == '3'">成品</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="tiemClass" label="产品大类" align="center"> </el-table-column>
|
||||
<el-table-column prop="formCode" label="表单编号" align="center"> </el-table-column>
|
||||
<el-table-column prop="execStandard" label="执行标准" align="center"> </el-table-column>
|
||||
<el-table-column prop="isAttDet" label="属性检测" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.isAttDet=='Y'?"是":"否"}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="描述" align="center"> </el-table-column>
|
||||
<el-table-column prop="schemeNo" label="编号" align="center"> </el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row)">编辑 </el-button>
|
||||
<!-- <el-button type="text" @click="copy(scope.row)">复制 </el-button>-->
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除 </el-button>
|
||||
<el-button type="text" @click="goDetail(scope.row.id)">详情 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="复制-质检方案" :visible.sync="itemCenterDialog" append-to-body width="30%">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="200px" label-position="right">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="新的质检方案编号" prop="schemeNo">
|
||||
<JnpfInput v-model="dataForm.schemeNo" placeholder="请输入" clearable :style="{ width: '100%' }"> </JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="新的质检方案名称" prop="schemeName" required>
|
||||
<JnpfInput v-model="dataForm.schemeName" placeholder="请输入" clearable :style="{ width: '100%' }"> </JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="submitCopy">确定</el-button>
|
||||
<el-button type="primary" @click.prevent="itemCenterDialog = false">取消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
||||
|
||||
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="refresh" />
|
||||
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
|
||||
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson" @superQuery="superQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './form'
|
||||
import Detail from './Detail'
|
||||
import ExportBox from '@/components/ExportBox'
|
||||
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
|
||||
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
|
||||
import columnList from './columnList'
|
||||
import { thousandsFormat } from '@/components/Generator/utils/index'
|
||||
import SuperQuery from '@/components/SuperQuery'
|
||||
import superQueryJson from './superQueryJson'
|
||||
|
||||
export default {
|
||||
name: 'checkScheme',
|
||||
components: {
|
||||
JNPFForm,
|
||||
Detail,
|
||||
ExportBox,
|
||||
ToFormDetail,
|
||||
SuperQuery,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemCenterDialog: false,
|
||||
dataForm: {
|
||||
schemeName: '',
|
||||
schemeNo: '',
|
||||
},
|
||||
dataRule: {},
|
||||
keyword: '',
|
||||
expandsTree: true,
|
||||
refreshTree: true,
|
||||
toFormDetailVisible: false,
|
||||
expandObj: {},
|
||||
columnOptions: [],
|
||||
mergeList: [],
|
||||
exportList: [],
|
||||
columnList,
|
||||
options: [
|
||||
{ fullName: '原材料', id: '1' },
|
||||
{ fullName: '半成品', id: '2' },
|
||||
{ fullName: '成品', id: '3' },
|
||||
],
|
||||
props: { label: 'fullName', value: 'id' },
|
||||
superQueryVisible: false,
|
||||
superQueryJson,
|
||||
uploadBoxVisible: false,
|
||||
detailVisible: false,
|
||||
query: {
|
||||
schemeName: undefined,
|
||||
schemeNo: undefined,
|
||||
schemeType:"1",
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id',
|
||||
isLeaf: 'isLeaf',
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
total: 0,
|
||||
queryData: {},
|
||||
listQuery: {
|
||||
superQueryJson: '',
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: '',
|
||||
},
|
||||
formVisible: false,
|
||||
flowVisible: false,
|
||||
flowListVisible: false,
|
||||
flowList: [],
|
||||
exportBoxVisible: false,
|
||||
tableField114_itemIdcolumnOptions: [
|
||||
{ label: '编号', value: 'item_no' },
|
||||
{ label: '名称', value: 'item_name' },
|
||||
{ label: '性质', value: 'nature' },
|
||||
{ label: '单位', value: 'unit_name' },
|
||||
],
|
||||
interfaceRes: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getColumnList(), this.initSearchDataAndListData()
|
||||
this.queryData = JSON.parse(JSON.stringify(this.query))
|
||||
},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.toFormDetailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
toggleTreeExpand(expands) {
|
||||
this.refreshTree = false
|
||||
this.expandsTree = expands
|
||||
this.$nextTick(() => {
|
||||
this.refreshTree = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.treeBox.setCurrentKey(null)
|
||||
})
|
||||
})
|
||||
},
|
||||
filterNode(value, data) {
|
||||
if (!value) return true
|
||||
return data[this.treeProps.label].indexOf(value) !== -1
|
||||
},
|
||||
loadNode(node, resolve) {
|
||||
const nodeData = node.data
|
||||
const config = {
|
||||
treeInterfaceId: '',
|
||||
treeTemplateJson: [],
|
||||
}
|
||||
if (config.treeInterfaceId) {
|
||||
//这里是为了拿到参数中关联的字段的值,后端自行拿
|
||||
if (config.treeTemplateJson && config.treeTemplateJson.length) {
|
||||
for (let i = 0; i < config.treeTemplateJson.length; i++) {
|
||||
const element = config.treeTemplateJson[i]
|
||||
element.defaultValue = nodeData[element.relationField] || ''
|
||||
}
|
||||
}
|
||||
//参数
|
||||
let query = {
|
||||
paramList: config.treeTemplateJson || [],
|
||||
}
|
||||
//接口
|
||||
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
|
||||
let data = res.data
|
||||
if (Array.isArray(data)) {
|
||||
resolve(data)
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getColumnList() {
|
||||
// 没有开启权限
|
||||
this.columnOptions = this.transformColumnList(this.columnList)
|
||||
},
|
||||
transformColumnList(columnList) {
|
||||
let list = []
|
||||
for (let i = 0; i < columnList.length; i++) {
|
||||
const e = columnList[i]
|
||||
if (!e.prop.includes('-')) {
|
||||
list.push(e)
|
||||
} else {
|
||||
let prop = e.prop.split('-')[0]
|
||||
let label = e.label.split('-')[0]
|
||||
let vModel = e.prop.split('-')[1]
|
||||
let newItem = {
|
||||
align: 'center',
|
||||
jnpfKey: 'table',
|
||||
prop,
|
||||
label,
|
||||
children: [],
|
||||
}
|
||||
e.vModel = vModel
|
||||
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
|
||||
if (!list.some(o => o.prop === prop)) list.push(newItem)
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].prop === prop) {
|
||||
list[i].children.push(e)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.getMergeList(list)
|
||||
this.getExportList(list)
|
||||
return list
|
||||
},
|
||||
arraySpanMethod({ column }) {
|
||||
for (let i = 0; i < this.mergeList.length; i++) {
|
||||
if (column.property == this.mergeList[i].prop) {
|
||||
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
|
||||
}
|
||||
}
|
||||
},
|
||||
getMergeList(list) {
|
||||
let newList = JSON.parse(JSON.stringify(list))
|
||||
newList.forEach(item => {
|
||||
if (item.children && item.children.length) {
|
||||
let child = {
|
||||
prop: item.prop + '-child-first',
|
||||
}
|
||||
item.children.unshift(child)
|
||||
}
|
||||
})
|
||||
newList.forEach(item => {
|
||||
if (item.children && item.children.length) {
|
||||
item.children.forEach((child, index) => {
|
||||
if (index == 0) {
|
||||
this.mergeList.push({
|
||||
prop: child.prop,
|
||||
rowspan: 1,
|
||||
colspan: item.children.length,
|
||||
})
|
||||
} else {
|
||||
this.mergeList.push({
|
||||
prop: child.prop,
|
||||
rowspan: 0,
|
||||
colspan: 0,
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.mergeList.push({
|
||||
prop: item.prop,
|
||||
rowspan: 1,
|
||||
colspan: 1,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getExportList(list) {
|
||||
let exportList = []
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].jnpfKey === 'table') {
|
||||
for (let j = 0; j < list[i].children.length; j++) {
|
||||
exportList.push(list[i].children[j])
|
||||
}
|
||||
} else {
|
||||
exportList.push(list[i])
|
||||
}
|
||||
}
|
||||
this.exportList = exportList
|
||||
},
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
async initSearchDataAndListData() {
|
||||
await this.initSearchData()
|
||||
this.initData()
|
||||
},
|
||||
//初始化查询的默认数据
|
||||
async initSearchData() {},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
keyword: this.keyword,
|
||||
dataType: 0,
|
||||
menuId: this.menuId,
|
||||
moduleId: '617404338293179269',
|
||||
type: 1,
|
||||
}
|
||||
request({
|
||||
url: `/api/example/inspplan/getList`,
|
||||
method: 'post',
|
||||
data: _query,
|
||||
}).then(res => {
|
||||
var _list = res.data.list
|
||||
this.list = _list.map(o => ({
|
||||
...o,
|
||||
...this.expandObj,
|
||||
}))
|
||||
this.total = res.data.pagination.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
request({
|
||||
url: `/api/example/inspplan/${id}`,
|
||||
method: 'DELETE',
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
handelUpload() {
|
||||
this.uploadBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.UploadBox.init('', 'example/inspplan')
|
||||
})
|
||||
},
|
||||
openSuperQuery() {
|
||||
this.superQueryVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.SuperQuery.init()
|
||||
})
|
||||
},
|
||||
superQuery(queryJson) {
|
||||
this.listQuery.superQueryJson = queryJson
|
||||
this.listQuery.currentPage = 1
|
||||
this.initData()
|
||||
},
|
||||
addOrUpdateHandle(row, isDetail) {
|
||||
let id = row ? row.id : ''
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail, this.list)
|
||||
})
|
||||
},
|
||||
copy(row) {
|
||||
this.itemCenterDialog = true
|
||||
this.dataForm = JSON.parse(JSON.stringify(row))
|
||||
this.dataForm.schemeName = ''
|
||||
this.dataForm.schemeNo = ''
|
||||
},
|
||||
submitCopy() {
|
||||
let _data = this.dataForm
|
||||
if (this.dataForm.schemeName === '') {
|
||||
this.$message.error('新的质检方案名称不能为空')
|
||||
return
|
||||
}
|
||||
request({
|
||||
url: `/api/example/inspplan/copy`,
|
||||
method: 'post',
|
||||
data: _data,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
})
|
||||
this.itemCenterDialog = false
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.exportList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/example/inspplan/Actions/Export`,
|
||||
method: 'post',
|
||||
data: query,
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1
|
||||
this.listQuery.pageSize = 20
|
||||
this.listQuery.sort = 'desc'
|
||||
this.listQuery.sidx = ''
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.search()
|
||||
},
|
||||
reset() {
|
||||
this.query = JSON.parse(JSON.stringify(this.queryData))
|
||||
this.search()
|
||||
},
|
||||
colseFlow(isrRefresh) {
|
||||
this.flowVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
@ -113,7 +113,7 @@
|
||||
label="合同编号" prop="contractNo"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.contractNo" :disabled="isDetail=='detail' "
|
||||
placeholder="自动生成" clearable :style='{"width":"100%"}'
|
||||
placeholder="请输入合同编号" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
@ -198,11 +198,11 @@
|
||||
<el-table :data="dataForm.orderDetailList" size='mini'
|
||||
>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
||||
<el-table-column label="物料名称"
|
||||
<el-table-column label="产品名称"
|
||||
prop="materialName" width="150"
|
||||
align="center" >
|
||||
<template slot="header">
|
||||
物料名称(<span class="required-sign"
|
||||
产品名称(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
@ -792,6 +792,8 @@ export default {
|
||||
this.listQuery.matCode='',
|
||||
this.listQuery.matName='',
|
||||
this.listQuery.spec='' ,
|
||||
this.selectedIds=[]
|
||||
|
||||
this.dataForm.orderDetailList.forEach(o => {
|
||||
this.selectedIds.push(o.materialId)
|
||||
})
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
label="合同编号" prop="contractNo"
|
||||
>
|
||||
<JnpfInput v-model="dataForm.contractNo" disabled
|
||||
placeholder="自动生成" clearable :style='{"width":"100%"}'
|
||||
placeholder="请输入合同编号" clearable :style='{"width":"100%"}'
|
||||
>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
@ -196,11 +196,11 @@
|
||||
<el-table :data="dataForm.orderDetailList" size='mini'
|
||||
>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" fixed="left" />
|
||||
<el-table-column label="物料名称"
|
||||
<el-table-column label="产品名称"
|
||||
prop="materialName" width="150"
|
||||
align="center" >
|
||||
<template slot="header">
|
||||
物料名称(<span class="required-sign"
|
||||
产品名称(<span class="required-sign"
|
||||
>*</span>)
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="订单状态">
|
||||
<JnpfSelect v-model="query.ordStatus" placeholder="请选择" clearable filterable :options="ordStatusOptions"
|
||||
<JnpfSelect v-model="query.ordStatus" placeholder="请选择" clearable disabled filterable :options="ordStatusOptions"
|
||||
:props="ordStatusProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user