Loading src/views/ledger/building/index.vue +116 −48 Original line number Original line Diff line number Diff line <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="projectName"> <el-form-item label="项目名称" prop="projectName"> <el-input <el-input v-model="queryParams.projectName" v-model="queryParams.projectName" Loading @@ -19,11 +26,12 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId"> <el-input <treeselect v-model="queryParams.deptId" v-model="queryParams.deptId" placeholder="请输入所属区域" :options="deptOptions" clearable :show-count="true" @keyup.enter.native="handleQuery" placeholder="请选择所属区域" style="width: 250px" /> /> </el-form-item> </el-form-item> <el-form-item label="用途" prop="useto"> <el-form-item label="用途" prop="useto"> Loading @@ -43,7 +51,11 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status"> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable > <el-option <el-option v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :key="dict.value" Loading @@ -53,8 +65,16 @@ </el-select> </el-select> </el-form-item> </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 <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item> </el-form> </el-form> Loading @@ -67,7 +87,8 @@ size="mini" size="mini" @click="handleAdd" @click="handleAdd" v-hasPermi="['system:ledgerBuilding:add']" v-hasPermi="['system:ledgerBuilding:add']" >新增</el-button> >新增</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -78,7 +99,8 @@ :disabled="single" :disabled="single" @click="handleUpdate" @click="handleUpdate" v-hasPermi="['system:ledgerBuilding:edit']" v-hasPermi="['system:ledgerBuilding:edit']" >修改</el-button> >修改</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -89,7 +111,8 @@ :disabled="multiple" :disabled="multiple" @click="handleDelete" @click="handleDelete" v-hasPermi="['system:ledgerBuilding:remove']" v-hasPermi="['system:ledgerBuilding:remove']" >删除</el-button> >删除</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -99,12 +122,20 @@ size="mini" size="mini" @click="handleExport" @click="handleExport" v-hasPermi="['system:ledgerBuilding:export']" v-hasPermi="['system:ledgerBuilding:export']" >导出</el-button> >导出</el-button > </el-col> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" ></right-toolbar> </el-row> </el-row> <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange" > <el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="序号" align="center"> <el-table-column label="序号" align="center"> <template slot-scope="scope"> <template slot-scope="scope"> Loading @@ -121,10 +152,17 @@ <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status"> <template slot-scope="scope"> <template slot-scope="scope"> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" /> </template> </template> </el-table-column> </el-table-column> <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 size="mini" size="mini" Loading @@ -132,14 +170,16 @@ icon="el-icon-edit" icon="el-icon-edit" @click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)" v-hasPermi="['system:ledgerBuilding:edit']" v-hasPermi="['system:ledgerBuilding:edit']" >修改</el-button> >修改</el-button > <el-button <el-button size="mini" size="mini" type="text" type="text" icon="el-icon-delete" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleDelete(scope.row)" v-hasPermi="['system:ledgerBuilding:remove']" v-hasPermi="['system:ledgerBuilding:remove']" >删除</el-button> >删除</el-button > </template> </template> </el-table-column> </el-table-column> </el-table> </el-table> Loading Loading @@ -168,7 +208,10 @@ <el-input v-model="form.groundFloor" placeholder="请输入地上楼层数" /> <el-input v-model="form.groundFloor" placeholder="请输入地上楼层数" /> </el-form-item> </el-form-item> <el-form-item label="地下楼层数(层)" prop="undergroundFloor"> <el-form-item label="地下楼层数(层)" prop="undergroundFloor"> <el-input v-model="form.undergroundFloor" placeholder="请输入地下楼层数" /> <el-input v-model="form.undergroundFloor" placeholder="请输入地下楼层数" /> </el-form-item> </el-form-item> <el-form-item label="用途" prop="useto"> <el-form-item label="用途" prop="useto"> <el-input v-model="form.useto" placeholder="请输入用途" /> <el-input v-model="form.useto" placeholder="请输入用途" /> Loading @@ -186,7 +229,6 @@ ></el-option> ></el-option> </el-select> </el-select> </el-form-item> </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> Loading @@ -197,11 +239,22 @@ </template> </template> <script> <script> import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding } from "@/api/ledger/building"; import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding, } from "@/api/ledger/building"; import { deptTreeSelect } from "@/api/system/user"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { export default { name: "Building", name: "Building", dicts: ['sys_normal_disable', 'data_source'], dicts: ["sys_normal_disable", "data_source"], components: { Treeselect, }, data() { data() { return { return { // 遮罩层 // 遮罩层 Loading Loading @@ -240,18 +293,25 @@ export default { // 表单参数 // 表单参数 form: {}, form: {}, // 表单校验 // 表单校验 rules: { rules: {}, } deptOptions: [], }; }; }, }, created() { created() { this.getList(); this.getList(); this.getDeptTree(); }, }, methods: { methods: { /** 查询部门下拉树结构 */ getDeptTree() { deptTreeSelect().then((response) => { this.deptOptions = response.data; }); }, /** 查询基础数据-楼宇列表 */ /** 查询基础数据-楼宇列表 */ getList() { getList() { this.loading = true; this.loading = true; listBuilding(this.queryParams).then(response => { listBuilding(this.queryParams).then((response) => { this.buildingList = response.rows; this.buildingList = response.rows; this.total = response.total; this.total = response.total; this.loading = false; this.loading = false; Loading Loading @@ -280,7 +340,7 @@ export default { createBy: null, createBy: null, createTime: null, createTime: null, updateBy: null, updateBy: null, updateTime: null updateTime: null, }; }; this.resetForm("form"); this.resetForm("form"); }, }, Loading @@ -296,9 +356,9 @@ export default { }, }, // 多选框选中数据 // 多选框选中数据 handleSelectionChange(selection) { handleSelectionChange(selection) { this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id); this.single = selection.length!==1 this.single = selection.length !== 1; this.multiple = !selection.length this.multiple = !selection.length; }, }, /** 新增按钮操作 */ /** 新增按钮操作 */ handleAdd() { handleAdd() { Loading @@ -309,8 +369,8 @@ export default { /** 修改按钮操作 */ /** 修改按钮操作 */ handleUpdate(row) { handleUpdate(row) { this.reset(); this.reset(); const id = row.id || this.ids const id = row.id || this.ids; getBuilding(id).then(response => { getBuilding(id).then((response) => { this.form = response.data; this.form = response.data; this.open = true; this.open = true; this.title = "修改基础数据-楼宇"; this.title = "修改基础数据-楼宇"; Loading @@ -318,16 +378,16 @@ export default { }, }, /** 提交按钮 */ /** 提交按钮 */ submitForm() { submitForm() { this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => { if (valid) { if (valid) { if (this.form.id != null) { if (this.form.id != null) { updateBuilding(this.form).then(response => { updateBuilding(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功"); this.open = false; this.open = false; this.getList(); this.getList(); }); }); } else { } else { addBuilding(this.form).then(response => { addBuilding(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功"); this.open = false; this.open = false; this.getList(); this.getList(); Loading @@ -339,19 +399,27 @@ export default { /** 删除按钮操作 */ /** 删除按钮操作 */ handleDelete(row) { handleDelete(row) { const ids = row.id || this.ids; const ids = row.id || this.ids; this.$modal.confirm('是否确认删除基础数据-楼宇编号为"' + ids + '"的数据项?').then(function() { this.$modal .confirm('是否确认删除基础数据-楼宇编号为"' + ids + '"的数据项?') .then(function () { return delBuilding(ids); return delBuilding(ids); }).then(() => { }) .then(() => { this.getList(); this.getList(); this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }) .catch(() => {}); }, }, /** 导出按钮操作 */ /** 导出按钮操作 */ handleExport() { handleExport() { this.download('/system/ledger/building/export', { this.download( ...this.queryParams "/system/ledger/building/export", }, `building_${new Date().getTime()}.xlsx`) { } ...this.queryParams, } }, `building_${new Date().getTime()}.xlsx` ); }, }, }; }; </script> </script> src/views/ledger/project/index.vue +125 −55 Original line number Original line Diff line number Diff line <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="name"> <el-form-item label="项目名称" prop="name"> <el-input <el-input v-model="queryParams.name" v-model="queryParams.name" Loading @@ -18,7 +25,11 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="项目业态" prop="business"> <el-form-item label="项目业态" prop="business"> <el-select v-model="queryParams.business" placeholder="请选择项目业态" clearable> <el-select v-model="queryParams.business" placeholder="请选择项目业态" clearable > <el-option <el-option v-for="dict in dict.type.risk_project_business" v-for="dict in dict.type.risk_project_business" :key="dict.value" :key="dict.value" Loading @@ -29,11 +40,12 @@ </el-form-item> </el-form-item> <el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId"> <el-input <treeselect v-model="queryParams.deptId" v-model="queryParams.deptId" placeholder="请输入所属区域" :options="deptOptions" clearable :show-count="true" @keyup.enter.native="handleQuery" placeholder="请选择所属区域" style="width: 250px" /> /> </el-form-item> </el-form-item> <el-form-item label="所在城市" prop="city"> <el-form-item label="所在城市" prop="city"> Loading @@ -53,7 +65,11 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status"> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable > <el-option <el-option v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :key="dict.value" Loading @@ -63,8 +79,16 @@ </el-select> </el-select> </el-form-item> </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 <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item> </el-form> </el-form> Loading @@ -77,7 +101,8 @@ size="mini" size="mini" @click="handleAdd" @click="handleAdd" v-hasPermi="['system:ledgerProject:add']" v-hasPermi="['system:ledgerProject:add']" >新增</el-button> >新增</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -88,7 +113,8 @@ :disabled="single" :disabled="single" @click="handleUpdate" @click="handleUpdate" v-hasPermi="['system:ledgerProject:edit']" v-hasPermi="['system:ledgerProject:edit']" >修改</el-button> >修改</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -99,7 +125,8 @@ :disabled="multiple" :disabled="multiple" @click="handleDelete" @click="handleDelete" v-hasPermi="['system:ledgerProject:remove']" v-hasPermi="['system:ledgerProject:remove']" >删除</el-button> >删除</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -109,12 +136,20 @@ size="mini" size="mini" @click="handleExport" @click="handleExport" v-hasPermi="['system:ledgerProject:export']" v-hasPermi="['system:ledgerProject:export']" >导出</el-button> >导出</el-button > </el-col> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" ></right-toolbar> </el-row> </el-row> <el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange" > <el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="序号" align="center"> <el-table-column label="序号" align="center"> <template slot-scope="scope"> <template slot-scope="scope"> Loading @@ -129,10 +164,17 @@ <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status"> <template slot-scope="scope"> <template slot-scope="scope"> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" /> </template> </template> </el-table-column> </el-table-column> <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 size="mini" size="mini" Loading @@ -140,14 +182,16 @@ icon="el-icon-edit" icon="el-icon-edit" @click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)" v-hasPermi="['system:ledgerProject:edit']" v-hasPermi="['system:ledgerProject:edit']" >修改</el-button> >修改</el-button > <el-button <el-button size="mini" size="mini" type="text" type="text" icon="el-icon-delete" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleDelete(scope.row)" v-hasPermi="['system:ledgerProject:remove']" v-hasPermi="['system:ledgerProject:remove']" >删除</el-button> >删除</el-button > </template> </template> </el-table-column> </el-table-column> </el-table> </el-table> Loading Loading @@ -180,7 +224,12 @@ </el-select> </el-select> </el-form-item> </el-form-item> <el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId"> <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属区域" /> <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属区域" /> </el-form-item> </el-form-item> <el-form-item label="所在城市" prop="city"> <el-form-item label="所在城市" prop="city"> <el-input v-model="form.city" placeholder="请输入所在城市" /> <el-input v-model="form.city" placeholder="请输入所在城市" /> Loading @@ -198,7 +247,6 @@ ></el-option> ></el-option> </el-select> </el-select> </el-form-item> </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> Loading @@ -209,14 +257,29 @@ </template> </template> <script> <script> import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"; import { import { listProject, getProject, delProject, addProject, updateProject } from "@/api/ledger/project/"; listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect, } from "@/api/system/user"; import { listProject, getProject, delProject, addProject, updateProject, } from "@/api/ledger/project/"; import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { export default { name: "Project", name: "Project", dicts: ['sys_normal_disable', 'data_source', 'risk_project_business'], dicts: ["sys_normal_disable", "data_source", "risk_project_business"], components: { Treeselect }, components: { Treeselect }, data() { data() { return { return { Loading Loading @@ -255,15 +318,14 @@ export default { // 表单参数 // 表单参数 form: {}, form: {}, // 表单校验 // 表单校验 rules: { rules: {}, } }; }; }, }, watch: { watch: { // 根据名称筛选部门树 // 根据名称筛选部门树 deptName(val) { deptName(val) { this.$refs.tree.filter(val); this.$refs.tree.filter(val); } }, }, }, created() { created() { this.getList(); this.getList(); Loading @@ -273,7 +335,7 @@ export default { /** 查询基础数据-项目列表 */ /** 查询基础数据-项目列表 */ getList() { getList() { this.loading = true; this.loading = true; listProject(this.queryParams).then(response => { listProject(this.queryParams).then((response) => { this.projectList = response.rows; this.projectList = response.rows; this.total = response.total; this.total = response.total; this.loading = false; this.loading = false; Loading @@ -281,7 +343,7 @@ export default { }, }, /** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */ getDeptTree() { getDeptTree() { deptTreeSelect().then(response => { deptTreeSelect().then((response) => { this.deptOptions = response.data; this.deptOptions = response.data; }); }); }, }, Loading Loading @@ -315,7 +377,7 @@ export default { createBy: null, createBy: null, createTime: null, createTime: null, updateBy: null, updateBy: null, updateTime: null updateTime: null, }; }; this.resetForm("form"); this.resetForm("form"); }, }, Loading @@ -331,9 +393,9 @@ export default { }, }, // 多选框选中数据 // 多选框选中数据 handleSelectionChange(selection) { handleSelectionChange(selection) { this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id); this.single = selection.length!==1 this.single = selection.length !== 1; this.multiple = !selection.length this.multiple = !selection.length; }, }, /** 新增按钮操作 */ /** 新增按钮操作 */ handleAdd() { handleAdd() { Loading @@ -344,8 +406,8 @@ export default { /** 修改按钮操作 */ /** 修改按钮操作 */ handleUpdate(row) { handleUpdate(row) { this.reset(); this.reset(); const id = row.id || this.ids const id = row.id || this.ids; getProject(id).then(response => { getProject(id).then((response) => { this.form = response.data; this.form = response.data; this.open = true; this.open = true; this.title = "修改基础数据-项目"; this.title = "修改基础数据-项目"; Loading @@ -353,16 +415,16 @@ export default { }, }, /** 提交按钮 */ /** 提交按钮 */ submitForm() { submitForm() { this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => { if (valid) { if (valid) { if (this.form.id != null) { if (this.form.id != null) { updateProject(this.form).then(response => { updateProject(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功"); this.open = false; this.open = false; this.getList(); this.getList(); }); }); } else { } else { addProject(this.form).then(response => { addProject(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功"); this.open = false; this.open = false; this.getList(); this.getList(); Loading @@ -374,19 +436,27 @@ export default { /** 删除按钮操作 */ /** 删除按钮操作 */ handleDelete(row) { handleDelete(row) { const ids = row.id || this.ids; const ids = row.id || this.ids; this.$modal.confirm('是否确认删除基础数据-项目编号为"' + ids + '"的数据项?').then(function() { this.$modal .confirm('是否确认删除基础数据-项目编号为"' + ids + '"的数据项?') .then(function () { return delProject(ids); return delProject(ids); }).then(() => { }) .then(() => { this.getList(); this.getList(); this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }) .catch(() => {}); }, }, /** 导出按钮操作 */ /** 导出按钮操作 */ handleExport() { handleExport() { this.download('system/ledger/project/export', { this.download( ...this.queryParams "system/ledger/project/export", }, `project_${new Date().getTime()}.xlsx`) { } ...this.queryParams, } }, `project_${new Date().getTime()}.xlsx` ); }, }, }; }; </script> </script> Loading
src/views/ledger/building/index.vue +116 −48 Original line number Original line Diff line number Diff line <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="projectName"> <el-form-item label="项目名称" prop="projectName"> <el-input <el-input v-model="queryParams.projectName" v-model="queryParams.projectName" Loading @@ -19,11 +26,12 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId"> <el-input <treeselect v-model="queryParams.deptId" v-model="queryParams.deptId" placeholder="请输入所属区域" :options="deptOptions" clearable :show-count="true" @keyup.enter.native="handleQuery" placeholder="请选择所属区域" style="width: 250px" /> /> </el-form-item> </el-form-item> <el-form-item label="用途" prop="useto"> <el-form-item label="用途" prop="useto"> Loading @@ -43,7 +51,11 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status"> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable > <el-option <el-option v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :key="dict.value" Loading @@ -53,8 +65,16 @@ </el-select> </el-select> </el-form-item> </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 <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item> </el-form> </el-form> Loading @@ -67,7 +87,8 @@ size="mini" size="mini" @click="handleAdd" @click="handleAdd" v-hasPermi="['system:ledgerBuilding:add']" v-hasPermi="['system:ledgerBuilding:add']" >新增</el-button> >新增</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -78,7 +99,8 @@ :disabled="single" :disabled="single" @click="handleUpdate" @click="handleUpdate" v-hasPermi="['system:ledgerBuilding:edit']" v-hasPermi="['system:ledgerBuilding:edit']" >修改</el-button> >修改</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -89,7 +111,8 @@ :disabled="multiple" :disabled="multiple" @click="handleDelete" @click="handleDelete" v-hasPermi="['system:ledgerBuilding:remove']" v-hasPermi="['system:ledgerBuilding:remove']" >删除</el-button> >删除</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -99,12 +122,20 @@ size="mini" size="mini" @click="handleExport" @click="handleExport" v-hasPermi="['system:ledgerBuilding:export']" v-hasPermi="['system:ledgerBuilding:export']" >导出</el-button> >导出</el-button > </el-col> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" ></right-toolbar> </el-row> </el-row> <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="buildingList" @selection-change="handleSelectionChange" > <el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="序号" align="center"> <el-table-column label="序号" align="center"> <template slot-scope="scope"> <template slot-scope="scope"> Loading @@ -121,10 +152,17 @@ <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status"> <template slot-scope="scope"> <template slot-scope="scope"> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" /> </template> </template> </el-table-column> </el-table-column> <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 size="mini" size="mini" Loading @@ -132,14 +170,16 @@ icon="el-icon-edit" icon="el-icon-edit" @click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)" v-hasPermi="['system:ledgerBuilding:edit']" v-hasPermi="['system:ledgerBuilding:edit']" >修改</el-button> >修改</el-button > <el-button <el-button size="mini" size="mini" type="text" type="text" icon="el-icon-delete" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleDelete(scope.row)" v-hasPermi="['system:ledgerBuilding:remove']" v-hasPermi="['system:ledgerBuilding:remove']" >删除</el-button> >删除</el-button > </template> </template> </el-table-column> </el-table-column> </el-table> </el-table> Loading Loading @@ -168,7 +208,10 @@ <el-input v-model="form.groundFloor" placeholder="请输入地上楼层数" /> <el-input v-model="form.groundFloor" placeholder="请输入地上楼层数" /> </el-form-item> </el-form-item> <el-form-item label="地下楼层数(层)" prop="undergroundFloor"> <el-form-item label="地下楼层数(层)" prop="undergroundFloor"> <el-input v-model="form.undergroundFloor" placeholder="请输入地下楼层数" /> <el-input v-model="form.undergroundFloor" placeholder="请输入地下楼层数" /> </el-form-item> </el-form-item> <el-form-item label="用途" prop="useto"> <el-form-item label="用途" prop="useto"> <el-input v-model="form.useto" placeholder="请输入用途" /> <el-input v-model="form.useto" placeholder="请输入用途" /> Loading @@ -186,7 +229,6 @@ ></el-option> ></el-option> </el-select> </el-select> </el-form-item> </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> Loading @@ -197,11 +239,22 @@ </template> </template> <script> <script> import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding } from "@/api/ledger/building"; import { listBuilding, getBuilding, delBuilding, addBuilding, updateBuilding, } from "@/api/ledger/building"; import { deptTreeSelect } from "@/api/system/user"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { export default { name: "Building", name: "Building", dicts: ['sys_normal_disable', 'data_source'], dicts: ["sys_normal_disable", "data_source"], components: { Treeselect, }, data() { data() { return { return { // 遮罩层 // 遮罩层 Loading Loading @@ -240,18 +293,25 @@ export default { // 表单参数 // 表单参数 form: {}, form: {}, // 表单校验 // 表单校验 rules: { rules: {}, } deptOptions: [], }; }; }, }, created() { created() { this.getList(); this.getList(); this.getDeptTree(); }, }, methods: { methods: { /** 查询部门下拉树结构 */ getDeptTree() { deptTreeSelect().then((response) => { this.deptOptions = response.data; }); }, /** 查询基础数据-楼宇列表 */ /** 查询基础数据-楼宇列表 */ getList() { getList() { this.loading = true; this.loading = true; listBuilding(this.queryParams).then(response => { listBuilding(this.queryParams).then((response) => { this.buildingList = response.rows; this.buildingList = response.rows; this.total = response.total; this.total = response.total; this.loading = false; this.loading = false; Loading Loading @@ -280,7 +340,7 @@ export default { createBy: null, createBy: null, createTime: null, createTime: null, updateBy: null, updateBy: null, updateTime: null updateTime: null, }; }; this.resetForm("form"); this.resetForm("form"); }, }, Loading @@ -296,9 +356,9 @@ export default { }, }, // 多选框选中数据 // 多选框选中数据 handleSelectionChange(selection) { handleSelectionChange(selection) { this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id); this.single = selection.length!==1 this.single = selection.length !== 1; this.multiple = !selection.length this.multiple = !selection.length; }, }, /** 新增按钮操作 */ /** 新增按钮操作 */ handleAdd() { handleAdd() { Loading @@ -309,8 +369,8 @@ export default { /** 修改按钮操作 */ /** 修改按钮操作 */ handleUpdate(row) { handleUpdate(row) { this.reset(); this.reset(); const id = row.id || this.ids const id = row.id || this.ids; getBuilding(id).then(response => { getBuilding(id).then((response) => { this.form = response.data; this.form = response.data; this.open = true; this.open = true; this.title = "修改基础数据-楼宇"; this.title = "修改基础数据-楼宇"; Loading @@ -318,16 +378,16 @@ export default { }, }, /** 提交按钮 */ /** 提交按钮 */ submitForm() { submitForm() { this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => { if (valid) { if (valid) { if (this.form.id != null) { if (this.form.id != null) { updateBuilding(this.form).then(response => { updateBuilding(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功"); this.open = false; this.open = false; this.getList(); this.getList(); }); }); } else { } else { addBuilding(this.form).then(response => { addBuilding(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功"); this.open = false; this.open = false; this.getList(); this.getList(); Loading @@ -339,19 +399,27 @@ export default { /** 删除按钮操作 */ /** 删除按钮操作 */ handleDelete(row) { handleDelete(row) { const ids = row.id || this.ids; const ids = row.id || this.ids; this.$modal.confirm('是否确认删除基础数据-楼宇编号为"' + ids + '"的数据项?').then(function() { this.$modal .confirm('是否确认删除基础数据-楼宇编号为"' + ids + '"的数据项?') .then(function () { return delBuilding(ids); return delBuilding(ids); }).then(() => { }) .then(() => { this.getList(); this.getList(); this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }) .catch(() => {}); }, }, /** 导出按钮操作 */ /** 导出按钮操作 */ handleExport() { handleExport() { this.download('/system/ledger/building/export', { this.download( ...this.queryParams "/system/ledger/building/export", }, `building_${new Date().getTime()}.xlsx`) { } ...this.queryParams, } }, `building_${new Date().getTime()}.xlsx` ); }, }, }; }; </script> </script>
src/views/ledger/project/index.vue +125 −55 Original line number Original line Diff line number Diff line <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="name"> <el-form-item label="项目名称" prop="name"> <el-input <el-input v-model="queryParams.name" v-model="queryParams.name" Loading @@ -18,7 +25,11 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="项目业态" prop="business"> <el-form-item label="项目业态" prop="business"> <el-select v-model="queryParams.business" placeholder="请选择项目业态" clearable> <el-select v-model="queryParams.business" placeholder="请选择项目业态" clearable > <el-option <el-option v-for="dict in dict.type.risk_project_business" v-for="dict in dict.type.risk_project_business" :key="dict.value" :key="dict.value" Loading @@ -29,11 +40,12 @@ </el-form-item> </el-form-item> <el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId"> <el-input <treeselect v-model="queryParams.deptId" v-model="queryParams.deptId" placeholder="请输入所属区域" :options="deptOptions" clearable :show-count="true" @keyup.enter.native="handleQuery" placeholder="请选择所属区域" style="width: 250px" /> /> </el-form-item> </el-form-item> <el-form-item label="所在城市" prop="city"> <el-form-item label="所在城市" prop="city"> Loading @@ -53,7 +65,11 @@ /> /> </el-form-item> </el-form-item> <el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status"> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select v-model="queryParams.status" placeholder="请选择状态" clearable > <el-option <el-option v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :key="dict.value" Loading @@ -63,8 +79,16 @@ </el-select> </el-select> </el-form-item> </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 <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-item> </el-form> </el-form> Loading @@ -77,7 +101,8 @@ size="mini" size="mini" @click="handleAdd" @click="handleAdd" v-hasPermi="['system:ledgerProject:add']" v-hasPermi="['system:ledgerProject:add']" >新增</el-button> >新增</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -88,7 +113,8 @@ :disabled="single" :disabled="single" @click="handleUpdate" @click="handleUpdate" v-hasPermi="['system:ledgerProject:edit']" v-hasPermi="['system:ledgerProject:edit']" >修改</el-button> >修改</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -99,7 +125,8 @@ :disabled="multiple" :disabled="multiple" @click="handleDelete" @click="handleDelete" v-hasPermi="['system:ledgerProject:remove']" v-hasPermi="['system:ledgerProject:remove']" >删除</el-button> >删除</el-button > </el-col> </el-col> <el-col :span="1.5"> <el-col :span="1.5"> <el-button <el-button Loading @@ -109,12 +136,20 @@ size="mini" size="mini" @click="handleExport" @click="handleExport" v-hasPermi="['system:ledgerProject:export']" v-hasPermi="['system:ledgerProject:export']" >导出</el-button> >导出</el-button > </el-col> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" ></right-toolbar> </el-row> </el-row> <el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange" > <el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="序号" align="center"> <el-table-column label="序号" align="center"> <template slot-scope="scope"> <template slot-scope="scope"> Loading @@ -129,10 +164,17 @@ <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="详细地址" align="center" prop="address" /> <el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status"> <template slot-scope="scope"> <template slot-scope="scope"> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" /> </template> </template> </el-table-column> </el-table-column> <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 size="mini" size="mini" Loading @@ -140,14 +182,16 @@ icon="el-icon-edit" icon="el-icon-edit" @click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)" v-hasPermi="['system:ledgerProject:edit']" v-hasPermi="['system:ledgerProject:edit']" >修改</el-button> >修改</el-button > <el-button <el-button size="mini" size="mini" type="text" type="text" icon="el-icon-delete" icon="el-icon-delete" @click="handleDelete(scope.row)" @click="handleDelete(scope.row)" v-hasPermi="['system:ledgerProject:remove']" v-hasPermi="['system:ledgerProject:remove']" >删除</el-button> >删除</el-button > </template> </template> </el-table-column> </el-table-column> </el-table> </el-table> Loading Loading @@ -180,7 +224,12 @@ </el-select> </el-select> </el-form-item> </el-form-item> <el-form-item label="所属区域" prop="deptId"> <el-form-item label="所属区域" prop="deptId"> <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属区域" /> <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属区域" /> </el-form-item> </el-form-item> <el-form-item label="所在城市" prop="city"> <el-form-item label="所在城市" prop="city"> <el-input v-model="form.city" placeholder="请输入所在城市" /> <el-input v-model="form.city" placeholder="请输入所在城市" /> Loading @@ -198,7 +247,6 @@ ></el-option> ></el-option> </el-select> </el-select> </el-form-item> </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> Loading @@ -209,14 +257,29 @@ </template> </template> <script> <script> import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"; import { import { listProject, getProject, delProject, addProject, updateProject } from "@/api/ledger/project/"; listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect, } from "@/api/system/user"; import { listProject, getProject, delProject, addProject, updateProject, } from "@/api/ledger/project/"; import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { export default { name: "Project", name: "Project", dicts: ['sys_normal_disable', 'data_source', 'risk_project_business'], dicts: ["sys_normal_disable", "data_source", "risk_project_business"], components: { Treeselect }, components: { Treeselect }, data() { data() { return { return { Loading Loading @@ -255,15 +318,14 @@ export default { // 表单参数 // 表单参数 form: {}, form: {}, // 表单校验 // 表单校验 rules: { rules: {}, } }; }; }, }, watch: { watch: { // 根据名称筛选部门树 // 根据名称筛选部门树 deptName(val) { deptName(val) { this.$refs.tree.filter(val); this.$refs.tree.filter(val); } }, }, }, created() { created() { this.getList(); this.getList(); Loading @@ -273,7 +335,7 @@ export default { /** 查询基础数据-项目列表 */ /** 查询基础数据-项目列表 */ getList() { getList() { this.loading = true; this.loading = true; listProject(this.queryParams).then(response => { listProject(this.queryParams).then((response) => { this.projectList = response.rows; this.projectList = response.rows; this.total = response.total; this.total = response.total; this.loading = false; this.loading = false; Loading @@ -281,7 +343,7 @@ export default { }, }, /** 查询部门下拉树结构 */ /** 查询部门下拉树结构 */ getDeptTree() { getDeptTree() { deptTreeSelect().then(response => { deptTreeSelect().then((response) => { this.deptOptions = response.data; this.deptOptions = response.data; }); }); }, }, Loading Loading @@ -315,7 +377,7 @@ export default { createBy: null, createBy: null, createTime: null, createTime: null, updateBy: null, updateBy: null, updateTime: null updateTime: null, }; }; this.resetForm("form"); this.resetForm("form"); }, }, Loading @@ -331,9 +393,9 @@ export default { }, }, // 多选框选中数据 // 多选框选中数据 handleSelectionChange(selection) { handleSelectionChange(selection) { this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id); this.single = selection.length!==1 this.single = selection.length !== 1; this.multiple = !selection.length this.multiple = !selection.length; }, }, /** 新增按钮操作 */ /** 新增按钮操作 */ handleAdd() { handleAdd() { Loading @@ -344,8 +406,8 @@ export default { /** 修改按钮操作 */ /** 修改按钮操作 */ handleUpdate(row) { handleUpdate(row) { this.reset(); this.reset(); const id = row.id || this.ids const id = row.id || this.ids; getProject(id).then(response => { getProject(id).then((response) => { this.form = response.data; this.form = response.data; this.open = true; this.open = true; this.title = "修改基础数据-项目"; this.title = "修改基础数据-项目"; Loading @@ -353,16 +415,16 @@ export default { }, }, /** 提交按钮 */ /** 提交按钮 */ submitForm() { submitForm() { this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => { if (valid) { if (valid) { if (this.form.id != null) { if (this.form.id != null) { updateProject(this.form).then(response => { updateProject(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功"); this.open = false; this.open = false; this.getList(); this.getList(); }); }); } else { } else { addProject(this.form).then(response => { addProject(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功"); this.open = false; this.open = false; this.getList(); this.getList(); Loading @@ -374,19 +436,27 @@ export default { /** 删除按钮操作 */ /** 删除按钮操作 */ handleDelete(row) { handleDelete(row) { const ids = row.id || this.ids; const ids = row.id || this.ids; this.$modal.confirm('是否确认删除基础数据-项目编号为"' + ids + '"的数据项?').then(function() { this.$modal .confirm('是否确认删除基础数据-项目编号为"' + ids + '"的数据项?') .then(function () { return delProject(ids); return delProject(ids); }).then(() => { }) .then(() => { this.getList(); this.getList(); this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }) .catch(() => {}); }, }, /** 导出按钮操作 */ /** 导出按钮操作 */ handleExport() { handleExport() { this.download('system/ledger/project/export', { this.download( ...this.queryParams "system/ledger/project/export", }, `project_${new Date().getTime()}.xlsx`) { } ...this.queryParams, } }, `project_${new Date().getTime()}.xlsx` ); }, }, }; }; </script> </script>