This commit is contained in:
likehai 2023-12-04 17:48:53 +08:00
parent 9328e65853
commit 31bf9bb81c
10 changed files with 1705 additions and 0 deletions

View File

@ -0,0 +1,85 @@
package com.god.web.controller.maintenance;
import com.god.common.annotation.Log;
import com.god.common.core.controller.BaseController;
import com.god.common.core.domain.AjaxResult;
import com.god.common.core.page.TableDataInfo;
import com.god.common.enums.BusinessType;
import com.god.common.utils.poi.ExcelUtil;
import com.god.maintenance.domain.MaintainUpkeepInfo;
import com.god.maintenance.service.IMaintainUpkeepInfoService;
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 god
* @date 2023-12-04
*/
@RestController
@RequestMapping("/maintenance/maintainUpkeepInfo")
public class MaintainUpkeepInfoController extends BaseController {
@Autowired
private IMaintainUpkeepInfoService maintainUpkeepInfoService;
/**
* 查询维修保养记录列表
*/
@GetMapping("/list")
public TableDataInfo list(MaintainUpkeepInfo maintainUpkeepInfo) {
startPage();
List<MaintainUpkeepInfo> list = maintainUpkeepInfoService.selectMaintainUpkeepInfoList(maintainUpkeepInfo);
return getDataTable(list);
}
/**
* 导出维修保养记录列表
*/
@Log(title = "维修保养记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MaintainUpkeepInfo maintainUpkeepInfo) {
List<MaintainUpkeepInfo> list = maintainUpkeepInfoService.selectMaintainUpkeepInfoList(maintainUpkeepInfo);
ExcelUtil<MaintainUpkeepInfo> util = new ExcelUtil<MaintainUpkeepInfo>(MaintainUpkeepInfo.class);
util.exportExcel(response, list, "维修保养记录数据");
}
/**
* 获取维修保养记录详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(maintainUpkeepInfoService.selectMaintainUpkeepInfoById(id));
}
/**
* 新增维修保养记录
*/
@Log(title = "维修保养记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MaintainUpkeepInfo maintainUpkeepInfo) {
return toAjax(maintainUpkeepInfoService.insertMaintainUpkeepInfo(maintainUpkeepInfo));
}
/**
* 修改维修保养记录
*/
@Log(title = "维修保养记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MaintainUpkeepInfo maintainUpkeepInfo) {
return toAjax(maintainUpkeepInfoService.updateMaintainUpkeepInfo(maintainUpkeepInfo));
}
/**
* 删除维修保养记录
*/
@Log(title = "维修保养记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return toAjax(maintainUpkeepInfoService.deleteMaintainUpkeepInfoByIds(ids));
}
}

View File

@ -0,0 +1,100 @@
package com.god.maintenance.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.god.common.annotation.Excel;
import com.god.common.core.domain.BaseEntity;
/**
* 维修保养记录对象 maintain_upkeep_info
*
* @author god
* @date 2023-12-04
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MaintainUpkeepInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 设备ID
*/
@Excel(name = "设备ID")
private String facilityId;
/**
* 设备名称
*/
@Excel(name = "设备名称")
private String facilityName;
/**
* 设备类型
*/
@Excel(name = "设备类型")
private String facilityType;
/**
* 品牌
*/
@Excel(name = "品牌")
private String facilityBrand;
/**
* 维修保养类型1维修2保养
*/
@Excel(name = "维修保养类型1维修2保养")
private String maintainUpkeepType;
/**
* 区分系统端口
*/
@Excel(name = "区分系统端口")
private String distinctionPort;
/**
* 维保时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "维保时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date nowTime;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTimeA;
/**
* 结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTimeA;
/**
* 维保人
*/
@Excel(name = "维保人")
private String maintenanceUser;
/**
* 维保内容
*/
@Excel(name = "维保内容")
private String maintenanceInfo;
/**
* 备用字段
*/
@Excel(name = "备用字段")
private String reserveOne;
}

View File

