|
@@ -0,0 +1,377 @@
|
|
|
+<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="xm">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.xm"
|
|
|
+ placeholder="请输入姓名"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="身份证号" prop="sfzh">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.sfzh"
|
|
|
+ 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="['gljt:swzm:add']"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['gljt:swzm:export']"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleImport"
|
|
|
+ v-hasPermi="['gljt:swzm:export']">导入
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="swzmList">
|
|
|
+ <el-table-column label="序号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="姓名" align="center" prop="xm"/>
|
|
|
+ <el-table-column label="身份证号" align="center" prop="sfzh"/>
|
|
|
+ <el-table-column label="死亡时间" align="center" prop="swsj" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ special(scope.row.swsj, 'time') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <!-- <el-button-->
|
|
|
+ <!-- size="mini"-->
|
|
|
+ <!-- type="text"-->
|
|
|
+ <!-- icon="el-icon-edit"-->
|
|
|
+ <!-- @click="handleUpdate(scope.row)"-->
|
|
|
+ <!-- v-hasPermi="['gljt:swzm:edit']"-->
|
|
|
+ <!-- >修改</el-button>-->
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row,scope.$index)"
|
|
|
+ v-hasPermi="['gljt:swzm: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 v-dialog-drag :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
+
|
|
|
+ <el-form-item label="姓名" prop="xm">
|
|
|
+ <el-input v-model="form.xm" placeholder="请输入姓名"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="身份证号" prop="sfzh">
|
|
|
+ <el-input v-model="form.sfzh" placeholder="请输入身份证号"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="死亡时间" prop="swsj">
|
|
|
+ <el-date-picker clearable style="width: 100%"
|
|
|
+ v-model="form.swsj"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyyMMddHHmmss"
|
|
|
+ placeholder="请选择死亡时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm" :loading="submitFormLoading">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 用户导入对话框 -->
|
|
|
+ <el-dialog v-dialog-drag title="导入死亡证明信息" :visible.sync="upload.open" width="400px" append-to-body>
|
|
|
+ <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url"
|
|
|
+ :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess"
|
|
|
+ :auto-upload="false" drag>
|
|
|
+ <i class="el-icon-upload"></i>
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
+ <div class="el-upload__tip text-center" slot="tip">
|
|
|
+ <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
+ <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
|
|
+ @click="importTemplate">下载模板
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {addSwzm, delSwzm, getSwzm, listSwzm, updateSwzm} from "@/api/gljt/swzm";
|
|
|
+import {chineseOne, idCard, Regular} from '@/utils/regular'
|
|
|
+import {getToken} from "@/utils/auth";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "Swzm",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ submitFormLoading: false,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 高龄津贴_死亡证明信息表格数据
|
|
|
+ swzmList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 数据状态时间范围
|
|
|
+ daterangeSwsj: [],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ xm: null,
|
|
|
+ sfzh: null,
|
|
|
+ },
|
|
|
+ // 用户导入参数
|
|
|
+ upload: {
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: {Authorization: 'Bearer ' + getToken()},
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + '/gljt/swzm/importData'
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ xm: [
|
|
|
+ {required: true, message: "姓名不能为空", trigger: "blur"},
|
|
|
+ {max: 72, message: '姓名不能超过72个字符', trigger: 'blur'},
|
|
|
+ {validator: chineseOne, trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ sfzh: [
|
|
|
+ {required: true, message: "身份证号不能为空", trigger: "blur"},
|
|
|
+ {max: 72, message: '身份证号不能超过72个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ state: [
|
|
|
+ {required: true, message: "数据状态不能为空", trigger: "blur"},
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 导入按钮操作 */
|
|
|
+ handleImport() {
|
|
|
+ this.upload.open = true;
|
|
|
+ },
|
|
|
+ handleFileUploadProgress(event, file, fileList) {
|
|
|
+ this.upload.isUploading = true;
|
|
|
+ },
|
|
|
+ // 文件上传成功处理
|
|
|
+ handleFileSuccess(response, file, fileList) {
|
|
|
+ this.upload.open = false;
|
|
|
+ this.upload.isUploading = false;
|
|
|
+ this.$refs.upload.clearFiles();
|
|
|
+ this.$alert('<div style=\'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;\'>' + response.msg + '</div>', '导入结果', {dangerouslyUseHTMLString: true});
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ // 提交上传文件
|
|
|
+ submitFileForm() {
|
|
|
+ this.$refs.upload.submit();
|
|
|
+ },
|
|
|
+ /** 下载模板操作 */
|
|
|
+ importTemplate() {
|
|
|
+ this.download('gljt/swzm/importTemplate', {}, `死亡证明信息_模板.xlsx`);
|
|
|
+ },
|
|
|
+ /** 查询高龄津贴_死亡证明信息列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ this.queryParams.params = {};
|
|
|
+ if (null != this.daterangeSwsj && '' != this.daterangeSwsj) {
|
|
|
+ this.queryParams.params["beginSwsj"] = this.daterangeSwsj[0];
|
|
|
+ this.queryParams.params["endSwsj"] = this.daterangeSwsj[1];
|
|
|
+ }
|
|
|
+ listSwzm(this.queryParams).then(response => {
|
|
|
+ this.swzmList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.submitFormLoading = false;
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ xm: null,
|
|
|
+ sfzh: null,
|
|
|
+ swsj: null,
|
|
|
+ state: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.daterangeSwsj = [];
|
|
|
+ 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
|
|
|
+ getSwzm(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ /****** sks 需要改动的地方 start ******/
|
|
|
+ // this.copyForm=this.deepCopy(response.data)
|
|
|
+ /****** sks 需要改动的地方 end ******/
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改高龄津贴_死亡证明信息";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.submitFormLoading = true;
|
|
|
+ if (this.form.id != null) {
|
|
|
+ /****** sks 需要改动的地方 start ******/
|
|
|
+ // let formData=this.comparisonObject(this.form,this.copyForm);
|
|
|
+ // if(formData) {
|
|
|
+ updateSwzm(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ // this.swzmList=this.dataReplacement(this.swzmList,this.form.id,formData);
|
|
|
+ this.getList();
|
|
|
+ }).finally(() => this.submitFormLoading = false);
|
|
|
+ // }else{
|
|
|
+ // this.$modal.msgSuccess("修改成功");
|
|
|
+ // this.open = false;
|
|
|
+ // this.submitFormLoading = false;
|
|
|
+ // }
|
|
|
+ /****** sks 需要改动的地方 end ******/
|
|
|
+ } else {
|
|
|
+ addSwzm(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ /****** sks 需要改动的地方 start ******/
|
|
|
+ // if (this.queryParams.pageSize===this.swzmList.length)
|
|
|
+ // {
|
|
|
+ // this.swzmList.pop();
|
|
|
+ // }
|
|
|
+ // this.swzmList.unshift({...this.form,id:response.data});
|
|
|
+ // this.total++;
|
|
|
+ /****** sks 需要改动的地方 end ******/
|
|
|
+ }).finally(() => this.submitFormLoading = false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row, index) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ const xh = (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
|
|
|
+ this.$modal.confirm('确认删除' + this.changeDelData(row, 'id', 'ID值', xh) + '的记录?').then(function () {
|
|
|
+ return delSwzm(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ /****** sks 需要改动的地方 ind参数需要传进来 start ******/
|
|
|
+ // this.swzmList.splice(index,1);
|
|
|
+ // if(this.swzmList.length===0)
|
|
|
+ // {
|
|
|
+ // this.getList();
|
|
|
+ // }else {
|
|
|
+ // this.total--;
|
|
|
+ // }
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ /****** sks 需要改动的地方 end ******/
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('gljt/swzm/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `swzm_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|