|
@@ -0,0 +1,322 @@
|
|
|
+<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="tzbt">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.tzbt"
|
|
|
+ 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:tzgg: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:tzgg:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="tzggList" >
|
|
|
+ <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="xzqh" />
|
|
|
+ <el-table-column label="通知标题" align="center" prop="tzbt" />
|
|
|
+ <el-table-column label="标题图片" align="center" prop="bttp" />
|
|
|
+ <el-table-column label="通知类型" align="center" prop="tzlx" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="tzsj" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ special(scope.row.tzsj,'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:tzgg:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row,scope.$index)"
|
|
|
+ v-hasPermi="['gljt:tzgg: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="tzbt">
|
|
|
+ <el-input v-model="form.tzbt" placeholder="请输入通知标题" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="标题图片" prop="bttp">
|
|
|
+ <el-input v-model="form.bttp" type="textarea" maxlength="200" show-word-limit placeholder="请输入标题图片" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="通知类型" prop="tzlx">
|
|
|
+ <el-input v-model="form.tzlx" type="textarea" maxlength="200" show-word-limit placeholder="请输入通知类型" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="通知内容" prop="tznr">
|
|
|
+ <el-input v-model="form.tznr" type="textarea" maxlength="200" show-word-limit placeholder="请输入通知内容" />
|
|
|
+ </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>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {addTzgg, delTzgg, getTzgg, listTzgg, updateTzgg} from "@/api/gljt/tzgg";
|
|
|
+ import {chineseOne, idCard, Regular} from '@/utils/regular'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: "Tzgg",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ submitFormLoading: false,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 高龄津贴_通知公告信息表格数据
|
|
|
+ tzggList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ xzqh: [
|
|
|
+ { required: true, message: "所属区划不能为空", trigger: "blur" },
|
|
|
+ { max: 12, message: '所属区划不能超过12个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ tzbt: [
|
|
|
+ { max: 50, message: '通知标题不能超过50个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ gkcs: [
|
|
|
+ { required: true, message: "观看次数不能为空", trigger: "blur" },
|
|
|
+ { max: 20, message: '观看次数不能超过20个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ kz1: [
|
|
|
+ { max: 20, message: '扩展字段不能超过20个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ kz2: [
|
|
|
+ { max: 20, message: '扩展字段不能超过20个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ kz3: [
|
|
|
+ { max: 20, message: '扩展字段不能超过20个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ kz4: [
|
|
|
+ { max: 20, message: '扩展字段不能超过20个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ kz5: [
|
|
|
+ { max: 20, message: '扩展字段不能超过20个字符', trigger: 'blur'},
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询高龄津贴_通知公告信息列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listTzgg(this.queryParams).then(response => {
|
|
|
+ this.tzggList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.submitFormLoading =false;
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ xzqh: null,
|
|
|
+ tzbt: null,
|
|
|
+ bttp: null,
|
|
|
+ tzlx: null,
|
|
|
+ tznr: null,
|
|
|
+ gkcs: null,
|
|
|
+ tzsj: null,
|
|
|
+ kz1: null,
|
|
|
+ kz2: null,
|
|
|
+ kz3: null,
|
|
|
+ kz4: null,
|
|
|
+ kz5: null,
|
|
|
+ kz6: null,
|
|
|
+ kz7: null,
|
|
|
+ kz8: null,
|
|
|
+ kz9: 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
|
|
|
+ getTzgg(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) {
|
|
|
+ updateTzgg(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ // this.tzggList=this.dataReplacement(this.tzggList,this.form.id,formData);
|
|
|
+ this.getList();
|
|
|
+ }).finally(()=>this.submitFormLoading =false);
|
|
|
+ // }else{
|
|
|
+ // this.$modal.msgSuccess("修改成功");
|
|
|
+ // this.open = false;
|
|
|
+ // this.submitFormLoading = false;
|
|
|
+ // }
|
|
|
+ /****** sks 需要改动的地方 end ******/
|
|
|
+ } else {
|
|
|
+ addTzgg(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ /****** sks 需要改动的地方 start ******/
|
|
|
+ // if (this.queryParams.pageSize===this.tzggList.length)
|
|
|
+ // {
|
|
|
+ // this.tzggList.pop();
|
|
|
+ // }
|
|
|
+ // this.tzggList.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 delTzgg(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ /****** sks 需要改动的地方 ind参数需要传进来 start ******/
|
|
|
+ // this.tzggList.splice(index,1);
|
|
|
+ // if(this.tzggList.length===0)
|
|
|
+ // {
|
|
|
+ // this.getList();
|
|
|
+ // }else {
|
|
|
+ // this.total--;
|
|
|
+ // }
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ /****** sks 需要改动的地方 end ******/
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('gljt/tzgg/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `tzgg_${new Date().getTime()}.xlsx`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|