parent
9b50ddaafc
commit
2fd44d2311
@ -0,0 +1,98 @@
|
|||||||
|
package com.ruoyi.szxc.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcZcssxj;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcZcssxjService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产设施巡检Controller
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-04-02
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/szxc/zcssxj")
|
||||||
|
public class SzxcZcssxjController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ISzxcZcssxjService szxcZcssxjService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:zcssxj:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SzxcZcssxj> list = szxcZcssxjService.selectSzxcZcssxjList(szxcZcssxj);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出资产设施巡检列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:zcssxj:export')")
|
||||||
|
@Log(title = "资产设施巡检", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
List<SzxcZcssxj> list = szxcZcssxjService.selectSzxcZcssxjList(szxcZcssxj);
|
||||||
|
ExcelUtil<SzxcZcssxj> util = new ExcelUtil<SzxcZcssxj>(SzxcZcssxj.class);
|
||||||
|
util.exportExcel(response, list, "资产设施巡检数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取资产设施巡检详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:zcssxj:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(szxcZcssxjService.selectSzxcZcssxjById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资产设施巡检
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:zcssxj:add')")
|
||||||
|
@Log(title = "资产设施巡检", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
return toAjax(szxcZcssxjService.insertSzxcZcssxj(szxcZcssxj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改资产设施巡检
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:zcssxj:edit')")
|
||||||
|
@Log(title = "资产设施巡检", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
return toAjax(szxcZcssxjService.updateSzxcZcssxj(szxcZcssxj));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产设施巡检
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('szxc:zcssxj:remove')")
|
||||||
|
@Log(title = "资产设施巡检", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(szxcZcssxjService.deleteSzxcZcssxjByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,258 @@
|
|||||||
|
package com.ruoyi.szxc.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产设施巡检对象 szxc_zcssxj
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-04-02
|
||||||
|
*/
|
||||||
|
public class SzxcZcssxj extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 资产设施id */
|
||||||
|
@Excel(name = "资产设施id")
|
||||||
|
private Long zcssId;
|
||||||
|
|
||||||
|
/** 资产设备名称 */
|
||||||
|
@Excel(name = "资产设备名称")
|
||||||
|
private String zcName;
|
||||||
|
|
||||||
|
/** 巡检人 */
|
||||||
|
@Excel(name = "巡检人")
|
||||||
|
private String xjName;
|
||||||
|
|
||||||
|
/** 巡检人电话 */
|
||||||
|
@Excel(name = "巡检人电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/** 巡检日期 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "巡检日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date xjDate;
|
||||||
|
|
||||||
|
/** 巡检标题 */
|
||||||
|
@Excel(name = "巡检标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/** 巡检结果 */
|
||||||
|
@Excel(name = "巡检结果")
|
||||||
|
private String xjResult;
|
||||||
|
|
||||||
|
/** 巡检说明 */
|
||||||
|
@Excel(name = "巡检说明")
|
||||||
|
private String xjExplain;
|
||||||
|
|
||||||
|
/** 巡检照片 */
|
||||||
|
@Excel(name = "巡检照片")
|
||||||
|
private String picture;
|
||||||
|
|
||||||
|
/** 巡检状态(字典) */
|
||||||
|
@Excel(name = "巡检状态(字典)")
|
||||||
|
private String xjStatus;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date xjStart;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date xjEnd;
|
||||||
|
|
||||||
|
/** 部门id */
|
||||||
|
@Excel(name = "部门id")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/** 所属网格 */
|
||||||
|
@Excel(name = "所属网格")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
/** 创建者ID */
|
||||||
|
@Excel(name = "创建者ID")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setZcssId(Long zcssId)
|
||||||
|
{
|
||||||
|
this.zcssId = zcssId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getZcssId()
|
||||||
|
{
|
||||||
|
return zcssId;
|
||||||
|
}
|
||||||
|
public void setZcName(String zcName)
|
||||||
|
{
|
||||||
|
this.zcName = zcName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getZcName()
|
||||||
|
{
|
||||||
|
return zcName;
|
||||||
|
}
|
||||||
|
public void setXjName(String xjName)
|
||||||
|
{
|
||||||
|
this.xjName = xjName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXjName()
|
||||||
|
{
|
||||||
|
return xjName;
|
||||||
|
}
|
||||||
|
public void setPhone(String phone)
|
||||||
|
{
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone()
|
||||||
|
{
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
public void setXjDate(Date xjDate)
|
||||||
|
{
|
||||||
|
this.xjDate = xjDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getXjDate()
|
||||||
|
{
|
||||||
|
return xjDate;
|
||||||
|
}
|
||||||
|
public void setTitle(String title)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle()
|
||||||
|
{
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
public void setXjResult(String xjResult)
|
||||||
|
{
|
||||||
|
this.xjResult = xjResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXjResult()
|
||||||
|
{
|
||||||
|
return xjResult;
|
||||||
|
}
|
||||||
|
public void setXjExplain(String xjExplain)
|
||||||
|
{
|
||||||
|
this.xjExplain = xjExplain;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXjExplain()
|
||||||
|
{
|
||||||
|
return xjExplain;
|
||||||
|
}
|
||||||
|
public void setPicture(String picture)
|
||||||
|
{
|
||||||
|
this.picture = picture;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPicture()
|
||||||
|
{
|
||||||
|
return picture;
|
||||||
|
}
|
||||||
|
public void setXjStatus(String xjStatus)
|
||||||
|
{
|
||||||
|
this.xjStatus = xjStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getXjStatus()
|
||||||
|
{
|
||||||
|
return xjStatus;
|
||||||
|
}
|
||||||
|
public void setXjStart(Date xjStart)
|
||||||
|
{
|
||||||
|
this.xjStart = xjStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getXjStart()
|
||||||
|
{
|
||||||
|
return xjStart;
|
||||||
|
}
|
||||||
|
public void setXjEnd(Date xjEnd)
|
||||||
|
{
|
||||||
|
this.xjEnd = xjEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getXjEnd()
|
||||||
|
{
|
||||||
|
return xjEnd;
|
||||||
|
}
|
||||||
|
public void setDeptId(Long deptId)
|
||||||
|
{
|
||||||
|
this.deptId = deptId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDeptId()
|
||||||
|
{
|
||||||
|
return deptId;
|
||||||
|
}
|
||||||
|
public void setDeptName(String deptName)
|
||||||
|
{
|
||||||
|
this.deptName = deptName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeptName()
|
||||||
|
{
|
||||||
|
return deptName;
|
||||||
|
}
|
||||||
|
public void setUserId(Long userId)
|
||||||
|
{
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserId()
|
||||||
|
{
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("zcssId", getZcssId())
|
||||||
|
.append("zcName", getZcName())
|
||||||
|
.append("xjName", getXjName())
|
||||||
|
.append("phone", getPhone())
|
||||||
|
.append("xjDate", getXjDate())
|
||||||
|
.append("title", getTitle())
|
||||||
|
.append("xjResult", getXjResult())
|
||||||
|
.append("xjExplain", getXjExplain())
|
||||||
|
.append("picture", getPicture())
|
||||||
|
.append("xjStatus", getXjStatus())
|
||||||
|
.append("xjStart", getXjStart())
|
||||||
|
.append("xjEnd", getXjEnd())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.append("deptId", getDeptId())
|
||||||
|
.append("deptName", getDeptName())
|
||||||
|
.append("userId", getUserId())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.szxc.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcZcssxj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产设施巡检Mapper接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-04-02
|
||||||
|
*/
|
||||||
|
public interface SzxcZcssxjMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检
|
||||||
|
*
|
||||||
|
* @param id 资产设施巡检主键
|
||||||
|
* @return 资产设施巡检
|
||||||
|
*/
|
||||||
|
public SzxcZcssxj selectSzxcZcssxjById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检列表
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 资产设施巡检集合
|
||||||
|
*/
|
||||||
|
public List<SzxcZcssxj> selectSzxcZcssxjList(SzxcZcssxj szxcZcssxj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资产设施巡检
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSzxcZcssxj(SzxcZcssxj szxcZcssxj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改资产设施巡检
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSzxcZcssxj(SzxcZcssxj szxcZcssxj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产设施巡检
|
||||||
|
*
|
||||||
|
* @param id 资产设施巡检主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcZcssxjById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除资产设施巡检
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcZcssxjByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.szxc.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcZcssxj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产设施巡检Service接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-04-02
|
||||||
|
*/
|
||||||
|
public interface ISzxcZcssxjService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检
|
||||||
|
*
|
||||||
|
* @param id 资产设施巡检主键
|
||||||
|
* @return 资产设施巡检
|
||||||
|
*/
|
||||||
|
public SzxcZcssxj selectSzxcZcssxjById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检列表
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 资产设施巡检集合
|
||||||
|
*/
|
||||||
|
public List<SzxcZcssxj> selectSzxcZcssxjList(SzxcZcssxj szxcZcssxj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资产设施巡检
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertSzxcZcssxj(SzxcZcssxj szxcZcssxj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改资产设施巡检
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateSzxcZcssxj(SzxcZcssxj szxcZcssxj);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除资产设施巡检
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的资产设施巡检主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcZcssxjByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产设施巡检信息
|
||||||
|
*
|
||||||
|
* @param id 资产设施巡检主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteSzxcZcssxjById(Long id);
|
||||||
|
}
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
package com.ruoyi.szxc.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcZcss;
|
||||||
|
import com.ruoyi.szxc.mapper.SzxcZcssMapper;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcZcssService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产设施Service业务层处理
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-04-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SzxcZcssServiceImpl implements ISzxcZcssService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SzxcZcssMapper szxcZcssMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施
|
||||||
|
*
|
||||||
|
* @param id 资产设施主键
|
||||||
|
* @return 资产设施
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SzxcZcss selectSzxcZcssById(Long id)
|
||||||
|
{
|
||||||
|
return szxcZcssMapper.selectSzxcZcssById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施列表
|
||||||
|
*
|
||||||
|
* @param szxcZcss 资产设施
|
||||||
|
* @return 资产设施
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SzxcZcss> selectSzxcZcssList(SzxcZcss szxcZcss)
|
||||||
|
{
|
||||||
|
return szxcZcssMapper.selectSzxcZcssList(szxcZcss);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资产设施
|
||||||
|
*
|
||||||
|
* @param szxcZcss 资产设施
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSzxcZcss(SzxcZcss szxcZcss)
|
||||||
|
{
|
||||||
|
szxcZcss.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return szxcZcssMapper.insertSzxcZcss(szxcZcss);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改资产设施
|
||||||
|
*
|
||||||
|
* @param szxcZcss 资产设施
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSzxcZcss(SzxcZcss szxcZcss)
|
||||||
|
{
|
||||||
|
szxcZcss.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return szxcZcssMapper.updateSzxcZcss(szxcZcss);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除资产设施
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的资产设施主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcZcssByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return szxcZcssMapper.deleteSzxcZcssByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产设施信息
|
||||||
|
*
|
||||||
|
* @param id 资产设施主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcZcssById(Long id)
|
||||||
|
{
|
||||||
|
return szxcZcssMapper.deleteSzxcZcssById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.szxc.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.szxc.mapper.SzxcZcssxjMapper;
|
||||||
|
import com.ruoyi.szxc.domain.SzxcZcssxj;
|
||||||
|
import com.ruoyi.szxc.service.ISzxcZcssxjService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资产设施巡检Service业务层处理
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-04-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SzxcZcssxjServiceImpl implements ISzxcZcssxjService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private SzxcZcssxjMapper szxcZcssxjMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检
|
||||||
|
*
|
||||||
|
* @param id 资产设施巡检主键
|
||||||
|
* @return 资产设施巡检
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SzxcZcssxj selectSzxcZcssxjById(Long id)
|
||||||
|
{
|
||||||
|
return szxcZcssxjMapper.selectSzxcZcssxjById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产设施巡检列表
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 资产设施巡检
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SzxcZcssxj> selectSzxcZcssxjList(SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
return szxcZcssxjMapper.selectSzxcZcssxjList(szxcZcssxj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增资产设施巡检
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertSzxcZcssxj(SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
szxcZcssxj.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return szxcZcssxjMapper.insertSzxcZcssxj(szxcZcssxj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改资产设施巡检
|
||||||
|
*
|
||||||
|
* @param szxcZcssxj 资产设施巡检
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateSzxcZcssxj(SzxcZcssxj szxcZcssxj)
|
||||||
|
{
|
||||||
|
szxcZcssxj.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return szxcZcssxjMapper.updateSzxcZcssxj(szxcZcssxj);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除资产设施巡检
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的资产设施巡检主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcZcssxjByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return szxcZcssxjMapper.deleteSzxcZcssxjByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除资产设施巡检信息
|
||||||
|
*
|
||||||
|
* @param id 资产设施巡检主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteSzxcZcssxjById(Long id)
|
||||||
|
{
|
||||||
|
return szxcZcssxjMapper.deleteSzxcZcssxjById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,146 @@
|
|||||||
|
<?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.ruoyi.szxc.mapper.SzxcZcssxjMapper">
|
||||||
|
|
||||||
|
<resultMap type="SzxcZcssxj" id="SzxcZcssxjResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="zcssId" column="zcss_id" />
|
||||||
|
<result property="zcName" column="zc_name" />
|
||||||
|
<result property="xjName" column="xj_name" />
|
||||||
|
<result property="phone" column="phone" />
|
||||||
|
<result property="xjDate" column="xj_date" />
|
||||||
|
<result property="title" column="title" />
|
||||||
|
<result property="xjResult" column="xj_result" />
|
||||||
|
<result property="xjExplain" column="xj_explain" />
|
||||||
|
<result property="picture" column="picture" />
|
||||||
|
<result property="xjStatus" column="xj_status" />
|
||||||
|
<result property="xjStart" column="xj_start" />
|
||||||
|
<result property="xjEnd" column="xj_end" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="deptId" column="dept_id" />
|
||||||
|
<result property="deptName" column="dept_name" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectSzxcZcssxjVo">
|
||||||
|
select id, zcss_id, zc_name, xj_name, phone, xj_date, title, xj_result, xj_explain, picture, xj_status, xj_start, xj_end, remark, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_zcssxj
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectSzxcZcssxjList" parameterType="SzxcZcssxj" resultMap="SzxcZcssxjResult">
|
||||||
|
<include refid="selectSzxcZcssxjVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="zcssId != null "> and zcss_id = #{zcssId}</if>
|
||||||
|
<if test="zcName != null and zcName != ''"> and zc_name like concat('%', #{zcName}, '%')</if>
|
||||||
|
<if test="xjName != null and xjName != ''"> and xj_name like concat('%', #{xjName}, '%')</if>
|
||||||
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||||
|
<if test="xjDate != null "> and xj_date = #{xjDate}</if>
|
||||||
|
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||||
|
<if test="xjResult != null and xjResult != ''"> and xj_result = #{xjResult}</if>
|
||||||
|
<if test="xjExplain != null and xjExplain != ''"> and xj_explain = #{xjExplain}</if>
|
||||||
|
<if test="picture != null and picture != ''"> and picture = #{picture}</if>
|
||||||
|
<if test="xjStatus != null and xjStatus != ''"> and xj_status = #{xjStatus}</if>
|
||||||
|
<if test="xjStart != null "> and xj_start = #{xjStart}</if>
|
||||||
|
<if test="xjEnd != null "> and xj_end = #{xjEnd}</if>
|
||||||
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||||
|
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||||
|
<if test="userId != null "> and user_id = #{userId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSzxcZcssxjById" parameterType="Long" resultMap="SzxcZcssxjResult">
|
||||||
|
<include refid="selectSzxcZcssxjVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertSzxcZcssxj" parameterType="SzxcZcssxj" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into szxc_zcssxj
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="zcssId != null">zcss_id,</if>
|
||||||
|
<if test="zcName != null">zc_name,</if>
|
||||||
|
<if test="xjName != null">xj_name,</if>
|
||||||
|
<if test="phone != null">phone,</if>
|
||||||
|
<if test="xjDate != null">xj_date,</if>
|
||||||
|
<if test="title != null">title,</if>
|
||||||
|
<if test="xjResult != null">xj_result,</if>
|
||||||
|
<if test="xjExplain != null">xj_explain,</if>
|
||||||
|
<if test="picture != null">picture,</if>
|
||||||
|
<if test="xjStatus != null">xj_status,</if>
|
||||||
|
<if test="xjStart != null">xj_start,</if>
|
||||||
|
<if test="xjEnd != null">xj_end,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
|
<if test="deptName != null">dept_name,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="zcssId != null">#{zcssId},</if>
|
||||||
|
<if test="zcName != null">#{zcName},</if>
|
||||||
|
<if test="xjName != null">#{xjName},</if>
|
||||||
|
<if test="phone != null">#{phone},</if>
|
||||||
|
<if test="xjDate != null">#{xjDate},</if>
|
||||||
|
<if test="title != null">#{title},</if>
|
||||||
|
<if test="xjResult != null">#{xjResult},</if>
|
||||||
|
<if test="xjExplain != null">#{xjExplain},</if>
|
||||||
|
<if test="picture != null">#{picture},</if>
|
||||||
|
<if test="xjStatus != null">#{xjStatus},</if>
|
||||||
|
<if test="xjStart != null">#{xjStart},</if>
|
||||||
|
<if test="xjEnd != null">#{xjEnd},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
|
<if test="deptName != null">#{deptName},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateSzxcZcssxj" parameterType="SzxcZcssxj">
|
||||||
|
update szxc_zcssxj
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="zcssId != null">zcss_id = #{zcssId},</if>
|
||||||
|
<if test="zcName != null">zc_name = #{zcName},</if>
|
||||||
|
<if test="xjName != null">xj_name = #{xjName},</if>
|
||||||
|
<if test="phone != null">phone = #{phone},</if>
|
||||||
|
<if test="xjDate != null">xj_date = #{xjDate},</if>
|
||||||
|
<if test="title != null">title = #{title},</if>
|
||||||
|
<if test="xjResult != null">xj_result = #{xjResult},</if>
|
||||||
|
<if test="xjExplain != null">xj_explain = #{xjExplain},</if>
|
||||||
|
<if test="picture != null">picture = #{picture},</if>
|
||||||
|
<if test="xjStatus != null">xj_status = #{xjStatus},</if>
|
||||||
|
<if test="xjStart != null">xj_start = #{xjStart},</if>
|
||||||
|
<if test="xjEnd != null">xj_end = #{xjEnd},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||||
|
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||||
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteSzxcZcssxjById" parameterType="Long">
|
||||||
|
delete from szxc_zcssxj where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteSzxcZcssxjByIds" parameterType="String">
|
||||||
|
delete from szxc_zcssxj where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询资产设施巡检列表
|
||||||
|
export function listZcssxj(query) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/zcssxj/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询资产设施巡检详细
|
||||||
|
export function getZcssxj(id) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/zcssxj/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增资产设施巡检
|
||||||
|
export function addZcssxj(data) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/zcssxj',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改资产设施巡检
|
||||||
|
export function updateZcssxj(data) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/zcssxj',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除资产设施巡检
|
||||||
|
export function delZcssxj(id) {
|
||||||
|
return request({
|
||||||
|
url: '/szxc/zcssxj/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -0,0 +1,458 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="资产设施id" prop="zcssId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.zcssId"
|
||||||
|
placeholder="请输入资产设施id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资产设备名称" prop="zcName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.zcName"
|
||||||
|
placeholder="请输入资产设备名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检人" prop="xjName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.xjName"
|
||||||
|
placeholder="请输入巡检人"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检人电话" prop="phone">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.phone"
|
||||||
|
placeholder="请输入巡检人电话"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检日期" prop="xjDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.xjDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择巡检日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检标题" prop="title">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.title"
|
||||||
|
placeholder="请输入巡检标题"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检结果" prop="xjResult">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.xjResult"
|
||||||
|
placeholder="请输入巡检结果"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检照片" prop="picture">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.picture"
|
||||||
|
placeholder="请输入巡检照片"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始时间" prop="xjStart">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.xjStart"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="xjEnd">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.xjEnd"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门id" prop="deptId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.deptId"
|
||||||
|
placeholder="请输入部门id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属网格" prop="deptName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.deptName"
|
||||||
|
placeholder="请输入所属网格"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建者ID" prop="userId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请输入创建者ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</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="['szxc:zcssxj: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="['szxc:zcssxj: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="['szxc:zcssxj:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['szxc:zcssxj:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="zcssxjList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="id" align="center" prop="id" />
|
||||||
|
<el-table-column label="资产设施id" align="center" prop="zcssId" />
|
||||||
|
<el-table-column label="资产设备名称" align="center" prop="zcName" />
|
||||||
|
<el-table-column label="巡检人" align="center" prop="xjName" />
|
||||||
|
<el-table-column label="巡检人电话" align="center" prop="phone" />
|
||||||
|
<el-table-column label="巡检日期" align="center" prop="xjDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.xjDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="巡检标题" align="center" prop="title" />
|
||||||
|
<el-table-column label="巡检结果" align="center" prop="xjResult" />
|
||||||
|
<el-table-column label="巡检说明" align="center" prop="xjExplain" />
|
||||||
|
<el-table-column label="巡检照片" align="center" prop="picture" />
|
||||||
|
<el-table-column label="巡检状态(字典)" align="center" prop="xjStatus" />
|
||||||
|
<el-table-column label="开始时间" align="center" prop="xjStart" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.xjStart, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="结束时间" align="center" prop="xjEnd" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.xjEnd, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="部门id" align="center" prop="deptId" />
|
||||||
|
<el-table-column label="所属网格" align="center" prop="deptName" />
|
||||||
|
<el-table-column label="创建者ID" align="center" prop="userId" />
|
||||||
|
<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="['szxc:zcssxj:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['szxc:zcssxj: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="zcssId">
|
||||||
|
<el-input v-model="form.zcssId" placeholder="请输入资产设施id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资产设备名称" prop="zcName">
|
||||||
|
<el-input v-model="form.zcName" placeholder="请输入资产设备名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检人" prop="xjName">
|
||||||
|
<el-input v-model="form.xjName" placeholder="请输入巡检人" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检人电话" prop="phone">
|
||||||
|
<el-input v-model="form.phone" placeholder="请输入巡检人电话" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检日期" prop="xjDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.xjDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择巡检日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检标题" prop="title">
|
||||||
|
<el-input v-model="form.title" placeholder="请输入巡检标题" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检结果" prop="xjResult">
|
||||||
|
<el-input v-model="form.xjResult" placeholder="请输入巡检结果" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检说明" prop="xjExplain">
|
||||||
|
<el-input v-model="form.xjExplain" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="巡检照片" prop="picture">
|
||||||
|
<el-input v-model="form.picture" placeholder="请输入巡检照片" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始时间" prop="xjStart">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.xjStart"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="xjEnd">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.xjEnd"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择结束时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门id" prop="deptId">
|
||||||
|
<el-input v-model="form.deptId" placeholder="请输入部门id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属网格" prop="deptName">
|
||||||
|
<el-input v-model="form.deptName" placeholder="请输入所属网格" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建者ID" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入创建者ID" />
|
||||||
|
</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 { listZcssxj, getZcssxj, delZcssxj, addZcssxj, updateZcssxj } from "@/api/szxc/zcssxj";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Zcssxj",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 资产设施巡检表格数据
|
||||||
|
zcssxjList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
zcssId: null,
|
||||||
|
zcName: null,
|
||||||
|
xjName: null,
|
||||||
|
phone: null,
|
||||||
|
xjDate: null,
|
||||||
|
title: null,
|
||||||
|
xjResult: null,
|
||||||
|
xjExplain: null,
|
||||||
|
picture: null,
|
||||||
|
xjStatus: null,
|
||||||
|
xjStart: null,
|
||||||
|
xjEnd: null,
|
||||||
|
deptId: null,
|
||||||
|
deptName: null,
|
||||||
|
userId: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询资产设施巡检列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listZcssxj(this.queryParams).then(response => {
|
||||||
|
this.zcssxjList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
zcssId: null,
|
||||||
|
zcName: null,
|
||||||
|
xjName: null,
|
||||||
|
phone: null,
|
||||||
|
xjDate: null,
|
||||||
|
title: null,
|
||||||
|
xjResult: null,
|
||||||
|
xjExplain: null,
|
||||||
|
picture: null,
|
||||||
|
xjStatus: null,
|
||||||
|
xjStart: null,
|
||||||
|
xjEnd: null,
|
||||||
|
remark: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
deptId: null,
|
||||||
|
deptName: null,
|
||||||
|
userId: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加资产设施巡检";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getZcssxj(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改资产设施巡检";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateZcssxj(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addZcssxj(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除资产设施巡检编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delZcssxj(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('szxc/zcssxj/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `zcssxj_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in new issue