资产设施巡检

main 4
hansha 2 years ago
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));
}
}

@ -10,7 +10,7 @@ import java.util.Date;
/** /**
* szxc_zcss * szxc_zcss
* *
* @author hs * @author hs
* @date 2024-04-02 * @date 2024-04-02
*/ */
@ -50,10 +50,29 @@ public class SzxcZcss extends BaseEntity
@Excel(name = "资产照片") @Excel(name = "资产照片")
private String picture; private String picture;
/** 是否巡检 */ /** 是否定期巡检 */
@Excel(name = "是否巡检") @Excel(name = "是否定期巡检")
private String xj; private String xj;
/** 巡检周期(天) */
@Excel(name = "巡检周期(天)")
private Long xjCycle;
/** 上次巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上次巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date lastTime;
/** 巡检开始日期 */
@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 */ /** 部门id */
@Excel(name = "部门id") @Excel(name = "部门id")
private Long deptId; private Long deptId;
@ -66,111 +85,147 @@ public class SzxcZcss extends BaseEntity
@Excel(name = "创建者ID") @Excel(name = "创建者ID")
private Long userId; private Long userId;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
} }
public Long getId() public Long getId()
{ {
return id; return id;
} }
public void setZcName(String zcName) public void setZcName(String zcName)
{ {
this.zcName = zcName; this.zcName = zcName;
} }
public String getZcName() public String getZcName()
{ {
return zcName; return zcName;
} }
public void setZcType(String zcType) public void setZcType(String zcType)
{ {
this.zcType = zcType; this.zcType = zcType;
} }
public String getZcType() public String getZcType()
{ {
return zcType; return zcType;
} }
public void setInstallDate(Date installDate) public void setInstallDate(Date installDate)
{ {
this.installDate = installDate; this.installDate = installDate;
} }
public Date getInstallDate() public Date getInstallDate()
{ {
return installDate; return installDate;
} }
public void setFzr(String fzr) public void setFzr(String fzr)
{ {
this.fzr = fzr; this.fzr = fzr;
} }
public String getFzr() public String getFzr()
{ {
return fzr; return fzr;
} }
public void setPhone(String phone) public void setPhone(String phone)
{ {
this.phone = phone; this.phone = phone;
} }
public String getPhone() public String getPhone()
{ {
return phone; return phone;
} }
public void setAddress(String address) public void setAddress(String address)
{ {
this.address = address; this.address = address;
} }
public String getAddress() public String getAddress()
{ {
return address; return address;
} }
public void setPicture(String picture) public void setPicture(String picture)
{ {
this.picture = picture; this.picture = picture;
} }
public String getPicture() public String getPicture()
{ {
return picture; return picture;
} }
public void setXj(String xj) public void setXj(String xj)
{ {
this.xj = xj; this.xj = xj;
} }
public String getXj() public String getXj()
{ {
return xj; return xj;
} }
public void setDeptId(Long deptId) public void setXjCycle(Long xjCycle)
{
this.xjCycle = xjCycle;
}
public Long getXjCycle()
{
return xjCycle;
}
public void setLastTime(Date lastTime)
{
this.lastTime = lastTime;
}
public Date getLastTime()
{
return lastTime;
}
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; this.deptId = deptId;
} }
public Long getDeptId() public Long getDeptId()
{ {
return deptId; return deptId;
} }
public void setDeptName(String deptName) public void setDeptName(String deptName)
{ {
this.deptName = deptName; this.deptName = deptName;
} }
public String getDeptName() public String getDeptName()
{ {
return deptName; return deptName;
} }
public void setUserId(Long userId) public void setUserId(Long userId)
{ {
this.userId = userId; this.userId = userId;
} }
public Long getUserId() public Long getUserId()
{ {
return userId; return userId;
} }
@ -178,23 +233,27 @@ public class SzxcZcss extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("zcName", getZcName()) .append("zcName", getZcName())
.append("zcType", getZcType()) .append("zcType", getZcType())
.append("installDate", getInstallDate()) .append("installDate", getInstallDate())
.append("fzr", getFzr()) .append("fzr", getFzr())
.append("phone", getPhone()) .append("phone", getPhone())
.append("address", getAddress()) .append("address", getAddress())
.append("picture", getPicture()) .append("picture", getPicture())
.append("xj", getXj()) .append("xj", getXj())
.append("remark", getRemark()) .append("xjCycle", getXjCycle())
.append("createBy", getCreateBy()) .append("lastTime", getLastTime())
.append("createTime", getCreateTime()) .append("xjStart", getXjStart())
.append("updateBy", getUpdateBy()) .append("xjEnd", getXjEnd())
.append("updateTime", getUpdateTime()) .append("remark", getRemark())
.append("deptId", getDeptId()) .append("createBy", getCreateBy())
.append("deptName", getDeptName()) .append("createTime", getCreateTime())
.append("userId", getUserId()) .append("updateBy", getUpdateBy())
.toString(); .append("updateTime", getUpdateTime())
.append("deptId", getDeptId())
.append("deptName", getDeptName())
.append("userId", getUserId())
.toString();
} }
} }

