Commit 2dc91e00 authored by 耿迪迪's avatar 耿迪迪

第三方施工意外事件后台

parent fc620f45
package com.zehong.web.controller.thirdbuild;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TConGasProInc;
import com.zehong.system.service.ITConGasProIncService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 第三方施工-涉气第三方施工意外事件Controller
*
* @author zehong
* @date 2024-06-27
*/
@RestController
@RequestMapping("/third/accident")
public class TConGasProIncController extends BaseController
{
@Autowired
private ITConGasProIncService tConGasProIncService;
/**
* 查询第三方施工-涉气第三方施工意外事件列表
*/
@GetMapping("/list")
public TableDataInfo list(TConGasProInc tConGasProInc)
{
startPage();
List<TConGasProInc> list = tConGasProIncService.selectTConGasProIncList(tConGasProInc);
return getDataTable(list);
}
/**
* 导出第三方施工-涉气第三方施工意外事件列表
*/
@Log(title = "第三方施工-涉气第三方施工意外事件", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TConGasProInc tConGasProInc)
{
List<TConGasProInc> list = tConGasProIncService.selectTConGasProIncList(tConGasProInc);
ExcelUtil<TConGasProInc> util = new ExcelUtil<TConGasProInc>(TConGasProInc.class);
return util.exportExcel(list, "第三方施工-涉气第三方施工意外事件数据");
}
/**
* 获取第三方施工-涉气第三方施工意外事件详细信息
*/
@GetMapping(value = "/{fConGasProIncId}")
public AjaxResult getInfo(@PathVariable("fConGasProIncId") Long fConGasProIncId)
{
return AjaxResult.success(tConGasProIncService.selectTConGasProIncById(fConGasProIncId));
}
/**
* 新增第三方施工-涉气第三方施工意外事件
*/
@Log(title = "第三方施工-涉气第三方施工意外事件", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TConGasProInc tConGasProInc)
{
return toAjax(tConGasProIncService.insertTConGasProInc(tConGasProInc));
}
/**
* 修改第三方施工-涉气第三方施工意外事件
*/
@Log(title = "第三方施工-涉气第三方施工意外事件", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TConGasProInc tConGasProInc)
{
return toAjax(tConGasProIncService.updateTConGasProInc(tConGasProInc));
}
/**
* 删除第三方施工-涉气第三方施工意外事件
*/
@Log(title = "第三方施工-涉气第三方施工意外事件", businessType = BusinessType.DELETE)
@DeleteMapping("/{fConGasProIncIds}")
public AjaxResult remove(@PathVariable Long[] fConGasProIncIds)
{
return toAjax(tConGasProIncService.deleteTConGasProIncByIds(fConGasProIncIds));
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 第三方施工-涉气第三方施工意外事件对象 t_con_gas_pro_inc
*
* @author zehong
* @date 2024-06-27
*/
public class TConGasProInc extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long fConGasProIncId;
/** 项目编码 */
@Excel(name = "项目编码")
private String fIntersectConstructionId;
/** 意外事件标题 */
@Excel(name = "意外事件标题")
private String fTitle;
/** 意外事件描述,施工过程中发生了燃气管道破坏的情况,但及时妥善处置,未发生事故的详细情况 */
@Excel(name = "意外事件描述,施工过程中发生了燃气管道破坏的情况,但及时妥善处置,未发生事故的详细情况")
private String fDescription;
/** 意外事件发生事件 yyyy-MM-dd hh:mm:ss */
@Excel(name = "意外事件发生事件 yyyy-MM-dd hh:mm:ss")
private String fOccurrenctTime;
/** 附件 */
@Excel(name = "附件")
private String fAttachment;
/** 备注 */
@Excel(name = "备注")
private String fRemark;
/** 最后修改时间 yyyy-MM-dd hh:mm:ss */
@Excel(name = "最后修改时间 yyyy-MM-dd hh:mm:ss")
private String fUpdateTime;
public void setfConGasProIncId(Long fConGasProIncId)
{
this.fConGasProIncId = fConGasProIncId;
}
public Long getfConGasProIncId()
{
return fConGasProIncId;
}
public void setfIntersectConstructionId(String fIntersectConstructionId)
{
this.fIntersectConstructionId = fIntersectConstructionId;
}
public String getfIntersectConstructionId()
{
return fIntersectConstructionId;
}
public void setfTitle(String fTitle)
{
this.fTitle = fTitle;
}
public String getfTitle()
{
return fTitle;
}
public void setfDescription(String fDescription)
{
this.fDescription = fDescription;
}
public String getfDescription()
{
return fDescription;
}
public void setfOccurrenctTime(String fOccurrenctTime)
{
this.fOccurrenctTime = fOccurrenctTime;
}
public String getfOccurrenctTime()
{
return fOccurrenctTime;
}
public void setfAttachment(String fAttachment)
{
this.fAttachment = fAttachment;
}
public String getfAttachment()
{
return fAttachment;
}
public void setfRemark(String fRemark)
{
this.fRemark = fRemark;
}
public String getfRemark()
{
return fRemark;
}
public void setfUpdateTime(String fUpdateTime)
{
this.fUpdateTime = fUpdateTime;
}
public String getfUpdateTime()
{
return fUpdateTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fConGasProIncId", getfConGasProIncId())
.append("fIntersectConstructionId", getfIntersectConstructionId())
.append("fTitle", getfTitle())
.append("fDescription", getfDescription())
.append("fOccurrenctTime", getfOccurrenctTime())
.append("fAttachment", getfAttachment())
.append("fRemark", getfRemark())
.append("fUpdateTime", getfUpdateTime())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TConGasProInc;
/**
* 第三方施工-涉气第三方施工意外事件Mapper接口
*
* @author zehong
* @date 2024-06-27
*/
public interface TConGasProIncMapper
{
/**
* 查询第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncId 第三方施工-涉气第三方施工意外事件ID
* @return 第三方施工-涉气第三方施工意外事件
*/
public TConGasProInc selectTConGasProIncById(Long fConGasProIncId);
/**
* 查询第三方施工-涉气第三方施工意外事件列表
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件集合
*/
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 新增第三方施工-涉气第三方施工意外事件
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 结果
*/
public int insertTConGasProInc(TConGasProInc tConGasProInc);
/**
* 修改第三方施工-涉气第三方施工意外事件
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 结果
*/
public int updateTConGasProInc(TConGasProInc tConGasProInc);
/**
* 删除第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncId 第三方施工-涉气第三方施工意外事件ID
* @return 结果
*/
public int deleteTConGasProIncById(Long fConGasProIncId);
/**
* 批量删除第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncIds 需要删除的数据ID
* @return 结果
*/
public int deleteTConGasProIncByIds(Long[] fConGasProIncIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TConGasProInc;
/**
* 第三方施工-涉气第三方施工意外事件Service接口
*
* @author zehong
* @date 2024-06-27
*/
public interface ITConGasProIncService
{
/**
* 查询第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncId 第三方施工-涉气第三方施工意外事件ID
* @return 第三方施工-涉气第三方施工意外事件
*/
public TConGasProInc selectTConGasProIncById(Long fConGasProIncId);
/**
* 查询第三方施工-涉气第三方施工意外事件列表
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件集合
*/
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc);
/**
* 新增第三方施工-涉气第三方施工意外事件
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 结果
*/
public int insertTConGasProInc(TConGasProInc tConGasProInc);
/**
* 修改第三方施工-涉气第三方施工意外事件
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 结果
*/
public int updateTConGasProInc(TConGasProInc tConGasProInc);
/**
* 批量删除第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncIds 需要删除的第三方施工-涉气第三方施工意外事件ID
* @return 结果
*/
public int deleteTConGasProIncByIds(Long[] fConGasProIncIds);
/**
* 删除第三方施工-涉气第三方施工意外事件信息
*
* @param fConGasProIncId 第三方施工-涉气第三方施工意外事件ID
* @return 结果
*/
public int deleteTConGasProIncById(Long fConGasProIncId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TConGasProIncMapper;
import com.zehong.system.domain.TConGasProInc;
import com.zehong.system.service.ITConGasProIncService;
/**
* 第三方施工-涉气第三方施工意外事件Service业务层处理
*
* @author zehong
* @date 2024-06-27
*/
@Service
public class TConGasProIncServiceImpl implements ITConGasProIncService
{
@Autowired
private TConGasProIncMapper tConGasProIncMapper;
/**
* 查询第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncId 第三方施工-涉气第三方施工意外事件ID
* @return 第三方施工-涉气第三方施工意外事件
*/
@Override
public TConGasProInc selectTConGasProIncById(Long fConGasProIncId)
{
return tConGasProIncMapper.selectTConGasProIncById(fConGasProIncId);
}
/**
* 查询第三方施工-涉气第三方施工意外事件列表
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 第三方施工-涉气第三方施工意外事件
*/
@Override
public List<TConGasProInc> selectTConGasProIncList(TConGasProInc tConGasProInc)
{
return tConGasProIncMapper.selectTConGasProIncList(tConGasProInc);
}
/**
* 新增第三方施工-涉气第三方施工意外事件
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 结果
*/
@Override
public int insertTConGasProInc(TConGasProInc tConGasProInc)
{
return tConGasProIncMapper.insertTConGasProInc(tConGasProInc);
}
/**
* 修改第三方施工-涉气第三方施工意外事件
*
* @param tConGasProInc 第三方施工-涉气第三方施工意外事件
* @return 结果
*/
@Override
public int updateTConGasProInc(TConGasProInc tConGasProInc)
{
return tConGasProIncMapper.updateTConGasProInc(tConGasProInc);
}
/**
* 批量删除第三方施工-涉气第三方施工意外事件
*
* @param fConGasProIncIds 需要删除的第三方施工-涉气第三方施工意外事件ID
* @return 结果
*/
@Override
public int deleteTConGasProIncByIds(Long[] fConGasProIncIds)
{
return tConGasProIncMapper.deleteTConGasProIncByIds(fConGasProIncIds);
}
/**
* 删除第三方施工-涉气第三方施工意外事件信息
*
* @param fConGasProIncId 第三方施工-涉气第三方施工意外事件ID
* @return 结果
*/
@Override
public int deleteTConGasProIncById(Long fConGasProIncId)
{
return tConGasProIncMapper.deleteTConGasProIncById(fConGasProIncId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TConGasProIncMapper">
<resultMap type="TConGasProInc" id="TConGasProIncResult">
<result property="fConGasProIncId" column="f_con_gas_pro_inc_id" />
<result property="fIntersectConstructionId" column="f_intersect_construction_id" />
<result property="fTitle" column="f_title" />
<result property="fDescription" column="f_description" />
<result property="fOccurrenctTime" column="f_occurrenct_time" />
<result property="fAttachment" column="f_attachment" />
<result property="fRemark" column="f_remark" />
<result property="fUpdateTime" column="f_update_time" />
</resultMap>
<sql id="selectTConGasProIncVo">
select f_con_gas_pro_inc_id, f_intersect_construction_id, f_title, f_description, f_occurrenct_time, f_attachment, f_remark, f_update_time from t_con_gas_pro_inc
</sql>
<select id="selectTConGasProIncList" parameterType="TConGasProInc" resultMap="TConGasProIncResult">
<include refid="selectTConGasProIncVo"/>
<where>
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''"> and f_intersect_construction_id = #{fIntersectConstructionId}</if>
<if test="fTitle != null and fTitle != ''"> and f_title = #{fTitle}</if>
<if test="fDescription != null and fDescription != ''"> and f_description = #{fDescription}</if>
<if test="fOccurrenctTime != null and fOccurrenctTime != ''"> and f_occurrenct_time = #{fOccurrenctTime}</if>
<if test="fAttachment != null and fAttachment != ''"> and f_attachment = #{fAttachment}</if>
<if test="fRemark != null and fRemark != ''"> and f_remark = #{fRemark}</if>
<if test="fUpdateTime != null and fUpdateTime != ''"> and f_update_time = #{fUpdateTime}</if>
</where>
</select>
<select id="selectTConGasProIncById" parameterType="Long" resultMap="TConGasProIncResult">
<include refid="selectTConGasProIncVo"/>
where f_con_gas_pro_inc_id = #{fConGasProIncId}
</select>
<insert id="insertTConGasProInc" parameterType="TConGasProInc" useGeneratedKeys="true" keyProperty="fConGasProIncId">
insert into t_con_gas_pro_inc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''">f_intersect_construction_id,</if>
<if test="fTitle != null and fTitle != ''">f_title,</if>
<if test="fDescription != null and fDescription != ''">f_description,</if>
<if test="fOccurrenctTime != null and fOccurrenctTime != ''">f_occurrenct_time,</if>
<if test="fAttachment != null and fAttachment != ''">f_attachment,</if>
<if test="fRemark != null and fRemark != ''">f_remark,</if>
<if test="fUpdateTime != null and fUpdateTime != ''">f_update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''">#{fIntersectConstructionId},</if>
<if test="fTitle != null and fTitle != ''">#{fTitle},</if>
<if test="fDescription != null and fDescription != ''">#{fDescription},</if>
<if test="fOccurrenctTime != null and fOccurrenctTime != ''">#{fOccurrenctTime},</if>
<if test="fAttachment != null and fAttachment != ''">#{fAttachment},</if>
<if test="fRemark != null and fRemark != ''">#{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">#{fUpdateTime},</if>
</trim>
</insert>
<update id="updateTConGasProInc" parameterType="TConGasProInc">
update t_con_gas_pro_inc
<trim prefix="SET" suffixOverrides=",">
<if test="fIntersectConstructionId != null and fIntersectConstructionId != ''">f_intersect_construction_id = #{fIntersectConstructionId},</if>
<if test="fTitle != null and fTitle != ''">f_title = #{fTitle},</if>
<if test="fDescription != null and fDescription != ''">f_description = #{fDescription},</if>
<if test="fOccurrenctTime != null and fOccurrenctTime != ''">f_occurrenct_time = #{fOccurrenctTime},</if>
<if test="fAttachment != null and fAttachment != ''">f_attachment = #{fAttachment},</if>
<if test="fRemark != null and fRemark != ''">f_remark = #{fRemark},</if>
<if test="fUpdateTime != null and fUpdateTime != ''">f_update_time = #{fUpdateTime},</if>
</trim>
where f_con_gas_pro_inc_id = #{fConGasProIncId}
</update>
<delete id="deleteTConGasProIncById" parameterType="Long">
delete from t_con_gas_pro_inc where f_con_gas_pro_inc_id = #{fConGasProIncId}
</delete>
<delete id="deleteTConGasProIncByIds" parameterType="String">
delete from t_con_gas_pro_inc where f_con_gas_pro_inc_id in
<foreach item="fConGasProIncId" collection="array" open="(" separator="," close=")">
#{fConGasProIncId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询第三方施工-涉气第三方施工意外事件列表
export function listInc(query) {
return request({
url: '/third/accident/list',
method: 'get',
params: query
})
}
// 查询第三方施工-涉气第三方施工意外事件详细
export function getInc(fConGasProIncId) {
return request({
url: '/third/accident/' + fConGasProIncId,
method: 'get'
})
}
// 新增第三方施工-涉气第三方施工意外事件
export function addInc(data) {
return request({
url: '/third/accident',
method: 'post',
data: data
})
}
// 修改第三方施工-涉气第三方施工意外事件
export function updateInc(data) {
return request({
url: '/third/accident',
method: 'put',
data: data
})
}
// 删除第三方施工-涉气第三方施工意外事件
export function delInc(fConGasProIncId) {
return request({
url: '/third/accident/' + fConGasProIncId,
method: 'delete'
})
}
// 导出第三方施工-涉气第三方施工意外事件
export function exportInc(query) {
return request({
url: '/third/accident/export',
method: 'get',
params: query
})
}
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="项目编码" prop="fIntersectConstructionId">
<el-input
v-model="queryParams.fIntersectConstructionId"
placeholder="请输入项目编码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="意外事件标题" prop="fTitle">
<el-input
v-model="queryParams.fTitle"
placeholder="请输入意外事件标题"
clearable
size="small"
@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"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="incList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="fConGasProIncId" />
<el-table-column label="项目编码" align="center" prop="fIntersectConstructionId" />
<el-table-column label="意外事件标题" align="center" prop="fTitle" />
<el-table-column label="意外事件描述" align="center" prop="fDescription" />
<el-table-column label="意外事件发生事件" align="center" prop="fOccurrenctTime" />
<el-table-column label="附件" align="center" prop="fAttachment" />
<el-table-column label="备注" align="center" prop="fRemark" />
<el-table-column label="最后修改时间" align="center" prop="fUpdateTime" />
<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="fIntersectConstructionId">
<el-input v-model="form.fIntersectConstructionId" placeholder="请输入项目编码" />
</el-form-item>
<el-form-item label="意外事件标题" prop="fTitle">
<el-input v-model="form.fTitle" placeholder="请输入意外事件标题" />
</el-form-item>
<el-form-item label="意外事件描述" prop="fDescription">
<el-input type="textarea" v-model="form.fDescription" placeholder="请输入意外事件描述" />
</el-form-item>
<el-form-item label="意外事件发生事件" prop="fOccurrenctTime">
<el-input v-model="form.fOccurrenctTime" placeholder="请输入意外事件发生事件" />
</el-form-item>
<el-form-item label="附件" prop="fAttachment">
<el-input v-model="form.fAttachment" placeholder="请输入附件" />
</el-form-item>
<el-form-item label="备注" prop="fRemark">
<el-input v-model="form.fRemark" 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 { listInc, getInc, delInc, addInc, updateInc, exportInc } from "@/api/thirdbuild/accident";
export default {
name: "Inc",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 涉气第三方施工意外事件表格数据
incList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fIntersectConstructionId: null,
fTitle: null,
fDescription: null,
fOccurrenctTime: null,
fAttachment: null,
fRemark: null,
fUpdateTime: null
},
// 表单参数
form: {},
// 表单校验
rules: {
fIntersectConstructionId: [
{ required: true, message: "项目编码不能为空", trigger: "blur" }
],
fTitle: [
{ required: true, message: "意外事件标题不能为空", trigger: "blur" }
],
fDescription: [
{ required: true, message: "意外事件描述", trigger: "blur" }
],
fOccurrenctTime: [
{ required: true, message: "意外事件发生事件不能为空", trigger: "blur" }
],
fAttachment: [
{ required: true, message: "附件不能为空", trigger: "blur" }
],
fRemark: [
{ required: true, message: "备注不能为空", trigger: "blur" }
],
fUpdateTime: [
{ required: true, message: "最后修改时间不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询涉气第三方施工意外事件列表 */
getList() {
this.loading = true;
listInc(this.queryParams).then(response => {
this.incList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fConGasProIncId: null,
fIntersectConstructionId: null,
fTitle: null,
fDescription: null,
fOccurrenctTime: null,
fAttachment: null,
fRemark: null,
fUpdateTime: 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.fConGasProIncId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加涉气第三方施工意外事件";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fConGasProIncId = row.fConGasProIncId || this.ids
getInc(fConGasProIncId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改涉气第三方施工意外事件";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fConGasProIncId != null) {
updateInc(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInc(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fConGasProIncIds = row.fConGasProIncId || this.ids;
this.$confirm('是否确认删除涉气第三方施工意外事件编号为"' + fConGasProIncIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInc(fConGasProIncIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有涉气第三方施工意外事件数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInc(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment