|
|
|
|
@ -1,10 +1,18 @@
|
|
|
|
|
<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="xqId">
|
|
|
|
|
<el-form-item label="所属小区id" prop="xqId">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.xqId"
|
|
|
|
|
placeholder="请输入所属小区"
|
|
|
|
|
placeholder="请输入所属小区id"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="小区名称" prop="xqName">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.xqName"
|
|
|
|
|
placeholder="请输入小区名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
@ -152,7 +160,8 @@
|
|
|
|
|
<el-table v-loading="loading" :data="ldinfoList" @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="所属小区" align="center" prop="xqId" />
|
|
|
|
|
<el-table-column label="所属小区id" align="center" prop="xqId" />
|
|
|
|
|
<el-table-column label="小区名称" align="center" prop="xqName" />
|
|
|
|
|
<el-table-column label="楼栋名称" align="center" prop="ldName" />
|
|
|
|
|
<el-table-column label="类型(0小区楼栋1独立房2其它)" align="center" prop="xqType" />
|
|
|
|
|
<el-table-column label="类别字典" align="center" prop="ldSort" />
|
|
|
|
|
@ -196,8 +205,11 @@
|
|
|
|
|
<!-- 添加或修改楼栋信息对话框 -->
|
|
|
|
|
<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="xqId">
|
|
|
|
|
<el-input v-model="form.xqId" placeholder="请输入所属小区" />
|
|
|
|
|
<el-form-item label="所属小区id" prop="xqId">
|
|
|
|
|
<el-input v-model="form.xqId" placeholder="请输入所属小区id" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="小区名称" prop="xqName">
|
|
|
|
|
<el-input v-model="form.xqName" placeholder="请输入小区名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="楼栋名称" prop="ldName">
|
|
|
|
|
<el-input v-model="form.ldName" placeholder="请输入楼栋名称" />
|
|
|
|
|
@ -242,171 +254,173 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listLdinfo, getLdinfo, delLdinfo, addLdinfo, updateLdinfo } from "@/api/szxc/ldinfo";
|
|
|
|
|
import { listLdinfo, getLdinfo, delLdinfo, addLdinfo, updateLdinfo } from "@/api/szxc/ldinfo";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Ldinfo",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 楼栋信息表格数据
|
|
|
|
|
ldinfoList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
xqId: null,
|
|
|
|
|
ldName: null,
|
|
|
|
|
xqType: null,
|
|
|
|
|
ldSort: null,
|
|
|
|
|
ldjg: null,
|
|
|
|
|
qnfs: null,
|
|
|
|
|
lcNum: null,
|
|
|
|
|
unitNum: null,
|
|
|
|
|
huNum: null,
|
|
|
|
|
ldDescribe: null,
|
|
|
|
|
deptId: null,
|
|
|
|
|
deptName: null,
|
|
|
|
|
userId: null
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
xqId: [
|
|
|
|
|
{ required: true, message: "所属小区不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
deptId: [
|
|
|
|
|
{ required: true, message: "部门id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询楼栋信息列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listLdinfo(this.queryParams).then(response => {
|
|
|
|
|
this.ldinfoList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: null,
|
|
|
|
|
xqId: null,
|
|
|
|
|
ldName: null,
|
|
|
|
|
xqType: null,
|
|
|
|
|
ldSort: null,
|
|
|
|
|
ldjg: null,
|
|
|
|
|
qnfs: null,
|
|
|
|
|
lcNum: null,
|
|
|
|
|
unitNum: null,
|
|
|
|
|
huNum: null,
|
|
|
|
|
ldDescribe: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
deptId: null,
|
|
|
|
|
deptName: null,
|
|
|
|
|
userId: null
|
|
|
|
|
export default {
|
|
|
|
|
name: "Ldinfo",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 楼栋信息表格数据
|
|
|
|
|
ldinfoList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
xqId: null,
|
|
|
|
|
xqName: null,
|
|
|
|
|
ldName: null,
|
|
|
|
|
xqType: null,
|
|
|
|
|
ldSort: null,
|
|
|
|
|
ldjg: null,
|
|
|
|
|
qnfs: null,
|
|
|
|
|
lcNum: null,
|
|
|
|
|
unitNum: null,
|
|
|
|
|
huNum: null,
|
|
|
|
|
ldDescribe: null,
|
|
|
|
|
deptId: null,
|
|
|
|
|
deptName: null,
|
|
|
|
|
userId: null
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
xqId: [
|
|
|
|
|
{ required: true, message: "所属小区id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
deptId: [
|
|
|
|
|
{ required: true, message: "部门id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
created() {
|
|
|
|
|
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
|
|
|
|
|
getLdinfo(id).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询楼栋信息列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listLdinfo(this.queryParams).then(response => {
|
|
|
|
|
this.ldinfoList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: null,
|
|
|
|
|
xqId: null,
|
|
|
|
|
xqName: null,
|
|
|
|
|
ldName: null,
|
|
|
|
|
xqType: null,
|
|
|
|
|
ldSort: null,
|
|
|
|
|
ldjg: null,
|
|
|
|
|
qnfs: null,
|
|
|
|
|
lcNum: null,
|
|
|
|
|
unitNum: null,
|
|
|
|
|
huNum: null,
|
|
|
|
|
ldDescribe: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
deptId: null,
|
|
|
|
|
deptName: null,
|
|
|
|
|
userId: 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 = "修改楼栋信息";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateLdinfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addLdinfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
this.title = "添加楼栋信息";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids
|
|
|
|
|
getLdinfo(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) {
|
|
|
|
|
updateLdinfo(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addLdinfo(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 delLdinfo(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('szxc/ldinfo/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `ldinfo_${new Date().getTime()}.xlsx`)
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除楼栋信息编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
|
return delLdinfo(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('szxc/ldinfo/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `ldinfo_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|