Commit 386cc251 authored by 耿迪迪's avatar 耿迪迪

产品

parent 858a6594
package com.zehong.web.controller.track;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.track.TProductDevice;
import com.zehong.system.service.track.ITProductDeviceService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 设备Controller
*
* @author zehong
* @date 2024-08-28
*/
@RestController
@RequestMapping("/track/device")
public class TProductDeviceController extends BaseController
{
@Autowired
private ITProductDeviceService tProductDeviceService;
/**
* 查询设备列表
*/
// @PreAuthorize("@ss.hasPermi('system:device:list')")
@GetMapping("/list")
public TableDataInfo list(TProductDevice tProductDevice)
{
startPage();
List<TProductDevice> list = tProductDeviceService.selectTProductDeviceList(tProductDevice);
return getDataTable(list);
}
/**
* 导出设备列表
*/
//@PreAuthorize("@ss.hasPermi('system:device:export')")
@Log(title = "设备", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProductDevice tProductDevice)
{
List<TProductDevice> list = tProductDeviceService.selectTProductDeviceList(tProductDevice);
ExcelUtil<TProductDevice> util = new ExcelUtil<TProductDevice>(TProductDevice.class);
return util.exportExcel(list, "设备数据");
}
/**
* 获取设备详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:device:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tProductDeviceService.selectTProductDeviceById(id));
}
/**
* 新增设备
*/
//@PreAuthorize("@ss.hasPermi('system:device:add')")
@Log(title = "设备", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProductDevice tProductDevice)
{
return toAjax(tProductDeviceService.insertTProductDevice(tProductDevice));
}
/**
* 修改设备
*/
//@PreAuthorize("@ss.hasPermi('system:device:edit')")
@Log(title = "设备", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProductDevice tProductDevice)
{
return toAjax(tProductDeviceService.updateTProductDevice(tProductDevice));
}
/**
* 删除设备
*/
//@PreAuthorize("@ss.hasPermi('system:device:remove')")
@Log(title = "设备", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tProductDeviceService.deleteTProductDeviceByIds(ids));
}
}
package com.zehong.web.controller.track;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.track.TProductDeviceMark;
import com.zehong.system.service.track.ITProductDeviceMarkService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 设备装配记录Controller
*
* @author zehong
* @date 2024-08-28
*/
@RestController
@RequestMapping("/track/deviceMark")
public class TProductDeviceMarkController extends BaseController
{
@Autowired
private ITProductDeviceMarkService tProductDeviceMarkService;
/**
* 查询设备装配记录列表
*/
// @PreAuthorize("@ss.hasPermi('system:mark:list')")
@GetMapping("/list")
public TableDataInfo list(TProductDeviceMark tProductDeviceMark)
{
startPage();
List<TProductDeviceMark> list = tProductDeviceMarkService.selectTProductDeviceMarkList(tProductDeviceMark);
return getDataTable(list);
}
/**
* 导出设备装配记录列表
*/
//@PreAuthorize("@ss.hasPermi('system:mark:export')")
@Log(title = "设备装配记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProductDeviceMark tProductDeviceMark)
{
List<TProductDeviceMark> list = tProductDeviceMarkService.selectTProductDeviceMarkList(tProductDeviceMark);
ExcelUtil<TProductDeviceMark> util = new ExcelUtil<TProductDeviceMark>(TProductDeviceMark.class);
return util.exportExcel(list, "设备装配记录数据");
}
/**
* 获取设备装配记录详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:mark:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tProductDeviceMarkService.selectTProductDeviceMarkById(id));
}
/**
* 新增设备装配记录
*/
//@PreAuthorize("@ss.hasPermi('system:mark:add')")
@Log(title = "设备装配记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProductDeviceMark tProductDeviceMark)
{
return toAjax(tProductDeviceMarkService.insertTProductDeviceMark(tProductDeviceMark));
}
/**
* 修改设备装配记录
*/
//@PreAuthorize("@ss.hasPermi('system:mark:edit')")
@Log(title = "设备装配记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProductDeviceMark tProductDeviceMark)
{
return toAjax(tProductDeviceMarkService.updateTProductDeviceMark(tProductDeviceMark));
}
/**
* 删除设备装配记录
*/
//@PreAuthorize("@ss.hasPermi('system:mark:remove')")
@Log(title = "设备装配记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tProductDeviceMarkService.deleteTProductDeviceMarkByIds(ids));
}
}
......@@ -45,6 +45,13 @@ public class TProductInspectController extends BaseController
return getDataTable(list);
}
@GetMapping("/executeInfoList")
public AjaxResult executeInfoList(TProductInspect tProductInspect)
{
List<TProductInspect> list = tProductInspectService.selectTProductInspectList(tProductInspect);
return AjaxResult.success(list);
}
/**
* 导出生产执行列表
*/
......
package com.zehong.system.domain.track;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 设备对象 t_product_device
*
* @author zehong
* @date 2024-08-28
*/
public class TProductDevice extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 计划编号 */
private Long planId;
/** 执行编号 */
private Long inspectId;
@Excel(name = "批次号")
private String batchNo;
/** 设备编号 */
@Excel(name = "设备编号")
private String deviceNo;
/** 设备名称 */
@Excel(name = "设备名称")
private String title;
/** 设备状态 */
@Excel(name = "设备状态",dictType = "t_produce_device_status")
private String status;
/** 创建人 */
private Long createId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setInspectId(Long inspectId)
{
this.inspectId = inspectId;
}
public Long getInspectId()
{
return inspectId;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public void setDeviceNo(String deviceNo)
{
this.deviceNo = deviceNo;
}
public String getDeviceNo()
{
return deviceNo;
}
public void setTitle(String title)
{
this.title = title;
}
public String getTitle()
{
return title;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setCreateId(Long createId)
{
this.createId = createId;
}
public Long getCreateId()
{
return createId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("planId", getPlanId())
.append("inspectId", getInspectId())
.append("deviceNo", getDeviceNo())
.append("title", getTitle())
.append("status", getStatus())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.toString();
}
}
package com.zehong.system.domain.track;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 设备装配记录对象 t_product_device_mark
*
* @author zehong
* @date 2024-08-28
*/
public class TProductDeviceMark extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 设备编号 */
@Excel(name = "设备编号")
private Long deviceId;
/** 装配编号 */
@Excel(name = "装配编号")
private Long markId;
/** 装配步骤编号 */
@Excel(name = "装配步骤编号")
private Long detailId;
/** 装配图片 */
@Excel(name = "装配图片")
private String imgUrl;
/** 装配视频 */
@Excel(name = "装配视频")
private String videoUrl;
/** $column.columnComment */
@Excel(name = "装配视频")
private Long createId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setMarkId(Long markId)
{
this.markId = markId;
}
public Long getMarkId()
{
return markId;
}
public void setDetailId(Long detailId)
{
this.detailId = detailId;
}
public Long getDetailId()
{
return detailId;
}
public void setImgUrl(String imgUrl)
{
this.imgUrl = imgUrl;
}
public String getImgUrl()
{
return imgUrl;
}
public void setVideoUrl(String videoUrl)
{
this.videoUrl = videoUrl;
}
public String getVideoUrl()
{
return videoUrl;
}
public void setCreateId(Long createId)
{
this.createId = createId;
}
public Long getCreateId()
{
return createId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deviceId", getDeviceId())
.append("markId", getMarkId())
.append("detailId", getDetailId())
.append("imgUrl", getImgUrl())
.append("videoUrl", getVideoUrl())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.toString();
}
}
......@@ -29,6 +29,8 @@ public class TProductMark extends BaseEntity
/** $column.columnComment */
private Long createId;
private String isDel;
public void setId(Long id)
{
this.id = id;
......@@ -66,6 +68,14 @@ public class TProductMark extends BaseEntity
return createId;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
......@@ -41,6 +41,8 @@ public class TProductPlan extends BaseEntity
/** 创建人 */
private Long createId;
private String isDel;
public void setId(Long id)
{
this.id = id;
......@@ -105,6 +107,14 @@ public class TProductPlan extends BaseEntity
return createId;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.mapper.track;
import java.util.List;
import com.zehong.system.domain.track.TProductDevice;
/**
* 设备Mapper接口
*
* @author zehong
* @date 2024-08-28
*/
public interface TProductDeviceMapper
{
/**
* 查询设备
*
* @param id 设备ID
* @return 设备
*/
public TProductDevice selectTProductDeviceById(Long id);
/**
* 查询设备列表
*
* @param tProductDevice 设备
* @return 设备集合
*/
public List<TProductDevice> selectTProductDeviceList(TProductDevice tProductDevice);
/**
* 新增设备
*
* @param tProductDevice 设备
* @return 结果
*/
public int insertTProductDevice(TProductDevice tProductDevice);
/**
* 修改设备
*
* @param tProductDevice 设备
* @return 结果
*/
public int updateTProductDevice(TProductDevice tProductDevice);
/**
* 删除设备
*
* @param id 设备ID
* @return 结果
*/
public int deleteTProductDeviceById(Long id);
/**
* 批量删除设备
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTProductDeviceByIds(Long[] ids);
}
package com.zehong.system.mapper.track;
import java.util.List;
import com.zehong.system.domain.track.TProductDeviceMark;
/**
* 设备装配记录Mapper接口
*
* @author zehong
* @date 2024-08-28
*/
public interface TProductDeviceMarkMapper
{
/**
* 查询设备装配记录
*
* @param id 设备装配记录ID
* @return 设备装配记录
*/
public TProductDeviceMark selectTProductDeviceMarkById(Long id);
/**
* 查询设备装配记录列表
*
* @param tProductDeviceMark 设备装配记录
* @return 设备装配记录集合
*/
public List<TProductDeviceMark> selectTProductDeviceMarkList(TProductDeviceMark tProductDeviceMark);
/**
* 新增设备装配记录
*
* @param tProductDeviceMark 设备装配记录
* @return 结果
*/
public int insertTProductDeviceMark(TProductDeviceMark tProductDeviceMark);
/**
* 修改设备装配记录
*
* @param tProductDeviceMark 设备装配记录
* @return 结果
*/
public int updateTProductDeviceMark(TProductDeviceMark tProductDeviceMark);
/**
* 删除设备装配记录
*
* @param id 设备装配记录ID
* @return 结果
*/
public int deleteTProductDeviceMarkById(Long id);
/**
* 批量删除设备装配记录
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTProductDeviceMarkByIds(Long[] ids);
}
package com.zehong.system.mapper;
package com.zehong.system.mapper.track;
import java.util.List;
import com.zehong.system.domain.track.TProductInspectDetail;
......
package com.zehong.system.mapper;
package com.zehong.system.mapper.track;
import java.util.List;
import com.zehong.system.domain.track.TProductInspect;
......
package com.zehong.system.service.impl.track;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.track.TProductDeviceMarkMapper;
import com.zehong.system.domain.track.TProductDeviceMark;
import com.zehong.system.service.track.ITProductDeviceMarkService;
/**
* 设备装配记录Service业务层处理
*
* @author zehong
* @date 2024-08-28
*/
@Service
public class TProductDeviceMarkServiceImpl implements ITProductDeviceMarkService
{
@Autowired
private TProductDeviceMarkMapper tProductDeviceMarkMapper;
/**
* 查询设备装配记录
*
* @param id 设备装配记录ID
* @return 设备装配记录
*/
@Override
public TProductDeviceMark selectTProductDeviceMarkById(Long id)
{
return tProductDeviceMarkMapper.selectTProductDeviceMarkById(id);
}
/**
* 查询设备装配记录列表
*
* @param tProductDeviceMark 设备装配记录
* @return 设备装配记录
*/
@Override
public List<TProductDeviceMark> selectTProductDeviceMarkList(TProductDeviceMark tProductDeviceMark)
{
return tProductDeviceMarkMapper.selectTProductDeviceMarkList(tProductDeviceMark);
}
/**
* 新增设备装配记录
*
* @param tProductDeviceMark 设备装配记录
* @return 结果
*/
@Override
public int insertTProductDeviceMark(TProductDeviceMark tProductDeviceMark)
{
tProductDeviceMark.setCreateTime(DateUtils.getNowDate());
tProductDeviceMark.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
return tProductDeviceMarkMapper.insertTProductDeviceMark(tProductDeviceMark);
}
/**
* 修改设备装配记录
*
* @param tProductDeviceMark 设备装配记录
* @return 结果
*/
@Override
public int updateTProductDeviceMark(TProductDeviceMark tProductDeviceMark)
{
return tProductDeviceMarkMapper.updateTProductDeviceMark(tProductDeviceMark);
}
/**
* 批量删除设备装配记录
*
* @param ids 需要删除的设备装配记录ID
* @return 结果
*/
@Override
public int deleteTProductDeviceMarkByIds(Long[] ids)
{
return tProductDeviceMarkMapper.deleteTProductDeviceMarkByIds(ids);
}
/**
* 删除设备装配记录信息
*
* @param id 设备装配记录ID
* @return 结果
*/
@Override
public int deleteTProductDeviceMarkById(Long id)
{
return tProductDeviceMarkMapper.deleteTProductDeviceMarkById(id);
}
}
package com.zehong.system.service.impl.track;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.track.TProductDevice;
import com.zehong.system.mapper.track.TProductDeviceMapper;
import com.zehong.system.service.track.ITProductDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.List;
/**
* 设备Service业务层处理
*
* @author zehong
* @date 2024-08-28
*/
@Service
public class TProductDeviceServiceImpl implements ITProductDeviceService
{
@Autowired
private TProductDeviceMapper tProductDeviceMapper;
/**
* 查询设备
*
* @param id 设备ID
* @return 设备
*/
@Override
public TProductDevice selectTProductDeviceById(Long id)
{
return tProductDeviceMapper.selectTProductDeviceById(id);
}
/**
* 查询设备列表
*
* @param tProductDevice 设备
* @return 设备
*/
@Override
public List<TProductDevice> selectTProductDeviceList(TProductDevice tProductDevice)
{
return tProductDeviceMapper.selectTProductDeviceList(tProductDevice);
}
/**
* 新增设备
*
* @param tProductDevice 设备
* @return 结果
*/
@Override
public int insertTProductDevice(TProductDevice tProductDevice)
{
try{
tProductDevice.setCreateTime(DateUtils.getNowDate());
tProductDevice.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
return tProductDeviceMapper.insertTProductDevice(tProductDevice);
}catch (Exception e){
Throwable cause = e.getCause();
if (cause instanceof SQLIntegrityConstraintViolationException){
String errMsg = cause.getMessage();
if (StringUtils.isNotEmpty(errMsg) && errMsg.contains("index_unique_device_no")){
throw new CustomException("设备编号不能重复");
}
}
throw e;
}
}
/**
* 修改设备
*
* @param tProductDevice 设备
* @return 结果
*/
@Override
public int updateTProductDevice(TProductDevice tProductDevice)
{
return tProductDeviceMapper.updateTProductDevice(tProductDevice);
}
/**
* 批量删除设备
*
* @param ids 需要删除的设备ID
* @return 结果
*/
@Override
public int deleteTProductDeviceByIds(Long[] ids)
{
return tProductDeviceMapper.deleteTProductDeviceByIds(ids);
}
/**
* 删除设备信息
*
* @param id 设备ID
* @return 结果
*/
@Override
public int deleteTProductDeviceById(Long id)
{
return tProductDeviceMapper.deleteTProductDeviceById(id);
}
}
......@@ -5,7 +5,7 @@ import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.track.TProductInspectDetail;
import com.zehong.system.domain.vo.HouseVo;
import com.zehong.system.mapper.TProductInspectDetailMapper;
import com.zehong.system.mapper.track.TProductInspectDetailMapper;
import com.zehong.system.service.track.ITProductInspectDetailService;
import com.zehong.system.service.track.ITProductStoreService;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -9,7 +9,7 @@ import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProductInspectMapper;
import com.zehong.system.mapper.track.TProductInspectMapper;
import com.zehong.system.domain.track.TProductInspect;
import com.zehong.system.service.track.ITProductInspectService;
......
package com.zehong.system.service.track;
import java.util.List;
import com.zehong.system.domain.track.TProductDeviceMark;
/**
* 设备装配记录Service接口
*
* @author zehong
* @date 2024-08-28
*/
public interface ITProductDeviceMarkService
{
/**
* 查询设备装配记录
*
* @param id 设备装配记录ID
* @return 设备装配记录
*/
public TProductDeviceMark selectTProductDeviceMarkById(Long id);
/**
* 查询设备装配记录列表
*
* @param tProductDeviceMark 设备装配记录
* @return 设备装配记录集合
*/
public List<TProductDeviceMark> selectTProductDeviceMarkList(TProductDeviceMark tProductDeviceMark);
/**
* 新增设备装配记录
*
* @param tProductDeviceMark 设备装配记录
* @return 结果
*/
public int insertTProductDeviceMark(TProductDeviceMark tProductDeviceMark);
/**
* 修改设备装配记录
*
* @param tProductDeviceMark 设备装配记录
* @return 结果
*/
public int updateTProductDeviceMark(TProductDeviceMark tProductDeviceMark);
/**
* 批量删除设备装配记录
*
* @param ids 需要删除的设备装配记录ID
* @return 结果
*/
public int deleteTProductDeviceMarkByIds(Long[] ids);
/**
* 删除设备装配记录信息
*
* @param id 设备装配记录ID
* @return 结果
*/
public int deleteTProductDeviceMarkById(Long id);
}
package com.zehong.system.service.track;
import java.util.List;
import com.zehong.system.domain.track.TProductDevice;
/**
* 设备Service接口
*
* @author zehong
* @date 2024-08-28
*/
public interface ITProductDeviceService
{
/**
* 查询设备
*
* @param id 设备ID
* @return 设备
*/
public TProductDevice selectTProductDeviceById(Long id);
/**
* 查询设备列表
*
* @param tProductDevice 设备
* @return 设备集合
*/
public List<TProductDevice> selectTProductDeviceList(TProductDevice tProductDevice);
/**
* 新增设备
*
* @param tProductDevice 设备
* @return 结果
*/
public int insertTProductDevice(TProductDevice tProductDevice);
/**
* 修改设备
*
* @param tProductDevice 设备
* @return 结果
*/
public int updateTProductDevice(TProductDevice tProductDevice);
/**
* 批量删除设备
*
* @param ids 需要删除的设备ID
* @return 结果
*/
public int deleteTProductDeviceByIds(Long[] ids);
/**
* 删除设备信息
*
* @param id 设备ID
* @return 结果
*/
public int deleteTProductDeviceById(Long id);
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.track.TProductDeviceMapper">
<resultMap type="TProductDevice" id="TProductDeviceResult">
<result property="id" column="id" />
<result property="planId" column="plan_id" />
<result property="inspectId" column="inspect_id" />
<result property="deviceNo" column="device_no" />
<result property="title" column="title" />
<result property="status" column="status" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
</resultMap>
<sql id="selectTProductDeviceVo">
SELECT
device.id,
device.plan_id,
device.inspect_id,
device.device_no,
device.title,
device.`STATUS`,
device.remark,
device.create_time,
device.create_id,
ins.batch_no as batchNo,
(select nick_name from sys_user us where us.user_id = device.create_id) as createBy
FROM
t_product_device device
LEFT JOIN t_product_inspect ins ON ins.id = device.inspect_id
</sql>
<select id="selectTProductDeviceList" parameterType="TProductDevice" resultMap="TProductDeviceResult">
<include refid="selectTProductDeviceVo"/>
<where>
<if test="inspectId != null "> and device.inspect_id like concat('%', #{inspectId}, '%')</if>
<if test="deviceNo != null and deviceNo != ''"> and device.device_no like concat('%', #{deviceNo}, '%')</if>
<if test="title != null and title != ''"> and device.title like concat('%', #{title}, '%')</if>
<if test="status != null and status != ''"> and device.status = #{status}</if>
</where>
order by device.create_time desc
</select>
<select id="selectTProductDeviceById" parameterType="Long" resultMap="TProductDeviceResult">
<include refid="selectTProductDeviceVo"/>
where device.id = #{id}
</select>
<insert id="insertTProductDevice" parameterType="TProductDevice" useGeneratedKeys="true" keyProperty="id">
insert into t_product_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">plan_id,</if>
<if test="inspectId != null">inspect_id,</if>
<if test="deviceNo != null and deviceNo != ''">device_no,</if>
<if test="title != null and title != ''">title,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planId != null">#{planId},</if>
<if test="inspectId != null">#{inspectId},</if>
<if test="deviceNo != null and deviceNo != ''">#{deviceNo},</if>
<if test="title != null and title != ''">#{title},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
</trim>
</insert>
<update id="updateTProductDevice" parameterType="TProductDevice">
update t_product_device
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">plan_id = #{planId},</if>
<if test="inspectId != null">inspect_id = #{inspectId},</if>
<if test="deviceNo != null and deviceNo != ''">device_no = #{deviceNo},</if>
<if test="title != null and title != ''">title = #{title},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTProductDeviceById" parameterType="Long">
delete from t_product_device where id = #{id}
</delete>
<delete id="deleteTProductDeviceByIds" parameterType="String">
delete from t_product_device where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.track.TProductDeviceMarkMapper">
<resultMap type="TProductDeviceMark" id="TProductDeviceMarkResult">
<result property="id" column="id" />
<result property="deviceId" column="device_id" />
<result property="markId" column="mark_id" />
<result property="detailId" column="detail_id" />
<result property="imgUrl" column="img_url" />
<result property="videoUrl" column="video_url" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
</resultMap>
<sql id="selectTProductDeviceMarkVo">
select id, device_id, mark_id, detail_id, img_url, video_url, remark, create_time, create_id from t_product_device_mark
</sql>
<select id="selectTProductDeviceMarkList" parameterType="TProductDeviceMark" resultMap="TProductDeviceMarkResult">
<include refid="selectTProductDeviceMarkVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="markId != null "> and mark_id = #{markId}</if>
<if test="detailId != null "> and detail_id = #{detailId}</if>
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
<if test="videoUrl != null and videoUrl != ''"> and video_url = #{videoUrl}</if>
<if test="createId != null "> and create_id = #{createId}</if>
</where>
</select>
<select id="selectTProductDeviceMarkById" parameterType="Long" resultMap="TProductDeviceMarkResult">
<include refid="selectTProductDeviceMarkVo"/>
where id = #{id}
</select>
<insert id="insertTProductDeviceMark" parameterType="TProductDeviceMark" useGeneratedKeys="true" keyProperty="id">
insert into t_product_device_mark
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="markId != null">mark_id,</if>
<if test="detailId != null">detail_id,</if>
<if test="imgUrl != null">img_url,</if>
<if test="videoUrl != null">video_url,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="markId != null">#{markId},</if>
<if test="detailId != null">#{detailId},</if>
<if test="imgUrl != null">#{imgUrl},</if>
<if test="videoUrl != null">#{videoUrl},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
</trim>
</insert>
<update id="updateTProductDeviceMark" parameterType="TProductDeviceMark">
update t_product_device_mark
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="markId != null">mark_id = #{markId},</if>
<if test="detailId != null">detail_id = #{detailId},</if>
<if test="imgUrl != null">img_url = #{imgUrl},</if>
<if test="videoUrl != null">video_url = #{videoUrl},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTProductDeviceMarkById" parameterType="Long">
delete from t_product_device_mark where id = #{id}
</delete>
<delete id="deleteTProductDeviceMarkByIds" parameterType="String">
delete from t_product_device_mark where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -35,7 +35,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
<if test="createId != null "> and create_id = #{createId}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
and is_del = '0'
</where>
order by create_time desc
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TProductInspectDetailMapper">
<mapper namespace="com.zehong.system.mapper.track.TProductInspectDetailMapper">
<resultMap type="TProductInspectDetail" id="TProductInspectDetailResult">
<result property="id" column="id" />
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TProductInspectMapper">
<mapper namespace="com.zehong.system.mapper.track.TProductInspectMapper">
<resultMap type="TProductInspect" id="TProductInspectResult">
<result property="id" column="id" />
......@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
<result property="isDel" column="is_del" />
</resultMap>
<sql id="selectTProductInspectVo">
......@@ -39,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where>
<if test="batchNo != null and batchNo != ''"> and ins.batch_no = #{batchNo}</if>
<if test="status != null and status != ''"> and ins.status = #{status}</if>
and ins.is_del = '0'
</where>
order by ins.create_time desc
</select>
......@@ -59,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
<if test="isDel != null">is_del,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planId != null">#{planId},</if>
......@@ -69,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
<if test="isDel != null">#{isDel},</if>
</trim>
</insert>
......@@ -83,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="isDel != null">is_del = #{isDel},</if>
</trim>
where id = #{id}
</update>
......@@ -92,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTProductInspectByIds" parameterType="String">
delete from t_product_inspect where id in
update t_product_inspect set is_del = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
......
......@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="content" column="content" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
<result property="isDel" column="is_del" />
</resultMap>
<sql id="selectTProductMarkVo">
......@@ -20,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectTProductMarkVo"/>
<where>
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
and is_del = '0'
</where>
order by create_time desc
</select>
......@@ -36,12 +38,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null and content != ''">content,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
<if test="isDel != null">is_del,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null and title != ''">#{title},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
<if test="isDel != null">#{isDel},</if>
</trim>
</insert>
......@@ -52,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="content != null and content != ''">content = #{content},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="isDel != null">is_del = #{isDel},</if>
</trim>
where id = #{id}
</update>
......@@ -61,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTProductMarkByIds" parameterType="String">
delete from t_product_mark where id in
update t_product_mark set is_del = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
......
......@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
<result property="isDel" column="is_del" />
</resultMap>
<sql id="selectTProductPlanVo">
......@@ -25,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
<if test="planNo != null and planNo != ''"> and plan_no like concat('%', #{planNo}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
and is_del = '0'
</where>
order by create_time desc
</select>
......@@ -44,6 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
<if test="isDel != null">is_del,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">#{title},</if>
......@@ -53,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
<if test="isDel != null">#{isDel},</if>
</trim>
</insert>
......@@ -66,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="isDel != null">is_del = #{isDel},</if>
</trim>
where id = #{id}
</update>
......@@ -75,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteTProductPlanByIds" parameterType="String">
delete from t_product_plan where id in
update t_product_plan set is_del = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
......
import request from '@/utils/request'
// 查询设备列表
export function listDevice(query) {
return request({
url: '/track/device/list',
method: 'get',
params: query
})
}
// 查询设备详细
export function getDevice(id) {
return request({
url: '/track/device/' + id,
method: 'get'
})
}
// 新增设备
export function addDevice(data) {
return request({
url: '/track/device',
method: 'post',
data: data
})
}
// 修改设备
export function updateDevice(data) {
return request({
url: '/track/device',
method: 'put',
data: data
})
}
// 删除设备
export function delDevice(id) {
return request({
url: '/track/device/' + id,
method: 'delete'
})
}
// 导出设备
export function exportDevice(query) {
return request({
url: '/track/device/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询设备装配记录列表
export function listMark(query) {
return request({
url: '/track/deviceMark/list',
method: 'get',
params: query
})
}
// 查询设备装配记录详细
export function getMark(id) {
return request({
url: '/track/deviceMark/' + id,
method: 'get'
})
}
// 新增设备装配记录
export function addMark(data) {
return request({
url: '/track/deviceMark',
method: 'post',
data: data
})
}
// 修改设备装配记录
export function updateMark(data) {
return request({
url: '/track/deviceMark',
method: 'put',
data: data
})
}
// 删除设备装配记录
export function delMark(id) {
return request({
url: '/track/deviceMark/' + id,
method: 'delete'
})
}
// 导出设备装配记录
export function exportMark(query) {
return request({
url: '/track/deviceMark/export',
method: 'get',
params: query
})
}
......@@ -51,3 +51,12 @@ export function exportInspect(query) {
params: query
})
}
//所有执行
export function executeInfoList(query) {
return request({
url: '/track/execute/executeInfoList',
method: 'get',
params: query
})
}
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="90px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="批次号">
<span v-if="detailInfo.batchNo">{{ detailInfo.batchNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号">
<span v-if="detailInfo.deviceNo">{{ detailInfo.deviceNo }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称">
<span v-if="detailInfo.title">{{ detailInfo.title }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备状态">
<span v-if="detailInfo.title">{{ $parent.statusFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建人">
<span v-if="detailInfo.createBy">{{ detailInfo.createBy }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="设备备注">
<span v-if="detailInfo.remark">{{ detailInfo.remark }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getDevice } from "@/api/track/device";
export default {
name: "detail-info",
data(){
return{
detailOpen: false,
detailInfo: {}
}
},
methods:{
getDetailInfo(id){
getDevice(id).then(res =>{
if(res.code == 200){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="执行编号" prop="inspectId">
<el-input
v-model="queryParams.inspectId"
placeholder="请输入执行编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编号" prop="deviceNo">
<el-input
v-model="queryParams.deviceNo"
placeholder="请输入设备编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择设备状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="批次号" align="center" prop="batchNo" />
<el-table-column label="设备编号" align="center" prop="deviceNo" />
<el-table-column label="设备名称" align="center" prop="title" />
<el-table-column label="设备状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="批次号" prop="inspectId">
<el-select style="width:100%" v-model="form.inspectId" placeholder="请选择批次号" clearable size="small">
<el-option
v-for="execute in executeData"
:key="execute.id"
:label="execute.batchNo"
:value="execute.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编号" prop="deviceNo">
<el-input v-model="form.deviceNo" placeholder="请输入设备编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备名称" prop="title">
<el-input v-model="form.title" placeholder="请输入设备名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备状态">
<el-select style="width:100%" v-model="form.status" placeholder="请选择设备状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="设备备注" prop="remark">
<el-input v-model="form.remark" :autosize="{ minRows: 3 }" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice } from "@/api/track/device";
import { executeInfoList } from "@/api/track/execute";
import DetailInfo from "./components/DetailInfo";
export default {
name: "Device",
components: {
DetailInfo
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
deviceNos: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 设备表格数据
deviceList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 设备状态字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
inspectId: null,
deviceNo: null,
title: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
inspectId: [
{ required: true, message: "执行编号不能为空", trigger: "blur" }
],
deviceNo: [
{ required: true, message: "设备编号不能为空", trigger: "blur" }
],
title: [
{ required: true, message: "设备名称不能为空", trigger: "blur" }
],
},
executeData: []
};
},
created() {
this.getList();
this.getDicts("t_produce_device_status").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询设备列表 */
getList() {
this.loading = true;
listDevice(this.queryParams).then(response => {
this.deviceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 设备状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
planId: null,
inspectId: null,
deviceNo: null,
title: null,
status: "0",
remark: null,
createTime: null,
createId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.deviceNos = selection.map(item => item.deviceNo);
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getExecuteInfo();
this.open = true;
this.title = "添加设备";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDevice(id).then(response => {
this.form = response.data;
this.getExecuteInfo();
this.open = true;
this.title = "修改设备";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDevice(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDevice(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
const deviceNos = row.deviceNo || this.deviceNos;
this.$confirm('是否确认删除设备编号为"' + deviceNos + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delDevice(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有设备数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDevice(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
//获取执行信息
getExecuteInfo(){
executeInfoList().then(res =>{
if(res.code == 200){
this.executeData = res.data;
}
})
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.id);
}
}
};
</script>
......@@ -176,7 +176,7 @@
<el-col :span="12">
<el-form-item label="执行状态" prop="status">
<el-select style="width: 100%" v-model="form.status" placeholder="请选择执行状态" clearable size="small">
<el-select style="width: 100% " v-model="form.status" placeholder="请选择执行状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment