Commit 4a0fa139 authored by gaoyingwei's avatar gaoyingwei

新增 危重症人员

parent 4854f366
package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Wzzry;
import com.ruoyi.system.service.IWzzryService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 危重症人员Controller
*
* @author ruoyi
* @date 2022-12-02
*/
@RestController
@RequestMapping("/system/wzzry")
public class WzzryController extends BaseController
{
@Autowired
private IWzzryService wzzryService;
/**
* 查询危重症人员列表
*/
@PreAuthorize("@ss.hasPermi('system:wzzry:list')")
@GetMapping("/list")
public TableDataInfo list(Wzzry wzzry)
{
startPage();
List<Wzzry> list = wzzryService.selectWzzryList(wzzry);
return getDataTable(list);
}
/**
* 导出危重症人员列表
*/
@PreAuthorize("@ss.hasPermi('system:wzzry:export')")
@Log(title = "危重症人员", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Wzzry wzzry)
{
List<Wzzry> list = wzzryService.selectWzzryList(wzzry);
ExcelUtil<Wzzry> util = new ExcelUtil<Wzzry>(Wzzry.class);
util.exportExcel(response, list, "危重症人员数据");
}
/**
* 获取危重症人员详细信息
*/
@PreAuthorize("@ss.hasPermi('system:wzzry:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(wzzryService.selectWzzryById(id));
}
/**
* 新增危重症人员
*/
@PreAuthorize("@ss.hasPermi('system:wzzry:add')")
@Log(title = "危重症人员", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody Wzzry wzzry)
{
return toAjax(wzzryService.insertWzzry(wzzry));
}
/**
* 修改危重症人员
*/
@PreAuthorize("@ss.hasPermi('system:wzzry:edit')")
@Log(title = "危重症人员", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody Wzzry wzzry)
{
return toAjax(wzzryService.updateWzzry(wzzry));
}
/**
* 删除危重症人员
*/
@PreAuthorize("@ss.hasPermi('system:wzzry:remove')")
@Log(title = "危重症人员", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(wzzryService.deleteWzzryByIds(ids));
}
}
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 危重症人员对象 wzzry
*
* @author ruoyi
* @date 2022-12-02
*/
public class Wzzry extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 姓名 */
@Excel(name = "姓名")
private String userName;
/** 身份证号码 */
@Excel(name = "身份证号码")
private String cardNo;
/** 联系方式 */
@Excel(name = "联系方式")
private String phone;
/** 街道/镇 */
@Excel(name = "街道/镇")
private String street;
/** 居委会 */
@Excel(name = "居委会")
private String committee;
/** 小区/村名称 */
@Excel(name = "小区/村名称")
private String community;
/** 楼号 */
@Excel(name = "楼号")
private String building;
/** 单元号 */
@Excel(name = "单元号")
private String unit;
/** 楼层 */
@Excel(name = "楼层")
private String floor;
/** 门牌号 */
@Excel(name = "门牌号")
private String house;
/** 住址 */
@Excel(name = "住址")
private String address;
/** 基础病情况(逗号分割) */
@Excel(name = "基础病情况", readConverterExp = "逗=号分割")
private String basicDisease;
/** 是否有人照顾(0:是,1:否) */
@Excel(name = "是否有人照顾", readConverterExp = "0=:是,1:否")
private String isCare;
/** 同住人数(不包括自己) */
@Excel(name = "同住人数(不包括自己)")
private Long cohabitantsNumber;
/** 状态(0正常 1停用) */
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志(0代表存在 2代表删除) */
private String delFlag;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setCardNo(String cardNo)
{
this.cardNo = cardNo;
}
public String getCardNo()
{
return cardNo;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setStreet(String street)
{
this.street = street;
}
public String getStreet()
{
return street;
}
public void setCommittee(String committee)
{
this.committee = committee;
}
public String getCommittee()
{
return committee;
}
public void setCommunity(String community)
{
this.community = community;
}
public String getCommunity()
{
return community;
}
public void setBuilding(String building)
{
this.building = building;
}
public String getBuilding()
{
return building;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
public void setFloor(String floor)
{
this.floor = floor;
}
public String getFloor()
{
return floor;
}
public void setHouse(String house)
{
this.house = house;
}
public String getHouse()
{
return house;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setBasicDisease(String basicDisease)
{
this.basicDisease = basicDisease;
}
public String getBasicDisease()
{
return basicDisease;
}
public void setIsCare(String isCare)
{
this.isCare = isCare;
}
public String getIsCare()
{
return isCare;
}
public void setCohabitantsNumber(Long cohabitantsNumber)
{
this.cohabitantsNumber = cohabitantsNumber;
}
public Long getCohabitantsNumber()
{
return cohabitantsNumber;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
public String getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("userName", getUserName())
.append("cardNo", getCardNo())
.append("phone", getPhone())
.append("street", getStreet())
.append("committee", getCommittee())
.append("community", getCommunity())
.append("building", getBuilding())
.append("unit", getUnit())
.append("floor", getFloor())
.append("house", getHouse())
.append("address", getAddress())
.append("basicDisease", getBasicDisease())
.append("isCare", getIsCare())
.append("cohabitantsNumber", getCohabitantsNumber())
.append("status", getStatus())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Wzzry;
/**
* 危重症人员Mapper接口
*
* @author ruoyi
* @date 2022-12-02
*/
public interface WzzryMapper
{
/**
* 查询危重症人员
*
* @param id 危重症人员主键
* @return 危重症人员
*/
public Wzzry selectWzzryById(Long id);
/**
* 查询危重症人员列表
*
* @param wzzry 危重症人员
* @return 危重症人员集合
*/
public List<Wzzry> selectWzzryList(Wzzry wzzry);
/**
* 新增危重症人员
*
* @param wzzry 危重症人员
* @return 结果
*/
public int insertWzzry(Wzzry wzzry);
/**
* 修改危重症人员
*
* @param wzzry 危重症人员
* @return 结果
*/
public int updateWzzry(Wzzry wzzry);
/**
* 删除危重症人员
*
* @param id 危重症人员主键
* @return 结果
*/
public int deleteWzzryById(Long id);
/**
* 批量删除危重症人员
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWzzryByIds(Long[] ids);
}
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Wzzry;
/**
* 危重症人员Service接口
*
* @author ruoyi
* @date 2022-12-02
*/
public interface IWzzryService
{
/**
* 查询危重症人员
*
* @param id 危重症人员主键
* @return 危重症人员
*/
public Wzzry selectWzzryById(Long id);
/**
* 查询危重症人员列表
*
* @param wzzry 危重症人员
* @return 危重症人员集合
*/
public List<Wzzry> selectWzzryList(Wzzry wzzry);
/**
* 新增危重症人员
*
* @param wzzry 危重症人员
* @return 结果
*/
public int insertWzzry(Wzzry wzzry);
/**
* 修改危重症人员
*
* @param wzzry 危重症人员
* @return 结果
*/
public int updateWzzry(Wzzry wzzry);
/**
* 批量删除危重症人员
*
* @param ids 需要删除的危重症人员主键集合
* @return 结果
*/
public int deleteWzzryByIds(Long[] ids);
/**
* 删除危重症人员信息
*
* @param id 危重症人员主键
* @return 结果
*/
public int deleteWzzryById(Long id);
}
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.system.mapper.WzzryMapper;
import com.ruoyi.system.domain.Wzzry;
import com.ruoyi.system.service.IWzzryService;
/**
* 危重症人员Service业务层处理
*
* @author ruoyi
* @date 2022-12-02
*/
@Service
public class WzzryServiceImpl implements IWzzryService
{
@Autowired
private WzzryMapper wzzryMapper;
/**
* 查询危重症人员
*
* @param id 危重症人员主键
* @return 危重症人员
*/
@Override
public Wzzry selectWzzryById(Long id)
{
return wzzryMapper.selectWzzryById(id);
}
/**
* 查询危重症人员列表
*
* @param wzzry 危重症人员
* @return 危重症人员
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u")
public List<Wzzry> selectWzzryList(Wzzry wzzry)
{
return wzzryMapper.selectWzzryList(wzzry);
}
/**
* 新增危重症人员
*
* @param wzzry 危重症人员
* @return 结果
*/
@Override
public int insertWzzry(Wzzry wzzry)
{
wzzry.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
wzzry.setCreateTime(DateUtils.getNowDate());
return wzzryMapper.insertWzzry(wzzry);
}
/**
* 修改危重症人员
*
* @param wzzry 危重症人员
* @return 结果
*/
@Override
public int updateWzzry(Wzzry wzzry)
{
wzzry.setUpdateTime(DateUtils.getNowDate());
return wzzryMapper.updateWzzry(wzzry);
}
/**
* 批量删除危重症人员
*
* @param ids 需要删除的危重症人员主键
* @return 结果
*/
@Override
public int deleteWzzryByIds(Long[] ids)
{
return wzzryMapper.deleteWzzryByIds(ids);
}
/**
* 删除危重症人员信息
*
* @param id 危重症人员主键
* @return 结果
*/
@Override
public int deleteWzzryById(Long id)
{
return wzzryMapper.deleteWzzryById(id);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.WzzryMapper">
<resultMap type="Wzzry" id="WzzryResult">
<result property="id" column="id" />
<result property="userName" column="user_name" />
<result property="cardNo" column="card_no" />
<result property="phone" column="phone" />
<result property="street" column="street" />
<result property="committee" column="committee" />
<result property="community" column="community" />
<result property="building" column="building" />
<result property="unit" column="unit" />
<result property="floor" column="floor" />
<result property="house" column="house" />
<result property="address" column="address" />
<result property="basicDisease" column="basic_disease" />
<result property="isCare" column="is_care" />
<result property="cohabitantsNumber" column="cohabitants_number" />
<result property="status" column="status" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectWzzryVo">
select id, user_name, card_no, phone, street, committee, community, building, unit, floor, house, address, basic_disease, is_care, cohabitants_number, status, del_flag, create_by, create_time, update_by, update_time, remark from wzzry
</sql>
<select id="selectWzzryList" parameterType="Wzzry" resultMap="WzzryResult">
select a.id, a.user_name, a.card_no, a.phone, a.street, a.committee, a.community, a.building, a.unit, a.floor, a.house, a.address, a.basic_disease, a.is_care, a.cohabitants_number, a.status, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark from wzzry a
left join sys_user u on u.user_id = a.create_by
left join sys_dept d on u.dept_id = d.dept_id
where a.del_flag = 0
<if test="userName != null and userName != ''"> and a.user_name like concat('%', #{userName}, '%')</if>
<if test="cardNo != null and cardNo != ''"> and a.card_no like concat('%', #{cardNo}, '%')</if>
<if test="phone != null and phone != ''"> and a.phone like concat('%', #{phone}, '%')</if>
<if test="street != null and street != ''"> and a.street = #{street}</if>
<if test="committee != null and committee != ''"> and a.committee = #{committee}</if>
<if test="community != null and community != ''"> and a.community = #{community}</if>
<if test="building != null and building != ''"> and a.building like concat('%', #{building}, '%')</if>
<if test="unit != null and unit != ''"> and a.unit like concat('%', #{unit}, '%')</if>
<if test="floor != null and floor != ''"> and a.floor = #{floor}</if>
<if test="house != null and house != ''"> and a.house like concat('%', #{house}, '%')</if>
<if test="address != null and address != ''"> and a.address like concat('%', #{address}, '%')</if>
<if test="basicDisease != null and basicDisease != ''"> and a.basic_disease = #{basicDisease}</if>
<if test="isCare != null and isCare != ''"> and a.is_care = #{isCare}</if>
<if test="cohabitantsNumber != null "> and a.cohabitants_number like concat('%', #{cohabitantsNumber}, '%')</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
${params.dataScope}
</select>
<select id="selectWzzryById" parameterType="Long" resultMap="WzzryResult">
<include refid="selectWzzryVo"/>
where id = #{id}
</select>
<insert id="insertWzzry" parameterType="Wzzry" useGeneratedKeys="true" keyProperty="id">
insert into wzzry
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userName != null">user_name,</if>
<if test="cardNo != null">card_no,</if>
<if test="phone != null">phone,</if>
<if test="street != null">street,</if>
<if test="committee != null">committee,</if>
<if test="community != null">community,</if>
<if test="building != null">building,</if>
<if test="unit != null">unit,</if>
<if test="floor != null">floor,</if>
<if test="house != null">house,</if>
<if test="address != null">address,</if>
<if test="basicDisease != null">basic_disease,</if>
<if test="isCare != null">is_care,</if>
<if test="cohabitantsNumber != null">cohabitants_number,</if>
<if test="status != null">status,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userName != null">#{userName},</if>
<if test="cardNo != null">#{cardNo},</if>
<if test="phone != null">#{phone},</if>
<if test="street != null">#{street},</if>
<if test="committee != null">#{committee},</if>
<if test="community != null">#{community},</if>
<if test="building != null">#{building},</if>
<if test="unit != null">#{unit},</if>
<if test="floor != null">#{floor},</if>
<if test="house != null">#{house},</if>
<if test="address != null">#{address},</if>
<if test="basicDisease != null">#{basicDisease},</if>
<if test="isCare != null">#{isCare},</if>
<if test="cohabitantsNumber != null">#{cohabitantsNumber},</if>
<if test="status != null">#{status},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateWzzry" parameterType="Wzzry">
update wzzry
<trim prefix="SET" suffixOverrides=",">
<if test="userName != null">user_name = #{userName},</if>
<if test="cardNo != null">card_no = #{cardNo},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="street != null">street = #{street},</if>
<if test="committee != null">committee = #{committee},</if>
<if test="community != null">community = #{community},</if>
<if test="building != null">building = #{building},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="floor != null">floor = #{floor},</if>
<if test="house != null">house = #{house},</if>
<if test="address != null">address = #{address},</if>
<if test="basicDisease != null">basic_disease = #{basicDisease},</if>
<if test="isCare != null">is_care = #{isCare},</if>
<if test="cohabitantsNumber != null">cohabitants_number = #{cohabitantsNumber},</if>
<if test="status != null">status = #{status},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWzzryById" parameterType="Long">
delete from wzzry where id = #{id}
</delete>
<delete id="deleteWzzryByIds" parameterType="String">
update wzzry set del_flag = '1' where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询危重症人员列表
export function listWzzry(query) {
return request({
url: '/system/wzzry/list',
method: 'get',
params: query
})
}
// 查询危重症人员详细
export function getWzzry(id) {
return request({
url: '/system/wzzry/' + id,
method: 'get'
})
}
// 新增危重症人员
export function addWzzry(data) {
return request({
url: '/system/wzzry',
method: 'post',
data: data
})
}
// 修改危重症人员
export function updateWzzry(data) {
return request({
url: '/system/wzzry',
method: 'put',
data: data
})
}
// 删除危重症人员
export function delWzzry(id) {
return request({
url: '/system/wzzry/' + id,
method: 'delete'
})
}
<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="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="身份证号码" prop="cardNo">
<el-input
v-model="queryParams.cardNo"
placeholder="请输入身份证号码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系方式" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入联系方式"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="楼号" prop="building">
<el-input
v-model="queryParams.building"
placeholder="请输入楼号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单元号" prop="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入单元号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="门牌号" prop="house">
<el-input
v-model="queryParams.house"
placeholder="请输入门牌号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="住址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入住址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="同住人数(不包括自己)" prop="cohabitantsNumber">
<el-input
v-model="queryParams.cohabitantsNumber"
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"
v-hasPermi="['system:wzzry: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="['system:wzzry: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="['system:wzzry: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="['system:wzzry:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="wzzryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="姓名" align="center" prop="userName" />
<el-table-column label="身份证号码" align="center" prop="cardNo" />
<el-table-column label="联系方式" align="center" prop="phone" />
<el-table-column label="街道/镇" align="center" prop="street" />
<el-table-column label="居委会" align="center" prop="committee" />
<el-table-column label="小区/村名称" align="center" prop="community" />
<el-table-column label="楼号" align="center" prop="building" />
<el-table-column label="单元号" align="center" prop="unit" />
<el-table-column label="楼层" align="center" prop="floor" />
<el-table-column label="门牌号" align="center" prop="house" />
<el-table-column label="住址" align="center" prop="address" />
<el-table-column label="基础病情况" align="center" prop="basicDisease" />
<el-table-column label="是否有人照顾" align="center" prop="isCare" />
<el-table-column label="同住人数(不包括自己)" align="center" prop="cohabitantsNumber" />
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:wzzry:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:wzzry:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改危重症人员对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="userName">
<el-input v-model="form.userName" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="身份证号码" prop="cardNo">
<el-input v-model="form.cardNo" placeholder="请输入身份证号码" />
</el-form-item>
<el-form-item label="联系方式" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系方式" />
</el-form-item>
<el-form-item label="楼号" prop="building">
<el-input v-model="form.building" placeholder="请输入楼号" />
</el-form-item>
<el-form-item label="单元号" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单元号" />
</el-form-item>
<el-form-item label="门牌号" prop="house">
<el-input v-model="form.house" placeholder="请输入门牌号" />
</el-form-item>
<el-form-item label="住址" prop="address">
<el-input v-model="form.address" placeholder="请输入住址" />
</el-form-item>
<el-form-item label="同住人数(不包括自己)" prop="cohabitantsNumber">
<el-input v-model="form.cohabitantsNumber" placeholder="请输入同住人数(不包括自己)" />
</el-form-item>
<el-form-item label="删除标志" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标志" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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 { listWzzry, getWzzry, delWzzry, addWzzry, updateWzzry } from "@/api/system/wzzry";
export default {
name: "Wzzry",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 危重症人员表格数据
wzzryList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userName: null,
cardNo: null,
phone: null,
street: null,
committee: null,
community: null,
building: null,
unit: null,
floor: null,
house: null,
address: null,
basicDisease: null,
isCare: null,
cohabitantsNumber: null,
status: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询危重症人员列表 */
getList() {
this.loading = true;
listWzzry(this.queryParams).then(response => {
this.wzzryList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
userName: null,
cardNo: null,
phone: null,
street: null,
committee: null,
community: null,
building: null,
unit: null,
floor: null,
house: null,
address: null,
basicDisease: null,
isCare: null,
cohabitantsNumber: null,
status: "0",
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: 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
getWzzry(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) {
updateWzzry(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addWzzry(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 delWzzry(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/wzzry/export', {
...this.queryParams
}, `wzzry_${new Date().getTime()}.xlsx`)
}
}
};
</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