Commit acada1cf authored by 耿迪迪's avatar 耿迪迪

调查项

parent 903dbaf4
package com.zehong.web.controller.supervision;
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.TInsSurListInfor;
import com.zehong.system.service.ITInsSurListInforService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 监督检查-调查项Controller
*
* @author zehong
* @date 2024-05-18
*/
@RestController
@RequestMapping("/supervision/survey")
public class TInsSurListInforController extends BaseController
{
@Autowired
private ITInsSurListInforService tInsSurListInforService;
/**
* 查询监督检查-调查项列表
*/
@PreAuthorize("@ss.hasPermi('supervision:survey:list')")
@GetMapping("/list")
public TableDataInfo list(TInsSurListInfor tInsSurListInfor)
{
startPage();
List<TInsSurListInfor> list = tInsSurListInforService.selectTInsSurListInforList(tInsSurListInfor);
return getDataTable(list);
}
/**
* 导出监督检查-调查项列表
*/
@PreAuthorize("@ss.hasPermi('supervision:survey:export')")
@Log(title = "监督检查-调查项", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TInsSurListInfor tInsSurListInfor)
{
List<TInsSurListInfor> list = tInsSurListInforService.selectTInsSurListInforList(tInsSurListInfor);
ExcelUtil<TInsSurListInfor> util = new ExcelUtil<TInsSurListInfor>(TInsSurListInfor.class);
return util.exportExcel(list, "监督检查-调查项数据");
}
/**
* 获取监督检查-调查项详细信息
*/
@PreAuthorize("@ss.hasPermi('supervision:survey:query')")
@GetMapping(value = "/{fInsSurListInforId}")
public AjaxResult getInfo(@PathVariable("fInsSurListInforId") Long fInsSurListInforId)
{
return AjaxResult.success(tInsSurListInforService.selectTInsSurListInforById(fInsSurListInforId));
}
/**
* 新增监督检查-调查项
*/
@PreAuthorize("@ss.hasPermi('supervision:survey:add')")
@Log(title = "监督检查-调查项", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TInsSurListInfor tInsSurListInfor)
{
return toAjax(tInsSurListInforService.insertTInsSurListInfor(tInsSurListInfor));
}
/**
* 修改监督检查-调查项
*/
@PreAuthorize("@ss.hasPermi('supervision:survey:edit')")
@Log(title = "监督检查-调查项", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TInsSurListInfor tInsSurListInfor)
{
return toAjax(tInsSurListInforService.updateTInsSurListInfor(tInsSurListInfor));
}
/**
* 删除监督检查-调查项
*/
@PreAuthorize("@ss.hasPermi('supervision:survey:remove')")
@Log(title = "监督检查-调查项", businessType = BusinessType.DELETE)
@DeleteMapping("/{fInsSurListInforIds}")
public AjaxResult remove(@PathVariable Long[] fInsSurListInforIds)
{
return toAjax(tInsSurListInforService.deleteTInsSurListInforByIds(fInsSurListInforIds));
}
}
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_ins_sur_list_infor
*
* @author zehong
* @date 2024-05-18
*/
public class TInsSurListInfor extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long fInsSurListInforId;
/** 关联的检查任务编码 */
@Excel(name = "关联的检查任务编码")
private String fCheckTaskCode;
/** 检查对象分类,按分类代码表23 分类填写
23-0100 :气代煤
23-0200-0201:传统电代煤
23-0200-0202:石墨烯
23-0200-0203:聚能
23-0200-0204:空气源热泵
23-0200-0205:地源热泵
23-9900-0301:集中供热
23-9900-0302:光伏+
23-9900-0303:光热+
23-9900-0304:醇基燃料
23-9900-0305:生物质 */
@Excel(name = "检查对象分类",dictType = "t_type_code")
private String fTypeCode;
/** 调查内容 */
@Excel(name = "调查内容")
private String fContents;
/** 结果填写类型,1单选、2-多选、3 输入 */
@Excel(name = "结果填写类型",dictType = "t_res_type")
private Long fResType;
/** 结果填写选项,单选和多选内容的可选项,以英文逗号间隔 */
@Excel(name = "结果填写选项")
private String fResOption;
/** 顺序号,调查项在检查对象所有调查项中的顺序号 */
@Excel(name = "顺序号")
private Long ord;
/** 最后修改时间 yyyy-MM-dd hh:mm:ss */
@Excel(name = "最后修改时间")
private String fLastUpdateTime;
public void setfInsSurListInforId(Long fInsSurListInforId)
{
this.fInsSurListInforId = fInsSurListInforId;
}
public Long getfInsSurListInforId()
{
return fInsSurListInforId;
}
public void setfCheckTaskCode(String fCheckTaskCode)
{
this.fCheckTaskCode = fCheckTaskCode;
}
public String getfCheckTaskCode()
{
return fCheckTaskCode;
}
public void setfTypeCode(String fTypeCode)
{
this.fTypeCode = fTypeCode;
}
public String getfTypeCode()
{
return fTypeCode;
}
public void setfContents(String fContents)
{
this.fContents = fContents;
}
public String getfContents()
{
return fContents;
}
public void setfResType(Long fResType)
{
this.fResType = fResType;
}
public Long getfResType()
{
return fResType;
}
public void setfResOption(String fResOption)
{
this.fResOption = fResOption;
}
public String getfResOption()
{
return fResOption;
}
public void setOrd(Long ord)
{
this.ord = ord;
}
public Long getOrd()
{
return ord;
}
public void setfLastUpdateTime(String fLastUpdateTime)
{
this.fLastUpdateTime = fLastUpdateTime;
}
public String getfLastUpdateTime()
{
return fLastUpdateTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fInsSurListInforId", getfInsSurListInforId())
.append("fCheckTaskCode", getfCheckTaskCode())
.append("fTypeCode", getfTypeCode())
.append("fContents", getfContents())
.append("fResType", getfResType())
.append("fResOption", getfResOption())
.append("ord", getOrd())
.append("fLastUpdateTime", getfLastUpdateTime())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TInsSurListInfor;
/**
* 监督检查-调查项Mapper接口
*
* @author zehong
* @date 2024-05-18
*/
public interface TInsSurListInforMapper
{
/**
* 查询监督检查-调查项
*
* @param fInsSurListInforId 监督检查-调查项ID
* @return 监督检查-调查项
*/
public TInsSurListInfor selectTInsSurListInforById(Long fInsSurListInforId);
/**
* 查询监督检查-调查项列表
*
* @param tInsSurListInfor 监督检查-调查项
* @return 监督检查-调查项集合
*/
public List<TInsSurListInfor> selectTInsSurListInforList(TInsSurListInfor tInsSurListInfor);
/**
* 新增监督检查-调查项
*
* @param tInsSurListInfor 监督检查-调查项
* @return 结果
*/
public int insertTInsSurListInfor(TInsSurListInfor tInsSurListInfor);
/**
* 修改监督检查-调查项
*
* @param tInsSurListInfor 监督检查-调查项
* @return 结果
*/
public int updateTInsSurListInfor(TInsSurListInfor tInsSurListInfor);
/**
* 删除监督检查-调查项
*
* @param fInsSurListInforId 监督检查-调查项ID
* @return 结果
*/
public int deleteTInsSurListInforById(Long fInsSurListInforId);
/**
* 批量删除监督检查-调查项
*
* @param fInsSurListInforIds 需要删除的数据ID
* @return 结果
*/
public int deleteTInsSurListInforByIds(Long[] fInsSurListInforIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TInsSurListInfor;
/**
* 监督检查-调查项Service接口
*
* @author zehong
* @date 2024-05-18
*/
public interface ITInsSurListInforService
{
/**
* 查询监督检查-调查项
*
* @param fInsSurListInforId 监督检查-调查项ID
* @return 监督检查-调查项
*/
public TInsSurListInfor selectTInsSurListInforById(Long fInsSurListInforId);
/**
* 查询监督检查-调查项列表
*
* @param tInsSurListInfor 监督检查-调查项
* @return 监督检查-调查项集合
*/
public List<TInsSurListInfor> selectTInsSurListInforList(TInsSurListInfor tInsSurListInfor);
/**
* 新增监督检查-调查项
*
* @param tInsSurListInfor 监督检查-调查项
* @return 结果
*/
public int insertTInsSurListInfor(TInsSurListInfor tInsSurListInfor);
/**
* 修改监督检查-调查项
*
* @param tInsSurListInfor 监督检查-调查项
* @return 结果
*/
public int updateTInsSurListInfor(TInsSurListInfor tInsSurListInfor);
/**
* 批量删除监督检查-调查项
*
* @param fInsSurListInforIds 需要删除的监督检查-调查项ID
* @return 结果
*/
public int deleteTInsSurListInforByIds(Long[] fInsSurListInforIds);
/**
* 删除监督检查-调查项信息
*
* @param fInsSurListInforId 监督检查-调查项ID
* @return 结果
*/
public int deleteTInsSurListInforById(Long fInsSurListInforId);
}
package com.zehong.system.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TInsSurListInforMapper;
import com.zehong.system.domain.TInsSurListInfor;
import com.zehong.system.service.ITInsSurListInforService;
/**
* 监督检查-调查项Service业务层处理
*
* @author zehong
* @date 2024-05-18
*/
@Service
public class TInsSurListInforServiceImpl implements ITInsSurListInforService
{
@Autowired
private TInsSurListInforMapper tInsSurListInforMapper;
/**
* 查询监督检查-调查项
*
* @param fInsSurListInforId 监督检查-调查项ID
* @return 监督检查-调查项
*/
@Override
public TInsSurListInfor selectTInsSurListInforById(Long fInsSurListInforId)
{
return tInsSurListInforMapper.selectTInsSurListInforById(fInsSurListInforId);
}
/**
* 查询监督检查-调查项列表
*
* @param tInsSurListInfor 监督检查-调查项
* @return 监督检查-调查项
*/
@Override
public List<TInsSurListInfor> selectTInsSurListInforList(TInsSurListInfor tInsSurListInfor)
{
return tInsSurListInforMapper.selectTInsSurListInforList(tInsSurListInfor);
}
/**
* 新增监督检查-调查项
*
* @param tInsSurListInfor 监督检查-调查项
* @return 结果
*/
@Override
public int insertTInsSurListInfor(TInsSurListInfor tInsSurListInfor)
{
tInsSurListInfor.setfLastUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
return tInsSurListInforMapper.insertTInsSurListInfor(tInsSurListInfor);
}
/**
* 修改监督检查-调查项
*
* @param tInsSurListInfor 监督检查-调查项
* @return 结果
*/
@Override
public int updateTInsSurListInfor(TInsSurListInfor tInsSurListInfor)
{
tInsSurListInfor.setfLastUpdateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
return tInsSurListInforMapper.updateTInsSurListInfor(tInsSurListInfor);
}
/**
* 批量删除监督检查-调查项
*
* @param fInsSurListInforIds 需要删除的监督检查-调查项ID
* @return 结果
*/
@Override
public int deleteTInsSurListInforByIds(Long[] fInsSurListInforIds)
{
return tInsSurListInforMapper.deleteTInsSurListInforByIds(fInsSurListInforIds);
}
/**
* 删除监督检查-调查项信息
*
* @param fInsSurListInforId 监督检查-调查项ID
* @return 结果
*/
@Override
public int deleteTInsSurListInforById(Long fInsSurListInforId)
{
return tInsSurListInforMapper.deleteTInsSurListInforById(fInsSurListInforId);
}
}
<?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.TInsSurListInforMapper">
<resultMap type="TInsSurListInfor" id="TInsSurListInforResult">
<result property="fInsSurListInforId" column="f_ins_sur_list_infor_id" />
<result property="fCheckTaskCode" column="f_check_task_code" />
<result property="fTypeCode" column="f_type_code" />
<result property="fContents" column="f_contents" />
<result property="fResType" column="f_res_type" />
<result property="fResOption" column="f_res_option" />
<result property="ord" column="ord" />
<result property="fLastUpdateTime" column="f_last_update_time" />
</resultMap>
<sql id="selectTInsSurListInforVo">
select f_ins_sur_list_infor_id, f_check_task_code, f_type_code, f_contents, f_res_type, f_res_option, ord, f_last_update_time from t_ins_sur_list_infor
</sql>
<select id="selectTInsSurListInforList" parameterType="TInsSurListInfor" resultMap="TInsSurListInforResult">
<include refid="selectTInsSurListInforVo"/>
<where>
<if test="fTypeCode != null and fTypeCode != ''"> and f_type_code = #{fTypeCode}</if>
<if test="fResType != null "> and f_res_type = #{fResType}</if>
</where>
</select>
<select id="selectTInsSurListInforById" parameterType="Long" resultMap="TInsSurListInforResult">
<include refid="selectTInsSurListInforVo"/>
where f_ins_sur_list_infor_id = #{fInsSurListInforId}
</select>
<insert id="insertTInsSurListInfor" parameterType="TInsSurListInfor" useGeneratedKeys="true" keyProperty="fInsSurListInforId">
insert into t_ins_sur_list_infor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fCheckTaskCode != null">f_check_task_code,</if>
<if test="fTypeCode != null">f_type_code,</if>
<if test="fContents != null">f_contents,</if>
<if test="fResType != null">f_res_type,</if>
<if test="fResOption != null">f_res_option,</if>
<if test="ord != null">ord,</if>
<if test="fLastUpdateTime != null">f_last_update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fCheckTaskCode != null">#{fCheckTaskCode},</if>
<if test="fTypeCode != null">#{fTypeCode},</if>
<if test="fContents != null">#{fContents},</if>
<if test="fResType != null">#{fResType},</if>
<if test="fResOption != null">#{fResOption},</if>
<if test="ord != null">#{ord},</if>
<if test="fLastUpdateTime != null">#{fLastUpdateTime},</if>
</trim>
</insert>
<update id="updateTInsSurListInfor" parameterType="TInsSurListInfor">
update t_ins_sur_list_infor
<trim prefix="SET" suffixOverrides=",">
<if test="fCheckTaskCode != null">f_check_task_code = #{fCheckTaskCode},</if>
<if test="fTypeCode != null">f_type_code = #{fTypeCode},</if>
<if test="fContents != null">f_contents = #{fContents},</if>
<if test="fResType != null">f_res_type = #{fResType},</if>
<if test="fResOption != null">f_res_option = #{fResOption},</if>
<if test="ord != null">ord = #{ord},</if>
<if test="fLastUpdateTime != null">f_last_update_time = #{fLastUpdateTime},</if>
</trim>
where f_ins_sur_list_infor_id = #{fInsSurListInforId}
</update>
<delete id="deleteTInsSurListInforById" parameterType="Long">
delete from t_ins_sur_list_infor where f_ins_sur_list_infor_id = #{fInsSurListInforId}
</delete>
<delete id="deleteTInsSurListInforByIds" parameterType="String">
delete from t_ins_sur_list_infor where f_ins_sur_list_infor_id in
<foreach item="fInsSurListInforId" collection="array" open="(" separator="," close=")">
#{fInsSurListInforId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询监督检查-调查项列表
export function listInfor(query) {
return request({
url: '/supervision/survey/list',
method: 'get',
params: query
})
}
// 查询监督检查-调查项详细
export function getInfor(fInsSurListInforId) {
return request({
url: '/supervision/survey/' + fInsSurListInforId,
method: 'get'
})
}
// 新增监督检查-调查项
export function addInfor(data) {
return request({
url: '/supervision/survey',
method: 'post',
data: data
})
}
// 修改监督检查-调查项
export function updateInfor(data) {
return request({
url: '/supervision/survey',
method: 'put',
data: data
})
}
// 删除监督检查-调查项
export function delInfor(fInsSurListInforId) {
return request({
url: '/supervision/survey/' + fInsSurListInforId,
method: 'delete'
})
}
// 导出监督检查-调查项
export function exportInfor(query) {
return request({
url: '/supervision/survey/export',
method: 'get',
params: query
})
}
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="120px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="检查任务编码">
<span v-if="detailInfo.fCheckTaskCode">{{ detailInfo.fCheckTaskCode }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检查对象分类">
<span v-if="detailInfo.fTypeCode">{{ $parent.fTypeCodeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="调查内容">
<span v-if="detailInfo.fContents">{{ detailInfo.fContents }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结果填写类型">
<span v-if="detailInfo.fResType">{{ $parent.fResTypeFormat(detailInfo) }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结果填写选项">
<span v-if="detailInfo.fResOption">{{ detailInfo.fResOption }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="顺序号">
<span v-if="detailInfo.ord">{{ detailInfo.ord }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="最后修改时间">
<span v-if="detailInfo.fLastUpdateTime">{{ detailInfo.fLastUpdateTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getInfor } from "@/api/supervision/survey";
export default {
name: "detail-info",
data(){
return{
detailInfo: {
fEnableState: 0,
fDeleteFlag: 0
},
detailOpen: false
}
},
methods:{
getDetailInfo(id){
getInfor(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="110px">
<el-form-item label="检查对象分类" prop="fTypeCode">
<el-select v-model="queryParams.fTypeCode" placeholder="请选择检查对象分类" clearable size="small">
<el-option
v-for="dict in fTypeCodeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="结果填写类型" prop="fResType">
<el-select v-model="queryParams.fResType" placeholder="请选择结果填写类型" clearable size="small">
<el-option
v-for="dict in fResTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</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="['supervision:survey: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="['supervision:survey: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="['supervision:survey:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['supervision:survey:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="inforList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="检查任务编码" align="center" prop="fCheckTaskCode" />
<el-table-column label="检查对象分类" align="center" prop="fTypeCode" :formatter="fTypeCodeFormat" />
<el-table-column label="调查内容" align="center" prop="fContents">
<template slot-scope="scope">
<span v-if="scope.row.fContents">{{ scope.row.fContents }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="结果填写类型" align="center" prop="fResType" :formatter="fResTypeFormat" />
<el-table-column label="结果填写选项" align="center" prop="fResOption">
<template slot-scope="scope">
<span v-if="scope.row.fResOption">{{ scope.row.fResOption }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="顺序号" align="center" prop="ord">
<template slot-scope="scope">
<span v-if="scope.row.ord">{{ scope.row.ord }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="最后修改时间" align="center" prop="fLastUpdateTime" />
<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-document"
@click="handleDetail(scope.row)"
v-hasPermi="['supervision:survey:query']"
>详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['supervision:survey:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['supervision:survey: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 destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="检查任务编码" prop="fCheckTaskCode">
<el-select
v-model="form.fCheckTaskCode"
placeholder="请选择任务编码"
style="width: 100%"
>
<el-option
v-for="task in taskData"
:key="task.fInsTaskInforId"
:label="task.fUniqueCode"
:value="task.fUniqueCode"
/>
</el-select>
</el-form-item>
<el-form-item label="检查对象分类" prop="fTypeCode">
<el-select
v-model="form.fTypeCode"
placeholder="请选择检查对象分类"
style="width: 100%"
>
<el-option
v-for="dict in fTypeCodeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="调查内容" prop="fContents">
<el-input type="textarea" v-model="form.fContents" placeholder="请输入调查内容" />
</el-form-item>
<el-form-item label="结果填写类型" prop="fResType">
<el-select
v-model="form.fResType"
placeholder="请选择结果填写类型"
style="width: 100%"
>
<el-option
v-for="dict in fResTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="结果填写选项" prop="fResOption">
<el-input v-model="form.fResOption" placeholder="请输入结果填写选项" />
</el-form-item>
<el-form-item label="顺序号" prop="ord">
<el-input v-model="form.ord" placeholder="请输入顺序号" />
</el-form-item>
<!--<el-form-item label="最后修改时间" prop="fLastUpdateTime">
<el-input v-model="form.fLastUpdateTime" 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>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div>
</template>
<script>
import { listInfor, getInfor, delInfor, addInfor, updateInfor, exportInfor } from "@/api/supervision/survey";
import { taskList } from "@/api/supervision/task";
import DetailInfo from "./components/DetailInfo";
export default {
name: "Infor",
components: {
DetailInfo
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 调查项表格数据
inforList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 检查对象分类
fTypeCodeOptions: [],
// 结果填写类型
fResTypeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fTypeCode: null,
fResType: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
fCheckTaskCode: [
{ required: true, message: "请选择检查项任务编码", trigger: "change" }
],
fTypeCode: [
{ required: true, message: "请选择检查对象分类", trigger: "change" }
],
fResType: [
{ required: true, message: "请选择结果填写类型", trigger: "change" }
],
},
taskData: []
};
},
created() {
this.getList();
this.getDicts("t_type_code").then(response => {
this.fTypeCodeOptions = response.data;
});
this.getDicts("f_res_type").then(response => {
this.fResTypeOptions = response.data;
});
},
methods: {
/** 查询调查项列表 */
getList() {
this.loading = true;
listInfor(this.queryParams).then(response => {
this.inforList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 检查对象分类
fTypeCodeFormat(row, column) {
return this.selectDictLabel(this.fTypeCodeOptions, row.fTypeCode);
},
// 结果填写类型,1单选、2-多选、3 输入字典翻译
fResTypeFormat(row, column) {
return this.selectDictLabel(this.fResTypeOptions, row.fResType);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fInsSurListInforId: null,
fCheckTaskCode: null,
fTypeCode: null,
fContents: null,
fResType: null,
fResOption: null,
ord: null,
fLastUpdateTime: 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.fInsSurListInforId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getTaskList();
this.open = true;
this.title = "添加调查项";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fInsSurListInforId = row.fInsSurListInforId || this.ids
getInfor(fInsSurListInforId).then(response => {
this.form = response.data;
this.getTaskList();
this.open = true;
this.title = "修改调查项";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fInsSurListInforId != null) {
updateInfor(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfor(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fInsSurListInforIds = row.fInsSurListInforId || this.ids;
this.$confirm('是否确认删除调查项编号为"' + fInsSurListInforIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInfor(fInsSurListInforIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有调查项数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInfor(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
//任务列表
getTaskList(){
taskList().then(res =>{
if(res.code == 200 && res.data){
this.taskData = res.data;
}
})
},
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.fInsSurListInforId);
},
}
};
</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