@ -0,0 +1,61 @@
package com.god.maintenance.mapper;
import java.util.List;
import com.god.maintenance.domain.MaintainUpkeepInfo;
/**
* 维修保养记录Mapper接口
*
* @author god
* @date 2023-12-04
*/
public interface MaintainUpkeepInfoMapper {
/**
* 查询维修保养记录
*
* @param id 维修保养记录主键
* @return 维修保养记录
*/
MaintainUpkeepInfo selectMaintainUpkeepInfoById(String id);
/**
* 查询维修保养记录列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录集合
*/
List<MaintainUpkeepInfo> selectMaintainUpkeepInfoList(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 新增维修保养记录
*
* @param maintainUpkeepInfo 维修保养记录
* @return 结果
*/
int insertMaintainUpkeepInfo(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 修改维修保养记录
*
* @param maintainUpkeepInfo 维修保养记录
* @return 结果
*/
int updateMaintainUpkeepInfo(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 删除维修保养记录
*
* @param id 维修保养记录主键
* @return 结果
*/
int deleteMaintainUpkeepInfoById(String id);
/**
* 批量删除维修保养记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteMaintainUpkeepInfoByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.god.maintenance.service;
import java.util.List;
import com.god.maintenance.domain.MaintainUpkeepInfo;
/**
* 维修保养记录Service接口
*
* @author god
* @date 2023-12-04
*/
public interface IMaintainUpkeepInfoService {
/**
* 查询维修保养记录
*
* @param id 维修保养记录主键
* @return 维修保养记录
*/
MaintainUpkeepInfo selectMaintainUpkeepInfoById(String id);
/**
* 查询维修保养记录列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录集合
*/
List<MaintainUpkeepInfo> selectMaintainUpkeepInfoList(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 新增维修保养记录
*
* @param maintainUpkeepInfo 维修保养记录
* @return 结果
*/
int insertMaintainUpkeepInfo(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 修改维修保养记录
*
* @param maintainUpkeepInfo 维修保养记录
* @return 结果
*/
int updateMaintainUpkeepInfo(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 批量删除维修保养记录
*
* @param ids 需要删除的维修保养记录主键集合
* @return 结果
*/
int deleteMaintainUpkeepInfoByIds(String[] ids);
/**
* 删除维修保养记录信息
*
* @param id 维修保养记录主键
* @return 结果
*/
int deleteMaintainUpkeepInfoById(String id);
}

View File

@ -0,0 +1,89 @@
package com.god.maintenance.service.impl;
import java.util.List;
import com.god.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.god.maintenance.mapper.MaintainUpkeepInfoMapper;
import com.god.maintenance.domain.MaintainUpkeepInfo;
import com.god.maintenance.service.IMaintainUpkeepInfoService;
/**
* 维修保养记录Service业务层处理
*
* @author god
* @date 2023-12-04
*/
@Service
public class MaintainUpkeepInfoServiceImpl implements IMaintainUpkeepInfoService {
@Autowired
private MaintainUpkeepInfoMapper maintainUpkeepInfoMapper;
/**
* 查询维修保养记录
*
* @param id 维修保养记录主键
* @return 维修保养记录
*/
@Override
public MaintainUpkeepInfo selectMaintainUpkeepInfoById(String id) {
return maintainUpkeepInfoMapper.selectMaintainUpkeepInfoById(id);
}
/**
* 查询维修保养记录列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录
*/
@Override
public List<MaintainUpkeepInfo> selectMaintainUpkeepInfoList(MaintainUpkeepInfo maintainUpkeepInfo) {
return maintainUpkeepInfoMapper.selectMaintainUpkeepInfoList(maintainUpkeepInfo);
}
/**
* 新增维修保养记录
*
* @param maintainUpkeepInfo 维修保养记录
* @return 结果
*/
@Override
public int insertMaintainUpkeepInfo(MaintainUpkeepInfo maintainUpkeepInfo) {
maintainUpkeepInfo.setId(IdUtils.fastSimpleUUID());
return maintainUpkeepInfoMapper.insertMaintainUpkeepInfo(maintainUpkeepInfo);
}
/**
* 修改维修保养记录
*
* @param maintainUpkeepInfo 维修保养记录
* @return 结果
*/
@Override
public int updateMaintainUpkeepInfo(MaintainUpkeepInfo maintainUpkeepInfo) {
return maintainUpkeepInfoMapper.updateMaintainUpkeepInfo(maintainUpkeepInfo);
}
/**
* 批量删除维修保养记录
*
* @param ids 需要删除的维修保养记录主键
* @return 结果
*/
@Override
public int deleteMaintainUpkeepInfoByIds(String[] ids) {
return maintainUpkeepInfoMapper.deleteMaintainUpkeepInfoByIds(ids);
}
/**
* 删除维修保养记录信息
*
* @param id 维修保养记录主键
* @return 结果
*/
@Override
public int deleteMaintainUpkeepInfoById(String id) {
return maintainUpkeepInfoMapper.deleteMaintainUpkeepInfoById(id);
}
}

View File

@ -0,0 +1,129 @@
<?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.god.maintenance.mapper.MaintainUpkeepInfoMapper">
<resultMap type="com.god.maintenance.domain.MaintainUpkeepInfo" id="MaintainUpkeepInfoResult">
<result property="id" column="id"/>
<result property="facilityName" column="facility_name"/>
<result property="facilityType" column="facility_type"/>
<result property="facilityBrand" column="facility_brand"/>
<result property="maintainUpkeepType" column="maintain_upkeep_type"/>
<result property="distinctionPort" column="distinction_port"/>
<result property="nowTime" column="now_time"/>
<result property="maintenanceUser" column="maintenance_user"/>
<result property="maintenanceInfo" column="maintenance_info"/>
<result property="remark" column="remark"/>
<result property="reserveOne" column="reserve_one"/>
<result property="facilityId" column="facility_id"/>
</resultMap>
<sql id="selectMaintainUpkeepInfoVo">
select i.id,
m.device_name as facility_name,
m.device_type as facility_type,
m.device_brand as facility_brand,
i.maintain_upkeep_type,
i.distinction_port,
i.now_time,
i.maintenance_user,
i.maintenance_info,
i.remark,
i.reserve_one,
i.facility_id
from maintain_upkeep_info i
left join gcjx_device_manage m on m.id = i.facility_id
</sql>
<select id="selectMaintainUpkeepInfoList" parameterType="com.god.maintenance.domain.MaintainUpkeepInfo"
resultMap="MaintainUpkeepInfoResult">
<include refid="selectMaintainUpkeepInfoVo"/>
<where>
<if test="facilityName != null and facilityName != ''">and i.facility_name like concat('%', #{facilityName},
'%')
</if>
<if test="facilityType != null and facilityType != ''">and i.facility_type = #{facilityType}</if>
<if test="facilityId != null and facilityId != ''">and i.facility_id = #{facilityId}</if>
<if test="facilityBrand != null and facilityBrand != ''">and i.facility_brand = #{facilityBrand}</if>
<if test="maintainUpkeepType != null and maintainUpkeepType != ''">and i.maintain_upkeep_type =
#{maintainUpkeepType}
</if>
<if test="distinctionPort != null and distinctionPort != ''">and i.distinction_port = #{distinctionPort}</if>
<if test="nowTime != null ">and i.now_time = #{nowTime}</if>
<if test="maintenanceUser != null and maintenanceUser != ''">and i.maintenance_user like concat('%',
#{maintenanceUser}, '%')
</if>
<if test="maintenanceInfo != null and maintenanceInfo != ''">and i.maintenance_info = #{maintenanceInfo}</if>
<if test="reserveOne != null and reserveOne != ''">and i.reserve_one = #{reserveOne}</if>
</where>
</select>
<select id="selectMaintainUpkeepInfoById" parameterType="String" resultMap="MaintainUpkeepInfoResult">
<include refid="selectMaintainUpkeepInfoVo"/>
where i.id = #{id}
</select>
<insert id="insertMaintainUpkeepInfo" parameterType="com.god.maintenance.domain.MaintainUpkeepInfo">
insert into maintain_upkeep_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="facilityName != null and facilityName != ''">facility_name,</if>
<if test="facilityId != null and facilityId != ''">facility_id,</if>
<if test="facilityType != null">facility_type,</if>
<if test="facilityBrand != null">facility_brand,</if>
<if test="maintainUpkeepType != null">maintain_upkeep_type,</if>
<if test="distinctionPort != null">distinction_port,</if>
<if test="nowTime != null">now_time,</if>
<if test="maintenanceUser != null">maintenance_user,</if>
<if test="maintenanceInfo != null">maintenance_info,</if>
<if test="remark != null">remark,</if>
<if test="reserveOne != null">reserve_one,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="facilityName != null and facilityName != ''">#{facilityName},</if>
<if test="facilityId != null and facilityId != ''">#{facilityId},</if>
<if test="facilityType != null">#{facilityType},</if>
<if test="facilityBrand != null">#{facilityBrand},</if>
<if test="maintainUpkeepType != null">#{maintainUpkeepType},</if>
<if test="distinctionPort != null">#{distinctionPort},</if>
<if test="nowTime != null">#{nowTime},</if>
<if test="maintenanceUser != null">#{maintenanceUser},</if>
<if test="maintenanceInfo != null">#{maintenanceInfo},</if>
<if test="remark != null">#{remark},</if>
<if test="reserveOne != null">#{reserveOne},</if>
</trim>
</insert>
<update id="updateMaintainUpkeepInfo" parameterType="com.god.maintenance.domain.MaintainUpkeepInfo">
update maintain_upkeep_info
<trim prefix="SET" suffixOverrides=",">
<if test="facilityName != null and facilityName != ''">facility_name = #{facilityName},</if>
<if test="facilityId != null and facilityId != ''">facility_id = #{facilityId},</if>
<if test="facilityType != null">facility_type = #{facilityType},</if>
<if test="facilityBrand != null">facility_brand = #{facilityBrand},</if>
<if test="maintainUpkeepType != null">maintain_upkeep_type = #{maintainUpkeepType},</if>
<if test="distinctionPort != null">distinction_port = #{distinctionPort},</if>
<if test="nowTime != null">now_time = #{nowTime},</if>
<if test="maintenanceUser != null">maintenance_user = #{maintenanceUser},</if>
<if test="maintenanceInfo != null">maintenance_info = #{maintenanceInfo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="reserveOne != null">reserve_one = #{reserveOne},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteMaintainUpkeepInfoById" parameterType="String">
delete
from maintain_upkeep_info
where id = #{id}
</delete>
<delete id="deleteMaintainUpkeepInfoByIds" parameterType="String">
delete from maintain_upkeep_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询维修保养记录列表
export function listMaintainUpkeepInfo(query) {
return request({
url: '/maintenance/maintainUpkeepInfo/list',
method: 'get',
params: query
})
}
// 查询维修保养记录详细
export function getMaintainUpkeepInfo(id) {
return request({
url: '/maintenance/maintainUpkeepInfo/' + id,
method: 'get'
})
}
// 新增维修保养记录
export function addMaintainUpkeepInfo(data) {
return request({
url: '/maintenance/maintainUpkeepInfo',
method: 'post',
data: data
})
}
// 修改维修保养记录
export function updateMaintainUpkeepInfo(data) {
return request({
url: '/maintenance/maintainUpkeepInfo',
method: 'put',
data: data
})
}
// 删除维修保养记录
export function delMaintainUpkeepInfo(id) {
return request({
url: '/maintenance/maintainUpkeepInfo/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,375 @@
<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="维修设备" prop="facilityId">
<!-- <el-input-->
<!-- v-model="queryParams.facilityId"-->
<!-- placeholder="请输入设备ID"-->
<!-- clearable-->
<!-- -->
<!-- />-->
<el-select v-model="queryParams.facilityId" placeholder="请选择维修设备">
<el-option
v-for="dict in deviceManageList"
:key="dict.id"
:label="dict.deviceName"
:value="dict.id"
@keyup.enter.native="handleQuery"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="维保时间" prop="nowTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.nowTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择维保时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="维修人" prop="maintenanceUser">
<el-input
v-model="queryParams.maintenanceUser"
placeholder="请输入维修人"
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"
>新增
</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="['maintenance:maintainUpkeepInfo: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="['maintenance:maintainUpkeepInfo: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="['maintenance:maintainUpkeepInfo:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="maintainUpkeepInfoList" @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="设备名称" align="center" prop="facilityName" :show-overflow-tooltip="true"/>
<el-table-column label="设备类型" align="center" prop="facilityType" width="140">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.facilityType"/>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" prop="facilityBrand" :show-overflow-tooltip="true"/>
<el-table-column label="维保类型" align="center" prop="maintainUpkeepType">
<template slot-scope="scope">
<dict-tag :options="dict.type.maintain_upkeep_type" :value="scope.row.maintainUpkeepType"/>
</template>
</el-table-column>
<!-- <el-table-column label="区分系统端口" align="center" prop="distinctionPort" />-->
<el-table-column label="维修时间" align="center" prop="nowTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.nowTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="维修人" align="center" prop="maintenanceUser"/>
<el-table-column label="维修内容" align="center" prop="maintenanceInfo" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="备用字段" align="center" prop="reserveOne" />-->
<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)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改维修保养记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备名称" prop="facilityId">
<el-select v-model="form.facilityId" placeholder="请选择维修设备">
<el-option
v-for="dict in deviceManageList"
:key="dict.id"
:label="dict.deviceName"
:value="dict.id"
></el-option>
</el-select>
<!-- <el-input v-model="form.facilityName" placeholder="请输入设备ID"/>-->
</el-form-item>
<!-- <el-form-item label="品牌" prop="facilityBrand">-->
<!-- <el-input v-model="form.facilityBrand" placeholder="请输入品牌"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="维保类型" prop="maintainUpkeepType">-->
<!-- <el-select v-model="form.maintainUpkeepType" placeholder="请选择维修保养类型1维修2保养">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.maintain_upkeep_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="区分系统端口" prop="distinctionPort">-->
<!-- <el-input v-model="form.distinctionPort" placeholder="请输入区分系统端口"/>-->
<!-- </el-form-item>-->
<el-form-item label="维修时间" prop="nowTime">
<el-date-picker clearable
v-model="form.nowTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择维修时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="维修人" prop="maintenanceUser">
<el-input v-model="form.maintenanceUser" placeholder="请输入维修人"/>
</el-form-item>
<el-form-item label="维修内容" prop="maintenanceInfo">
<el-input v-model="form.maintenanceInfo" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="备用字段" prop="reserveOne">-->
<!-- <el-input v-model="form.reserveOne" placeholder="请输入备用字段"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMaintainUpkeepInfo,
getMaintainUpkeepInfo,
delMaintainUpkeepInfo,
addMaintainUpkeepInfo,
updateMaintainUpkeepInfo
} from '@/api/maintenance/maintainUpkeepInfo'
import { listDeviceManage } from '@/api/deviceInfo/deviceManage'
export default {
name: 'MaintainUpkeepInfo',
dicts: ['maintain_upkeep_type', 'gcjx_device_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
maintainUpkeepInfoList: [],
//
deviceManageList:[],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
facilityName: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: "1",
distinctionPort: "9210",
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
reserveOne: null
},
//
form: {},
//
rules: {
facilityName: [
{ required: true, message: '设备不能为空', trigger: 'blur' }
]
}
}
},
created() {
this.getList()
},
methods: {
/** 查询维修保养记录列表 */
getList() {
this.loading = true
listMaintainUpkeepInfo(this.queryParams).then(response => {
this.maintainUpkeepInfoList = response.rows
this.total = response.total
this.loading = false
})
const queryParamsA = {
pageNum: 1,
pageSize: 1000
}
listDeviceManage(queryParamsA).then(response => {
this.deviceManageList = response.rows
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
facilityName: null,
facilityId: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: "1",
distinctionPort: "9210",
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
remark: null,
reserveOne: 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
getMaintainUpkeepInfo(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) {
updateMaintainUpkeepInfo(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addMaintainUpkeepInfo(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 delMaintainUpkeepInfo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('maintenance/maintainUpkeepInfo/export', {
...this.queryParams
}, `maintainUpkeepInfo_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@ -0,0 +1,375 @@
<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="保养设备" prop="facilityId">
<!-- <el-input-->
<!-- v-model="queryParams.facilityId"-->
<!-- placeholder="请输入设备ID"-->
<!-- clearable-->
<!-- -->
<!-- />-->
<el-select v-model="queryParams.facilityId" placeholder="请选择保养设备">
<el-option
v-for="dict in deviceManageList"
:key="dict.id"
:label="dict.deviceName"
:value="dict.id"
@keyup.enter.native="handleQuery"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="维保时间" prop="nowTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.nowTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择维保时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="保养人" prop="maintenanceUser">
<el-input
v-model="queryParams.maintenanceUser"
placeholder="请输入保养人"
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"
>新增
</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="['maintenance:maintainUpkeepInfo: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="['maintenance:maintainUpkeepInfo: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="['maintenance:maintainUpkeepInfo:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="maintainUpkeepInfoList" @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="设备名称" align="center" prop="facilityName" :show-overflow-tooltip="true"/>
<el-table-column label="设备类型" align="center" prop="facilityType" width="140">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.facilityType"/>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" prop="facilityBrand" :show-overflow-tooltip="true"/>
<el-table-column label="维保类型" align="center" prop="maintainUpkeepType">
<template slot-scope="scope">
<dict-tag :options="dict.type.maintain_upkeep_type" :value="scope.row.maintainUpkeepType"/>
</template>
</el-table-column>
<!-- <el-table-column label="区分系统端口" align="center" prop="distinctionPort" />-->
<el-table-column label="保养时间" align="center" prop="nowTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.nowTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="保养人" align="center" prop="maintenanceUser"/>
<el-table-column label="保养内容" align="center" prop="maintenanceInfo" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="备用字段" align="center" prop="reserveOne" />-->
<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)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改维修保养记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备名称" prop="facilityId">
<el-select v-model="form.facilityId" placeholder="请选择维修设备">
<el-option
v-for="dict in deviceManageList"
:key="dict.id"
:label="dict.deviceName"
:value="dict.id"
></el-option>
</el-select>
<!-- <el-input v-model="form.facilityName" placeholder="请输入设备ID"/>-->
</el-form-item>
<!-- <el-form-item label="品牌" prop="facilityBrand">-->
<!-- <el-input v-model="form.facilityBrand" placeholder="请输入品牌"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="维保类型" prop="maintainUpkeepType">-->
<!-- <el-select v-model="form.maintainUpkeepType" placeholder="请选择维修保养类型1维修2保养">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.maintain_upkeep_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="区分系统端口" prop="distinctionPort">-->
<!-- <el-input v-model="form.distinctionPort" placeholder="请输入区分系统端口"/>-->
<!-- </el-form-item>-->
<el-form-item label="保养时间" prop="nowTime">
<el-date-picker clearable
v-model="form.nowTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择维修时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="保养人" prop="maintenanceUser">
<el-input v-model="form.maintenanceUser" placeholder="请输入维修人"/>
</el-form-item>
<el-form-item label="保养内容" prop="maintenanceInfo">
<el-input v-model="form.maintenanceInfo" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="备用字段" prop="reserveOne">-->
<!-- <el-input v-model="form.reserveOne" placeholder="请输入备用字段"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMaintainUpkeepInfo,
getMaintainUpkeepInfo,
delMaintainUpkeepInfo,
addMaintainUpkeepInfo,
updateMaintainUpkeepInfo
} from '@/api/maintenance/maintainUpkeepInfo'
import { listDeviceManage } from '@/api/deviceInfo/deviceManage'
export default {
name: 'MaintainUpkeepInfo',
dicts: ['maintain_upkeep_type', 'gcjx_device_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
maintainUpkeepInfoList: [],
//
deviceManageList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
facilityName: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: '2',
distinctionPort: '9210',
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
reserveOne: null
},
//
form: {},
//
rules: {
facilityName: [
{ required: true, message: '设备不能为空', trigger: 'blur' }
]
}
}
},
created() {
this.getList()
},
methods: {
/** 查询维修保养记录列表 */
getList() {
this.loading = true
listMaintainUpkeepInfo(this.queryParams).then(response => {
this.maintainUpkeepInfoList = response.rows
this.total = response.total
this.loading = false
})
const queryParamsA = {
pageNum: 1,
pageSize: 1000
}
listDeviceManage(queryParamsA).then(response => {
this.deviceManageList = response.rows
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
facilityName: null,
facilityId: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: '2',
distinctionPort: '9210',
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
remark: null,
reserveOne: 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
getMaintainUpkeepInfo(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) {
updateMaintainUpkeepInfo(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addMaintainUpkeepInfo(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 delMaintainUpkeepInfo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('maintenance/maintainUpkeepInfo/export', {
...this.queryParams
}, `maintainUpkeepInfo_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@ -0,0 +1,386 @@
<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="维修设备" prop="facilityId">
<!-- <el-input-->
<!-- v-model="queryParams.facilityId"-->
<!-- placeholder="请输入设备ID"-->
<!-- clearable-->
<!-- -->
<!-- />-->
<el-select v-model="queryParams.facilityId" placeholder="请选择维修设备">
<el-option
v-for="dict in deviceManageList"
:key="dict.id"
:label="dict.deviceName"
:value="dict.id"
@keyup.enter.native="handleQuery"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="维修保养类型1维修2保养" prop="maintainUpkeepType">
<el-select v-model="queryParams.maintainUpkeepType" placeholder="请选择维修保养类型1维修2保养" clearable>
<el-option
v-for="dict in dict.type.maintain_upkeep_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="维保时间" prop="nowTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.nowTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择维保时间">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="维保人" prop="maintenanceUser">
<el-input
v-model="queryParams.maintenanceUser"
placeholder="请输入维保人"
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"
>新增
</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="['maintenance:maintainUpkeepInfo: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="['maintenance:maintainUpkeepInfo: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="['maintenance:maintainUpkeepInfo:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="maintainUpkeepInfoList" @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="设备名称" align="center" prop="facilityName" :show-overflow-tooltip="true"/>
<el-table-column label="设备类型" align="center" prop="facilityType" width="140">
<template slot-scope="scope">
<dict-tag :options="dict.type.gcjx_device_type" :value="scope.row.facilityType"/>
</template>
</el-table-column>
<el-table-column label="品牌" align="center" prop="facilityBrand" :show-overflow-tooltip="true"/>
<el-table-column label="维保类型" align="center" prop="maintainUpkeepType">
<template slot-scope="scope">
<dict-tag :options="dict.type.maintain_upkeep_type" :value="scope.row.maintainUpkeepType"/>
</template>
</el-table-column>
<!-- <el-table-column label="区分系统端口" align="center" prop="distinctionPort" />-->
<el-table-column label="维保时间" align="center" prop="nowTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.nowTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="维保人" align="center" prop="maintenanceUser"/>
<el-table-column label="维保内容" align="center" prop="maintenanceInfo" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="备用字段" align="center" prop="reserveOne" />-->
<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)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改维修保养记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备名称" prop="facilityId">
<el-select v-model="form.facilityId" placeholder="请选择维修设备">
<el-option
v-for="dict in deviceManageList"
:key="dict.id"
:label="dict.deviceName"
:value="dict.id"
></el-option>
</el-select>
<!-- <el-input v-model="form.facilityName" placeholder="请输入设备ID"/>-->
</el-form-item>
<!-- <el-form-item label="品牌" prop="facilityBrand">-->
<!-- <el-input v-model="form.facilityBrand" placeholder="请输入品牌"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="维保类型" prop="maintainUpkeepType">-->
<!-- <el-select v-model="form.maintainUpkeepType" placeholder="请选择维修保养类型1维修2保养">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.maintain_upkeep_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="区分系统端口" prop="distinctionPort">-->
<!-- <el-input v-model="form.distinctionPort" placeholder="请输入区分系统端口"/>-->
<!-- </el-form-item>-->
<el-form-item label="维修时间" prop="nowTime">
<el-date-picker clearable
v-model="form.nowTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择维修时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="维修人" prop="maintenanceUser">
<el-input v-model="form.maintenanceUser" placeholder="请输入维修人"/>
</el-form-item>
<el-form-item label="维修内容" prop="maintenanceInfo">
<el-input v-model="form.maintenanceInfo" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
<!-- <el-form-item label="备用字段" prop="reserveOne">-->
<!-- <el-input v-model="form.reserveOne" placeholder="请输入备用字段"/>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listMaintainUpkeepInfo,
getMaintainUpkeepInfo,
delMaintainUpkeepInfo,
addMaintainUpkeepInfo,
updateMaintainUpkeepInfo
} from '@/api/maintenance/maintainUpkeepInfo'
import { listDeviceManage } from '@/api/deviceInfo/deviceManage'
export default {
name: 'MaintainUpkeepInfo',
dicts: ['maintain_upkeep_type', 'gcjx_device_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
maintainUpkeepInfoList: [],
//
deviceManageList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
facilityName: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: '1',
distinctionPort: '9210',
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
reserveOne: null
},
//
form: {},
//
rules: {
facilityName: [
{ required: true, message: '设备不能为空', trigger: 'blur' }
]
}
}
},
created() {
this.getList()
},
methods: {
/** 查询维修保养记录列表 */
getList() {
this.loading = true
listMaintainUpkeepInfo(this.queryParams).then(response => {
this.maintainUpkeepInfoList = response.rows
this.total = response.total
this.loading = false
})
const queryParamsA = {
pageNum: 1,
pageSize: 1000
}
listDeviceManage(queryParamsA).then(response => {
this.deviceManageList = response.rows
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
facilityName: null,
facilityId: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: '1',
distinctionPort: '9210',
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
remark: null,
reserveOne: 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
getMaintainUpkeepInfo(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) {
updateMaintainUpkeepInfo(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addMaintainUpkeepInfo(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 delMaintainUpkeepInfo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
})
},
/** 导出按钮操作 */
handleExport() {
this.download('maintenance/maintainUpkeepInfo/export', {
...this.queryParams
}, `maintainUpkeepInfo_${new Date().getTime()}.xlsx`)
}
}
}
</script>