@ -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);
}
}

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.szxc.mapper.SzxcZcssMapper"> <mapper namespace="com.ruoyi.szxc.mapper.SzxcZcssMapper">
<resultMap type="SzxcZcss" id="SzxcZcssResult"> <resultMap type="SzxcZcss" id="SzxcZcssResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="zcName" column="zc_name" /> <result property="zcName" column="zc_name" />
@ -14,6 +14,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="address" column="address" /> <result property="address" column="address" />
<result property="picture" column="picture" /> <result property="picture" column="picture" />
<result property="xj" column="xj" /> <result property="xj" column="xj" />
<result property="xjCycle" column="xj_cycle" />
<result property="lastTime" column="last_time" />
<result property="xjStart" column="xj_start" />
<result property="xjEnd" column="xj_end" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
@ -25,12 +29,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectSzxcZcssVo"> <sql id="selectSzxcZcssVo">
select id, zc_name, zc_type, install_date, fzr, phone, address, picture, xj, remark, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_zcss select id, zc_name, zc_type, install_date, fzr, phone, address, picture, xj, xj_cycle, last_time, xj_start, xj_end, remark, create_by, create_time, update_by, update_time, dept_id, dept_name, user_id from szxc_zcss
</sql> </sql>
<select id="selectSzxcZcssList" parameterType="SzxcZcss" resultMap="SzxcZcssResult"> <select id="selectSzxcZcssList" parameterType="SzxcZcss" resultMap="SzxcZcssResult">
<include refid="selectSzxcZcssVo"/> <include refid="selectSzxcZcssVo"/>
<where> <where>
<if test="zcName != null and zcName != ''"> and zc_name like concat('%', #{zcName}, '%')</if> <if test="zcName != null and zcName != ''"> and zc_name like concat('%', #{zcName}, '%')</if>
<if test="zcType != null and zcType != ''"> and zc_type = #{zcType}</if> <if test="zcType != null and zcType != ''"> and zc_type = #{zcType}</if>
<if test="installDate != null "> and install_date = #{installDate}</if> <if test="installDate != null "> and install_date = #{installDate}</if>
@ -39,17 +43,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null and address != ''"> and address = #{address}</if> <if test="address != null and address != ''"> and address = #{address}</if>
<if test="picture != null and picture != ''"> and picture = #{picture}</if> <if test="picture != null and picture != ''"> and picture = #{picture}</if>
<if test="xj != null and xj != ''"> and xj = #{xj}</if> <if test="xj != null and xj != ''"> and xj = #{xj}</if>
<if test="xjCycle != null "> and xj_cycle = #{xjCycle}</if>
<if test="lastTime != null "> and last_time = #{lastTime}</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="deptId != null "> and dept_id = #{deptId}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if> <if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="userId != null "> and user_id = #{userId}</if> <if test="userId != null "> and user_id = #{userId}</if>
</where> </where>
</select> </select>
<select id="selectSzxcZcssById" parameterType="Long" resultMap="SzxcZcssResult"> <select id="selectSzxcZcssById" parameterType="Long" resultMap="SzxcZcssResult">
<include refid="selectSzxcZcssVo"/> <include refid="selectSzxcZcssVo"/>
where id = #{id} where id = #{id}
</select> </select>
<insert id="insertSzxcZcss" parameterType="SzxcZcss" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSzxcZcss" parameterType="SzxcZcss" useGeneratedKeys="true" keyProperty="id">
insert into szxc_zcss insert into szxc_zcss
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -61,6 +69,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">address,</if> <if test="address != null">address,</if>
<if test="picture != null">picture,</if> <if test="picture != null">picture,</if>
<if test="xj != null">xj,</if> <if test="xj != null">xj,</if>
<if test="xjCycle != null">xj_cycle,</if>
<if test="lastTime != null">last_time,</if>
<if test="xjStart != null">xj_start,</if>
<if test="xjEnd != null">xj_end,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -69,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">dept_id,</if> <if test="deptId != null">dept_id,</if>
<if test="deptName != null">dept_name,</if> <if test="deptName != null">dept_name,</if>
<if test="userId != null">user_id,</if> <if test="userId != null">user_id,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="zcName != null">#{zcName},</if> <if test="zcName != null">#{zcName},</if>
<if test="zcType != null">#{zcType},</if> <if test="zcType != null">#{zcType},</if>
@ -79,6 +91,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">#{address},</if> <if test="address != null">#{address},</if>
<if test="picture != null">#{picture},</if> <if test="picture != null">#{picture},</if>
<if test="xj != null">#{xj},</if> <if test="xj != null">#{xj},</if>
<if test="xjCycle != null">#{xjCycle},</if>
<if test="lastTime != null">#{lastTime},</if>
<if test="xjStart != null">#{xjStart},</if>
<if test="xjEnd != null">#{xjEnd},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -87,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null">#{deptId},</if> <if test="deptId != null">#{deptId},</if>
<if test="deptName != null">#{deptName},</if> <if test="deptName != null">#{deptName},</if>
<if test="userId != null">#{userId},</if> <if test="userId != null">#{userId},</if>
</trim> </trim>
</insert> </insert>
<update id="updateSzxcZcss" parameterType="SzxcZcss"> <update id="updateSzxcZcss" parameterType="SzxcZcss">
@ -101,6 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="address != null">address = #{address},</if> <if test="address != null">address = #{address},</if>
<if test="picture != null">picture = #{picture},</if> <if test="picture != null">picture = #{picture},</if>
<if test="xj != null">xj = #{xj},</if> <if test="xj != null">xj = #{xj},</if>
<if test="xjCycle != null">xj_cycle = #{xjCycle},</if>
<if test="lastTime != null">last_time = #{lastTime},</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="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
@ -118,7 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<delete id="deleteSzxcZcssByIds" parameterType="String"> <delete id="deleteSzxcZcssByIds" parameterType="String">
delete from szxc_zcss where id in delete from szxc_zcss where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -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'
})
}

