Commit b54a04f8 authored by 吴卿华's avatar 吴卿华

Merge remote-tracking branch 'origin/master'

parents 5e122ebd c7cd5964
package com.zehong.web.controller.contractor;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.TContractor;
import com.zehong.system.service.ISysUserService;
import com.zehong.system.service.ITContractorService;
import org.springframework.security.access.prepost.PreAuthorize;
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.TBreakRulesPersonRecord;
import com.zehong.system.service.ITBreakRulesPersonRecordService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 违章人员记录Controller
*
* @author zehong
* @date 2023-02-11
*/
@RestController
@RequestMapping("/breakRulesPerson/record")
public class TBreakRulesPersonRecordController extends BaseController
{
@Autowired
private ITBreakRulesPersonRecordService tBreakRulesPersonRecordService;
@Autowired
private ITContractorService tContractorService;
@Autowired
private ISysUserService iSysUserService;
/**
* 查询违章人员记录列表
*/
//@PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list")
public TableDataInfo list(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
startPage();
List<TBreakRulesPersonRecord> list = tBreakRulesPersonRecordService.selectTBreakRulesPersonRecordList(tBreakRulesPersonRecord);
return getDataTable(list);
}
/**
* 导出违章人员记录列表
*/
//@PreAuthorize("@ss.hasPermi('system:record:export')")
@Log(title = "违章人员记录", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
List<TBreakRulesPersonRecord> list = tBreakRulesPersonRecordService.selectTBreakRulesPersonRecordList(tBreakRulesPersonRecord);
for(TBreakRulesPersonRecord record : list){
if(null !=record.getContractId()){
TContractor contractor = tContractorService.selectTContractorById(record.getContractId());
record.setContractName(contractor.getContractorName());
}
SysUser user = iSysUserService.selectUserById(record.getReportPerson());
record.setReportPersonName(user.getNickName());
}
ExcelUtil<TBreakRulesPersonRecord> util = new ExcelUtil<TBreakRulesPersonRecord>(TBreakRulesPersonRecord.class);
return util.exportExcel(list, "违章人员记录数据");
}
/**
* 获取违章人员记录详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:record:query')")
@GetMapping(value = "/{breakRulesPersonId}")
public AjaxResult getInfo(@PathVariable("breakRulesPersonId") Long breakRulesPersonId)
{
return AjaxResult.success(tBreakRulesPersonRecordService.selectTBreakRulesPersonRecordById(breakRulesPersonId));
}
/**
* 新增违章人员记录
*/
//@PreAuthorize("@ss.hasPermi('system:record:add')")
@Log(title = "违章人员记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return toAjax(tBreakRulesPersonRecordService.insertTBreakRulesPersonRecord(tBreakRulesPersonRecord));
}
/**
* 修改违章人员记录
*/
//@PreAuthorize("@ss.hasPermi('system:record:edit')")
@Log(title = "违章人员记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return toAjax(tBreakRulesPersonRecordService.updateTBreakRulesPersonRecord(tBreakRulesPersonRecord));
}
/**
* 删除违章人员记录
*/
//@PreAuthorize("@ss.hasPermi('system:record:remove')")
@Log(title = "违章人员记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{breakRulesPersonIds}")
public AjaxResult remove(@PathVariable Long[] breakRulesPersonIds)
{
return toAjax(tBreakRulesPersonRecordService.deleteTBreakRulesPersonRecordByIds(breakRulesPersonIds));
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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_break_rules_person_record
*
* @author zehong
* @date 2023-02-11
*/
public class TBreakRulesPersonRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
private Long breakRulesPersonId;
/** 承包商id */
private Long contractId;
/**承包商名称*/
@Excel(name = "承包商")
private String contractName;
/** 违规人员姓名 */
@Excel(name = "人员姓名")
private String breakRulesPersonName;
/** 违规时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "违规时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date breakTime;
/** 违规照片 */
@Excel(name = "违规照片")
private String breakPicUrl;
/** 违规说明 */
@Excel(name = "违规说明")
private String breakDescription;
/** 电子签名 */
//@Excel(name = "电子签名")
private String signature;
/** 上报人 */
private Long reportPerson;
/**上报人姓名*/
@Excel(name = "上报人")
private String reportPersonName;
/** 上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reportTime;
/** 是否删除(0正常,1删除) */
private String isDel;
private Date reportTimeBegin;
private Date reportTimeEnd;
public void setBreakRulesPersonId(Long breakRulesPersonId)
{
this.breakRulesPersonId = breakRulesPersonId;
}
public Long getBreakRulesPersonId()
{
return breakRulesPersonId;
}
public void setContractId(Long contractId)
{
this.contractId = contractId;
}
public Long getContractId()
{
return contractId;
}
public void setBreakRulesPersonName(String breakRulesPersonName)
{
this.breakRulesPersonName = breakRulesPersonName;
}
public String getBreakRulesPersonName()
{
return breakRulesPersonName;
}
public void setBreakTime(Date breakTime)
{
this.breakTime = breakTime;
}
public Date getBreakTime()
{
return breakTime;
}
public void setBreakPicUrl(String breakPicUrl)
{
this.breakPicUrl = breakPicUrl;
}
public String getBreakPicUrl()
{
return breakPicUrl;
}
public void setBreakDescription(String breakDescription)
{
this.breakDescription = breakDescription;
}
public String getBreakDescription()
{
return breakDescription;
}
public void setSignature(String signature)
{
this.signature = signature;
}
public String getSignature()
{
return signature;
}
public void setReportPerson(Long reportPerson)
{
this.reportPerson = reportPerson;
}
public Long getReportPerson()
{
return reportPerson;
}
public void setReportTime(Date reportTime)
{
this.reportTime = reportTime;
}
public Date getReportTime()
{
return reportTime;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public Date getReportTimeBegin() {
return reportTimeBegin;
}
public void setReportTimeBegin(Date reportTimeBegin) {
this.reportTimeBegin = reportTimeBegin;
}
public Date getReportTimeEnd() {
return reportTimeEnd;
}
public void setReportTimeEnd(Date reportTimeEnd) {
this.reportTimeEnd = reportTimeEnd;
}
public String getContractName() {
return contractName;
}
public void setContractName(String contractName) {
this.contractName = contractName;
}
public String getReportPersonName() {
return reportPersonName;
}
public void setReportPersonName(String reportPersonName) {
this.reportPersonName = reportPersonName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("breakRulesPersonId", getBreakRulesPersonId())
.append("contractId", getContractId())
.append("breakRulesPersonName", getBreakRulesPersonName())
.append("breakTime", getBreakTime())
.append("breakPicUrl", getBreakPicUrl())
.append("breakDescription", getBreakDescription())
.append("signature", getSignature())
.append("reportPerson", getReportPerson())
.append("reportTime", getReportTime())
.append("isDel", getIsDel())
.append("remark", getRemark())
.toString();
}
}
......@@ -2,9 +2,12 @@ package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 设备信息管理对象 t_device_info
*
......@@ -18,171 +21,176 @@ public class TDeviceInfo extends BaseEntity
/** $column.columnComment */
private Long id;
/** 设备位号 */
@Excel(name = "设备位号")
private String tagNumber;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备编码 */
@Excel(name = "设备编码")
private String deviceCode;
/** 规格 */
@Excel(name = "规格")
private String specifications;
/** 设备状态(0正常 1报警 2离线) */
private String deviceStatus;
/** 技术性能 */
@Excel(name = "技术性能")
private String function;
/** 设备类型 */
@Excel(name = "设备类型(液位探测器/气体报警器/压力报警器)", readConverterExp = "1=液位探测器,2=气体报警器,3=压力报警器")
private String deviceType;
/** 介质 */
@Excel(name = "介质")
private String medium;
/** 位号 */
@Excel(name = "位号")
private String tagNumber;
/** 制造厂家 */
@Excel(name = "制造厂家")
private String manufactor;
/** 设备等级 */
@Excel(name = "设备等级(一级危险源/二级危险源/三级危险源)", readConverterExp = "1=一级危险源,2=二级危险源,3=三级危险源")
private String deviceGrade;
/** 所属车间 */
@Excel(name = "所属车间", readConverterExp = "1=电仪车间,2=化工车间,3=热电车间,4=压缩车间,5=尿素车间,6=制气车间,7=维修车间")
private String shop;
/** 安装位置 */
@Excel(name = "安装位置")
private String installLocation;
/** 投运时间 */
@Excel(name = "投运时间(xxxx-xx-xx)", dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date commissionDate;
/** 是否特种设备(0否,1是) */
@Excel(name = "是否特种设备(是/否)", readConverterExp = "0=否,1=是")
private String isSpecial;
/** 设备状态 */
@Excel(name = "设备状态", readConverterExp = "0=运行,1=备用,2=检修")
private String deviceStatus;
/** 负责人 */
@Excel(name = "负责人")
private String responsiblePerson;
/** 设备分类 */
@Excel(name = "设备分类(动设备/静设备)", readConverterExp = "1=动设备,2=静设备")
private String classify;
/** 分级 */
@Excel(name = "分级")
private String deviceGrade;
/** 负责人电话 */
@Excel(name = "负责人电话")
private String responsiblePhone;
/** 是否特种设备(0否,1是) */
@Excel(name = "是否特种设备(否/是)", readConverterExp = "0=否,1=是")
private String isSpecial;
/** 备注信息 */
@Excel(name = "备注信息")
private String remarks;
/** 特种设备类型 */
@Excel(name = "特种设备类型(预防事故设施/控制事故设施/减少与消除事故影响设施)", readConverterExp = "1=预防事故设施,2=控制事故设施,3=减少与消除事故影响设施")
private String deviceType;
/** 是否作废(0正常,1作废) */
@Excel(name = "是否作废(0正常,1作废)")
/** 是否报废(0正常,1报废) */
@Excel(name = "是否报废(否/是)", readConverterExp = "0=否,1=是")
private String isCancel;
/** 是否删除(0正常,1删除) */
private String isDel;
public void setId(Long id)
{
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getId()
{
return id;
public String getTagNumber() {
return tagNumber;
}
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
public void setTagNumber(String tagNumber) {
this.tagNumber = tagNumber;
}
public String getDeviceName()
{
public String getDeviceName() {
return deviceName;
}
public void setDeviceCode(String deviceCode)
{
this.deviceCode = deviceCode;
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCode()
{
return deviceCode;
public String getSpecifications() {
return specifications;
}
public void setDeviceStatus(String deviceStatus)
{
this.deviceStatus = deviceStatus;
public void setSpecifications(String specifications) {
this.specifications = specifications;
}
public String getDeviceStatus()
{
return deviceStatus;
public String getFunction() {
return function;
}
public void setDeviceType(String deviceType)
{
this.deviceType = deviceType;
public void setFunction(String function) {
this.function = function;
}
public String getDeviceType()
{
return deviceType;
public String getMedium() {
return medium;
}
public void setTagNumber(String tagNumber)
{
this.tagNumber = tagNumber;
public void setMedium(String medium) {
this.medium = medium;
}
public String getTagNumber()
{
return tagNumber;
public String getManufactor() {
return manufactor;
}
public void setDeviceGrade(String deviceGrade)
{
this.deviceGrade = deviceGrade;
public void setManufactor(String manufactor) {
this.manufactor = manufactor;
}
public String getDeviceGrade()
{
return deviceGrade;
public String getShop() {
return shop;
}
public void setInstallLocation(String installLocation)
{
this.installLocation = installLocation;
public void setShop(String shop) {
this.shop = shop;
}
public String getInstallLocation()
{
return installLocation;
public Date getCommissionDate() {
return commissionDate;
}
public void setIsSpecial(String isSpecial)
{
this.isSpecial = isSpecial;
public void setCommissionDate(Date commissionDate) {
this.commissionDate = commissionDate;
}
public String getIsSpecial()
{
return isSpecial;
public String getDeviceStatus() {
return deviceStatus;
}
public void setResponsiblePerson(String responsiblePerson)
{
this.responsiblePerson = responsiblePerson;
public void setDeviceStatus(String deviceStatus) {
this.deviceStatus = deviceStatus;
}
public String getResponsiblePerson()
{
return responsiblePerson;
public String getDeviceType() {
return deviceType;
}
public void setResponsiblePhone(String responsiblePhone)
{
this.responsiblePhone = responsiblePhone;
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getResponsiblePhone()
{
return responsiblePhone;
public String getClassify() {
return classify;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
public void setClassify(String classify) {
this.classify = classify;
}
public String getIsDel()
{
return isDel;
public String getDeviceGrade() {
return deviceGrade;
}
public String getRemarks() {
return remarks;
public void setDeviceGrade(String deviceGrade) {
this.deviceGrade = deviceGrade;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
public String getIsSpecial() {
return isSpecial;
}
public void setIsSpecial(String isSpecial) {
this.isSpecial = isSpecial;
}
public String getIsCancel() {
......@@ -192,4 +200,12 @@ public class TDeviceInfo extends BaseEntity
public void setIsCancel(String isCancel) {
this.isCancel = isCancel;
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel;
}
}
......@@ -27,9 +27,9 @@ public class TSpecialDeviceRecord extends BaseEntity
@Excel(name = "对应类型")
private String operateType;
/** 设备号 */
@Excel(name = "设备号")
private String deviceCode;
/** 设备号 */
@Excel(name = "设备号")
private String tagNumber;
/** 设备id */
private Long deviceId;
......@@ -46,14 +46,12 @@ public class TSpecialDeviceRecord extends BaseEntity
/** 是否删除 */
private String isDel;
public void setId(Long id)
{
this.id = id;
public Long getId() {
return id;
}
public Long getId()
{
return id;
public void setId(Long id) {
this.id = id;
}
public String getOperateCode() {
......@@ -64,14 +62,20 @@ public class TSpecialDeviceRecord extends BaseEntity
this.operateCode = operateCode;
}
public void setDeviceCode(String deviceCode)
{
this.deviceCode = deviceCode;
public String getOperateType() {
return operateType;
}
public void setOperateType(String operateType) {
this.operateType = operateType;
}
public String getTagNumber() {
return tagNumber;
}
public String getDeviceCode()
{
return deviceCode;
public void setTagNumber(String tagNumber) {
this.tagNumber = tagNumber;
}
public Long getDeviceId() {
......@@ -82,24 +86,14 @@ public class TSpecialDeviceRecord extends BaseEntity
this.deviceId = deviceId;
}
public String getOperateType() {
return operateType;
}
public void setOperateType(String operateType) {
this.operateType = operateType;
public Date getEffectiveDate() {
return effectiveDate;
}
public void setEffectiveDate(Date effectiveDate)
{
public void setEffectiveDate(Date effectiveDate) {
this.effectiveDate = effectiveDate;
}
public Date getEffectiveDate()
{
return effectiveDate;
}
public String getRecordStatus() {
return recordStatus;
}
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TBreakRulesPersonRecord;
/**
* 违章人员记录Mapper接口
*
* @author zehong
* @date 2023-02-11
*/
public interface TBreakRulesPersonRecordMapper
{
/**
* 查询违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 违章人员记录
*/
public TBreakRulesPersonRecord selectTBreakRulesPersonRecordById(Long breakRulesPersonId);
/**
* 查询违章人员记录列表
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 违章人员记录集合
*/
public List<TBreakRulesPersonRecord> selectTBreakRulesPersonRecordList(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 新增违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int insertTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 修改违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int updateTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 删除违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordById(Long breakRulesPersonId);
/**
* 批量删除违章人员记录
*
* @param breakRulesPersonIds 需要删除的数据ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordByIds(Long[] breakRulesPersonIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TBreakRulesPersonRecord;
/**
* 违章人员记录Service接口
*
* @author zehong
* @date 2023-02-11
*/
public interface ITBreakRulesPersonRecordService
{
/**
* 查询违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 违章人员记录
*/
public TBreakRulesPersonRecord selectTBreakRulesPersonRecordById(Long breakRulesPersonId);
/**
* 查询违章人员记录列表
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 违章人员记录集合
*/
public List<TBreakRulesPersonRecord> selectTBreakRulesPersonRecordList(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 新增违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int insertTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 修改违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
public int updateTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord);
/**
* 批量删除违章人员记录
*
* @param breakRulesPersonIds 需要删除的违章人员记录ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordByIds(Long[] breakRulesPersonIds);
/**
* 删除违章人员记录信息
*
* @param breakRulesPersonId 违章人员记录ID
* @return 结果
*/
public int deleteTBreakRulesPersonRecordById(Long breakRulesPersonId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TBreakRulesPersonRecordMapper;
import com.zehong.system.domain.TBreakRulesPersonRecord;
import com.zehong.system.service.ITBreakRulesPersonRecordService;
/**
* 违章人员记录Service业务层处理
*
* @author zehong
* @date 2023-02-11
*/
@Service
public class TBreakRulesPersonRecordServiceImpl implements ITBreakRulesPersonRecordService
{
@Autowired
private TBreakRulesPersonRecordMapper tBreakRulesPersonRecordMapper;
/**
* 查询违章人员记录
*
* @param breakRulesPersonId 违章人员记录ID
* @return 违章人员记录
*/
@Override
public TBreakRulesPersonRecord selectTBreakRulesPersonRecordById(Long breakRulesPersonId)
{
return tBreakRulesPersonRecordMapper.selectTBreakRulesPersonRecordById(breakRulesPersonId);
}
/**
* 查询违章人员记录列表
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 违章人员记录
*/
@Override
public List<TBreakRulesPersonRecord> selectTBreakRulesPersonRecordList(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return tBreakRulesPersonRecordMapper.selectTBreakRulesPersonRecordList(tBreakRulesPersonRecord);
}
/**
* 新增违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
@Override
public int insertTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return tBreakRulesPersonRecordMapper.insertTBreakRulesPersonRecord(tBreakRulesPersonRecord);
}
/**
* 修改违章人员记录
*
* @param tBreakRulesPersonRecord 违章人员记录
* @return 结果
*/
@Override
public int updateTBreakRulesPersonRecord(TBreakRulesPersonRecord tBreakRulesPersonRecord)
{
return tBreakRulesPersonRecordMapper.updateTBreakRulesPersonRecord(tBreakRulesPersonRecord);
}
/**
* 批量删除违章人员记录
*
* @param breakRulesPersonIds 需要删除的违章人员记录ID
* @return 结果
*/
@Override
public int deleteTBreakRulesPersonRecordByIds(Long[] breakRulesPersonIds)
{
return tBreakRulesPersonRecordMapper.deleteTBreakRulesPersonRecordByIds(breakRulesPersonIds);
}
/**
* 删除违章人员记录信息
*
* @param breakRulesPersonId 违章人员记录ID
* @return 结果
*/
@Override
public int deleteTBreakRulesPersonRecordById(Long breakRulesPersonId)
{
return tBreakRulesPersonRecordMapper.deleteTBreakRulesPersonRecordById(breakRulesPersonId);
}
}
......@@ -126,32 +126,32 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
{
try
{
// 验证是否存在这个用户
TDeviceInfo d = new TDeviceInfo();
d.setDeviceCode(device.getDeviceCode());
List<TDeviceInfo> list = tDeviceInfoMapper.selectTDeviceInfoList(d);
if (list.size() == 0)
{
// // 验证是否存在这个设备位号
// TDeviceInfo d = new TDeviceInfo();
// d.setTagNumber(device.getTagNumber());
// List<TDeviceInfo> list = tDeviceInfoMapper.selectTDeviceInfoList(d);
// if (list.size() == 0)
// {
this.insertTDeviceInfo(device);
successNum++;
// successMsg.append("<br/>" + successNum + "、设备 " + device.getDeviceName() + "(" + device.getDeviceCode() + ")" + " 导入成功");
}
else if (isUpdateSupport)
{
this.updateTDeviceInfo(device);
successNum++;
// successMsg.append("<br/>" + successNum + "、设备 " + device.getDeviceName() + "(" + device.getDeviceCode() + ")" + " 更新成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、设备编号 " + device.getDeviceCode() + " 已存在");
}
//// successMsg.append("<br/>" + successNum + "、设备 " + device.getDeviceName() + "(" + device.getDeviceCode() + ")" + " 导入成功");
// }
// else if (isUpdateSupport)
// {
// this.updateTDeviceInfo(device);
// successNum++;
//// successMsg.append("<br/>" + successNum + "、设备 " + device.getDeviceName() + "(" + device.getDeviceCode() + ")" + " 更新成功");
// }
// else
// {
// failureNum++;
// failureMsg.append("<br/>" + failureNum + "、设备位号 " + device.getTagNumber() + " 已存在");
// }
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、设备 " + device.getDeviceName() + "(" + device.getDeviceCode() + ")" + " 导入失败:";
String msg = "<br/>" + failureNum + "、设备 " + device.getDeviceName() + "(" + device.getTagNumber() + ")" + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
......
......@@ -68,7 +68,7 @@ public class TMaintainPlanServiceImpl implements ITMaintainPlanService
TDeviceInfo tDeviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(Long.valueOf(id));
TSpecialDeviceRecord tSpecialDeviceRecord = new TSpecialDeviceRecord();
tSpecialDeviceRecord.setDeviceCode(tDeviceInfo.getDeviceCode());
tSpecialDeviceRecord.setTagNumber(tDeviceInfo.getTagNumber());
tSpecialDeviceRecord.setDeviceId(tDeviceInfo.getId());
tSpecialDeviceRecord.setOperateCode(planCode);
tSpecialDeviceRecord.setOperateType("1");
......
......@@ -66,7 +66,7 @@ public class TRepairOrderServiceImpl implements ITRepairOrderService
TDeviceInfo tDeviceInfo = tDeviceInfoMapper.selectTDeviceInfoById(tRepairOrder.getDeviceId());
TSpecialDeviceRecord tSpecialDeviceRecord = new TSpecialDeviceRecord();
tSpecialDeviceRecord.setDeviceCode(tDeviceInfo.getDeviceCode());
tSpecialDeviceRecord.setTagNumber(tDeviceInfo.getTagNumber());
tSpecialDeviceRecord.setDeviceId(tDeviceInfo.getId());
tSpecialDeviceRecord.setOperateCode(repairCode);
tSpecialDeviceRecord.setOperateType("2");
......
<?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.TBreakRulesPersonRecordMapper">
<resultMap type="TBreakRulesPersonRecord" id="TBreakRulesPersonRecordResult">
<result property="breakRulesPersonId" column="break_rules_person_id" />
<result property="contractId" column="contract_id" />
<result property="breakRulesPersonName" column="break_rules_person_name" />
<result property="breakTime" column="break_time" />
<result property="breakPicUrl" column="break_pic_url" />
<result property="breakDescription" column="break_description" />
<result property="signature" column="signature" />
<result property="reportPerson" column="report_person" />
<result property="reportTime" column="report_time" />
<result property="isDel" column="is_del" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectTBreakRulesPersonRecordVo">
select break_rules_person_id, contract_id, break_rules_person_name, break_time, break_pic_url, break_description, signature, report_person, report_time, is_del, remark from t_break_rules_person_record
</sql>
<select id="selectTBreakRulesPersonRecordList" parameterType="TBreakRulesPersonRecord" resultMap="TBreakRulesPersonRecordResult">
<include refid="selectTBreakRulesPersonRecordVo"/>
<where>
<if test="contractId != null "> and contract_id = #{contractId}</if>
<if test="breakRulesPersonName != null and breakRulesPersonName != ''"> and break_rules_person_name like concat('%', #{breakRulesPersonName}, '%')</if>
<if test="breakTime != null "> and break_time = #{breakTime}</if>
<if test="breakPicUrl != null and breakPicUrl != ''"> and break_pic_url = #{breakPicUrl}</if>
<if test="breakDescription != null and breakDescription != ''"> and break_description = #{breakDescription}</if>
<if test="signature != null and signature != ''"> and signature = #{signature}</if>
<if test="reportPerson != null "> and report_person = #{reportPerson}</if>
<if test="reportTimeBegin != null and reportTimeEnd != null"> and report_time BETWEEN #{ reportTimeBegin } AND #{ reportTimeEnd }</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
ORDER BY report_time DESC
</select>
<select id="selectTBreakRulesPersonRecordById" parameterType="Long" resultMap="TBreakRulesPersonRecordResult">
<include refid="selectTBreakRulesPersonRecordVo"/>
where break_rules_person_id = #{breakRulesPersonId}
</select>
<insert id="insertTBreakRulesPersonRecord" parameterType="TBreakRulesPersonRecord" useGeneratedKeys="true" keyProperty="breakRulesPersonId">
insert into t_break_rules_person_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="contractId != null">contract_id,</if>
<if test="breakRulesPersonName != null">break_rules_person_name,</if>
<if test="breakTime != null">break_time,</if>
<if test="breakPicUrl != null">break_pic_url,</if>
<if test="breakDescription != null">break_description,</if>
<if test="signature != null">signature,</if>
<if test="reportPerson != null">report_person,</if>
<if test="reportTime != null">report_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="contractId != null">#{contractId},</if>
<if test="breakRulesPersonName != null">#{breakRulesPersonName},</if>
<if test="breakTime != null">#{breakTime},</if>
<if test="breakPicUrl != null">#{breakPicUrl},</if>
<if test="breakDescription != null">#{breakDescription},</if>
<if test="signature != null">#{signature},</if>
<if test="reportPerson != null">#{reportPerson},</if>
<if test="reportTime != null">#{reportTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateTBreakRulesPersonRecord" parameterType="TBreakRulesPersonRecord">
update t_break_rules_person_record
<trim prefix="SET" suffixOverrides=",">
<if test="contractId != null">contract_id = #{contractId},</if>
<if test="breakRulesPersonName != null">break_rules_person_name = #{breakRulesPersonName},</if>
<if test="breakTime != null">break_time = #{breakTime},</if>
<if test="breakPicUrl != null">break_pic_url = #{breakPicUrl},</if>
<if test="breakDescription != null">break_description = #{breakDescription},</if>
<if test="signature != null">signature = #{signature},</if>
<if test="reportPerson != null">report_person = #{reportPerson},</if>
<if test="reportTime != null">report_time = #{reportTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where break_rules_person_id = #{breakRulesPersonId}
</update>
<delete id="deleteTBreakRulesPersonRecordById" parameterType="Long">
delete from t_break_rules_person_record where break_rules_person_id = #{breakRulesPersonId}
</delete>
<delete id="deleteTBreakRulesPersonRecordByIds" parameterType="String">
delete from t_break_rules_person_record where break_rules_person_id in
<foreach item="breakRulesPersonId" collection="array" open="(" separator="," close=")">
#{breakRulesPersonId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -7,43 +7,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TDeviceInfo" id="TDeviceInfoResult">
<result property="id" column="id" />
<result property="deviceName" column="device_name" />
<result property="deviceCode" column="device_code" />
<result property="deviceStatus" column="device_status" />
<result property="deviceType" column="device_type" />
<result property="classify" column="classify" />
<result property="tagNumber" column="tag_number" />
<result property="specifications" column="specifications" />
<result property="function" column="function" />
<result property="medium" column="medium" />
<result property="manufactor" column="manufactor" />
<result property="shop" column="shop" />
<result property="commissionDate" column="commission_date" />
<result property="deviceStatus" column="device_status" />
<result property="deviceGrade" column="device_grade" />
<result property="installLocation" column="install_location" />
<result property="isCancel" column="is_cancel" />
<result property="isSpecial" column="is_special" />
<result property="responsiblePerson" column="responsible_person" />
<result property="responsiblePhone" column="responsible_phone" />
<result property="isDel" column="is_del" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="isCancel" column="is_cancel" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTDeviceInfoVo">
select id, device_name, device_code, device_status, device_type, tag_number, device_grade, install_location, is_special, responsible_person, responsible_phone, create_time, update_time, is_cancel, is_del, remarks from t_device_info
select id, device_name, device_type, classify, tag_number, specifications, function, medium, manufactor, shop, commission_date, device_status, device_grade, is_cancel, is_special, is_del, create_time, update_time from t_device_info
</sql>
<select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/>
<where> is_del = '0'
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code like concat('%', #{deviceCode}, '%')</if>
<if test="tagNumber != null and tagNumber != ''"> and tag_number like concat('%', #{tagNumber}, '%')</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
<if test="tagNumber != null and tagNumber != ''"> and tag_number = #{tagNumber}</if>
<if test="shop != null and shop != ''"> and shop = #{shop}</if>
<if test="deviceGrade != null and deviceGrade != ''"> and device_grade = #{deviceGrade}</if>
<if test="isSpecial != null and isSpecial != ''"> and is_special = #{isSpecial}</if>
<if test="isCancel != null and isCancel != ''"> and is_cancel = #{isCancel}</if>
<if test="responsiblePhone != null and responsiblePhone != ''"> and responsible_phone = #{responsiblePhone}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
AND date_format(commission_date,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
AND date_format(commission_date,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
</select>
......@@ -57,35 +58,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into t_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceName != null">device_name,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceStatus != null">device_status,</if>
<if test="deviceType != null">device_type,</if>
<if test="classify != null">classify,</if>
<if test="tagNumber != null">tag_number,</if>
<if test="specifications != null">specifications,</if>
<if test="function != null">function,</if>
<if test="medium != null">medium,</if>
<if test="manufactor != null">manufactor,</if>
<if test="shop != null">shop,</if>
<if test="commissionDate != null">commission_date,</if>
<if test="deviceStatus != null">device_status,</if>
<if test="deviceGrade != null">device_grade,</if>
<if test="installLocation != null">install_location,</if>
<if test="isCancel != null">is_cancel,</if>
<if test="isSpecial != null">is_special,</if>
<if test="responsiblePerson != null">responsible_person,</if>
<if test="responsiblePhone != null">responsible_phone,</if>
<if test="isDel != null">is_del,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceStatus != null">#{deviceStatus},</if>
<if test="deviceType != null">#{deviceType},</if>
<if test="classify != null">#{classify},</if>
<if test="tagNumber != null">#{tagNumber},</if>
<if test="specifications != null">#{specifications},</if>
<if test="function != null">#{function},</if>
<if test="medium != null">#{medium},</if>
<if test="manufactor != null">#{manufactor},</if>
<if test="shop != null">#{shop},</if>
<if test="commissionDate != null">#{commissionDate},</if>
<if test="deviceStatus != null">#{deviceStatus},</if>
<if test="deviceGrade != null">#{deviceGrade},</if>
<if test="installLocation != null">#{installLocation},</if>
<if test="isCancel != null">#{isCancel},</if>
<if test="isSpecial != null">#{isSpecial},</if>
<if test="responsiblePerson != null">#{responsiblePerson},</if>
<if test="responsiblePhone != null">#{responsiblePhone},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
......@@ -93,20 +100,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update t_device_info
<trim prefix="SET" suffixOverrides=",">
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
<if test="deviceType != null">device_type = #{deviceType},</if>
<if test="classify != null">classify = #{classify},</if>
<if test="tagNumber != null">tag_number = #{tagNumber},</if>
<if test="specifications != null">specifications = #{specifications},</if>
<if test="function != null">function = #{function},</if>
<if test="medium != null">medium = #{medium},</if>
<if test="manufactor != null">manufactor = #{manufactor},</if>
<if test="shop != null">shop = #{shop},</if>
<if test="commissionDate != null">commission_date = #{commissionDate},</if>
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
<if test="deviceGrade != null">device_grade = #{deviceGrade},</if>
<if test="installLocation != null">install_location = #{installLocation},</if>
<if test="isCancel != null">is_cancel = #{isCancel},</if>
<if test="isSpecial != null">is_special = #{isSpecial},</if>
<if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if>
<if test="responsiblePhone != null">responsible_phone = #{responsiblePhone},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="isCancel != null">is_cancel = #{isCancel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id} and is_del = '0'
</update>
......
import request from '@/utils/request'
// 查询违章人员记录列表
export function listRecord(query) {
return request({
url: '/breakRulesPerson/record/list',
method: 'get',
params: query
})
}
// 查询违章人员记录详细
export function getRecord(breakRulesPersonId) {
return request({
url: '/breakRulesPerson/record/' + breakRulesPersonId,
method: 'get'
})
}
// 新增违章人员记录
export function addRecord(data) {
return request({
url: '/breakRulesPerson/record',
method: 'post',
data: data
})
}
// 修改违章人员记录
export function updateRecord(data) {
return request({
url: '/breakRulesPerson/record',
method: 'put',
data: data
})
}
// 删除违章人员记录
export function delRecord(breakRulesPersonId) {
return request({
url: '/breakRulesPerson/record/' + breakRulesPersonId,
method: 'delete'
})
}
// 导出违章人员记录
export function exportRecord(query) {
return request({
url: '/breakRulesPerson/record/export',
method: 'get',
params: query
})
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="承包商" prop="contractId">
<el-select v-model="queryParams.contractId" placeholder="请选择承包商" clearable size="small">
<el-option
v-for="dict in contractorInfos"
:key="dict.id"
:label="dict.contractorName"
:value="dict.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="人员姓名" prop="breakRulesPersonName">
<el-input
v-model="queryParams.breakRulesPersonName"
placeholder="请输入人员姓名"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker
v-model="reportTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="上报开始日期"
end-placeholder="上报结束日期"
@change="dateFormat">
</el-date-picker>
</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"
v-hasPermi="['system:record:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:record:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:record:remove']"
>删除</el-button>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:record:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<!--<el-table-column type="selection" width="55" align="center" />-->
<!--<el-table-column label="违章id" align="center" prop="breakRulesPersonId" />-->
<el-table-column label="承包商" align="center" prop="contractId" :formatter="contractorFormate"/>
<el-table-column label="人员姓名" align="center" prop="breakRulesPersonName" />
<el-table-column label="违规时间" align="center" prop="breakTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.breakTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="违规照片" align="center" prop="breakPicUrl" >
<template slot-scope="scope">
<el-image style="height: 30px;width: 30px" size="small" :preview-src-list="[scope.row.breakPicUrl]" :src="scope.row.breakPicUrl" ></el-image>
</template>
</el-table-column>
<el-table-column label="违规说明" align="center" prop="breakDescription" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column label="电子签名" align="center" prop="signature" >
<template slot-scope="scope">
<el-image style="height: 30px;width: 30px" size="small" :preview-src-list="[scope.row.signature]" :src="scope.row.signature" ></el-image>
</template>
</el-table-column>
<el-table-column label="上报人" align="center" prop="reportPerson" :formatter="reportPersonFormate"/>
<el-table-column label="上报时间" align="center" prop="reportTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <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-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:record:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:record:remove']"
>删除</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="承包商id" prop="contractId">
<el-input v-model="form.contractId" placeholder="请输入承包商id" />
</el-form-item>
<el-form-item label="违规人员姓名" prop="breakRulesPersonName">
<el-input v-model="form.breakRulesPersonName" placeholder="请输入违规人员姓名" />
</el-form-item>
<el-form-item label="违规时间" prop="breakTime">
<el-date-picker clearable size="small"
v-model="form.breakTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择违规时间">
</el-date-picker>
</el-form-item>
<el-form-item label="违规照片" prop="breakPicUrl">
<el-input v-model="form.breakPicUrl" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="违规说明" prop="breakDescription">
<el-input v-model="form.breakDescription" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="电子签名" prop="signature">
<el-input v-model="form.signature" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="上报人" prop="reportPerson">
<el-input v-model="form.reportPerson" placeholder="请输入上报人" />
</el-form-item>
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="form.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
<el-form-item label="是否删除(0正常,1删除)" prop="isDel">
<el-input v-model="form.isDel" placeholder="请输入是否删除(0正常,1删除)" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</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>
</div>
</template>
<script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord, exportRecord } from "@/api/contractor/breakRulesPersonRecord";
import { listAll } from "@/api/contractor/contractorInfo";
import { getAllUserName } from "@/api/system/user"
export default {
name: "Record",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 违章人员记录表格数据
recordList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
contractId: null,
breakRulesPersonName: null,
breakTime: null,
breakPicUrl: null,
breakDescription: null,
signature: null,
reportPerson: null,
reportTime: null,
isDel: null,
reportTimeBegin:"",
reportTimeEnd:"",
},
// 表单参数
form: {},
// 表单校验
rules: {
},
//承包商信息
contractorInfos:[],
userInfo:[],
reportTime:[]
};
},
created() {
this.getList();
this.contractorInfo();
this.userInfos();
},
methods: {
/** 查询违章人员记录列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
breakRulesPersonId: null,
contractId: null,
breakRulesPersonName: null,
breakTime: null,
breakPicUrl: null,
breakDescription: null,
signature: null,
reportPerson: null,
reportTime: null,
isDel: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.reportTime = null;
this.queryParams.reportTimeBegin = null;
this.queryParams.reportTimeEnd = null;
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.breakRulesPersonId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加违章人员记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const breakRulesPersonId = row.breakRulesPersonId || this.ids
getRecord(breakRulesPersonId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改违章人员记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.breakRulesPersonId != null) {
updateRecord(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRecord(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const breakRulesPersonIds = row.breakRulesPersonId || this.ids;
this.$confirm('是否确认删除违章人员记录编号为"' + breakRulesPersonIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delRecord(breakRulesPersonIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有违章人员记录数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportRecord(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
//承包商信息
contractorInfo(){
listAll().then(res =>{
if(res.code == 200){
this.contractorInfos = res.data;
}
})
},
//承包商名称
contractorFormate(row){
const contrator = this.contractorInfos.find(contractor => contractor.id == row.contractId);
return contrator?contrator.contractorName:"";
},
userInfos(){
getAllUserName().then(res =>{
if(res.code == 200){
this.userInfo = res.data;
}
})
},
//上报人信息
reportPersonFormate(row){
const user = this.userInfo.find(user =>user.userId == row.reportPerson);
return user?user.nickName:"";
},
dateFormat(picker){
this.reportTime = picker;
this.queryParams.reportTimeBegin = picker[0];
this.queryParams.reportTimeEnd = picker[1];
},
}
};
</script>
......@@ -82,6 +82,12 @@
<el-table-column label="承包商状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-document-copy"
@click="detailInfo(scope.row)"
>详情</el-button>
<el-button
v-if="scope.row.status == '0'"
size="mini"
......@@ -238,12 +244,139 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 详情承包商信息对话框 -->
<el-dialog title="信息详情" :visible.sync="openDetail" width="800px" append-to-body>
<el-form label-width="120px">
<el-row>
<el-col :span="23">
<el-form-item label="单位名称:" prop="contractorName">
<span>{{ form.contractorName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="法定代表人:" prop="legalPerson">
<span>{{ form.legalPerson }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="法定代表人手机:" prop="legalPersonPhone">
<span>{{ form.legalPerson }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="主要负责人:" prop="keyPerson">
<span>{{ form.keyPerson }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主要负责人手机:" prop="keyPersonPhone">
<span>{{ form.keyPersonPhone }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="安全负责人:" prop="safetyPerson">
<span>{{ form.safetyPerson }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全负责人手机:" prop="safetyPersonPhone">
<span>{{ form.safetyPersonPhone }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="单位资质名称:" prop="certificateName">
<span>{{ form.certificateName }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="单位资质证照" prop="certificateUrl">
<img :src="form.certificateUrl" style="width: 20%;vertical-align:middle;cursor:pointer;" @click="showPicture(form)"/>
<el-image :zIndex="9999" :ref="'a'+form.id" :src="form.certificateUrl" v-show="false" :preview-src-list="[form.certificateUrl]" v-if="form.certificateUrl != '' && form.certificateUrl != null"></el-image>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="团队信息记录" prop="teamInformation">
<span>{{ form.teamInformation }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="违章记录" prop="violationRecords">
<el-table class="breakTable" v-loading="loading" :data="breakRulesPersonRecords" height="250px">
<el-table-column label="承包商" align="center" prop="contractId" :formatter="contractorFormate" width="180"/>
<el-table-column label="人员姓名" align="center" prop="breakRulesPersonName" />
<el-table-column label="违规时间" align="center" prop="breakTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.breakTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="违规照片" align="center" prop="breakPicUrl" >
<template slot-scope="scope">
<el-image style="height: 30px;width: 30px" size="small" :preview-src-list="[scope.row.breakPicUrl]" :src="scope.row.breakPicUrl" ></el-image>
</template>
</el-table-column>
<el-table-column label="违规说明" align="center" prop="breakDescription" min-width="100" :show-overflow-tooltip="true"/>
<el-table-column label="电子签名" align="center" prop="signature" >
<template slot-scope="scope">
<el-image style="height: 30px;width: 30px" size="small" :preview-src-list="[scope.row.signature]" :src="scope.row.signature" ></el-image>
</template>
</el-table-column>
<el-table-column label="上报人" align="center" prop="reportPerson" :formatter="reportPersonFormate"/>
<el-table-column label="上报时间" align="center" prop="reportTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="pageNum"
:limit.sync="pageSize"
@pagination="breakPersonRecords"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="承包商评定" prop="contractorEvaluate">
<el-radio-group v-model="form.contractorEvaluate" disabled>
<el-radio label="1"></el-radio>
<el-radio label="2"></el-radio>
<el-radio label="3"></el-radio>
</el-radio-group>
</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="openDetail = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import MyFileUpload from '@/components/MyFileUpload';
import { listContractorInfo, getContractorInfo, delContractorInfo, addContractorInfo, updateContractorInfo, exportContractorInfo } from "@/api/contractor/contractorInfo";
import { listContractorInfo, getContractorInfo, delContractorInfo, addContractorInfo, updateContractorInfo, exportContractorInfo,listAll } from "@/api/contractor/contractorInfo";
import { listRecord } from "@/api/contractor/breakRulesPersonRecord";
import { getAllUserName } from "@/api/system/user"
export default {
name: "ContractorInfo",
......@@ -304,7 +437,17 @@ export default {
contractorName: [
{ required: true, message: "请输入单位名称", trigger: "blur" }
],
}
},
openDetail:false,
breakRulesPersonRecords: [],
//承包商信息
contractorInfos:[],
userInfo:[],
// 总条数
total: 0,
pageNum: 1,
pageSize: 10,
contractId:""
};
},
created() {
......@@ -315,6 +458,8 @@ export default {
this.getDicts("t_contractor_status").then(response => {
this.statusOptions = response.data;
});
this.contractorInfo();
this.userInfos();
},
methods: {
// 承包商评定
......@@ -397,6 +542,20 @@ export default {
this.title = "修改承包商信息";
});
},
detailInfo(row){
const id = row.id || this.ids
getContractorInfo(id).then(response => {
this.form = response.data;
if (this.form.certificateUrl) {
this.fileList.push({
url: this.form.certificateUrl,
});
}
this.openDetail = true;
this.contractId = id;
this.breakPersonRecords();
});
},
/** 审核按钮操作 */
handleApproval(row) {
this.readOnly = true;
......@@ -491,6 +650,51 @@ export default {
this.$refs['a'+row.id].showViewer = true;
console.log("===",row.id);
},
breakPersonRecords(){
listRecord({contractId : this.contractId,pageNum:this.pageNum,pageSize:this.pageSize}).then(res =>{
if(res.code == 200){
this.breakRulesPersonRecords = res.rows;
this.total = res.total;
}
})
},
//承包商信息
contractorInfo(){
listAll().then(res =>{
if(res.code == 200){
this.contractorInfos = res.data;
}
})
},
//承包商名称
contractorFormate(row){
const contrator = this.contractorInfos.find(contractor => contractor.id == row.contractId);
return contrator?contrator.contractorName:"";
},
userInfos(){
getAllUserName().then(res =>{
if(res.code == 200){
this.userInfo = res.data;
}
})
},
//上报人信息
reportPersonFormate(row){
const user = this.userInfo.find(user =>user.userId == row.reportPerson);
return user?user.nickName:"";
},
}
};
</script>
<style lang="scss">
// 滚动条的宽度
.breakTable .el-table__body-wrapper::-webkit-scrollbar {
width: 8px; // 横向滚动条
height: 8px; // 纵向滚动条 必写
}
// 滚动条的滑块
.breakTable .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #ddd;
border-radius: 3px;
}
</style>
......@@ -10,16 +10,16 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="deviceCode">
<el-form-item label="设备位号" prop="tagNumber">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编码"
v-model="queryParams.tagNumber"
placeholder="请输入设备位号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<!--<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
<el-option
v-for = "dict in typeOptions"
......@@ -28,6 +28,16 @@
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>-->
<el-form-item label="所属车间" prop="shop">
<el-select v-model="queryParams.shop" placeholder="请选择所属车间" clearable size="small">
<el-option
v-for = "dict in shopOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="是否报废" prop="isCancel">
<el-select v-model="queryParams.isCancel" placeholder="请选择是否报废" clearable size="small">
......@@ -75,36 +85,34 @@
<el-table v-loading="loading" :data="deviceInfoList" >
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编码" align="center" prop="deviceCode" >
<el-table-column label="设备位号" align="center" prop="tagNumber" >
<template slot-scope="scope">
<span v-if="scope.row.deviceCode == '' || scope.row.deviceCode == null">-</span>
<span v-else>{{scope.row.deviceCode}}</span>
<span v-if="scope.row.tagNumber == '' || scope.row.tagNumber == null">-</span>
<span v-else>{{scope.row.tagNumber}}</span>
</template>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType">
<el-table-column label="介质" align="center" prop="medium" >
<template slot-scope="scope">
<span v-if="scope.row.deviceType == '' || scope.row.deviceType == null">-</span>
<span v-if="scope.row.deviceType == '1'">液位探测器</span>
<span v-if="scope.row.deviceType == '2'">气体探测器</span>
<span v-if="scope.row.deviceType == '3'">液压力探测器</span>
<span v-if="scope.row.medium == '' || scope.row.medium == null">-</span>
<span v-else>{{scope.row.medium}}</span>
</template>
</el-table-column>
<el-table-column label="设备等级" align="center" prop="deviceGrade">
<el-table-column label="所属车间" align="center" prop="shop" :formatter="shopFormat" />
<el-table-column label="设备分类" align="center" prop="classify" :formatter="classifyFormat" />
<el-table-column label="设备状态" align="center" prop="deviceStatus" :formatter="statusFormat" />
<el-table-column label="分级" align="center" prop="deviceGrade" >
<template slot-scope="scope">
<span v-if="scope.row.deviceGrade == '' || scope.row.deviceGrade == null">-</span>
<span v-if="scope.row.deviceGrade == '1'">一级危险源</span>
<span v-if="scope.row.deviceGrade == '2'">二级危险源</span>
<span v-if="scope.row.deviceGrade == '3'">三级危险源</span>
<span v-else>{{scope.row.deviceGrade}}</span>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" prop="deviceStatus" :formatter="statusFormat" />
<el-table-column label="是否报废" align="center" prop="isCancel" >
<template slot-scope="scope">
<span v-if="scope.row.isCancel == '0'"></span>
<span v-if="scope.row.isCancel == '1'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button
v-if="scope.row.isCancel=='0'"
......@@ -120,6 +128,13 @@
icon="el-icon-edit"
@click="handleCancel(scope.row)"
>报废</el-button>
<el-button
v-if="scope.row.isCancel=='0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
......@@ -144,33 +159,47 @@
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
<el-input v-model="form.deviceName" placeholder="请输入设备名称" :disabled="readOnly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编码" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编码" />
<el-form-item label="设备位号" prop="tagNumber">
<el-input v-model="form.tagNumber" placeholder="请输入设备位号" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型" clearable size="small" style="width: 100%">
<el-option
v-for = "dict in typeOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
/>
</el-select>
<el-form-item label="介质" prop="medium">
<el-input v-model="form.medium" placeholder="请输入介质" :disabled="readOnly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备等级" prop="deviceGrade">
<el-select v-model="form.deviceGrade" placeholder="请选择设备等级" clearable size="small" style="width: 100%">
<el-form-item label="制造厂家" prop="manufactor">
<el-input v-model="form.manufactor" placeholder="请输入规格" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="规格" prop="specifications">
<el-input v-model="form.specifications" placeholder="请输入规格" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="技术性能" prop="function">
<el-input type="textarea" v-model="form.function" placeholder="请输入技术性能" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="所属车间" prop="shop">
<el-select v-model="form.shop" placeholder="请选择所属车间" clearable size="small" style="width: 100%" :disabled="readOnly">
<el-option
v-for = "dict in gradeOptions"
v-for = "dict in shopOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
......@@ -178,43 +207,53 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!--<el-col :span="11">
<el-form-item label="是否特种设备" prop="isSpecial">
<el-select v-model="form.isSpecial" placeholder="请选择是否特种设备" clearable size="small" style="width: 100%">
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
<el-col :span="12">
<el-form-item label="投运时间" prop="commissionDate">
<el-date-picker clearable size="small" :disabled="readOnly"
v-model="form.commissionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择投运时间"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>-->
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="位号" prop="tagNumber">
<el-input v-model="form.tagNumber" placeholder="请输入位号" />
<el-form-item label="设备分类" prop="classify">
<el-select v-model="form.classify" placeholder="请选择设备分类" clearable size="small" style="width: 100%" :disabled="readOnly">
<el-option
v-for = "dict in classifyOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安装位置" prop="installLocation">
<el-input v-model="form.installLocation" placeholder="请输入安装位置" />
<el-form-item label="分级" prop="deviceGrade">
<el-input v-model="form.deviceGrade" placeholder="请输入分级" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="负责人" prop="responsiblePerson">
<el-input v-model="form.responsiblePerson" placeholder="请输入负责人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人电话" prop="responsiblePhone">
<el-input v-model="form.responsiblePhone" placeholder="请输入负责人电话" />
<el-form-item label="设备状态" prop="deviceStatus">
<el-select v-model="form.deviceStatus" placeholder="请选择设备状态" clearable size="small" style="width: 100%" :disabled="readOnly">
<el-option
v-for = "dict in statusOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer" v-show="!readOnly">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
......@@ -240,7 +279,7 @@
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的设备数据
<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的设备数据-->
<el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
</div>
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
......@@ -279,29 +318,29 @@ export default {
total: 0,
// 设备信息管理表格数据
deviceInfoList: [],
// 设备类型数据字典
typeOptions: [],
// 设备状态数据字典
statusOptions: [],
// 设备等级数据字典
gradeOptions: [],
// 所属车间数据字典
shopOptions: [],
// 设备分类数据字典
classifyOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
readOnly: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceName: null,
deviceCode: null,
deviceStatus: null,
deviceType: null,
tagNumber: null,
shop: null,
deviceGrade: null,
isSpecial: "0",
isCancel: null,
responsiblePhone: null,
},
// 设备导入参数
upload: {
......@@ -325,45 +364,42 @@ export default {
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" }
],
/*deviceCode: [
{ required: true, message: "请输入设备编号", trigger: "blur" }
shop: [
{ required: true, message: "请选择所属车间", trigger: "blur" }
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" }
classify: [
{ required: true, message: "请选择设备分类", trigger: "blur" }
],
deviceStatus: [
{ required: true, message: "请选择设备状态", trigger: "blur" }
],
deviceGrade: [
{ required: true, message: "请选择设备等级", trigger: "blur" }
],*/
/*isSpecial: [
{ required: true, message: "请选择是否特种装备", trigger: "blur" }
],*/
}
};
},
created() {
this.getList();
this.getDicts("t_device_type").then(response =>{
this.typeOptions = response.data;
this.getDicts("t_classify").then(response =>{
this.classifyOptions = response.data;
})
this.getDicts("t_device_status").then(response =>{
this.statusOptions = response.data;
})
this.getDicts("t_device_grade").then(response =>{
this.gradeOptions = response.data;
this.getDicts("t_shop").then(response =>{
this.shopOptions = response.data;
})
},
methods: {
// 设备类型
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.deviceType);
// 设备分类
classifyFormat(row, column) {
return this.selectDictLabel(this.classifyOptions, row.classify);
},
// 设备状态
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.deviceStatus);
},
// 设备等级
gradeFormat(row, column) {
return this.selectDictLabel(this.gradeOptions, row.deviceGrade);
// 所属车间
shopFormat(row, column) {
return this.selectDictLabel(this.shopOptions, row.shop);
},
/** 查询设备信息管理列表 */
getList() {
......@@ -384,15 +420,18 @@ export default {
this.form = {
id: null,
deviceName: null,
deviceCode: null,
deviceStatus: "0",
deviceStatus: null,
deviceType: null,
tagNumber: null,
deviceGrade: null,
installLocation: null,
classify: null,
specifications: null,
function: null,
medium: null,
manufactor: null,
shop: null,
isSpecial: "0",
responsiblePerson: null,
responsiblePhone: null,
commissionDate: null,
createTime: null,
updateTime: null,
isDel: null
......@@ -411,12 +450,14 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.readOnly=false;
this.reset();
this.open = true;
this.title = "添加设备信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.readOnly=false;
this.reset();
const id = row.id || this.ids
getDeviceInfo(id).then(response => {
......@@ -461,10 +502,20 @@ export default {
this.msgSuccess("报废成功");
}).catch(() => {});
},
/** 详情按钮操作 */
handleDetail(row) {
this.readOnly=true;
this.reset();
getDeviceInfo(row.id).then(response => {
this.form = response.data;
this.open = true;
this.title = "设备信息详情";
});
},
/** 删除按钮操作 */
handleDelete(row) {
// const ids = row.id || this.ids;
this.$confirm('是否确认删除设备编号为"' + row.deviceCode + '"的数据项?', "警告", {
this.$confirm('是否确认删除"' + row.deviceName + '"?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -493,7 +544,7 @@ export default {
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.title = "设备导入";
this.upload.open = true;
},
/** 下载模板操作 */
......
......@@ -10,16 +10,16 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编码" prop="deviceCode">
<el-form-item label="设备位号" prop="tagNumber">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编码"
v-model="queryParams.tagNumber"
placeholder="请输入设备位号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<!--<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
<el-option
v-for = "dict in typeOptions"
......@@ -28,6 +28,16 @@
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>-->
<el-form-item label="所属车间" prop="shop">
<el-select v-model="queryParams.shop" placeholder="请选择所属车间" clearable size="small">
<el-option
v-for = "dict in shopOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="是否报废" prop="isCancel">
<el-select v-model="queryParams.isCancel" placeholder="请选择是否报废" clearable size="small">
......@@ -75,36 +85,35 @@
<el-table v-loading="loading" :data="deviceInfoList" >
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编码" align="center" prop="deviceCode" >
<el-table-column label="设备位号" align="center" prop="tagNumber" >
<template slot-scope="scope">
<span v-if="scope.row.deviceCode == '' || scope.row.deviceCode == null">-</span>
<span v-else>{{scope.row.deviceCode}}</span>
<span v-if="scope.row.tagNumber == '' || scope.row.tagNumber == null">-</span>
<span v-else>{{scope.row.tagNumber}}</span>
</template>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType">
<el-table-column label="介质" align="center" prop="medium" >
<template slot-scope="scope">
<span v-if="scope.row.deviceType == '' || scope.row.deviceType == null">-</span>
<span v-if="scope.row.deviceType == '1'">液位探测器</span>
<span v-if="scope.row.deviceType == '2'">气体探测器</span>
<span v-if="scope.row.deviceType == '3'">液压力探测器</span>
<span v-if="scope.row.medium == '' || scope.row.medium == null">-</span>
<span v-else>{{scope.row.medium}}</span>
</template>
</el-table-column>
<el-table-column label="设备等级" align="center" prop="deviceGrade">
<el-table-column label="所属车间" align="center" prop="shop" :formatter="shopFormat" />
<el-table-column label="设备类型" align="center" prop="deviceType" :formatter="typeFormat" width="200" />
<el-table-column label="设备分类" align="center" prop="classify" :formatter="classifyFormat" />
<el-table-column label="设备状态" align="center" prop="deviceStatus" :formatter="statusFormat" />
<el-table-column label="分级" align="center" prop="deviceGrade" >
<template slot-scope="scope">
<span v-if="scope.row.deviceGrade == '' || scope.row.deviceGrade == null">-</span>
<span v-if="scope.row.deviceGrade == '1'">一级危险源</span>
<span v-if="scope.row.deviceGrade == '2'">二级危险源</span>
<span v-if="scope.row.deviceGrade == '3'">三级危险源</span>
<span v-else>{{scope.row.deviceGrade}}</span>
</template>
</el-table-column>
<el-table-column label="设备状态" align="center" prop="deviceStatus" :formatter="statusFormat" />
<el-table-column label="是否报废" align="center" prop="isCancel" >
<template slot-scope="scope">
<span v-if="scope.row.isCancel == '0'"></span>
<span v-if="scope.row.isCancel == '1'"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope">
<el-button
v-if="scope.row.isCancel=='0'"
......@@ -120,6 +129,13 @@
icon="el-icon-edit"
@click="handleCancel(scope.row)"
>报废</el-button>
<el-button
v-if="scope.row.isCancel=='0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button
size="mini"
type="text"
......@@ -144,21 +160,47 @@
<el-row>
<el-col :span="11">
<el-form-item label="设备名称" prop="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
<el-input v-model="form.deviceName" placeholder="请输入设备名称" :disabled="readOnly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备编码" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编码" />
<el-form-item label="设备位号" prop="tagNumber">
<el-input v-model="form.tagNumber" placeholder="请输入设备位号" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型" clearable size="small" style="width: 100%">
<el-form-item label="介质" prop="medium">
<el-input v-model="form.medium" placeholder="请输入介质" :disabled="readOnly" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="制造厂家" prop="manufactor">
<el-input v-model="form.manufactor" placeholder="请输入规格" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="规格" prop="specifications">
<el-input v-model="form.specifications" placeholder="请输入规格" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="技术性能" prop="function">
<el-input type="textarea" v-model="form.function" placeholder="请输入技术性能" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="所属车间" prop="shop">
<el-select v-model="form.shop" placeholder="请选择所属车间" clearable size="small" style="width: 100%" :disabled="readOnly">
<el-option
v-for = "dict in typeOptions"
v-for = "dict in shopOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
......@@ -167,10 +209,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="设备等级" prop="deviceGrade">
<el-select v-model="form.deviceGrade" placeholder="请选择设备等级" clearable size="small" style="width: 100%">
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型" clearable size="small" style="width: 100%" :disabled="readOnly">
<el-option
v-for = "dict in gradeOptions"
v-for = "dict in typeOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
......@@ -179,42 +221,52 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<!--<el-col :span="11">
<el-form-item label="是否特种设备" prop="isSpecial">
<el-select v-model="form.isSpecial" placeholder="请选择是否特种设备" clearable size="small" style="width: 100%">
<el-option label="否" value="0" />
<el-option label="是" value="1" />
</el-select>
</el-form-item>
</el-col>-->
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="位号" prop="tagNumber">
<el-input v-model="form.tagNumber" placeholder="请输入位号" />
<el-form-item label="设备分类" prop="classify">
<el-select v-model="form.classify" placeholder="请选择设备分类" clearable size="small" style="width: 100%" :disabled="readOnly">
<el-option
v-for = "dict in classifyOptions"
:key = "dict.dictValue"
:label = "dict.dictLabel"
:value = "dict.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安装位置" prop="installLocation">
<el-input v-model="form.installLocation" placeholder="请输入安装位置" />
<el-form-item label="投运时间" prop="commissionDate">
<el-date-picker clearable size="small" :disabled="readOnly"
v-model="form.commissionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择投运时间"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="负责人" prop="responsiblePerson">
<el-input v-model="form.responsiblePerson" placeholder="请输入负责人" />
<el-form-item label="设备状态" prop="deviceStatus">
<el-select v-model="form.deviceStatus" placeholder="请选择设备状态" clearable size="small" style="width: 100%" :disabled="readOnly">
<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="12">
<el-form-item label="负责人电话" prop="responsiblePhone">
<el-input v-model="form.responsiblePhone" placeholder="请输入负责人电话" />
<el-form-item label="分级" prop="deviceGrade">
<el-input v-model="form.deviceGrade" placeholder="请输入分级" :disabled="readOnly" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<div slot="footer" class="dialog-footer" v-show="!readOnly">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
......@@ -240,7 +292,7 @@
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的设备数据
<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的设备数据-->
<el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
</div>
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
......@@ -283,25 +335,27 @@ export default {
typeOptions: [],
// 设备状态数据字典
statusOptions: [],
// 设备等级数据字典
gradeOptions: [],
// 所属车间数据字典
shopOptions: [],
// 设备分类数据字典
classifyOptions: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
readOnly: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceName: null,
deviceCode: null,
deviceStatus: null,
deviceType: null,
tagNumber: null,
shop: null,
deviceGrade: null,
isSpecial: "1",
isCancel: null,
responsiblePhone: null,
},
// 设备导入参数
upload: {
......@@ -325,18 +379,18 @@ export default {
deviceName: [
{ required: true, message: "请输入设备名称", trigger: "blur" }
],
/*deviceCode: [
{ required: true, message: "请输入设备编号", trigger: "blur" }
shop: [
{ required: true, message: "请选择所属车间", trigger: "blur" }
],
classify: [
{ required: true, message: "请选择设备分类", trigger: "blur" }
],
deviceStatus: [
{ required: true, message: "请选择设备状态", trigger: "blur" }
],
deviceType: [
{ required: true, message: "请选择设备类型", trigger: "blur" }
],
deviceGrade: [
{ required: true, message: "请选择设备等级", trigger: "blur" }
],*/
/*isSpecial: [
{ required: true, message: "请选择是否特种装备", trigger: "blur" }
],*/
}
};
},
......@@ -351,6 +405,12 @@ export default {
this.getDicts("t_device_grade").then(response =>{
this.gradeOptions = response.data;
})
this.getDicts("t_classify").then(response =>{
this.classifyOptions = response.data;
})
this.getDicts("t_shop").then(response =>{
this.shopOptions = response.data;
})
},
methods: {
// 设备类型
......@@ -361,9 +421,13 @@ export default {
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.deviceStatus);
},
// 设备等级
gradeFormat(row, column) {
return this.selectDictLabel(this.gradeOptions, row.deviceGrade);
// 设备分类
classifyFormat(row, column) {
return this.selectDictLabel(this.classifyOptions, row.classify);
},
// 所属车间
shopFormat(row, column) {
return this.selectDictLabel(this.shopOptions, row.shop);
},
/** 查询设备信息管理列表 */
getList() {
......@@ -384,15 +448,18 @@ export default {
this.form = {
id: null,
deviceName: null,
deviceCode: null,
deviceStatus: "0",
deviceStatus: null,
deviceType: null,
tagNumber: null,
deviceGrade: null,
installLocation: null,
classify: null,
specifications: null,
function: null,
medium: null,
manufactor: null,
shop: null,
isSpecial: "1",
responsiblePerson: null,
responsiblePhone: null,
commissionDate: null,
createTime: null,
updateTime: null,
isDel: null
......@@ -411,18 +478,20 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.readOnly=false;
this.reset();
this.open = true;
this.title = "添加设备信息";
this.title = "添加特种设备信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.readOnly=false;
this.reset();
const id = row.id || this.ids
getDeviceInfo(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备信息";
this.title = "修改特种设备信息";
});
},
/** 提交按钮 */
......@@ -461,10 +530,20 @@ export default {
this.msgSuccess("报废成功");
}).catch(() => {});
},
/** 详情按钮操作 */
handleDetail(row) {
this.readOnly=true;
this.reset();
getDeviceInfo(row.id).then(response => {
this.form = response.data;
this.open = true;
this.title = "特种设备信息详情";
});
},
/** 删除按钮操作 */
handleDelete(row) {
// const ids = row.id || this.ids;
this.$confirm('是否确认删除设备编号为"' + row.deviceCode + '"的数据项?', "警告", {
this.$confirm('是否确认删除"' + row.deviceName + '"?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -479,7 +558,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有设备信息管理数据项?', "警告", {
this.$confirm('是否确认导出所有特种设备信息管理数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
......@@ -493,7 +572,7 @@ export default {
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.title = "特种设备导入";
this.upload.open = true;
},
/** 下载模板操作 */
......
......@@ -78,7 +78,7 @@
<span v-else>-</span>
</template>
</el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />-->
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
......@@ -95,7 +95,7 @@
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button
<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
......@@ -108,6 +108,7 @@
type="text"
icon="el-icon-edit"
@click="handleApproval(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>审批</el-button>
<el-button
v-if="scope.row.status == '2'"
......@@ -115,7 +116,8 @@
type="text"
icon="el-icon-edit"
@click="handleInvalid(scope.row)"
>作废</el-button>-->
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>作废</el-button>
<el-button
size="mini"
type="text"
......@@ -176,10 +178,10 @@
</span>
<span v-else>-</span>
</el-form-item>
<!--<el-form-item v-show="operate" label="审批" prop="status">
<el-form-item v-show="operate" label="审批" prop="status">
<el-radio v-model="form.status" label="2">通过</el-radio>
<el-radio v-model="form.status" label="0">驳回</el-radio>
</el-form-item>-->
</el-form-item>
</div>
<div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">制度内容</div>
......@@ -312,6 +314,7 @@ export default {
};
this.resetForm("form");
this.fileList = [];
this.operate=false;
},
/** 搜索按钮操作 */
handleQuery() {
......@@ -362,7 +365,7 @@ export default {
},
/** 审批按钮操作 */
handleApproval(row) {
this.readOnly = true;
this.readOnly = false;
this.reset();
const systemId = row.systemId || this.ids
getEnterpriseSystem(systemId).then(response => {
......
......@@ -84,9 +84,9 @@
<span v-else>-</span>
</template>
</el-table-column>
<!-- <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="120px" />-->
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="120px" />
<el-table-column label="创建时间" align="center" prop="createTime" width="150px" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210px" >
<template slot-scope="scope">
<el-button
size="mini"
......@@ -101,12 +101,13 @@
icon="el-icon-edit"
@click="handleDetail(scope.row)"
>详情</el-button>
<!--<el-button
<el-button
v-if="scope.row.status == '0'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handlePublish(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>发布</el-button>
<el-button
v-if="scope.row.status == '1'"
......@@ -114,6 +115,7 @@
type="text"
icon="el-icon-edit"
@click="handleApproval(scope.row)"
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>审批</el-button>
<el-button
v-if="scope.row.status == '2'"
......@@ -121,7 +123,8 @@
type="text"
icon="el-icon-edit"
@click="handleInvalid(scope.row)"
>作废</el-button>-->
v-hasPermi="['safetyManagement:enterpriseSystem:edit']"
>作废</el-button>
<el-button
size="mini"
type="text"
......@@ -198,10 +201,10 @@
</span>
<span v-else>-</span>
</el-form-item>
<!--<el-form-item v-show="operate" label="审批" prop="status">
<el-form-item v-show="operate" label="审批" prop="status">
<el-radio v-model="form.status" label="2">通过</el-radio>
<el-radio v-model="form.status" label="0">驳回</el-radio>
</el-form-item>-->
</el-form-item>
</div>
<div style="width: 58%;margin-left: 2%">
<div class="dialogTitle">法律法规内容</div>
......@@ -333,6 +336,7 @@ export default {
};
this.resetForm("form");
this.fileList = [];
this.operate=false;
},
/** 搜索按钮操作 */
handleQuery() {
......
<template>
<!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">s -->
<!-- <el-tab-pane label="报警列表" name="first"> -->
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="报警类型" prop="alarmContent">
<el-select v-model="queryParams.alarmContent" placeholder="请选择预警类型">
<el-option
v-for="dict in alarmContentOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警级别" prop="alarmLevel">
<el-select v-model="queryParams.alarmLevel" placeholder="请选择报警级别">
<el-option
v-for="dict in alarmLevelOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="报警状态" prop="alarmStatus">
<el-select v-model="queryParams.alarmStatus" placeholder="请选择报警状态" clearable size="small">
<el-option label="正在报警" value="0" />
<el-option label="自动消警" value="1" />
<el-option label="手动消警" value="2" />
</el-select>
</el-form-item> -->
<el-form-item label="报警时间" prop="alarmStatus">
<el-time-picker
is-range
v-model="queryParams.alarmStatus"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围">
</el-time-picker>
</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="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:alarm:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="alarmList" @selection-change="handleSelectionChange">
<!--<el-table-column type="selection" width="55" align="center" />-->
<!--<el-table-column label="id" align="center" prop="alarmId" />-->
<el-table-column label="报警设备" align="center" prop="deviceName" />
<el-table-column label="预警类型" align="center" prop="alarmContent" :formatter="alarmContentFormat" />
<el-table-column label="报警级别" align="center" prop="alarmLevel" >
<template slot-scope="scope">
<span :style="colorList[scope.row.alarmLevel]" >{{alarmLevelFormat(scope.row,null)}}</span>
</template>
</el-table-column>
<!--:formatter="alarmLevelFormat"-->
<el-table-column label="报警开始时间" align="center" prop="alarmBeginTime" width="180"/>
<el-table-column label="报警结束时间" align="center" prop="alarmEndTime" width="180"/>
<el-table-column label="报警状态" align="center" prop="alarmStatus" >
<template slot-scope="scope">
<span style="color: red" v-if="scope.row.alarmStatus==0">正在报警</span>
<span v-if="scope.row.alarmStatus==1">自动消警</span>
<span v-if="scope.row.alarmStatus==2">手动消警</span>
</template>
<span></span>
<span></span>
</el-table-column>
<el-table-column label="预警图片" align="center" prop="alarmImageUrl" >
<template slot-scope="scope">
<img :src="scope.row.alarmImageUrl" style="width: 20%;vertical-align:middle;cursor:pointer;" @click="showPicture(scope.row)"/>
<el-image :ref="'a'+scope.row.id" :src="scope.row.alarmImageUrl" v-show="false" :preview-src-list="[scope.row.alarmImageUrl]" v-if="scope.row.alarmImageUrl != '' && scope.row.alarmImageUrl != null"></el-image>
</template>
</el-table-column>
<el-table-column label="预警值" align="center" prop="alarmVaule" />
<!--<el-table-column label="备注" align="center" prop="remarks" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
v-if="scope.row.alarmStatus==0"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleXiao(scope.row)"
>手动消警</el-button>
<!--<el-button-->
<!--size="mini"-->
<!--type="text"-->
<!--icon="el-icon-delete"-->
<!--@click="handleDelete(scope.row)"-->
<!--v-hasPermi="['system:alarm:remove']"-->
<!--&gt;删除</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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="关联设备id" prop="relationDeviceId">
<el-input v-model="form.relationDeviceId" placeholder="请输入关联设备id" />
</el-form-item>
<el-form-item label="预警类型" prop="alarmContent">
<el-select v-model="form.alarmContent" placeholder="请选择预警类型">
<el-option
v-for="dict in alarmContentOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="报警级别" prop="alarmLevel">
<el-select v-model="form.alarmLevel" placeholder="请选择报警级别">
<el-option
v-for="dict in alarmLevelOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="预警开始时间" prop="alarmBeginTime">
<el-date-picker clearable size="small"
v-model="form.alarmBeginTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择预警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="预警结束时间" prop="alarmEndTime">
<el-date-picker clearable size="small"
v-model="form.alarmEndTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择预警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="预警图片" prop="alarmImageUrl">
<el-input v-model="form.alarmImageUrl" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="预警值" prop="alarmVaule">
<el-input v-model="form.alarmVaule" placeholder="请输入预警值" />
</el-form-item>
<!--<el-form-item label="备注" prop="remarks">-->
<!--<el-input v-model="form.remarks" placeholder="请输入备注" />-->
<!--</el-form-item>-->
</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>
</div>
<!-- </el-tab-pane> -->
<!-- <el-tab-pane label="报警统计" name="second">
<div style="width: 100%;">
<chartindex></chartindex>
</div>
</el-tab-pane> -->
<!-- </el-tabs> -->
</template>
<script>
import { listAlarm, getAlarm, delAlarm, addAlarm, updateAlarm, exportAlarm,getStatistics } from "@/api/system/alarm";
import chartindex from "@/views/system/alarm/chartindex";
export default {
name: "Alarm",
components: {
chartindex,
},
data() {
return {
// 遮罩层
loading: true,
activeName: 'second',
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 报警记录表格数据
alarmList: [],
colorList:[
"color:red",
"color:red;font-weight: bolder;",
"color:#ff7744",
"color:#ffaa33",
"color:#bbbb00",
"color:#ccff33",
],
ceshi:"color:#ff00ff",
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 预警类型字典
alarmContentOptions: [],
// 报警级别字典
alarmLevelOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
alarmBeginTime: null,
alarmEndTime: null,
alarmStatus: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
this.getDicts("t_alarm_content").then(response => {
this.alarmContentOptions = response.data;
});
this.getDicts("t_alarm_level").then(response => {
this.alarmLevelOptions = response.data;
});
},
methods: {
/** 查询报警记录列表 */
getList() {
this.loading = true;
listAlarm(this.queryParams).then(response => {
// this.alarmList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 预警类型字典翻译
alarmContentFormat(row, column) {
return this.selectDictLabel(this.alarmContentOptions, row.alarmContent);
},
// 报警级别字典翻译
alarmLevelFormat(row, column) {
return this.selectDictLabel(this.alarmLevelOptions, row.alarmLevel);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
alarmId: null,
relationDeviceId: null,
alarmContent: null,
alarmLevel: null,
alarmBeginTime: null,
alarmEndTime: null,
alarmStatus: "0",
alarmImageUrl: null,
alarmVaule: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//tabs切换
handleClick(tab, event) {
console.log(tab, event);
},
showPicture(row){
this.$refs['a'+row.id].showViewer = true;
console.log("===",row.id);
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.alarmId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报警记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const alarmId = row.alarmId || this.ids
getAlarm(alarmId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报警记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.alarmId != null) {
updateAlarm(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAlarm(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const alarmIds = row.alarmId || this.ids;
this.$confirm('是否确认删除报警记录编号为"' + alarmIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delAlarm(alarmIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
handleXiao(row) {
const alarmIds = row.alarmId || this.ids;
this.$confirm('是否确认消除这项报警状态?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return updateAlarm({alarmId:row.alarmId,alarmStatus:2});
}).then(() => {
this.getList();
this.msgSuccess("手动消警成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有报警记录数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportAlarm(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
......@@ -23,7 +23,7 @@
<kaptcha.version>2.3.2</kaptcha.version>
<mybatis-spring-boot.version>2.1.4</mybatis-spring-boot.version>
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
<fastjson.version>1.2.76</fastjson.version>
<fastjson.version>1.2.83</fastjson.version>
<oshi.version>5.6.0</oshi.version>
<jna.version>5.7.0</jna.version>
<commons.io.version>2.5</commons.io.version>
......
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