feat(example): 重构机台参数表单增加工艺参数明细功能
This commit is contained in:
parent
08413b6e0a
commit
f3dc60d8bd
@ -0,0 +1,9 @@
|
|||||||
|
package jnpf.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import jnpf.model.machine.MachineParamDetailEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MachineParamDetailMapper extends BaseMapper<MachineParamDetailEntity> {
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package jnpf.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import jnpf.model.machine.MachineParamDetailEntity;
|
||||||
|
import jnpf.model.machine.MachineParamDetailForm;
|
||||||
|
import jnpf.model.machine.MachineParamDetailPagination;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface MachineParamDetailService extends IService<MachineParamDetailEntity> {
|
||||||
|
List<MachineParamDetailEntity> getList(MachineParamDetailPagination pagination);
|
||||||
|
|
||||||
|
MachineParamDetailEntity getInfo(String id);
|
||||||
|
|
||||||
|
void create(MachineParamDetailEntity entity);
|
||||||
|
|
||||||
|
boolean update(String id, MachineParamDetailEntity entity);
|
||||||
|
|
||||||
|
void delete(MachineParamDetailEntity entity);
|
||||||
|
|
||||||
|
String checkForm(MachineParamDetailForm form, int i);
|
||||||
|
|
||||||
|
void saveOrUpdate(MachineParamDetailForm form, String id, boolean isSave) throws Exception;
|
||||||
|
|
||||||
|
List<MachineParamDetailEntity> getListByMachineParamId(Integer machineParamId);
|
||||||
|
|
||||||
|
void deleteByMachineParamId(Integer machineParamId);
|
||||||
|
}
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
package jnpf.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
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.mapper.MachineParamDetailMapper;
|
||||||
|
import jnpf.model.machine.MachineParamDetailEntity;
|
||||||
|
import jnpf.model.machine.MachineParamDetailForm;
|
||||||
|
import jnpf.model.machine.MachineParamDetailPagination;
|
||||||
|
import jnpf.service.MachineParamDetailService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MachineParamDetailServiceImpl extends ServiceImpl<MachineParamDetailMapper, MachineParamDetailEntity> implements MachineParamDetailService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MachineParamDetailEntity> getList(MachineParamDetailPagination pagination) {
|
||||||
|
LambdaQueryWrapper<MachineParamDetailEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(pagination.getEnabledStatus())) {
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getEnabledStatus, pagination.getEnabledStatus());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pagination.getProcParamName())) {
|
||||||
|
wrapper.like(MachineParamDetailEntity::getProcParamName, pagination.getProcParamName());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pagination.getProcParamUnit())) {
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getProcParamUnit, pagination.getProcParamUnit());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pagination.getProcParamId())) {
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getProcParamId, pagination.getProcParamId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pagination.getIsAlert())) {
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getIsAlert, pagination.getIsAlert());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pagination.getMachineParamId())) {
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getMachineParamId, pagination.getMachineParamId());
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getDeleteMark, 0);
|
||||||
|
wrapper.orderByDesc(MachineParamDetailEntity::getId);
|
||||||
|
|
||||||
|
if ("0".equals(pagination.getDataType())) {
|
||||||
|
Page<MachineParamDetailEntity> page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize());
|
||||||
|
IPage<MachineParamDetailEntity> result = this.page(page, wrapper);
|
||||||
|
return pagination.setData(result.getRecords(), result.getTotal());
|
||||||
|
} else {
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MachineParamDetailEntity getInfo(String id) {
|
||||||
|
QueryWrapper<MachineParamDetailEntity> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.lambda().eq(MachineParamDetailEntity::getId, id);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(MachineParamDetailEntity entity) {
|
||||||
|
this.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean update(String id, MachineParamDetailEntity entity) {
|
||||||
|
return this.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(MachineParamDetailEntity entity) {
|
||||||
|
if (entity != null) {
|
||||||
|
this.removeById(entity.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkForm(MachineParamDetailForm form, int i) {
|
||||||
|
if (ObjectUtil.isEmpty(form.getMachineParamId())) {
|
||||||
|
return "主表ID不能为空";
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(form.getProcParamName())) {
|
||||||
|
return "参数名称不能为空";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void saveOrUpdate(MachineParamDetailForm form, String id, boolean isSave) throws Exception {
|
||||||
|
MachineParamDetailEntity entity;
|
||||||
|
if (isSave) {
|
||||||
|
entity = new MachineParamDetailEntity();
|
||||||
|
BeanUtils.copyProperties(form, entity);
|
||||||
|
entity.setId(null);
|
||||||
|
this.save(entity);
|
||||||
|
} else {
|
||||||
|
entity = getInfo(id);
|
||||||
|
if (entity == null) {
|
||||||
|
throw new Exception("数据不存在");
|
||||||
|
}
|
||||||
|
BeanUtils.copyProperties(form, entity);
|
||||||
|
this.updateById(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MachineParamDetailEntity> getListByMachineParamId(Integer machineParamId) {
|
||||||
|
LambdaQueryWrapper<MachineParamDetailEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getMachineParamId, machineParamId);
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getDeleteMark, 0);
|
||||||
|
wrapper.orderByAsc(MachineParamDetailEntity::getId);
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void deleteByMachineParamId(Integer machineParamId) {
|
||||||
|
LambdaQueryWrapper<MachineParamDetailEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(MachineParamDetailEntity::getMachineParamId, machineParamId);
|
||||||
|
this.remove(wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -29,4 +29,5 @@ public interface MachineService extends IService<MachineEntity> {
|
|||||||
String checkForm(MachineForm form, int i);
|
String checkForm(MachineForm form, int i);
|
||||||
void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception;
|
void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception;
|
||||||
|
|
||||||
|
List<MachineEntity> getMachineList(String keyWord);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,4 +29,6 @@ public interface MaterialService extends IService<MaterialEntity> {
|
|||||||
String checkForm(MaterialForm form, int i);
|
String checkForm(MaterialForm form, int i);
|
||||||
void saveOrUpdate(MaterialForm materialForm, String id, boolean isSave) throws Exception;
|
void saveOrUpdate(MaterialForm materialForm, String id, boolean isSave) throws Exception;
|
||||||
|
|
||||||
|
List<MaterialEntity> getSelector(String keyWord);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,27 +7,26 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import jnpf.mapper.MachineParamMapper;
|
import jnpf.mapper.MachineParamMapper;
|
||||||
import jnpf.model.machine.MachineParamEntity;
|
import jnpf.model.machine.*;
|
||||||
import jnpf.model.machine.MachineParamForm;
|
import jnpf.service.MachineParamDetailService;
|
||||||
import jnpf.model.machine.MachineParamPagination;
|
|
||||||
import jnpf.service.MachineParamService;
|
import jnpf.service.MachineParamService;
|
||||||
import jnpf.util.StringUtil;
|
import jnpf.util.StringUtil;
|
||||||
import jnpf.util.UserProvider;
|
import jnpf.util.UserProvider;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, MachineParamEntity> implements MachineParamService {
|
public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, MachineParamEntity> implements MachineParamService {
|
||||||
|
|
||||||
@Resource
|
private final UserProvider userProvider;
|
||||||
private UserProvider userProvider;
|
|
||||||
|
private final MachineParamDetailService machineParamDetailService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MachineParamService self;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MachineParamEntity> getList(MachineParamPagination machineParamPagination) {
|
public List<MachineParamEntity> getList(MachineParamPagination machineParamPagination) {
|
||||||
@ -126,6 +125,7 @@ public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, Mac
|
|||||||
BeanUtils.copyProperties(machineParamForm, entity);
|
BeanUtils.copyProperties(machineParamForm, entity);
|
||||||
entity.setId(null);
|
entity.setId(null);
|
||||||
this.save(entity);
|
this.save(entity);
|
||||||
|
extracted(machineParamForm, entity);
|
||||||
} else {
|
} else {
|
||||||
MachineParamEntity entity = getInfo(id);
|
MachineParamEntity entity = getInfo(id);
|
||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
@ -133,10 +133,23 @@ public class MachineParamServiceImpl extends ServiceImpl<MachineParamMapper, Mac
|
|||||||
} else {
|
} else {
|
||||||
BeanUtils.copyProperties(machineParamForm, entity);
|
BeanUtils.copyProperties(machineParamForm, entity);
|
||||||
this.updateById(entity);
|
this.updateById(entity);
|
||||||
|
machineParamDetailService.deleteByMachineParamId(entity.getId());
|
||||||
|
extracted(machineParamForm, entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void extracted(MachineParamForm machineParamForm, MachineParamEntity entity) {
|
||||||
|
List<MachineParamDetailForm> detailList = machineParamForm.getDetailList();
|
||||||
|
for (MachineParamDetailForm detailForm : detailList) {
|
||||||
|
MachineParamDetailEntity detailEntity = new MachineParamDetailEntity();
|
||||||
|
BeanUtils.copyProperties(detailForm, detailEntity);
|
||||||
|
detailEntity.setMachineParamId(entity.getId());
|
||||||
|
detailEntity.setEnabledStatus(1);
|
||||||
|
machineParamDetailService.save(detailEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MachineParamEntity> getSelectList(String selectKey) {
|
public List<MachineParamEntity> getSelectList(String selectKey) {
|
||||||
LambdaQueryWrapper<MachineParamEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MachineParamEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@ -171,4 +171,13 @@ public class MachineServiceImpl extends ServiceImpl<MachineMapper, MachineEntity
|
|||||||
this.saveOrUpdate(entity);
|
this.saveOrUpdate(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MachineEntity> getMachineList(String keyWord) {
|
||||||
|
LambdaQueryWrapper<MachineEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(MachineEntity::getEnabledStatus, "1");
|
||||||
|
wrapper.eq(MachineEntity::getDeleteMark, 0);
|
||||||
|
wrapper.like(MachineEntity::getMachineName, keyWord);
|
||||||
|
wrapper.orderByDesc(MachineEntity::getId);
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,4 +154,15 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
|
|||||||
this.saveOrUpdate(entity);
|
this.saveOrUpdate(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MaterialEntity> getSelector(String keyWord) {
|
||||||
|
LambdaQueryWrapper<MaterialEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(MaterialEntity::getEnabledStatus, 1);
|
||||||
|
wrapper.eq(MaterialEntity::getDeleteMark, 0);
|
||||||
|
if (StringUtil.isNotEmpty(keyWord)) {
|
||||||
|
wrapper.like(MaterialEntity::getMatName, keyWord);
|
||||||
|
}
|
||||||
|
wrapper.orderByDesc(MaterialEntity::getId);
|
||||||
|
return this.list(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,5 +153,22 @@ public class MachineController {
|
|||||||
return ActionResult.success(realList);
|
return ActionResult.success(realList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取机台下拉列表
|
||||||
|
@Operation(summary = "获取机台下拉列表")
|
||||||
|
@GetMapping("/getMachineList")
|
||||||
|
public ActionResult getMachineList(@RequestParam(required = false, defaultValue = "", value = "keyWord") String keyWord) {
|
||||||
|
List<MachineEntity> list = machineService.getMachineList(keyWord);
|
||||||
|
List<Map<String, Object>> result = list.stream()
|
||||||
|
.map(entity -> {
|
||||||
|
Map<String, Object> map = JsonUtil.entityToMap(entity);
|
||||||
|
map.put("id", entity.getId());
|
||||||
|
map.put("name", entity.getMachineName());
|
||||||
|
map.put("code", entity.getMachineCd());
|
||||||
|
return map;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return ActionResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,11 +5,13 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||||||
import jnpf.base.ActionResult;
|
import jnpf.base.ActionResult;
|
||||||
import jnpf.base.vo.PageListVO;
|
import jnpf.base.vo.PageListVO;
|
||||||
import jnpf.base.vo.PaginationVO;
|
import jnpf.base.vo.PaginationVO;
|
||||||
|
import jnpf.model.machine.MachineParamDetailEntity;
|
||||||
import jnpf.model.machine.MachineParamEntity;
|
import jnpf.model.machine.MachineParamEntity;
|
||||||
import jnpf.model.machine.MachineParamForm;
|
import jnpf.model.machine.MachineParamForm;
|
||||||
import jnpf.model.machine.MachineParamPagination;
|
import jnpf.model.machine.MachineParamPagination;
|
||||||
import jnpf.permission.entity.UserEntity;
|
import jnpf.permission.entity.UserEntity;
|
||||||
import jnpf.permission.service.UserService;
|
import jnpf.permission.service.UserService;
|
||||||
|
import jnpf.service.MachineParamDetailService;
|
||||||
import jnpf.service.MachineParamService;
|
import jnpf.service.MachineParamService;
|
||||||
import jnpf.util.JsonUtil;
|
import jnpf.util.JsonUtil;
|
||||||
import jnpf.util.StringUtil;
|
import jnpf.util.StringUtil;
|
||||||
@ -30,6 +32,9 @@ public class MachineParamController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private MachineParamService machineParamService;
|
private MachineParamService machineParamService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MachineParamDetailService machineParamDetailService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
|
|
||||||
@ -58,6 +63,8 @@ public class MachineParamController {
|
|||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ActionResult info(@PathVariable("id") String id) {
|
public ActionResult info(@PathVariable("id") String id) {
|
||||||
MachineParamEntity entity = machineParamService.getInfo(id);
|
MachineParamEntity entity = machineParamService.getInfo(id);
|
||||||
|
List<MachineParamDetailEntity> listByMachineParamId = machineParamDetailService.getListByMachineParamId(entity.getId());
|
||||||
|
entity.setDetailList(listByMachineParamId);
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
return ActionResult.success(JsonUtil.entityToMap(entity));
|
return ActionResult.success(JsonUtil.entityToMap(entity));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -142,4 +142,22 @@ public class MaterialController {
|
|||||||
return ActionResult.fail("删除失败,数据不存在");
|
return ActionResult.fail("删除失败,数据不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取物料下拉框
|
||||||
|
@Operation(summary = "获取物料下拉框")
|
||||||
|
@GetMapping("/getMaterialList")
|
||||||
|
public ActionResult getSelector(@RequestParam(value = "keyWord", required = false, defaultValue = "") String keyWord) {
|
||||||
|
List<MaterialEntity> list = materialService.getSelector(keyWord);
|
||||||
|
List<Map<String, Object>> result = list.stream()
|
||||||
|
.map(entity -> {
|
||||||
|
Map<String, Object> map = JsonUtil.entityToMap(entity);
|
||||||
|
map.put("id", entity.getId());
|
||||||
|
map.put("name", entity.getMatName());
|
||||||
|
map.put("spec", entity.getSpec());
|
||||||
|
map.put("code", entity.getMatCode());
|
||||||
|
return map;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return ActionResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -121,7 +121,7 @@ public class ProcParamController {
|
|||||||
Map<String, Object> map = new HashMap<>(3);
|
Map<String, Object> map = new HashMap<>(3);
|
||||||
map.put("id", entity.getId());
|
map.put("id", entity.getId());
|
||||||
map.put("code", entity.getProcParamName());
|
map.put("code", entity.getProcParamName());
|
||||||
map.put("name", entity.getProcParamName());
|
map.put("name", entity.getProcCd());
|
||||||
return map;
|
return map;
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
@ -0,0 +1,74 @@
|
|||||||
|
package jnpf.model.machine;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("tba_machine_param_detail")
|
||||||
|
public class MachineParamDetailEntity {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
|
||||||
|
private String creatorUserId;
|
||||||
|
|
||||||
|
@TableField(value = "f_creator_time", fill = FieldFill.INSERT)
|
||||||
|
private Date creatorTime;
|
||||||
|
|
||||||
|
@TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private String lastModifyUserId;
|
||||||
|
|
||||||
|
@TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Date lastModifyTime;
|
||||||
|
|
||||||
|
@TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE)
|
||||||
|
private String deleteUserId;
|
||||||
|
|
||||||
|
@TableField(value = "f_delete_time", fill = FieldFill.UPDATE)
|
||||||
|
private Date deleteTime;
|
||||||
|
|
||||||
|
@TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private Integer deleteMark;
|
||||||
|
|
||||||
|
@TableField(value = "f_flow_id")
|
||||||
|
private String flowId;
|
||||||
|
|
||||||
|
@TableField(value = "f_flow_task_id")
|
||||||
|
private String flowTaskId;
|
||||||
|
|
||||||
|
@TableField("enabled_status")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@TableField("proc_param_name")
|
||||||
|
private String procParamName;
|
||||||
|
|
||||||
|
@TableField("proc_param_unit")
|
||||||
|
private String procParamUnit;
|
||||||
|
|
||||||
|
@TableField("proc_param_id")
|
||||||
|
private Integer procParamId;
|
||||||
|
|
||||||
|
@TableField("standard_value")
|
||||||
|
private BigDecimal standardValue;
|
||||||
|
|
||||||
|
@TableField("upper_limit")
|
||||||
|
private BigDecimal upperLimit;
|
||||||
|
|
||||||
|
@TableField("lower_limit")
|
||||||
|
private BigDecimal lowerLimit;
|
||||||
|
|
||||||
|
@TableField("dev")
|
||||||
|
private String dev;
|
||||||
|
|
||||||
|
@TableField("is_alert")
|
||||||
|
private String isAlert;
|
||||||
|
|
||||||
|
@TableField("machine_param_id")
|
||||||
|
private Integer machineParamId;
|
||||||
|
}
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
package jnpf.model.machine;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MachineParamDetailForm {
|
||||||
|
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称")
|
||||||
|
private String procParamName;
|
||||||
|
|
||||||
|
@Schema(description = "参数单位")
|
||||||
|
private String procParamUnit;
|
||||||
|
|
||||||
|
@Schema(description = "参数id")
|
||||||
|
private Integer procParamId;
|
||||||
|
|
||||||
|
@Schema(description = "标准值")
|
||||||
|
private BigDecimal standardValue;
|
||||||
|
|
||||||
|
@Schema(description = "上限值")
|
||||||
|
private BigDecimal upperLimit;
|
||||||
|
|
||||||
|
@Schema(description = "下限值")
|
||||||
|
private BigDecimal lowerLimit;
|
||||||
|
|
||||||
|
@Schema(description = "偏差")
|
||||||
|
private String dev;
|
||||||
|
|
||||||
|
@Schema(description = "是否预警(0 是 1否)")
|
||||||
|
private String isAlert;
|
||||||
|
|
||||||
|
@Schema(description = "主表id")
|
||||||
|
private Integer machineParamId;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private Date creatorTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建用户ID")
|
||||||
|
private String creatorUserId;
|
||||||
|
|
||||||
|
@Schema(description = "最后修改时间")
|
||||||
|
private Date lastModifyTime;
|
||||||
|
|
||||||
|
@Schema(description = "最后修改用户ID")
|
||||||
|
private String lastModifyUserId;
|
||||||
|
|
||||||
|
@Schema(description = "删除时间")
|
||||||
|
private Date deleteTime;
|
||||||
|
|
||||||
|
@Schema(description = "删除用户ID")
|
||||||
|
private String deleteUserId;
|
||||||
|
|
||||||
|
@Schema(description = "删除标记")
|
||||||
|
private Integer deleteMark;
|
||||||
|
|
||||||
|
@Schema(description = "流程ID")
|
||||||
|
private String flowId;
|
||||||
|
|
||||||
|
@Schema(description = "流程任务ID")
|
||||||
|
private String flowTaskId;
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package jnpf.model.machine;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jnpf.base.Pagination;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MachineParamDetailPagination extends Pagination {
|
||||||
|
|
||||||
|
|
||||||
|
private String selectKey;
|
||||||
|
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
@Schema(description = "状态(1启用 2 未启用)")
|
||||||
|
private Integer enabledStatus;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称")
|
||||||
|
private String procParamName;
|
||||||
|
|
||||||
|
@Schema(description = "参数单位")
|
||||||
|
private String procParamUnit;
|
||||||
|
|
||||||
|
@Schema(description = "参数id")
|
||||||
|
private Integer procParamId;
|
||||||
|
|
||||||
|
@Schema(description = "标准值")
|
||||||
|
private BigDecimal standardValue;
|
||||||
|
|
||||||
|
@Schema(description = "是否预警(0 是 1否)")
|
||||||
|
private String isAlert;
|
||||||
|
|
||||||
|
@Schema(description = "主表id")
|
||||||
|
private Integer machineParamId;
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package jnpf.model.machine;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("tba_machine_param")
|
@TableName("tba_machine_param")
|
||||||
@ -76,4 +77,7 @@ public class MachineParamEntity {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String createUserName;
|
private String createUserName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<MachineParamDetailEntity> detailList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,9 @@ package jnpf.model.machine;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class MachineParamForm {
|
public class MachineParamForm {
|
||||||
@ -54,4 +56,6 @@ public class MachineParamForm {
|
|||||||
|
|
||||||
@Schema(description = "流程任务ID")
|
@Schema(description = "流程任务ID")
|
||||||
private String flowTaskId;
|
private String flowTaskId;
|
||||||
|
|
||||||
|
List<MachineParamDetailForm> detailList;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,36 +2,112 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
:title="!dataForm.id ? '新建' : '编辑'"
|
:title="!dataForm.id ? '新建' : '编辑'"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
width="600px"
|
width="1200px"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
@close="handleClose"
|
@close="handleClose"
|
||||||
>
|
>
|
||||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right">
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right">
|
||||||
<template v-if="!loading">
|
<template v-if="!loading">
|
||||||
<el-form-item label="工序编码" prop="procCd">
|
<el-row :gutter="20">
|
||||||
<JnpfSelect v-model="dataForm.procCd" placeholder="请选择工序" :options="procOptions" :props="procProps" clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
<el-col :span="8">
|
||||||
|
<el-form-item label="工序" prop="procCd">
|
||||||
|
<JnpfSelect v-model="dataForm.procCd" placeholder="请选择工序" :options="procOptions" :props="procProps" filterable clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
||||||
</JnpfSelect>
|
</JnpfSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物料编码" prop="matCode">
|
</el-col>
|
||||||
<JnpfSelect v-model="dataForm.matCode" placeholder="请选择物料" :options="materialOptions" :props="materialProps" clearable :style="{ width: '100%' }">
|
<el-col :span="8">
|
||||||
|
<el-form-item label="机台" prop="machineCd">
|
||||||
|
<JnpfSelect v-model="dataForm.machineCd" placeholder="请选择机台" :options="machineOptions" :props="machineProps" filterable clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
||||||
</JnpfSelect>
|
</JnpfSelect>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="启用状态" prop="enabledStatus">
|
||||||
|
<JnpfSelect v-model="dataForm.enabledStatus" placeholder="请选择状态" :options="enabledStatusOptions" :props="enabledStatusProps" clearable :style="{ width: '100%' }">
|
||||||
|
</JnpfSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="产品名称" prop="matCode">
|
||||||
|
<JnpfSelect v-model="dataForm.matCode" placeholder="请选择物料" :options="materialOptions" filterable :props="materialProps" clearable @change="handleMaterialChange" :style="{ width: '100%' }">
|
||||||
|
</JnpfSelect>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
<el-form-item label="规格型号" prop="spec">
|
<el-form-item label="规格型号" prop="spec">
|
||||||
<JnpfInput v-model="dataForm.spec" placeholder="请输入规格型号" clearable :style="{ width: '100%' }">
|
<JnpfInput v-model="dataForm.spec" placeholder="请输入规格型号" clearable :style="{ width: '100%' }">
|
||||||
</JnpfInput>
|
</JnpfInput>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="机台编码" prop="machineCd">
|
</el-col>
|
||||||
<JnpfSelect v-model="dataForm.machineCd" placeholder="请选择机台" :options="machineOptions" :props="machineProps" clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
</el-row>
|
||||||
</JnpfSelect>
|
<el-row>
|
||||||
</el-form-item>
|
<el-col :span="16">
|
||||||
<el-form-item label="状态" prop="enabledStatus">
|
|
||||||
<JnpfSelect v-model="dataForm.enabledStatus" placeholder="请选择状态" :options="enabledStatusOptions" :props="enabledStatusProps" clearable :style="{ width: '100%' }">
|
|
||||||
</JnpfSelect>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<JnpfTextarea v-model="dataForm.remark" placeholder="请输入备注" :style="{ width: '100%' }" :autoSize="{ minRows: 4, maxRows: 4 }" type="textarea">
|
<JnpfTextarea v-model="dataForm.remark" placeholder="请输入备注" :style="{ width: '100%' }" :autoSize="{ minRows: 1, maxRows: 1 }" type="textarea">
|
||||||
</JnpfTextarea>
|
</JnpfTextarea>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="margin-bottom: 10px; display: flex; align-items: center;">
|
||||||
|
<span style="font-weight: bold;">工艺参数信息</span>
|
||||||
|
<el-button type="primary" size="small" @click="addParamItem" style="margin-left: 10px;">新 增</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table :data="paramList" border style="width: 100%;" size="small">
|
||||||
|
<el-table-column type="index" label="序号" width="50" align="center"></el-table-column>
|
||||||
|
<el-table-column label="工艺参数名称(*)" prop="procParamName">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<JnpfSelect v-model="scope.row.procParamName" placeholder="请选择" :options="paramNameOptions" :props="{ label: 'label', value: 'value' }" filterable clearable>
|
||||||
|
</JnpfSelect>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="标准值(*)" prop="standardValue">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.standardValue" placeholder="请输入"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="下限值(*)" prop="lowerLimit">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.lowerLimit" placeholder="请输入"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="上限值(*)" prop="upperLimit">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.upperLimit" placeholder="请输入"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="偏差" prop="dev">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.dev" placeholder="请输入"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="单位(*)" prop="procParamUnit">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.procParamUnit" placeholder="请输入"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否预警(*)" prop="isAlert">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<JnpfSelect v-model="scope.row.isAlert" placeholder="请选择" :options="isAlertOptions" :props="{ label: 'label', value: 'value' }">
|
||||||
|
</JnpfSelect>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" prop="remark">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input v-model="scope.row.remark" placeholder="请输入"></el-input>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="60" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" @click="removeParamItem(scope.$index)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@ -44,6 +120,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import { enabledStatusOptions } from '../common/dict'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
@ -67,7 +144,7 @@ export default {
|
|||||||
machineCd: undefined,
|
machineCd: undefined,
|
||||||
machineName: undefined,
|
machineName: undefined,
|
||||||
machineId: undefined,
|
machineId: undefined,
|
||||||
enabledStatus: 1,
|
enabledStatus: '1',
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
},
|
},
|
||||||
dataRule: {
|
dataRule: {
|
||||||
@ -100,10 +177,7 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
enabledStatusOptions: [
|
enabledStatusOptions,
|
||||||
{ fullName: "启用", id: 1 },
|
|
||||||
{ fullName: "未启用", id: 2 },
|
|
||||||
],
|
|
||||||
enabledStatusProps: { label: "fullName", value: "id" },
|
enabledStatusProps: { label: "fullName", value: "id" },
|
||||||
procList: [],
|
procList: [],
|
||||||
materialList: [],
|
materialList: [],
|
||||||
@ -114,6 +188,12 @@ export default {
|
|||||||
procProps: { label: "label", value: "value" },
|
procProps: { label: "label", value: "value" },
|
||||||
materialProps: { label: "label", value: "value" },
|
materialProps: { label: "label", value: "value" },
|
||||||
machineProps: { label: "label", value: "value" },
|
machineProps: { label: "label", value: "value" },
|
||||||
|
paramList: [],
|
||||||
|
paramNameOptions: [],
|
||||||
|
isAlertOptions: [
|
||||||
|
{ label: '是', value: '0' },
|
||||||
|
{ label: '否', value: '1' },
|
||||||
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -161,7 +241,7 @@ export default {
|
|||||||
machineCd: undefined,
|
machineCd: undefined,
|
||||||
machineName: undefined,
|
machineName: undefined,
|
||||||
machineId: undefined,
|
machineId: undefined,
|
||||||
enabledStatus: 1,
|
enabledStatus: '1',
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -169,6 +249,34 @@ export default {
|
|||||||
this.loadProcList();
|
this.loadProcList();
|
||||||
this.loadMaterialList();
|
this.loadMaterialList();
|
||||||
this.loadMachineList();
|
this.loadMachineList();
|
||||||
|
this.loadParamNameOptions();
|
||||||
|
},
|
||||||
|
loadParamNameOptions() {
|
||||||
|
request({
|
||||||
|
url: `/api/example/procparam/getSelect`,
|
||||||
|
method: 'get'
|
||||||
|
}).then(res => {
|
||||||
|
const list = res.data || [];
|
||||||
|
this.paramNameOptions = list.map(item => ({
|
||||||
|
label: item.name || '',
|
||||||
|
value: item.id || '',
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addParamItem() {
|
||||||
|
this.paramList.push({
|
||||||
|
procParamName: undefined,
|
||||||
|
standardValue: undefined,
|
||||||
|
lowerLimit: undefined,
|
||||||
|
upperLimit: undefined,
|
||||||
|
dev: undefined,
|
||||||
|
procParamUnit: undefined,
|
||||||
|
isAlert: '0',
|
||||||
|
remark: undefined,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
removeParamItem(index) {
|
||||||
|
this.paramList.splice(index, 1);
|
||||||
},
|
},
|
||||||
loadProcList() {
|
loadProcList() {
|
||||||
request({
|
request({
|
||||||
@ -177,7 +285,7 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.procList = res.data || [];
|
this.procList = res.data || [];
|
||||||
this.procOptions = this.procList.map(item => ({
|
this.procOptions = this.procList.map(item => ({
|
||||||
label: `${item.procCd} - ${item.procName}`,
|
label: item.procName,
|
||||||
value: item.procCd,
|
value: item.procCd,
|
||||||
procName: item.procName,
|
procName: item.procName,
|
||||||
id: item.id
|
id: item.id
|
||||||
@ -187,13 +295,14 @@ export default {
|
|||||||
loadMaterialList() {
|
loadMaterialList() {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/material/getMaterialList`,
|
url: `/api/example/material/getMaterialList`,
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: { keyWord: '' }
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.materialList = res.data || [];
|
this.materialList = res.data || [];
|
||||||
this.materialOptions = this.materialList.map(item => ({
|
this.materialOptions = this.materialList.map(item => ({
|
||||||
label: `${item.matCode} - ${item.matName}`,
|
label: `${item.matName}`,
|
||||||
value: item.matCode,
|
value: item.id,
|
||||||
matName: item.matName,
|
matName: item.name,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
spec: item.spec
|
spec: item.spec
|
||||||
}));
|
}));
|
||||||
@ -202,18 +311,57 @@ export default {
|
|||||||
loadMachineList() {
|
loadMachineList() {
|
||||||
request({
|
request({
|
||||||
url: `/api/example/machine/getMachineList`,
|
url: `/api/example/machine/getMachineList`,
|
||||||
method: 'get'
|
method: 'get',
|
||||||
|
params: { keyWord: '' }
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.machineList = res.data || [];
|
this.machineList = res.data || [];
|
||||||
this.machineOptions = this.machineList.map(item => ({
|
this.machineOptions = this.machineList.map(item => ({
|
||||||
label: `${item.machineCd} - ${item.machineName}`,
|
label: `${item.name}`,
|
||||||
value: item.machineCd,
|
value: item.id,
|
||||||
machineName: item.machineName,
|
machineName: item.name,
|
||||||
id: item.id
|
id: item.id
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleMaterialChange(value) {
|
||||||
|
if (value) {
|
||||||
|
const material = this.materialOptions.find(item => item.value === value);
|
||||||
|
if (material) {
|
||||||
|
this.dataForm.spec = material.spec || '';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.dataForm.spec = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
|
// 验证表格必填字段
|
||||||
|
for (let i = 0; i < this.paramList.length; i++) {
|
||||||
|
const item = this.paramList[i];
|
||||||
|
if (!item.procParamName) {
|
||||||
|
this.$message.error(`第 ${i + 1} 行工艺参数名称不能为空`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!item.standardValue) {
|
||||||
|
this.$message.error(`第 ${i + 1} 行标准值不能为空`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!item.lowerLimit) {
|
||||||
|
this.$message.error(`第 ${i + 1} 行下限值不能为空`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!item.upperLimit) {
|
||||||
|
this.$message.error(`第 ${i + 1} 行上限值不能为空`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!item.procParamUnit) {
|
||||||
|
this.$message.error(`第 ${i + 1} 行单位不能为空`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!item.isAlert) {
|
||||||
|
this.$message.error(`第 ${i + 1} 行是否预警不能为空`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.$refs.formRef.validate((valid) => {
|
this.$refs.formRef.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.btnLoading = true;
|
this.btnLoading = true;
|
||||||
@ -233,6 +381,7 @@ export default {
|
|||||||
mateId: material ? material.id : undefined,
|
mateId: material ? material.id : undefined,
|
||||||
machineName: machine ? machine.machineName : undefined,
|
machineName: machine ? machine.machineName : undefined,
|
||||||
machineId: machine ? machine.id : undefined,
|
machineId: machine ? machine.id : undefined,
|
||||||
|
detailList: this.paramList,
|
||||||
};
|
};
|
||||||
|
|
||||||
request({
|
request({
|
||||||
@ -258,7 +407,7 @@ export default {
|
|||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.$emit('refresh', false)
|
this.$emit('refresh', true)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
<el-table-column prop="enabledStatus" label="启用状态" align="center">
|
<el-table-column prop="enabledStatus" label="启用状态" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="scope.row.enabledStatus == 1 ? 'success' : 'info'" size="small">
|
<el-tag :type="scope.row.enabledStatus == 1 ? 'success' : 'info'" size="small">
|
||||||
{{ scope.row.enabledStatus == 1 ? '启用' : scope.row.enabledStatus == 2 ? '未启用' : scope.row.enabledStatus }}
|
{{ getLabel('enabledStatus', scope.row.enabledStatus) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -54,7 +54,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
|
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
|
||||||
<el-button type="text" @click="handleDetail(scope.row.id)">详情</el-button>
|
<el-button type="text" @click="handleDetail(scope.row.id)">详情</el-button>
|
||||||
<el-button type="text" @click="handleDelete(scope.row.id)" style="color: #f56c6c;">删除</el-button>
|
<!-- <el-button type="text" @click="handleDelete(scope.row.id)" style="color: #f56c6c;">删除</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</JNPF-table>
|
</JNPF-table>
|
||||||
@ -71,6 +71,7 @@ import request from "@/utils/request";
|
|||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import JNPFForm from "./form";
|
import JNPFForm from "./form";
|
||||||
import jnpf from "@/utils/jnpf";
|
import jnpf from "@/utils/jnpf";
|
||||||
|
import { enabledStatusOptions, getLabel } from '../common/dict'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "machineparam",
|
name: "machineparam",
|
||||||
@ -101,10 +102,7 @@ export default {
|
|||||||
sidx: "",
|
sidx: "",
|
||||||
},
|
},
|
||||||
formVisible: false,
|
formVisible: false,
|
||||||
enabledStatusOptions: [
|
enabledStatusOptions,
|
||||||
{ fullName: "启用", id: 1 },
|
|
||||||
{ fullName: "未启用", id: 2 },
|
|
||||||
],
|
|
||||||
enabledStatusProps: { label: "fullName", value: "id" },
|
enabledStatusProps: { label: "fullName", value: "id" },
|
||||||
specOptions: [],
|
specOptions: [],
|
||||||
specProps: { label: "spec", value: "spec" },
|
specProps: { label: "spec", value: "spec" },
|
||||||
@ -191,6 +189,9 @@ export default {
|
|||||||
};
|
};
|
||||||
this.search();
|
this.search();
|
||||||
},
|
},
|
||||||
|
getLabel(type, value) {
|
||||||
|
return getLabel(type, value);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -16,7 +16,7 @@ NEW_FILE_CODE
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in procList"
|
v-for="item in procList"
|
||||||
:key="item.procCd"
|
:key="item.procCd"
|
||||||
:label="`${item.procCd} - ${item.procName}`"
|
:label="item.procName"
|
||||||
:value="item.procCd">
|
:value="item.procCd">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|||||||
@ -43,7 +43,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="JNPF-common-search-box button-row" :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="24" class="button-col">
|
<el-col :span="24" class="button-col">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<div></div>
|
<div></div>
|
||||||
<div class="JNPF-common-head-right"></div>
|
<div class="JNPF-common-head-right"></div>
|
||||||
</div>
|
</div>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" :hasNO="false" border ref="table" height="400" :row-key="row => row.itemId" @selection-change="handleSelectionChange" :index="false">
|
<JNPF-table v-loading="listLoading" :data="list" :hasNO="false" border ref="table" :row-key="row => row.itemId" @selection-change="handleSelectionChange" :index="false">
|
||||||
<el-table-column type="index" label="序号" align="center" width="60" fixed="left" />
|
<el-table-column type="index" label="序号" align="center" width="60" fixed="left" />
|
||||||
<el-table-column type="selection" align="center" :reserve-selection="true" fixed="left" />
|
<el-table-column type="selection" align="center" :reserve-selection="true" fixed="left" />
|
||||||
<el-table-column prop="saleOrdNo" label="订单编码" align="center" min-width="120" fixed="left"/>
|
<el-table-column prop="saleOrdNo" label="订单编码" align="center" min-width="120" fixed="left"/>
|
||||||
@ -258,6 +258,16 @@ export default {
|
|||||||
|
|
||||||
search() {
|
search() {
|
||||||
this.listQuery.currentPage = 1;
|
this.listQuery.currentPage = 1;
|
||||||
|
// 清空表格选中状态
|
||||||
|
this.selectedRows = [];
|
||||||
|
this.hasSelected = false;
|
||||||
|
const table = this.$refs.table;
|
||||||
|
if (table) {
|
||||||
|
const elTable = table.$refs.JNPFTable || table.$refs.table;
|
||||||
|
if (elTable && elTable.clearSelection) {
|
||||||
|
elTable.clearSelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
this.initData();
|
this.initData();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -394,19 +404,6 @@ export default {
|
|||||||
::v-deep .el-form-item__label {
|
::v-deep .el-form-item__label {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
}
|
}
|
||||||
.JNPF-common-layout-main {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
min-height: calc(100vh - 220px);
|
|
||||||
}
|
|
||||||
.tableContainer {
|
|
||||||
flex: 1;
|
|
||||||
height: auto;
|
|
||||||
min-height: 300px;
|
|
||||||
}
|
|
||||||
.button-row {
|
|
||||||
padding-top: 8px;
|
|
||||||
}
|
|
||||||
.button-col {
|
.button-col {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user