diff --git a/src/views/modules/base/residentManagement/louzhang/addForm.vue b/src/views/modules/base/residentManagement/louzhang/addForm.vue index 49e4faff7..d93f4d96f 100644 --- a/src/views/modules/base/residentManagement/louzhang/addForm.vue +++ b/src/views/modules/base/residentManagement/louzhang/addForm.vue @@ -114,17 +114,17 @@ 管理范围: {{ formData.rangeName || "--" }} + - @@ -176,7 +176,7 @@ export default { rangeProps: { multiple: true, checkStrictly: true, - // emitPath: true, + emitPath: true, children: 'subAgencyList', label: 'agencyName', value: 'agencyId' @@ -212,12 +212,10 @@ export default { methods: { async initForm (type, row) { this.formType = type; - if (this.formType === 'add') { } else { this.startLoading(); - this.categorizedResiId = row.categorizedResiId await this.getDetail(); if (this.formData.agencyId) { @@ -225,11 +223,19 @@ export default { } this.endLoading(); } - - - - }, + filterByLevel(data, levels) { + let result = []; + for (let item of data) { + if (levels.includes(item.level)) { + result.push(item); + } + if (item.subAgencyList) { + result = result.concat(this.filterByLevel(item.subAgencyList, levels)); + } + } + return result; + }, async getDetail () { const url = `/actual/base/resiCategorized/buildingUnitChief/detail/${this.categorizedResiId}`; @@ -272,7 +278,6 @@ export default { handleChangeRange (val) { - }, async getGridList () { const { user } = this.$store.state @@ -318,13 +323,15 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg) } else { - - this.optionsRange = res.data + console.log(res.data); + this.optionsRange = this.filterByLevel(res.data, ['quarter', 'building', 'unit']); + this.processOptions(this.optionsRange); } }) - .catch(() => { - this.dataListLoading = false - return this.$message.error('网络错误') + .catch((error) => { + this.dataListLoading = false; + console.error("Error details:", error); // 打印错误详细信息 + return this.$message.error('网络错误'); }) this.dataListLoading = false }, @@ -389,6 +396,28 @@ export default { resetData () { this.formData = {}; }, + processOptions(options) { + options.forEach(item => { + if (item.level === "quarter") { + item.disabled = true; // 禁用第一层 + } else if (item.level === "building") { + item.disabled = false; // 启用第二层 + } else if (item.level === "unit") { + item.disabled = false; // 启用第三层 + + // 如果存在第四层,禁用它 + if (item.subAgencyList) { + item.subAgencyList.forEach(fourthLevel => { + fourthLevel.disabled = true; // 禁用第四层 + }); + } + } + + if (item.subAgencyList) { + this.processOptions(item.subAgencyList); + } + }); + }, // 开启加载动画 startLoading () { loading = Loading.service({ diff --git a/src/views/modules/communityParty/partyOrg/orgTree.vue b/src/views/modules/communityParty/partyOrg/orgTree.vue index 0b2b62e59..07420f7b2 100644 --- a/src/views/modules/communityParty/partyOrg/orgTree.vue +++ b/src/views/modules/communityParty/partyOrg/orgTree.vue @@ -41,8 +41,8 @@ :load="handleTreeNodeExpand" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" ref="table" - > - + :row-class-name="rowClassName" + > { + if(item.childrenQty != 0){ + item.hasChildren = true + } + }) this.tableKey = new Date().getTime(); // 默认加载2级,并且展开,从第三级开始,需要展开上一级动态查询得到 console.log(">>>>", this.partyOrgTree) @@ -285,6 +299,11 @@ export default { }) this.epmetResultResolver.success((data) => { + data.forEach(item=>{ + if(item.childrenQty != 0){ + item.hasChildren = true + } + }) row.children = data; // 清空原有子节点 resolve(row.children); // 重新添加子节点 // this.partyOrgTree.push(data); @@ -379,4 +398,7 @@ export default { margin-top: 20px; text-align: center; } +::v-deep .no-expand>:nth-child(1) .cell .el-table__expand-icon{ + display: none; +} diff --git a/src/views/modules/satisfaction/communitySelfInsp/followUpDetail.vue b/src/views/modules/satisfaction/communitySelfInsp/followUpDetail.vue index ab54c6c00..da10eb4c4 100644 --- a/src/views/modules/satisfaction/communitySelfInsp/followUpDetail.vue +++ b/src/views/modules/satisfaction/communitySelfInsp/followUpDetail.vue @@ -1,8 +1,7 @@