添加常住人口登记

master
hansha 2 years ago
parent d9bc87ca92
commit f455fa231a

@ -0,0 +1,104 @@
package com.da.dangan.controller;
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.da.common.annotation.Log;
import com.da.common.core.controller.BaseController;
import com.da.common.core.domain.AjaxResult;
import com.da.common.enums.BusinessType;
import com.da.dangan.domain.DaCzrkdj;
import com.da.dangan.service.IDaCzrkdjService;
import com.da.common.utils.poi.ExcelUtil;
import com.da.common.core.page.TableDataInfo;
/**
* Controller
*
* @author hs
* @date 2024-05-08
*/
@RestController
@RequestMapping("/dangan/czrkdj")
public class DaCzrkdjController extends BaseController
{
@Autowired
private IDaCzrkdjService daCzrkdjService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:list')")
@GetMapping("/list")
public TableDataInfo list(DaCzrkdj daCzrkdj)
{
startPage();
List<DaCzrkdj> list = daCzrkdjService.selectDaCzrkdjList(daCzrkdj);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:export')")
@Log(title = "常住人口登记", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DaCzrkdj daCzrkdj)
{
List<DaCzrkdj> list = daCzrkdjService.selectDaCzrkdjList(daCzrkdj);
ExcelUtil<DaCzrkdj> util = new ExcelUtil<DaCzrkdj>(DaCzrkdj.class);
util.exportExcel(response, list, "常住人口登记数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(daCzrkdjService.selectDaCzrkdjById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:add')")
@Log(title = "常住人口登记", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DaCzrkdj daCzrkdj)
{
return toAjax(daCzrkdjService.insertDaCzrkdj(daCzrkdj));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:edit')")
@Log(title = "常住人口登记", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DaCzrkdj daCzrkdj)
{
return toAjax(daCzrkdjService.updateDaCzrkdj(daCzrkdj));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('dangan:czrkdj:remove')")
@Log(title = "常住人口登记", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(daCzrkdjService.deleteDaCzrkdjByIds(ids));
}
}

@ -0,0 +1,172 @@
package com.da.dangan.domain;
import com.da.common.annotation.Excel;
import com.da.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* da_czrkdj
*
* @author hs
* @date 2024-05-08
*/
public class DaCzrkdj extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 目录id */
@Excel(name = "目录id")
private Long muId;
/** 姓名 */
@Excel(name = "姓名")
private String name;
/** 户主姓名 */
@Excel(name = "户主姓名")
private String hzName;
/** 与户主关系 */
@Excel(name = "与户主关系")
private String relation;
/** 出生日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 籍贯 */
@Excel(name = "籍贯")
private String jiguan;
/** 身份证号 */
@Excel(name = "身份证号")
private String cardId;
/** 档案图片 */
@Excel(name = "档案图片")
private String pictures;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMuId(Long muId)
{
this.muId = muId;
}
public Long getMuId()
{
return muId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setHzName(String hzName)
{
this.hzName = hzName;
}
public String getHzName()
{
return hzName;
}
public void setRelation(String relation)
{
this.relation = relation;
}
public String getRelation()
{
return relation;
}
public void setBirthday(Date birthday)
{
this.birthday = birthday;
}
public Date getBirthday()
{
return birthday;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
public void setJiguan(String jiguan)
{
this.jiguan = jiguan;
}
public String getJiguan()
{
return jiguan;
}
public void setCardId(String cardId)
{
this.cardId = cardId;
}
public String getCardId()
{
return cardId;
}
public void setPictures(String pictures)
{
this.pictures = pictures;
}
public String getPictures()
{
return pictures;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("muId", getMuId())
.append("name", getName())
.append("hzName", getHzName())
.append("relation", getRelation())
.append("birthday", getBirthday())
.append("address", getAddress())
.append("jiguan", getJiguan())
.append("cardId", getCardId())
.append("pictures", getPictures())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,62 @@
package com.da.dangan.mapper;
import com.da.dangan.domain.DaCzrkdj;
import java.util.List;
/**
* Mapper
*
* @author hs
* @date 2024-05-08
*/
public interface DaCzrkdjMapper
{
/**
*
*
* @param id
* @return
*/
public DaCzrkdj selectDaCzrkdjById(Long id);
/**
*
*
* @param daCzrkdj
* @return
*/
public List<DaCzrkdj> selectDaCzrkdjList(DaCzrkdj daCzrkdj);
/**
*
*
* @param daCzrkdj
* @return
*/
public int insertDaCzrkdj(DaCzrkdj daCzrkdj);
/**
*
*
* @param daCzrkdj
* @return
*/
public int updateDaCzrkdj(DaCzrkdj daCzrkdj);
/**
*
*
* @param id
* @return
*/
public int deleteDaCzrkdjById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteDaCzrkdjByIds(Long[] ids);
}

@ -0,0 +1,62 @@
package com.da.dangan.service;
import com.da.dangan.domain.DaCzrkdj;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-05-08
*/
public interface IDaCzrkdjService
{
/**
*
*
* @param id
* @return
*/
public DaCzrkdj selectDaCzrkdjById(Long id);
/**
*
*
* @param daCzrkdj
* @return
*/
public List<DaCzrkdj> selectDaCzrkdjList(DaCzrkdj daCzrkdj);
/**
*
*
* @param daCzrkdj
* @return
*/
public int insertDaCzrkdj(DaCzrkdj daCzrkdj);
/**
*
*
* @param daCzrkdj
* @return
*/
public int updateDaCzrkdj(DaCzrkdj daCzrkdj);
/**
*
*
* @param ids
* @return
*/
public int deleteDaCzrkdjByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteDaCzrkdjById(Long id);
}

@ -0,0 +1,97 @@
package com.da.dangan.service.impl;
import com.da.common.utils.DateUtils;
import com.da.dangan.domain.DaCzrkdj;
import com.da.dangan.mapper.DaCzrkdjMapper;
import com.da.dangan.service.IDaCzrkdjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author hs
* @date 2024-05-08
*/
@Service
public class DaCzrkdjServiceImpl implements IDaCzrkdjService
{
@Autowired
private DaCzrkdjMapper daCzrkdjMapper;
/**
*
*
* @param id
* @return
*/
@Override
public DaCzrkdj selectDaCzrkdjById(Long id)
{
return daCzrkdjMapper.selectDaCzrkdjById(id);
}
/**
*
*
* @param daCzrkdj
* @return
*/
@Override
public List<DaCzrkdj> selectDaCzrkdjList(DaCzrkdj daCzrkdj)
{
return daCzrkdjMapper.selectDaCzrkdjList(daCzrkdj);
}
/**
*
*
* @param daCzrkdj
* @return
*/
@Override
public int insertDaCzrkdj(DaCzrkdj daCzrkdj)
{
daCzrkdj.setCreateTime(DateUtils.getNowDate());
return daCzrkdjMapper.insertDaCzrkdj(daCzrkdj);
}
/**
*
*
* @param daCzrkdj
* @return
*/
@Override
public int updateDaCzrkdj(DaCzrkdj daCzrkdj)
{
daCzrkdj.setUpdateTime(DateUtils.getNowDate());
return daCzrkdjMapper.updateDaCzrkdj(daCzrkdj);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteDaCzrkdjByIds(Long[] ids)
{
return daCzrkdjMapper.deleteDaCzrkdjByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteDaCzrkdjById(Long id)
{
return daCzrkdjMapper.deleteDaCzrkdjById(id);
}
}

@ -0,0 +1,116 @@
<?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.da.dangan.mapper.DaCzrkdjMapper">
<resultMap type="DaCzrkdj" id="DaCzrkdjResult">
<result property="id" column="id" />
<result property="muId" column="mu_id" />
<result property="name" column="name" />
<result property="hzName" column="hz_name" />
<result property="relation" column="relation" />
<result property="birthday" column="birthday" />
<result property="address" column="address" />
<result property="jiguan" column="jiguan" />
<result property="cardId" column="card_id" />
<result property="pictures" column="pictures" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDaCzrkdjVo">
select id, mu_id, name, hz_name, relation, birthday, address, jiguan, card_id, pictures, remark, create_by, create_time, update_by, update_time from da_czrkdj
</sql>
<select id="selectDaCzrkdjList" parameterType="DaCzrkdj" resultMap="DaCzrkdjResult">
<include refid="selectDaCzrkdjVo"/>
<where>
<if test="muId != null "> and mu_id = #{muId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="hzName != null and hzName != ''"> and hz_name like concat('%', #{hzName}, '%')</if>
<if test="relation != null and relation != ''"> and relation = #{relation}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="jiguan != null and jiguan != ''"> and jiguan = #{jiguan}</if>
<if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
<if test="pictures != null and pictures != ''"> and pictures = #{pictures}</if>
</where>
</select>
<select id="selectDaCzrkdjById" parameterType="Long" resultMap="DaCzrkdjResult">
<include refid="selectDaCzrkdjVo"/>
where id = #{id}
</select>
<insert id="insertDaCzrkdj" parameterType="DaCzrkdj" useGeneratedKeys="true" keyProperty="id">
insert into da_czrkdj
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="muId != null">mu_id,</if>
<if test="name != null">name,</if>
<if test="hzName != null">hz_name,</if>
<if test="relation != null">relation,</if>
<if test="birthday != null">birthday,</if>
<if test="address != null">address,</if>
<if test="jiguan != null">jiguan,</if>
<if test="cardId != null">card_id,</if>
<if test="pictures != null">pictures,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="muId != null">#{muId},</if>
<if test="name != null">#{name},</if>
<if test="hzName != null">#{hzName},</if>
<if test="relation != null">#{relation},</if>
<if test="birthday != null">#{birthday},</if>
<if test="address != null">#{address},</if>
<if test="jiguan != null">#{jiguan},</if>
<if test="cardId != null">#{cardId},</if>
<if test="pictures != null">#{pictures},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDaCzrkdj" parameterType="DaCzrkdj">
update da_czrkdj
<trim prefix="SET" suffixOverrides=",">
<if test="muId != null">mu_id = #{muId},</if>
<if test="name != null">name = #{name},</if>
<if test="hzName != null">hz_name = #{hzName},</if>
<if test="relation != null">relation = #{relation},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="address != null">address = #{address},</if>
<if test="jiguan != null">jiguan = #{jiguan},</if>
<if test="cardId != null">card_id = #{cardId},</if>
<if test="pictures != null">pictures = #{pictures},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDaCzrkdjById" parameterType="Long">
delete from da_czrkdj where id = #{id}
</delete>
<delete id="deleteDaCzrkdjByIds" parameterType="String">
delete from da_czrkdj where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询常住人口登记列表
export function listCzrkdj(query) {
return request({
url: '/dangan/czrkdj/list',
method: 'get',
params: query
})
}
// 查询常住人口登记详细
export function getCzrkdj(id) {
return request({
url: '/dangan/czrkdj/' + id,
method: 'get'
})
}
// 新增常住人口登记
export function addCzrkdj(data) {
return request({
url: '/dangan/czrkdj',
method: 'post',
data: data
})
}
// 修改常住人口登记
export function updateCzrkdj(data) {
return request({
url: '/dangan/czrkdj',
method: 'put',
data: data
})
}
// 删除常住人口登记
export function delCzrkdj(id) {
return request({
url: '/dangan/czrkdj/' + id,
method: 'delete'
})
}

@ -0,0 +1,370 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="目录id" prop="muId">
<el-input
v-model="queryParams.muId"
placeholder="请输入目录id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="户主姓名" prop="hzName">
<el-input
v-model="queryParams.hzName"
placeholder="请输入户主姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="与户主关系" prop="relation">
<el-input
v-model="queryParams.relation"
placeholder="请输入与户主关系"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出生日期" prop="birthday">
<el-date-picker clearable
v-model="queryParams.birthday"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择出生日期">
</el-date-picker>
</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="jiguan">
<el-input
v-model="queryParams.jiguan"
placeholder="请输入籍贯"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="身份证号" prop="cardId">
<el-input
v-model="queryParams.cardId"
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="['dangan:czrkdj: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="['dangan:czrkdj: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="['dangan:czrkdj: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="['dangan:czrkdj:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="czrkdjList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="目录id" align="center" prop="muId" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="户主姓名" align="center" prop="hzName" />
<el-table-column label="与户主关系" align="center" prop="relation" />
<el-table-column label="出生日期" align="center" prop="birthday" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="地址" align="center" prop="address" />
<el-table-column label="籍贯" align="center" prop="jiguan" />
<el-table-column label="身份证号" align="center" prop="cardId" />
<el-table-column label="档案图片" align="center" prop="pictures" />
<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="['dangan:czrkdj:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dangan:czrkdj:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改常住人口登记对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="目录id" prop="muId">
<el-input v-model="form.muId" placeholder="请输入目录id" />
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="户主姓名" prop="hzName">
<el-input v-model="form.hzName" placeholder="请输入户主姓名" />
</el-form-item>
<el-form-item label="与户主关系" prop="relation">
<el-input v-model="form.relation" placeholder="请输入与户主关系" />
</el-form-item>
<el-form-item label="出生日期" prop="birthday">
<el-date-picker clearable
v-model="form.birthday"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择出生日期">
</el-date-picker>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" placeholder="请输入地址" />
</el-form-item>
<el-form-item label="籍贯" prop="jiguan">
<el-input v-model="form.jiguan" placeholder="请输入籍贯" />
</el-form-item>
<el-form-item label="身份证号" prop="cardId">
<el-input v-model="form.cardId" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="档案图片" prop="pictures">
<el-input v-model="form.pictures" 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>
<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 { listCzrkdj, getCzrkdj, delCzrkdj, addCzrkdj, updateCzrkdj } from "@/api/dangan/czrkdj";
export default {
name: "Czrkdj",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
czrkdjList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
muId: null,
name: null,
hzName: null,
relation: null,
birthday: null,
address: null,
jiguan: null,
cardId: null,
pictures: null,
},
//
form: {},
//
rules: {
muId: [
{ required: true, message: "目录id不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询常住人口登记列表 */
getList() {
this.loading = true;
listCzrkdj(this.queryParams).then(response => {
this.czrkdjList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
muId: null,
name: null,
hzName: null,
relation: null,
birthday: null,
address: null,
jiguan: null,
cardId: null,
pictures: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: 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
getCzrkdj(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) {
updateCzrkdj(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCzrkdj(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 delCzrkdj(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('dangan/czrkdj/export', {
...this.queryParams
}, `czrkdj_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save