@ -11,10 +11,10 @@
</el-form-item> </el-form-item>
<el-form-item label="安装时间" prop="installDate"> <el-form-item label="安装时间" prop="installDate">
<el-date-picker clearable <el-date-picker clearable
v-model="queryParams.installDate" v-model="queryParams.installDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择安装时间"> placeholder="请选择安装时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="负责人" prop="fzr"> <el-form-item label="负责人" prop="fzr">
@ -49,14 +49,46 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="是否巡检" prop="xj"> <el-form-item label="是否定期巡检" prop="xj">
<el-input <el-input
v-model="queryParams.xj" v-model="queryParams.xj"
placeholder="请输入是否巡检" placeholder="请输入是否定期巡检"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="巡检周期(天)" prop="xjCycle">
<el-input
v-model="queryParams.xjCycle"
placeholder="请输入巡检周期(天)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上次巡检时间" prop="lastTime">
<el-date-picker clearable
v-model="queryParams.lastTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择上次巡检时间">
</el-date-picker>
</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-form-item label="部门id" prop="deptId">
<el-input <el-input
v-model="queryParams.deptId" v-model="queryParams.deptId"
@ -147,7 +179,23 @@
<el-table-column label="联系电话" align="center" prop="phone" /> <el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" />
<el-table-column label="资产照片" align="center" prop="picture" /> <el-table-column label="资产照片" align="center" prop="picture" />
<el-table-column label="是否巡检" align="center" prop="xj" /> <el-table-column label="是否定期巡检" align="center" prop="xj" />
<el-table-column label="巡检周期(天)" align="center" prop="xjCycle" />
<el-table-column label="上次巡检时间" align="center" prop="lastTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<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="备注" align="center" prop="remark" />
<el-table-column label="部门id" align="center" prop="deptId" /> <el-table-column label="部门id" align="center" prop="deptId" />
<el-table-column label="所属网格" align="center" prop="deptName" /> <el-table-column label="所属网格" align="center" prop="deptName" />
@ -171,7 +219,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -188,10 +236,10 @@
</el-form-item> </el-form-item>
<el-form-item label="安装时间" prop="installDate"> <el-form-item label="安装时间" prop="installDate">
<el-date-picker clearable <el-date-picker clearable
v-model="form.installDate" v-model="form.installDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择安装时间"> placeholder="请选择安装时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="负责人" prop="fzr"> <el-form-item label="负责人" prop="fzr">
@ -206,8 +254,35 @@
<el-form-item label="资产照片" prop="picture"> <el-form-item label="资产照片" prop="picture">
<el-input v-model="form.picture" placeholder="请输入资产照片" /> <el-input v-model="form.picture" placeholder="请输入资产照片" />
</el-form-item> </el-form-item>
<el-form-item label="是否巡检" prop="xj"> <el-form-item label="是否定期巡检" prop="xj">
<el-input v-model="form.xj" placeholder="请输入是否巡检" /> <el-input v-model="form.xj" placeholder="请输入是否定期巡检" />
</el-form-item>
<el-form-item label="巡检周期(天)" prop="xjCycle">
<el-input v-model="form.xjCycle" placeholder="请输入巡检周期(天)" />
</el-form-item>
<el-form-item label="上次巡检时间" prop="lastTime">
<el-date-picker clearable
v-model="form.lastTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择上次巡检时间">
</el-date-picker>
</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>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" /> <el-input v-model="form.remark" placeholder="请输入备注" />
@ -231,162 +306,170 @@
</template> </template>
<script> <script>
import { listZcss, getZcss, delZcss, addZcss, updateZcss } from "@/api/szxc/zcss"; import { listZcss, getZcss, delZcss, addZcss, updateZcss } from "@/api/szxc/zcss";
export default { export default {
name: "Zcss", name: "Zcss",
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
zcssList: [], zcssList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
zcName: null, zcName: null,
zcType: null, zcType: null,
installDate: null, installDate: null,
fzr: null, fzr: null,
phone: null, phone: null,
address: null, address: null,
picture: null, picture: null,
xj: null, xj: null,
deptId: null, xjCycle: null,
deptName: null, lastTime: null,
userId: null xjStart: null,
}, xjEnd: null,
// deptId: null,
form: {}, deptName: null,
// userId: null
rules: { },
} //
}; form: {},
}, //
created() { rules: {
this.getList(); }
},
methods: {
/** 查询资产设施列表 */
getList() {
this.loading = true;
listZcss(this.queryParams).then(response => {
this.zcssList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
zcName: null,
zcType: null,
installDate: null,
fzr: null,
phone: null,
address: null,
picture: null,
xj: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
deptName: null,
userId: null
}; };
this.resetForm("form");
}, },
/** 搜索按钮操作 */ created() {
handleQuery() {
this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ methods: {
resetQuery() { /** 查询资产设施列表 */
this.resetForm("queryForm"); getList() {
this.handleQuery(); this.loading = true;
}, listZcss(this.queryParams).then(response => {
// this.zcssList = response.rows;
handleSelectionChange(selection) { this.total = response.total;
this.ids = selection.map(item => item.id) this.loading = false;
this.single = selection.length!==1 });
this.multiple = !selection.length },
}, //
/** 新增按钮操作 */ cancel() {
handleAdd() { this.open = false;
this.reset(); this.reset();
this.open = true; },
this.title = "添加资产设施"; //
}, reset() {
/** 修改按钮操作 */ this.form = {
handleUpdate(row) { id: null,
this.reset(); zcName: null,
const id = row.id || this.ids zcType: null,
getZcss(id).then(response => { installDate: null,
this.form = response.data; fzr: null,
phone: null,
address: null,
picture: null,
xj: null,
xjCycle: null,
lastTime: 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.open = true;
this.title = "修改资产设施"; this.title = "添加资产设施";
}); },
}, /** 修改按钮操作 */
/** 提交按钮 */ handleUpdate(row) {
submitForm() { this.reset();
this.$refs["form"].validate(valid => { const id = row.id || this.ids
if (valid) { getZcss(id).then(response => {
if (this.form.id != null) { this.form = response.data;
updateZcss(this.form).then(response => { this.open = true;
this.$modal.msgSuccess("修改成功"); this.title = "修改资产设施";
this.open = false; });
this.getList(); },
}); /** 提交按钮 */
} else { submitForm() {
addZcss(this.form).then(response => { this.$refs["form"].validate(valid => {
this.$modal.msgSuccess("新增成功"); if (valid) {
this.open = false; if (this.form.id != null) {
this.getList(); updateZcss(this.form).then(response => {
}); this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addZcss(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
} }
} });
}); },
}, /** 删除按钮操作 */
/** 删除按钮操作 */ handleDelete(row) {
handleDelete(row) { const ids = row.id || this.ids;
const ids = row.id || this.ids; this.$modal.confirm('是否确认删除资产设施编号为"' + ids + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除资产设施编号为"' + ids + '"的数据项?').then(function() { return delZcss(ids);
return delZcss(ids); }).then(() => {
}).then(() => { this.getList();
this.getList(); this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess("删除成功"); }).catch(() => {});
}).catch(() => {}); },
}, /** 导出按钮操作 */
/** 导出按钮操作 */ handleExport() {
handleExport() { this.download('szxc/zcss/export', {
this.download('szxc/zcss/export', { ...this.queryParams
...this.queryParams }, `zcss_${new Date().getTime()}.xlsx`)
}, `zcss_${new Date().getTime()}.xlsx`) }
} }
} };
};
</script> </script>

@ -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…
Cancel
Save