From d29f133122aaf6c43ab3352799752caf836f23a1 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Fri, 25 Aug 2023 14:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=AE=A1=E7=90=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/columns/constants/index.js | 4 +- src/views/components/resiSearch.vue | 6 +- src/views/dataBoard/renfang/resi/list.vue | 480 +++--- .../modules/base/community/buildTable.vue | 540 ++++--- .../modules/base/community/communityForm.vue | 141 +- .../base/community/communityTable copy.vue | 1302 ----------------- .../modules/base/community/communityTable.vue | 528 ++++--- .../modules/base/community/roomDetail.vue | 88 +- src/views/modules/base/community/roomForm.vue | 49 +- .../modules/base/community/roomTable.vue | 541 ++++--- src/views/modules/base/resi.vue | 142 +- .../residentManagement/louzhang/addForm.vue | 33 +- .../louzhang/louzhangList.vue | 24 +- 13 files changed, 1579 insertions(+), 2299 deletions(-) delete mode 100644 src/views/modules/base/community/communityTable copy.vue diff --git a/src/js/columns/constants/index.js b/src/js/columns/constants/index.js index 5ad06e88b..99938e1f0 100644 --- a/src/js/columns/constants/index.js +++ b/src/js/columns/constants/index.js @@ -52,10 +52,10 @@ export const healthStatusList = [ export const dormitoryTypeList = [ { label: '楼长', - value: 1 + value: '1' }, { label: '单元长', - value: 0 + value: '0' } ] diff --git a/src/views/components/resiSearch.vue b/src/views/components/resiSearch.vue index 04cae109b..fbd05f8ac 100644 --- a/src/views/components/resiSearch.vue +++ b/src/views/components/resiSearch.vue @@ -382,7 +382,9 @@ export default { villageId: '', buildId: '', unitId: '', - homeId: '' + homeId: '', + level: '', + orgType: '' }, GRID_ID: '', tempFormList, @@ -706,6 +708,8 @@ export default { "agencyId" ); this.level = this.sarr[this.sarr.length - 1].level + this.form.level = this.sarr[this.sarr.length - 1].level + this.getValiheList() }, getLastItem (list, vals, key) { diff --git a/src/views/dataBoard/renfang/resi/list.vue b/src/views/dataBoard/renfang/resi/list.vue index 0cdf7b3ce..fc22d2bc5 100644 --- a/src/views/dataBoard/renfang/resi/list.vue +++ b/src/views/dataBoard/renfang/resi/list.vue @@ -1,41 +1,33 @@ diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index 9f4473b3d..9f58019a0 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/src/views/modules/base/community/buildTable.vue @@ -3,75 +3,143 @@
- 新增楼栋 + 新增楼栋 -
+
- +
- - 导入楼栋数据 + + 导入楼栋数据
- - 导入房屋数据 + + 导入房屋数据
- 导入 + 导入
- 导出 - 批量删除 + 导出 + 批量删除
- +
- 下载小区模板 + 下载小区模板
- 下载楼栋模板 + 下载楼栋模板
- 下载房屋模板 + 下载房屋模板
- 导出一户一档 + 导出一户一档
-
- 智能填报 +
+ 智能填报
- 更多 + 更多
- - + + - + - + - + - + - + - + - + - + - + - + - +
- +
- - + + - - + + - - + + }" + :orgId="agencyObj.id" + @close="handleDiyClose">
@@ -171,10 +327,11 @@ import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 import baobiao from "@/views/modules/cpts/baobiao"; import communityExportInfo from "./communityExportInfo.vue"; +import util from "@/js/util"; let loading // 加载动画 export default { - data() { + data () { return { searchHeight: 190,//搜索栏高度 importBuildingLoading: false, @@ -205,7 +362,7 @@ export default { displayedBaobiaoBtn: false, - queryConditions:[] + queryConditions: [] } }, components: { @@ -214,7 +371,7 @@ export default { BuildDetail, communityExportInfo }, - async mounted() { + async mounted () { // this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({ // elseParams: { // categoryKeys: ['house_info'], categoryKey: 'house_info', @@ -223,7 +380,7 @@ export default { this.getQueryConditions() }, computed: { - tableHeight() { + tableHeight () { let height = this.searchHeight + 270 return this.$store.state.inIframe ? this.clientHeight - height + this.iframeHeight : this.clientHeight - height @@ -233,7 +390,7 @@ export default { ...mapGetters(['clientHeight', 'iframeHeight']) }, methods: { - reportForm() { + reportForm () { let paramMap = { pageSize: this.pageSize, pageNo: this.pageNo, @@ -255,10 +412,10 @@ export default { }) }, - indexMethod(index) { + indexMethod (index) { return index + 1; }, - handleSortOrderChange(value) { + handleSortOrderChange (value) { this.sortType = value.order === 'ascending' ? 'asc' : 'desc' this.loadTable() @@ -268,7 +425,7 @@ export default { // }, - handleEditSort(row) { + handleEditSort (row) { if (!row.isChange) { row.isChange = true } @@ -276,7 +433,7 @@ export default { }, - async handleChangeSort(row, index) { + async handleChangeSort (row, index) { // row.isChange = false let params = { @@ -304,17 +461,17 @@ export default { }, - checkSelect(row, index) { - let isChecked = false; - if (row.showBtn) { // 判断里面是否存在某个参数 - isChecked = true - } else { - isChecked = false - } + checkSelect (row, index) { + let isChecked = true; + // if (row.showBtn) { // 判断里面是否存在某个参数 + // isChecked = true + // } else { + // isChecked = false + // } return isChecked }, - async loadTable(fromTree, treeObj) { + async loadTable (fromTree, treeObj) { this.addDisabled = true this.tableLoading = true if (fromTree) { @@ -346,10 +503,10 @@ export default { // item.sort = item.sort.toFixed(2) item.isChange = false if (item.agencyId === this.staffAgencyId) { - item.showBtn = true + // item.showBtn = true this.validTableDataNum++ } else { - item.showBtn = false + // item.showBtn = false } }); @@ -362,12 +519,12 @@ export default { this.tableLoading = false }, - diaClose() { + diaClose () { this.$refs.ref_form.resetData() this.formShow = false }, - async handleDetail(row) { + async handleDetail (row) { // this.formTitle = '楼栋详情' // this.formShow = true // const _data = await this.detail(row) @@ -383,12 +540,12 @@ export default { }) }, - detailFormCancle() { + detailFormCancle () { this.$refs.ref_form_detail.diaDestroy() this.detailShow = false }, - handleAdd() { + handleAdd () { this.formTitle = '新增楼栋' this.formShow = true this.$nextTick(() => { @@ -397,7 +554,7 @@ export default { }) }, - async handleEdit(row) { + async handleEdit (row) { this.formTitle = '修改楼栋' this.formShow = true const _data = await this.detail(row) @@ -406,52 +563,30 @@ export default { }) }, - handleToNextLevel(row) { + handleToNextLevel (row) { this.$emit('toNextLevel', row, 'building') }, - addFormCancle() { + addFormCancle () { this.formShow = false }, - addFormOk() { + addFormOk () { this.formShow = false this.loadTable() this.$emit('refreshTree') }, - deleteBatch() { - if (this.selection.length > 0) { - this.$confirm("确认删除选择的楼栋?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(() => { - this.deleteCommunityBatch() - }) - .catch(err => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - }); - } else { - this.$message.warning('请先选择要删除的楼栋') - } - }, - selectAll(selection) { + selectAll (selection) { this.selection = selection }, - selectionChange(selection) { + selectionChange (selection) { this.selection = selection }, - async handleDelete(row) { + async handleDelete (row) { this.$confirm("确认删除?", "提示", { confirmButtonText: "确定", @@ -459,78 +594,85 @@ export default { type: "warning" }) .then(() => { - this.deleteBuild(row) + let ids = [row.buildingId]; + + this.deleteBuild(ids, false) }) .catch(err => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - }); - }, - async deleteCommunityBatch() { - let ids = [] - this.selection.forEach(element => { + deleteBatch () { + if (this.selection.length > 0) { + this.$confirm("确认删除选择的楼栋?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + let ids = []; + console.log(this.selection); + this.selection.forEach((element) => { + ids.push(element.buildingId); + }); + + //第一次删除,非强制删除 + this.deleteBuild(ids, false) + }) + .catch(err => { + if (err == "cancel") { - ids.push(element.buildingId) - }); + } - const url = "/actual/base/communityHouse/deleteCommunityInfoByIds" + }); + } else { + this.$message.warning('请先选择要删除的楼栋') + } + }, + async deleteBuild (ids, forceDelete) { + const url = "/actual/base/communityHouse/deleteCommunityInfoByIds"; let params = { + forceDelete: forceDelete, type: 'building', ids: ids } - const { data, code, msg } = await requestPost(url, params) + const { data, code, msg } = await requestPost(url, params); if (code === 0) { this.$message({ type: "success", - message: "删除成功" + message: "删除成功", }); this.$emit('refreshTree') this.loadTable() + } else if (code > 8000) { - this.$message({ - showClose: true, - message: msg, - duration: 0 + + this.$confirm(msg, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - this.$emit('refreshTree') - this.loadTable() - } else { - this.$message.error(msg) - } - }, + .then(() => { - async deleteBuild(row) { - const url = "/actual/base/communityBuilding/deleteBuilding" + this.deleteBuild(ids, true); + }) + .catch((err) => { + if (err == "cancel") { - let params = { - buildingId: row.buildingId - } + } + }); - const { data, code, msg } = await requestPost(url, params) - if (code === 0) { - this.$message({ - type: "success", - message: "删除成功" - }); - this.$emit('refreshTree') - this.loadTable() } else { - // this.$message.error(msg) + this.$message.error(msg); } }, - async detail(row) { + + async detail (row) { const url = "/actual/base/communityBuilding/getBuildingDetail/" + row.buildingId @@ -544,7 +686,7 @@ export default { }, //导出表格 - async handleExport() { + async handleExport () { // 老版本直接在页面中导出是好的可以解开直接用 // let title = this.agencyObj.label // title = title + '—楼栋列表' @@ -569,7 +711,7 @@ export default { await this.getExportList(); }, - async getExportList(type) { + async getExportList (type) { const url = "/oper/customize/icformitemgroup/list"; let params = { formCode: "community_info", @@ -594,35 +736,35 @@ export default { } }, - async getQueryConditions() { - let params = { - formCode: "community_info", - customerId: this.$store.state.user.customerId, - }; - - const { data } = await this.$http.post( - "/oper/customize/icform/queryItems", - params - ); - - if (data.code === 0) { - this.queryConditions = data.data.map((item) => { - return { - ...item, - humpName: util.capitalToHump(item.columnName), - }; - }); - console.log(this.queryConditions); - } else { - this.$message.error(data.msg); - } - }, - - handleDiyClose() { + async getQueryConditions () { + let params = { + formCode: "community_info", + customerId: this.$store.state.user.customerId, + }; + + const { data } = await this.$http.post( + "/oper/customize/icform/queryItems", + params + ); + + if (data.code === 0) { + this.queryConditions = data.data.map((item) => { + return { + ...item, + humpName: util.capitalToHump(item.columnName), + }; + }); + console.log(this.queryConditions); + } else { + this.$message.error(data.msg); + } + }, + + handleDiyClose () { this.diyDialog = false; }, // 下载文件 - download(data, fileName) { + download (data, fileName) { if (!data) { return } @@ -647,7 +789,7 @@ export default { }, - handleExportModule(type) { + handleExportModule (type) { let title = '' let url = "" @@ -680,7 +822,7 @@ export default { }, //导出一户一档 - handleExportYihuyidang() { + handleExportYihuyidang () { this.yihuyidangDisabled = true let title = this.agencyObj.label title = title + '-一户一档' @@ -719,7 +861,7 @@ export default { // 上传文件之前的钩子 - beforeUpload(file, type) { + beforeUpload (file, type) { this.files = file; const isText = file.type === 'application/vnd.ms-excel' @@ -737,11 +879,11 @@ export default { }, // 上传文件个数超过定义的数量 - handleExceed(files, fileList) { + handleExceed (files, fileList) { this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`) }, - async uploadFile(type) { + async uploadFile (type) { if (this.fileName == "") { this.$message.warning('请选择要上传的文件!') return false @@ -817,7 +959,7 @@ export default { }, - showMessage(msg) { + showMessage (msg) { this.$alert(msg, '操作结果', { confirmButtonText: '关闭', callback: action => { @@ -827,18 +969,18 @@ export default { }); }, - handleSizeChange(val) { + handleSizeChange (val) { this.pageSize = val this.pageNo = 1 this.loadTable() }, - handleCurrentChange(val) { + handleCurrentChange (val) { this.pageNo = val this.loadTable() }, // 开启加载动画 - startLoading() { + startLoading () { loading = Loading.service({ lock: true, // 是否锁定 text: '正在加载……', // 加载中需要显示的文字 @@ -846,7 +988,7 @@ export default { }) }, // 结束加载动画 - endLoading() { + endLoading () { // clearTimeout(timer); if (loading) { loading.close() @@ -856,7 +998,7 @@ export default { watch: { '$store.state.sidebarFold': { - handler(newVal, oldVal) { + handler (newVal, oldVal) { if (newVal) {//收起 this.searchHeight = 155 diff --git a/src/views/modules/base/community/communityForm.vue b/src/views/modules/base/community/communityForm.vue index 7806df92e..3175b2145 100644 --- a/src/views/modules/base/community/communityForm.vue +++ b/src/views/modules/base/community/communityForm.vue @@ -9,24 +9,22 @@ label-width="150px" class="g-edit-form"> - - {{ dataForm.agencyName }} + {{ dataForm.agencyName+'-'+dataForm.gridName }} - - - - - + + import { mapGetters } from 'vuex' import { Loading } from 'element-ui' // 引入Loading服务 -import { requestPost } from '@/js/dai/request' +import { requestPost, requestGet } from '@/js/dai/request' import daiMap from "@/utils/dai-map"; var map var search @@ -218,8 +216,6 @@ export default { resultList: [], loading: false, - - gridList: [], propertyList: [], btnDisable: false, @@ -227,6 +223,7 @@ export default { quartersType: '0', propertyId: '', dataForm: { + // cascaderId: '', neighborHoodName: '', // 小区名称【不超过50字】 agencyId: '', // 所属组织ID agencyName: '', @@ -250,20 +247,94 @@ export default { }, keyWords: '', - agencyObj: {} + agencyObj: {}, + + //级联 + props: { + checkStrictly: true, + emitPath: false, + // children: 'subAgencyList', + // label: 'agencyName', + // value: 'agencyId', + lazy: true, + lazyLoad: this.lazyLoadAgency + }, + userAgencyId: '', } }, components: {}, async created () { + this.user = this.$store.state.user; + this.userAgencyId = this.user.agencyId; await this.loadAgency() - await this.loadGrid() + await this.loadProperty() }, methods: { - handleSelGrid (index) { - this.dataForm.gridName = this.gridList[index].gridName + lazyLoadAgency (node, resolve) { + + setTimeout(() => { + this.getAgency(node, resolve) + }, 200) + }, + async getAgency (node, resolve) { + + const url = "/gov/org/agency/dynamicOrgTreeWithDepth" + console.log('级联', node.value) + + let params = { + rootOrgId: node.value ? node.value : '', + leafDepth: 1 + } + + const { data, code, msg } = await requestGet(url, params) + let array = [] + if (node.value) {//根节点 + array = data.children.length > 0 ? data.children : [] + + } else { + array = [data] + } + + if (code === 0) { + const nodes = array.map(item => ({ + value: item.id, // + label: item.name, + level: item.agencyLevel, + orgType: item.orgType, + leaf: node.level >= 4 // 5层级 + })) + resolve(nodes) + + } else { + this.$message.error(msg) + } + + }, + + handleChangeAngency (val) { + + + let selAgency = this.$refs.ref_cascader_agency.getCheckedNodes()[0] + console.log('选择的组织', selAgency) + if (selAgency.data) { + if (selAgency.data.orgType !== 'grid') { + this.dataForm.gridId = '' + this.dataForm.agencyId = '' + this.$message.info('请选择网格') + return false + } else { + this.dataForm.gridId = val + this.dataForm.agencyId = selAgency.parent.value + } + } else { + this.dataForm.gridId = '' + this.dataForm.agencyId = '' + } + }, + async initForm (type, row, agencyObj) { this.$refs.ref_form.resetFields(); @@ -289,11 +360,11 @@ export default { // map.setMarker(this.dataForm.latitude, this.dataForm.longitude); // } - if (agencyObj.level == 'grid') { - console.log(agencyObj) - this.dataForm.gridId = agencyObj.id - this.dataForm.gridName = agencyObj.label - } + // if (agencyObj.level == 'grid') { + // console.log(agencyObj) + // this.dataForm.gridId = agencyObj.id + // this.dataForm.gridName = agencyObj.label + // } }, // 地图初始化函数,本例取名为init,开发者可根据实际情况定义 initMap (latitude, longitude) { @@ -401,22 +472,7 @@ export default { this.$message.error(msg) } }, - //加载网格 - async loadGrid () { - const url = '/gov/org/grid/allgridsnopermission' - // const url = "https://epmet-dev.elinkservice.cn:7082/api/apimock-v2/95518686fa128a53f64c678906848062/gov/org/grid/allgrids" - let params = { - agencyId: this.dataForm.agencyId - } - - const { data, code, msg } = await requestPost(url, params) - if (code === 0) { - this.gridList = data - } else { - this.$message.error(msg) - } - }, //加载物业 async loadProperty () { const url = '/actual/base/communityPropertyManagement/listPropertyManagements' @@ -462,6 +518,7 @@ export default { } }, async addCommunity () { + console.log('dataForm', this.dataForm) let url = '' if (this.formType === 'add') { @@ -587,7 +644,7 @@ export default { { required: true, message: '所属组织不能为空', trigger: 'blur' } ], gridId: [ - { required: true, message: '所属网格不能为空', trigger: 'blur' } + { required: true, message: '所属组织不能为空', trigger: 'blur' } ], coding: [ { required: true, message: '小区编码不能为空', trigger: 'blur' } diff --git a/src/views/modules/base/community/communityTable copy.vue b/src/views/modules/base/community/communityTable copy.vue deleted file mode 100644 index c08bb6cd3..000000000 --- a/src/views/modules/base/community/communityTable copy.vue +++ /dev/null @@ -1,1302 +0,0 @@ - - - - - - diff --git a/src/views/modules/base/community/communityTable.vue b/src/views/modules/base/community/communityTable.vue index e01a120e0..afb6dc2a3 100644 --- a/src/views/modules/base/community/communityTable.vue +++ b/src/views/modules/base/community/communityTable.vue @@ -2,56 +2,99 @@
- 新增小区 - -
- + 新增小区 + +
+
- - 导入小区数据 + 导入小区数据
- - 导入楼栋数据 + 导入楼栋数据
- - 导入房屋数据 + 导入房屋数据
- 导入 + 导入
- 导出 + 导出 - 批量删除 + 批量删除
- -
- 下载小区模板 + +
+ 下载小区模板
-
- 下载楼栋模板 +
+ 下载楼栋模板
-
- 下载房屋模板 +
+ 下载房屋模板
-
- 智能填报 +
+ 智能填报
- 更多 + 更多
- - + + - + - + - + - + - +
- +
- - + + - - + + - - + + }" + :orgId="treeObj.id" + @close="handleDiyClose"> @@ -268,7 +411,7 @@ export default { }, }, - data() { + data () { return { searchHeight: 190, //搜索栏高度 // tableHeight: 0, @@ -320,7 +463,7 @@ export default { }, computed: { - tableHeight() { + tableHeight () { console.log(this.searchHeight); let height = this.searchHeight + 270; return this.$store.state.inIframe @@ -331,7 +474,7 @@ export default { ...mapGetters(["clientHeight", "iframeHeight"]), }, watch: { - selection(val) { + selection (val) { if (val.length > 0) { this.showDeletBtn = true; } else { @@ -339,7 +482,7 @@ export default { } }, "$store.state.sidebarFold": { - handler(newVal, oldVal) { + handler (newVal, oldVal) { if (newVal) { //收起 this.searchHeight = 155; @@ -358,9 +501,9 @@ export default { communityExportInfo, }, - activated() { }, + activated () { }, - async mounted() { + async mounted () { this.customerId = localStorage.getItem("customerId"); this.displayedBaobiaoBtn = await this.$refs.baobiao.existsTemplate({ elseParams: { @@ -371,31 +514,31 @@ export default { }, methods: { - async getQueryConditions() { - let params = { - formCode: "community_info", - customerId: this.$store.state.user.customerId, - }; - - const { data } = await this.$http.post( - "/oper/customize/icform/queryItems", - params - ); - - if (data.code === 0) { - this.queryConditions = data.data.map((item) => { - return { - ...item, - humpName: util.capitalToHump(item.columnName), - }; - }); - console.log(this.queryConditions); - } else { - this.$message.error(data.msg); - } + async getQueryConditions () { + let params = { + formCode: "community_info", + customerId: this.$store.state.user.customerId, + }; + + const { data } = await this.$http.post( + "/oper/customize/icform/queryItems", + params + ); + + if (data.code === 0) { + this.queryConditions = data.data.map((item) => { + return { + ...item, + humpName: util.capitalToHump(item.columnName), + }; + }); + console.log(this.queryConditions); + } else { + this.$message.error(data.msg); + } }, - reportForm() { + reportForm () { let paramMap = { pageSize: this.pageSize, pageNo: this.pageNo, @@ -418,7 +561,7 @@ export default { }, }); }, - async loadTable(fromTree, treeObj) { + async loadTable (fromTree, treeObj) { this.treeObj = { ...treeObj } @@ -475,10 +618,10 @@ export default { this.total = data.total; data.list.forEach((item) => { if (item.agencyId === this.staffAgencyId) { - item.showBtn = true; + // item.showBtn = true; this.validTableDataNum++; } else { - item.showBtn = false; + // item.showBtn = false; } }); this.tableData = data.list; @@ -488,23 +631,23 @@ export default { this.tableLoading = false; }, - checkSelect(row, index) { - let isChecked = false; - if (row.showBtn) { - // 判断里面是否存在某个参数 - isChecked = true; - } else { - isChecked = false; - } + checkSelect (row, index) { + let isChecked = true; + // if (row.showBtn) { + // // 判断里面是否存在某个参数 + // isChecked = true; + // } else { + // isChecked = false; + // } return isChecked; }, - diaClose() { + diaClose () { this.$refs.ref_form.resetData(); this.formShow = false; }, - async handleDetail(row) { + async handleDetail (row) { // this.formTitle = '小区详情' // this.formShow = true // const _data = await this.detail(row) @@ -520,14 +663,14 @@ export default { }); }, - handleAdd() { + handleAdd () { this.formTitle = "新增小区"; this.formShow = true; this.$nextTick(() => { this.$refs.ref_form.initForm("add", null, this.agencyObj); }); }, - async detail(row) { + async detail (row) { const url = "/actual/base/communityQuarters/getQuartersDetail/" + row.neighborHoodId; @@ -541,7 +684,7 @@ export default { } }, // 补全一房一码点击事件 - async handleYhymInfo() { + async handleYhymInfo () { this.yhymLoading = true; const url = "/gov/org/house/createBatchHouseCodeAndUrl"; @@ -568,7 +711,7 @@ export default { } }, // 补全小程序一户一码 - async createBatchNeiQrUrl() { + async createBatchNeiQrUrl () { this.xcxmLoading = true; const url = "/gov/org/neighborhood/createBatchNeiQrUrl"; @@ -594,7 +737,7 @@ export default { this.$message.error(msg); } }, - async handleEdit(row) { + async handleEdit (row) { this.formTitle = "修改小区"; this.formShow = true; const _data = await this.detail(row); @@ -603,24 +746,50 @@ export default { }); }, - handleToNextLevel(row) { + handleToNextLevel (row) { this.$emit("toNextLevel", row, "community"); }, - addFormCancle() { + addFormCancle () { this.formShow = false; }, - detailFormCancle() { + detailFormCancle () { this.$refs.ref_form_detail.diaDestroy(); this.detailShow = false; }, - addFormOk() { + addFormOk () { this.formShow = false; this.loadTable(); this.$emit("refreshTree"); }, - deleteBatch() { + + selectAll (selection) { + this.selection = selection; + }, + selectionChange (selection) { + this.selection = selection; + }, + + async handleDelete (row) { + this.$confirm("确认删除?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + let ids = [row.neighborHoodId]; + + //第一次删除,非强制删除 + this.deleteCommunity(ids, false); + }) + .catch((err) => { + if (err == "cancel") { + + } + }); + }, + deleteBatch () { if (this.selection.length > 0) { this.$confirm("确认删除选择的小区?", "提示", { confirmButtonText: "确定", @@ -628,7 +797,15 @@ export default { type: "warning", }) .then(() => { - this.deleteCommunityBatch(); + + let ids = []; + console.log(this.selection); + this.selection.forEach((element) => { + ids.push(element.neighborHoodId); + }); + + //第一次删除,非强制删除 + this.deleteCommunity(ids, false); }) .catch((err) => { if (err == "cancel") { @@ -642,45 +819,14 @@ export default { this.$message.warning("请先选择要删除的小区"); } }, - selectAll(selection) { - this.selection = selection; - }, - selectionChange(selection) { - this.selection = selection; - }, - - async handleDelete(row) { - this.$confirm("确认删除?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - }) - .then(() => { - this.deleteCommunity(row); - }) - .catch((err) => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - }); - }, - - async deleteCommunityBatch() { - let ids = []; - console.log(this.selection); - this.selection.forEach((element) => { - ids.push(element.neighborHoodId); - }); + async deleteCommunity (ids, forceDelete) { const url = "/actual/base/communityHouse/deleteCommunityInfoByIds"; - let params = { - type: "neighborHood", - ids: ids, - }; + forceDelete: forceDelete, + type: 'neighborHood', + ids: ids + } const { data, code, msg } = await requestPost(url, params); @@ -691,39 +837,31 @@ export default { }); this.$emit("refreshTree"); this.loadTable(); + } else if (code > 8000) { - this.$message({ - showClose: true, - message: msg, - duration: 0, - }); - this.$emit("refreshTree"); - this.loadTable(); - } else { - this.$message.error(msg); - } - }, - async deleteCommunity(row) { - const url = "/actual/base/communityQuarters/deleteQuarters"; - let params = { - neighborHoodId: row.neighborHoodId, - }; + this.$confirm(msg, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + + this.deleteCommunity(ids, true); + }) + .catch((err) => { + if (err == "cancel") { + + } + }); - const { data, code, msg } = await requestPost(url, params); - if (code === 0) { - this.$message({ - type: "success", - message: "删除成功", - }); - this.$emit("refreshTree"); - this.loadTable(); } else { - // this.$message.error(msg); + this.$message.error(msg); } }, - async handleDownQr(row, type) { + + async handleDownQr (row, type) { let title = row.label + "二维码.png"; // const url = window.SITE_CONFIG['apiURL'] + `/gov/org/icneighborhood/createQrCode/${row.neighborHoodId}` const url = "/gov/org/agency/create-qrcode"; @@ -748,10 +886,10 @@ export default { }); }, // 导出按钮点击事件 - async handleExportOpen() { + async handleExportOpen () { await this.getExportList(); }, - async getExportList(type) { + async getExportList (type) { const url = "/oper/customize/icformitemgroup/list"; let params = { formCode: "community_info", @@ -776,7 +914,7 @@ export default { } }, //导出表格 以前是导出 现在改成导出房屋数据 - async handleExport() { + async handleExport () { let title = this.agencyObj.label; title = title + "—小区列表"; @@ -797,15 +935,15 @@ export default { } ); }, - handleDiyClose() { + handleDiyClose () { this.diyDialog = false; }, - handleClose(done) { + handleClose (done) { this.diyDialog = false; }, // 下载文件 - download(data, downFileName) { + download (data, downFileName) { if (!data) { return; } @@ -829,7 +967,7 @@ export default { } }, - handleExportModule(type) { + handleExportModule (type) { let title = ""; let url = ""; if (type === "community") { @@ -858,7 +996,7 @@ export default { }, //导出一户一档 - handleExportYihuyidang() { + handleExportYihuyidang () { this.yihuyidangDisabled = true; let title = this.agencyObj.label; title = title + "-一户一档"; @@ -900,7 +1038,7 @@ export default { // 导出一房一码 - handleExportYihuyima() { + handleExportYihuyima () { this.exportBtn = true; this.yihuyimaDisabled = true; let title = this.agencyObj.label; @@ -929,7 +1067,7 @@ export default { }, // 上传文件之前的钩子 - beforeUpload(file, type) { + beforeUpload (file, type) { this.files = file; const isText = file.type === "application/vnd.ms-excel"; @@ -948,11 +1086,11 @@ export default { } }, // 上传文件个数超过定义的数量 - handleExceed(files, fileList) { + handleExceed (files, fileList) { this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`); }, - async uploadFile(type) { + async uploadFile (type) { if (this.fileName == "") { this.$message.warning("请选择要上传的文件!"); return false; @@ -1033,7 +1171,7 @@ export default { ); }, - showMessage(msg) { + showMessage (msg) { this.$alert(msg, "操作结果", { confirmButtonText: "关闭", callback: (action) => { @@ -1042,18 +1180,18 @@ export default { }, }); }, - handleSizeChange(val) { + handleSizeChange (val) { this.pageSize = val; this.pageNo = 1; this.loadTable(this.treeObj); }, - handleCurrentChange(val) { + handleCurrentChange (val) { this.pageNo = val; this.loadTable(this.treeObj); }, // 开启加载动画 - startLoading() { + startLoading () { loading = Loading.service({ lock: true, // 是否锁定 text: "正在加载……", // 加载中需要显示的文字 @@ -1061,7 +1199,7 @@ export default { }); }, // 结束加载动画 - endLoading() { + endLoading () { // clearTimeout(timer); if (loading) { loading.close(); diff --git a/src/views/modules/base/community/roomDetail.vue b/src/views/modules/base/community/roomDetail.vue index dac59ed75..967f7870c 100644 --- a/src/views/modules/base/community/roomDetail.vue +++ b/src/views/modules/base/community/roomDetail.vue @@ -35,6 +35,10 @@ 房屋状态: {{ dataForm.rentName ? dataForm.rentName : "--" }}
+
+ 家庭标签: + {{ dataForm.familyTagShow ? dataForm.familyTagShow : "--" }} +
房主姓名: {{ dataForm.ownerName ? dataForm.ownerName : "--" }} @@ -44,8 +48,14 @@ {{ dataForm.ownerPhone ? dataForm.ownerPhone : "--" }} - - + + {{ dataForm.ownerIdCard ? dataForm.ownerIdCard : "--" }} - - + + 0) { + let array = [] + this.dataForm.familyTags.forEach(onetag => { + this.dicts.family_tag.forEach(onedic => { + if (onetag === onedic.value) { + array.push(onedic.label) + } + }); + + }); + this.dataForm.familyTagShow = array.join(',') + } + } else { this.$message.error(msg); } }, + async getDicts () { + try { + const dictTypes = ["family_tag"]; // 把所有dictType放在这个数组里 + const requests = dictTypes.map((dictType) => { + return this.$http.post("sys/dict/data/dictlist", { + dictType: dictType, + }); + }); + const results = await Promise.all(requests); + results.forEach((result, index) => { + if (result.data.code === 0) { + this.dicts[dictTypes[index]].push(...result.data.data); + } else { + console.log(`获取${dictTypes[index]}字典失败: ${result.msg}`); + } + }); + } catch (error) { + console.log("获取字典失败: ", error); + } + }, resetData () { this.houseId = ""; //房屋ID diff --git a/src/views/modules/base/community/roomForm.vue b/src/views/modules/base/community/roomForm.vue index 68d18acfa..7b33ee918 100644 --- a/src/views/modules/base/community/roomForm.vue +++ b/src/views/modules/base/community/roomForm.vue @@ -138,6 +138,16 @@ + + + {{item.label}} + + { + return this.$http.post("sys/dict/data/dictlist", { + dictType: dictType, + }); + }); + const results = await Promise.all(requests); + results.forEach((result, index) => { + if (result.data.code === 0) { + this.dicts[dictTypes[index]].push(...result.data.data); + } else { + console.log(`获取${dictTypes[index]}字典失败: ${result.msg}`); + } + }); + } catch (error) { + console.log("获取字典失败: ", error); + } + }, + handleCancle () { this.resetData() this.$emit('dialogCancle') @@ -406,7 +450,8 @@ export default { ownerIdCard: '', //房主证件号 remark: '', // 备注 coding: '', - sysCoding: '' + sysCoding: '', + familyTags: [] } }, diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index 445a0d3db..49d7664cf 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -3,74 +3,130 @@
- 新增房屋 + 新增房屋 -
+
- +
- - 导入房屋数据 + + 导入房屋数据
- 导入 + 导入
- 导出 + 导出 - 批量删除 + 批量删除
- +
- 下载小区模板 + 下载小区模板
- 下载楼栋模板 + 下载楼栋模板
- 下载房屋模板 + 下载房屋模板
- 导出一户一档 + 导出一户一档
-
- 智能填报 +
+ 智能填报
- 更多 + 更多
- - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
- +
- - + + - + - + - - + + }" + :orgId="agencyObj.id" + @close="handleDiyClose">
@@ -170,10 +327,11 @@ import { mapGetters } from "vuex"; import { Loading } from "element-ui"; // 引入Loading服务 import baobiao from "@/views/modules/cpts/baobiao"; import communityExportInfo from "./communityExportInfo.vue"; +import util from "@/js/util"; let loading; // 加载动画 export default { - data() { + data () { return { searchHeight: 190,//搜索栏高度 source: "tree", //来源 @@ -234,7 +392,7 @@ export default { ic_house_view_real_data: false, //显示脱敏信息 }, diyDialog: false, - queryConditions:[] + queryConditions: [] }; }, components: { @@ -243,7 +401,7 @@ export default { roomDetail, communityExportInfo }, - async mounted() { + async mounted () { this.updateBtnAuths(); this.getQueryConditions() @@ -255,7 +413,7 @@ export default { // }); }, computed: { - tableHeight() { + tableHeight () { console.log(this.searchHeight) let height = this.searchHeight + 270 return this.$store.state.inIframe ? this.clientHeight - height + this.iframeHeight : this.clientHeight - height @@ -266,7 +424,7 @@ export default { }, methods: { // 更新按钮权限 - updateBtnAuths() { + updateBtnAuths () { let rot = this.$route; if (Array.isArray(rot.meta.btns)) { rot.meta.btns.forEach((item) => { @@ -275,7 +433,7 @@ export default { } }, - reportForm() { + reportForm () { let paramMap = { pageSize: this.pageSize, pageNo: this.pageNo, @@ -303,25 +461,25 @@ export default { }); }, - indexMethod(index) { + indexMethod (index) { return index + 1; }, - handleSortOrderChange(value) { + handleSortOrderChange (value) { this.sortType = value.order === "ascending" ? "asc" : "desc"; this.loadTable(); }, - handleSortChange(value) { + handleSortChange (value) { this.sortType = value.order === "ascending" ? "asc" : "desc"; this.loadTable(); }, - handleEditSort(row) { + handleEditSort (row) { if (!row.isChange) { row.isChange = true; } }, - async handleChangeSort(row, index) { + async handleChangeSort (row, index) { // row.isChange = false let params = { @@ -344,20 +502,20 @@ export default { } }, - checkSelect(row, index) { - let isChecked = false; - if (row.showBtn) { - // 判断里面是否存在某个参数 - isChecked = true; - } else { - isChecked = false; - } + checkSelect (row, index) { + let isChecked = true; + // if (row.showBtn) { + // // 判断里面是否存在某个参数 + // isChecked = true; + // } else { + // isChecked = false; + // } return isChecked; }, - loadTreeFromSearch() { }, + loadTreeFromSearch () { }, - async loadTable(source, treeObj) { + async loadTable (source, treeObj) { this.source = source; this.tableLoading = true; this.addDisabled = true @@ -424,10 +582,10 @@ export default { item.doorName; if (item.agencyId === this.staffAgencyId) { - item.showBtn = true; + // item.showBtn = true; this.validTableDataNum++; } else { - item.showBtn = false; + // item.showBtn = false; } }); this.tableData = data.list; @@ -438,12 +596,12 @@ export default { this.tableLoading = false; }, - diaClose() { + diaClose () { this.$refs.ref_form.resetData(); this.formShow = false; }, - handleDetail(row) { + handleDetail (row) { this.detailShow = true; // const _data = await this.detail(row) @@ -452,12 +610,12 @@ export default { }); }, - detailFormCancle() { + detailFormCancle () { // this.$refs.ref_form_detail.diaDestroy() this.detailShow = false; }, - handleAdd() { + handleAdd () { this.formTitle = "新增房屋"; this.formShow = true; this.$nextTick(() => { @@ -465,7 +623,7 @@ export default { }); }, - handleEdit(row) { + handleEdit (row) { this.formTitle = "修改房屋"; this.formShow = true; this.$nextTick(() => { @@ -473,52 +631,34 @@ export default { }); }, - addFormCancle() { + addFormCancle () { this.formShow = false; }, - addFormOk() { + addFormOk () { this.formShow = false; this.loadTable(); this.$emit('refreshTree') }, - deleteBatch() { - if (this.selection.length > 0) { - this.$confirm("确认删除选择的房屋?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - }) - .then(() => { - this.deleteCommunityBatch(); - }) - .catch((err) => { - if (err == "cancel") { - // this.$message({ - // type: "info", - // message: "已取消删除" - // }); - } - }); - } else { - this.$message.warning("请先选择要删除的房屋"); - } - }, - selectAll(selection) { + + selectAll (selection) { this.selection = selection; }, - selectionChange(selection) { + selectionChange (selection) { this.selection = selection; }, - async handleDelete(row) { + async handleDelete (row) { this.$confirm("确认删除?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", }) .then(() => { - this.deleteRoom(row); + let ids = [row.houseId]; + //第一次删除,非强制删除 + this.deleteRoom(ids, false) + }) .catch((err) => { if (err == "cancel") { @@ -530,18 +670,43 @@ export default { }); }, - async deleteCommunityBatch() { - let ids = []; - this.selection.forEach((element) => { - ids.push(element.houseId); - }); + deleteBatch () { + if (this.selection.length > 0) { + this.$confirm("确认删除选择的房屋?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + let ids = []; + console.log(this.selection); + this.selection.forEach((element) => { + ids.push(element.houseId); + }); + + //第一次删除,非强制删除 + this.deleteRoom(ids, false) + }) + .catch((err) => { + if (err == "cancel") { + // this.$message({ + // type: "info", + // message: "已取消删除" + // }); + } + }); + } else { + this.$message.warning("请先选择要删除的房屋"); + } + }, + async deleteRoom (ids, forceDelete) { const url = "/actual/base/communityHouse/deleteCommunityInfoByIds"; - let params = { - type: "house", - ids: ids, - }; + forceDelete: forceDelete, + type: 'house', + ids: ids + } const { data, code, msg } = await requestPost(url, params); @@ -552,42 +717,34 @@ export default { }); this.$emit("refreshTree"); this.loadTable(); + } else if (code > 8000) { - this.$message({ - showClose: true, - message: msg, - duration: 0, - }); - this.$emit("refreshTree"); - this.loadTable(); - } else { - this.$message.error(msg); - } - }, - async deleteRoom(row) { - const url = "/actual/base/communityHouse/deleteHouse"; + this.$confirm(msg, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { - let params = { - houseId: row.houseId, - }; + this.deleteRoom(ids, true); + }) + .catch((err) => { + if (err == "cancel") { + + } + }); - const { data, code, msg } = await requestPost(url, params); - if (code === 0) { - this.$message({ - type: "success", - message: "删除成功", - }); - this.$emit("refreshTree"); - this.loadTable(); } else { - // this.$message.error(msg); + this.$message.error(msg); } }, + + //导出表格 - async handleExport() { + async handleExport () { // let title = this.agencyObj.label; // title = title + "—房屋列表"; @@ -641,7 +798,7 @@ export default { // ); await this.getExportList(); }, - async getExportList(type) { + async getExportList (type) { const url = "/oper/customize/icformitemgroup/list"; let params = { formCode: "community_info", @@ -665,34 +822,34 @@ export default { this.$message.error(msg); } }, - async getQueryConditions() { - let params = { - formCode: "community_info", - customerId: this.$store.state.user.customerId, - }; - - const { data } = await this.$http.post( - "/oper/customize/icform/queryItems", - params - ); - - if (data.code === 0) { - this.queryConditions = data.data.map((item) => { - return { - ...item, - humpName: util.capitalToHump(item.columnName), - }; - }); - console.log(this.queryConditions); - } else { - this.$message.error(data.msg); - } + async getQueryConditions () { + let params = { + formCode: "community_info", + customerId: this.$store.state.user.customerId, + }; + + const { data } = await this.$http.post( + "/oper/customize/icform/queryItems", + params + ); + + if (data.code === 0) { + this.queryConditions = data.data.map((item) => { + return { + ...item, + humpName: util.capitalToHump(item.columnName), + }; + }); + console.log(this.queryConditions); + } else { + this.$message.error(data.msg); + } }, - handleDiyClose() { + handleDiyClose () { this.diyDialog = false; }, // 下载文件 - download(data, fileName) { + download (data, fileName) { if (!data) { return; } @@ -716,7 +873,7 @@ export default { } }, - handleExportModule(type) { + handleExportModule (type) { let title = '' let url = "" @@ -749,7 +906,7 @@ export default { }, //导出一户一档 - handleExportYihuyidang() { + handleExportYihuyidang () { this.yihuyidangDisabled = true; let title = this.agencyObj.label; title = title + "-一户一档"; @@ -809,7 +966,7 @@ export default { ); }, // 上传文件之前的钩子 - beforeUpload(file) { + beforeUpload (file) { this.files = file; const isText = file.type === "application/vnd.ms-excel"; @@ -826,11 +983,11 @@ export default { } }, // 上传文件个数超过定义的数量 - handleExceed(files, fileList) { + handleExceed (files, fileList) { this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`); }, - async uploadFile() { + async uploadFile () { if (this.fileName == "") { this.$message.warning("请选择要上传的文件!"); return false; @@ -884,7 +1041,7 @@ export default { ); }, - showMessage(msg) { + showMessage (msg) { this.$alert(msg, "操作结果", { confirmButtonText: "关闭", callback: (action) => { @@ -894,18 +1051,18 @@ export default { }); }, - handleSizeChange(val) { + handleSizeChange (val) { this.pageSize = val; this.pageNo = 1; this.loadTable(); }, - handleCurrentChange(val) { + handleCurrentChange (val) { this.pageNo = val; this.loadTable(); }, // 开启加载动画 - startLoading() { + startLoading () { loading = Loading.service({ lock: true, // 是否锁定 text: "正在加载……", // 加载中需要显示的文字 @@ -913,7 +1070,7 @@ export default { }); }, // 结束加载动画 - endLoading() { + endLoading () { // clearTimeout(timer); if (loading) { loading.close(); @@ -921,7 +1078,7 @@ export default { }, }, watch: { - selection(val) { + selection (val) { if (val.length > 0) { this.showDeletBtn = true; } else { @@ -929,7 +1086,7 @@ export default { } }, '$store.state.sidebarFold': { - handler(newVal, oldVal) { + handler (newVal, oldVal) { if (newVal) {//收起 this.searchHeight = 155 diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 323d78cec..6b94683cd 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -6,7 +6,8 @@ ? 'm-form-box-height-auto' : 'm-form-box-height' "> - + @@ -18,7 +19,7 @@ plain class="f-right5 diy-button--white" @click="resetSearchForm">重置 - +
-