|
|
|
@ -1,6 +1,14 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div class="app-container">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
|
|
|
<el-form-item label="标签名称" prop="tagName">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="queryParams.tagName"
|
|
|
|
|
|
|
|
placeholder="请输入标签名称"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
<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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
@ -57,6 +65,7 @@
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column label="居民id" align="center" prop="jmId" />
|
|
|
|
<el-table-column label="居民id" align="center" prop="jmId" />
|
|
|
|
<el-table-column label="标签id" align="center" prop="tagId" />
|
|
|
|
<el-table-column label="标签id" align="center" prop="tagId" />
|
|
|
|
|
|
|
|
<el-table-column label="标签名称" align="center" prop="tagName" />
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
@ -88,6 +97,9 @@
|
|
|
|
<!-- 添加或修改居民标签关联对话框 -->
|
|
|
|
<!-- 添加或修改居民标签关联对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
<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 ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
|
|
|
<el-form-item label="标签名称" prop="tagName">
|
|
|
|
|
|
|
|
<el-input v-model="form.tagName" placeholder="请输入标签名称" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
@ -98,136 +110,138 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { listJmtag, getJmtag, delJmtag, addJmtag, updateJmtag } from "@/api/szxc/jmtag";
|
|
|
|
import { listJmtag, getJmtag, delJmtag, addJmtag, updateJmtag } from "@/api/szxc/jmtag";
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "Jmtag",
|
|
|
|
name: "Jmtag",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 遮罩层
|
|
|
|
// 遮罩层
|
|
|
|
loading: true,
|
|
|
|
loading: true,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
|
ids: [],
|
|
|
|
ids: [],
|
|
|
|
// 非单个禁用
|
|
|
|
// 非单个禁用
|
|
|
|
single: true,
|
|
|
|
single: true,
|
|
|
|
// 非多个禁用
|
|
|
|
// 非多个禁用
|
|
|
|
multiple: true,
|
|
|
|
multiple: true,
|
|
|
|
// 显示搜索条件
|
|
|
|
// 显示搜索条件
|
|
|
|
showSearch: true,
|
|
|
|
showSearch: true,
|
|
|
|
// 总条数
|
|
|
|
// 总条数
|
|
|
|
total: 0,
|
|
|
|
total: 0,
|
|
|
|
// 居民标签关联表格数据
|
|
|
|
// 居民标签关联表格数据
|
|
|
|
jmtagList: [],
|
|
|
|
jmtagList: [],
|
|
|
|
// 弹出层标题
|
|
|
|
// 弹出层标题
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
// 是否显示弹出层
|
|
|
|
// 是否显示弹出层
|
|
|
|
open: false,
|
|
|
|
open: false,
|
|
|
|
// 查询参数
|
|
|
|
// 查询参数
|
|
|
|
queryParams: {
|
|
|
|
queryParams: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
},
|
|
|
|
tagName: null
|
|
|
|
// 表单参数
|
|
|
|
},
|
|
|
|
form: {},
|
|
|
|
// 表单参数
|
|
|
|
// 表单校验
|
|
|
|
form: {},
|
|
|
|
rules: {
|
|
|
|
// 表单校验
|
|
|
|
}
|
|
|
|
rules: {
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
/** 查询居民标签关联列表 */
|
|
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
listJmtag(this.queryParams).then(response => {
|
|
|
|
|
|
|
|
this.jmtagList = response.rows;
|
|
|
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 取消按钮
|
|
|
|
|
|
|
|
cancel() {
|
|
|
|
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 表单重置
|
|
|
|
|
|
|
|
reset() {
|
|
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
|
|
jmId: null,
|
|
|
|
|
|
|
|
tagId: null
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.resetForm("form");
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
created() {
|
|
|
|
handleQuery() {
|
|
|
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
methods: {
|
|
|
|
resetQuery() {
|
|
|
|
/** 查询居民标签关联列表 */
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
getList() {
|
|
|
|
this.handleQuery();
|
|
|
|
this.loading = true;
|
|
|
|
},
|
|
|
|
listJmtag(this.queryParams).then(response => {
|
|
|
|
// 多选框选中数据
|
|
|
|
this.jmtagList = response.rows;
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
this.total = response.total;
|
|
|
|
this.ids = selection.map(item => item.jmId)
|
|
|
|
this.loading = false;
|
|
|
|
this.single = selection.length!==1
|
|
|
|
});
|
|
|
|
this.multiple = !selection.length
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 取消按钮
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
cancel() {
|
|
|
|
handleAdd() {
|
|
|
|
this.open = false;
|
|
|
|
this.reset();
|
|
|
|
this.reset();
|
|
|
|
this.open = true;
|
|
|
|
},
|
|
|
|
this.title = "添加居民标签关联";
|
|
|
|
// 表单重置
|
|
|
|
},
|
|
|
|
reset() {
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
this.form = {
|
|
|
|
handleUpdate(row) {
|
|
|
|
jmId: null,
|
|
|
|
this.reset();
|
|
|
|
tagId: null,
|
|
|
|
const jmId = row.jmId || this.ids
|
|
|
|
tagName: null
|
|
|
|
getJmtag(jmId).then(response => {
|
|
|
|
};
|
|
|
|
this.form = response.data;
|
|
|
|
this.resetForm("form");
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
|
|
|
handleQuery() {
|
|
|
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
|
|
|
resetQuery() {
|
|
|
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
|
|
|
this.ids = selection.map(item => item.jmId)
|
|
|
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
|
|
|
handleAdd() {
|
|
|
|
|
|
|
|
this.reset();
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改居民标签关联";
|
|
|
|
this.title = "添加居民标签关联";
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 提交按钮 */
|
|
|
|
handleUpdate(row) {
|
|
|
|
submitForm() {
|
|
|
|
this.reset();
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
const jmId = row.jmId || this.ids
|
|
|
|
if (valid) {
|
|
|
|
getJmtag(jmId).then(response => {
|
|
|
|
if (this.form.jmId != null) {
|
|
|
|
this.form = response.data;
|
|
|
|
updateJmtag(this.form).then(response => {
|
|
|
|
this.open = true;
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
this.title = "修改居民标签关联";
|
|
|
|
this.open = false;
|
|
|
|
});
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
});
|
|
|
|
/** 提交按钮 */
|
|
|
|
} else {
|
|
|
|
submitForm() {
|
|
|
|
addJmtag(this.form).then(response => {
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
if (valid) {
|
|
|
|
this.open = false;
|
|
|
|
if (this.form.jmId != null) {
|
|
|
|
this.getList();
|
|
|
|
updateJmtag(this.form).then(response => {
|
|
|
|
});
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
addJmtag(this.form).then(response => {
|
|
|
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
|
|
|
this.open = false;
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
handleDelete(row) {
|
|
|
|
handleDelete(row) {
|
|
|
|
const jmIds = row.jmId || this.ids;
|
|
|
|
const jmIds = row.jmId || this.ids;
|
|
|
|
this.$modal.confirm('是否确认删除居民标签关联编号为"' + jmIds + '"的数据项?').then(function() {
|
|
|
|
this.$modal.confirm('是否确认删除居民标签关联编号为"' + jmIds + '"的数据项?').then(function() {
|
|
|
|
return delJmtag(jmIds);
|
|
|
|
return delJmtag(jmIds);
|
|
|
|
}).then(() => {
|
|
|
|
}).then(() => {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
handleExport() {
|
|
|
|
handleExport() {
|
|
|
|
this.download('szxc/jmtag/export', {
|
|
|
|
this.download('szxc/jmtag/export', {
|
|
|
|
...this.queryParams
|
|
|
|
...this.queryParams
|
|
|
|
}, `jmtag_${new Date().getTime()}.xlsx`)
|
|
|
|
}, `jmtag_${new Date().getTime()}.xlsx`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|