diff --git a/src/views/modules/base/community/buildTable.vue b/src/views/modules/base/community/buildTable.vue index b28c2bd9a..b8d5ecafc 100644 --- a/src/views/modules/base/community/buildTable.vue +++ b/src/views/modules/base/community/buildTable.vue @@ -365,6 +365,11 @@ export default { this.agencyObj = treeObj + // if (this.agencyObj.pid === this.staffAgencyId) {//如果所选树的父级组织id和登录人员id相同,有权限 + // this.showImportBtn = true + // } else { + // this.showImportBtn = false + // } } @@ -407,7 +412,12 @@ export default { }, async handleDetail (row) { - + // this.formTitle = '楼栋详情' + // this.formShow = true + // const _data = await this.detail(row) + // this.$nextTick(() => { + // this.$refs.ref_form.initForm('detail', _data, this.agencyObj) + // }) this.detailShow = true diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue index 250bf2de0..fb38da89d 100644 --- a/src/views/modules/base/community/community.vue +++ b/src/views/modules/base/community/community.vue @@ -3,9 +3,9 @@
- + + @node-click="handleNodeClick"> @@ -40,17 +38,6 @@ :label-width="'80px'">
- - - + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ @@ -222,7 +277,7 @@ export default { return time.getTime() > nowData } return { - // filterText: '', + filterText: '', treeLoading: true, treeData: [], openNodes: [], @@ -230,17 +285,6 @@ export default { children: 'children', label: 'showName' }, - orgOptions: [], - orgOptionProps: { - multiple: false, - value: 'agencyId', - label: 'agencyName', - children: 'subAgencyList', - checkStrictly: true - }, - agencyIdArray: [], - orgType: '', - orgId: '', selTreeObj: {}, @@ -291,10 +335,19 @@ export default { disabledDate: startDisabledDate }, + optionsV: [], + optionsB: [], + optionsH: [], + optionsD: [], + neighborHoodId: "", + buildingId: "", + buildingUnitId: "", + houseId: "", selGridId: '', selAgencyId: '', - + vDisabled: false, + bDisabled: false, } }, components: { @@ -305,7 +358,8 @@ export default { await this.loadOrgData() await this.loadTree() - await this.getOrgTreeList() + // await this.loadOpenNode() + this.getValiheList('', '') await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) if (this.treeData.length > 0) { @@ -319,6 +373,7 @@ export default { }, computed: { rowHeight () { + return this.$store.state.inIframe ? this.clientHeight - 140 + this.iframeHeight + 'px' : this.clientHeight - 140 + 'px' }, @@ -330,56 +385,113 @@ export default { ...mapGetters(['clientHeight', 'iframeHeight']) }, methods: { - async getOrgTreeList () { - let url = '/gov/org/customeragency/agencygridtree' - let params = {} - const { data, code, msg } = await requestPost(url, params) + handleChangeV (val) { + + this.buildingId = ""; + this.buildingUnitId = ""; + this.houseId = ""; + this.getBuildList(); + // this.getUniList(); + // this.getHouseList(); + }, + handleChangeB (val) { + + this.buildingUnitId = ""; + this.houseId = ""; + this.getUniList(); + // this.getHouseList(); + }, + handleChangeD () { + this.houseId = ""; + this.getHouseList(); + }, + + async getValiheList () { + const { user } = this.$store.state; + if (!this.selGridId) { + this.selAgencyId = this.selAgencyId ? this.selAgencyId : user.agencyId + } + + const url = "/gov/org/icneighborhood/neighborhood-options"; + // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page" + let params = { + gridId: this.selGridId, + agencyId: this.selAgencyId, + isPage: false + }; + + const { data, code, msg } = await requestPost(url, params); if (code === 0) { - this.orgOptions = [] - this.orgOptions.push(data) + this.optionsV = data; + this.neighborHoodId = "" + this.buildingId = ""; + this.buildingUnitId = ""; + this.houseId = ""; } else { - this.$message.error(msg) + this.$message.error(msg); } + }, - handleChangeAgency (val) { - let obj = this.$refs["myCascader"].getCheckedNodes()[0].data - if (obj) { - this.orgType = obj.level === 'grid' ? 'grid' : 'agency' - this.orgId = obj.agencyId + async getBuildList () { + const url = "/gov/org/icbuilding/buildingoption"; + // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page" + let params = { + neighborHoodId: this.neighborHoodId, + }; + + const { data, code, msg } = await requestPost(url, params); + if (code === 0) { + this.optionsB = data; + this.buildingId = ""; + this.buildingUnitId = ""; + this.houseId = ""; } else { - this.orgType = '' - this.orgId = '' + this.$message.error(msg); } }, - async lazyLoadTree (node, resolve) { - console.log(node) - // debugger - if (node.level !== 0) { - const url = "/gov/org/building/next-tree-node" - let params = { - id: node.data.id, - level: node.data.level - } + async getUniList () { - const { data, code, msg } = await requestPost(url, params) + const url = "/gov/org/icbuildingunit/unitoption"; + // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page" + let params = { + buildingId: this.buildingId, + }; - if (code === 0) { - resolve(data) + const { data, code, msg } = await requestPost(url, params); - } else { - this.$message.error(msg) - } + if (code === 0) { + this.optionsD = data; + this.buildingUnitId = ""; + this.houseId = ""; + } else { + this.$message.error(msg); } - }, + }, + getHouseList () { + this.$http + .post("/gov/org/ichouse/houseoption", { unitId: this.buildingUnitId }) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + + this.optionsH = res.data; + this.houseId = ""; + } + }) + .catch(() => { + return this.$message.error("网络错误"); + }); + }, handleSearch () { // if (this.ownerName || this.ownerPhone || this.rentFlag || this.purpose || this.remark) { @@ -404,32 +516,45 @@ export default { this.remark = '' this.updateStartDate = '' this.updateEndDate = '' - this.orgType = '' - this.orgId = '' + this.neighborHoodId = '' + this.buildingId = '' + this.buildingUnitId = '' + this.houseId = '' this.pageSize = 10 this.pageNo = 1 + // this.handleNodeClick(this.selObj) + // this.loadTable() + }, - this.agencyIdArray = [] + async loadOpenNode () { + const url = "/gov/org/building/tree-ids" + let params = {} - }, + const { data, code, msg } = await requestPost(url, params) + if (code === 0) { + this.openNodes = data + + + } else { + this.$message.error(msg) + } + }, async loadTree (isRefresh) { - const url = "/gov/org/building/treeinit" + const url = "/gov/org/building/treelist" let params = {} const { data, code, msg } = await requestPost(url, params) if (code === 0) { this.openNodes = [] - this.openNodes.push(data.id) - - this.treeData = [] - this.treeData.push(data) + this.openNodes.push(data[0].id) - if (!isRefresh && data) { + this.treeData = data + if (!isRefresh && data.length > 0) { - this.selTreeObj = data + this.selTreeObj = data[0] if (!this.selTreeObj.latitude) { this.selTreeObj.latitude = this.centerPoint[0] } @@ -477,22 +602,30 @@ export default { this.selObj = JSON.parse(JSON.stringify(obj)) this.getTreeObj(obj) await nextTick(1000) - + this.vDisabled = false + this.bDisabled = false if (obj.level === 'building') {//点击楼栋 this.selAgencyId = '' this.selGridId = '' - + await this.getValiheList() + this.neighborHoodId = this.selTreeObj.pid + await this.getBuildList() + this.buildingId = this.selTreeObj.id + await this.getUniList() this.$refs['ref_buildingTable'].loadTable('tree', this.selTreeObj) - + this.vDisabled = true + this.bDisabled = true } else if (obj.level === 'neighborHood') {//点击小区 this.selAgencyId = '' this.selGridId = '' - + await this.getValiheList() + this.neighborHoodId = this.selTreeObj.id + await this.getBuildList() this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj) - + this.vDisabled = true } else { this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj) @@ -503,7 +636,7 @@ export default { this.selAgencyId = this.selTreeObj.id this.selGridId = '' } - + this.getValiheList('', '') } @@ -521,51 +654,30 @@ export default { }, //进入下一级 - async toNextLevel (row, level) { - console.log(row) - if (level === 'community') { - this.selTreeObj.id = row.neighborHoodId - this.selTreeObj.label = row.neighborHoodName - this.selTreeObj.latitude = row.latitude - this.selTreeObj.level = 'neighborHood' - this.selTreeObj.longitude = row.longitude + toNextLevel (row, level) { + if (level === 'community') { + this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId).data + this.openNodes.push(this.selTreeObj.id) } else { - this.selTreeObj.id = row.buildingId - this.selTreeObj.label = row.buildingName - this.selTreeObj.latitude = row.latitude - this.selTreeObj.level = "building" - this.selTreeObj.longitude = row.longitude + this.selTreeObj = this.$refs.ref_tree.getNode(row.buildingId).data } - console.log(this.selTreeObj) - - this.ownerName = '' - this.ownerPhone = '' - this.rentFlag = '' - this.purpose = '' - this.remark = '' - this.updateStartDate = '' - this.updateEndDate = '' - this.showRoomTable = false - - this.selObj = JSON.parse(JSON.stringify(this.selTreeObj)) - // this.getTreeObj(obj) - await nextTick(1000) - - if (this.selObj.level === 'building') {//点击楼栋 - this.selAgencyId = '' - this.selGridId = '' - - this.$refs['ref_buildingTable'].loadTable('tree', this.selTreeObj) - } else if (this.selObj.level === 'neighborHood') {//点击小区 - this.selAgencyId = '' - this.selGridId = '' - - this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj) + this.handleNodeClick(this.selTreeObj) + this.$nextTick(() => { + // ref_tree 元素的ref value 绑定的node-key + this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id); + }); - } + const node = document.getElementById(this.selTreeObj.id) // 通过Id获取到对应的dom元素 + setTimeout(() => { + if (node) { + this.$nextTick(() => { + node.scrollIntoView({ block: 'center' }) // 通过scrollIntoView方法将对应的dom元素定位到可见区域 【block: 'center'】这个属性是在垂直方向居中显示 + }) + } + }, 100) }, @@ -644,9 +756,9 @@ export default { } }, watch: { - // filterText (val) { - // this.$refs.ref_tree.filter(val); - // } + filterText (val) { + this.$refs.ref_tree.filter(val); + } }, components: { communityTable, buildTable, roomTable diff --git a/src/views/modules/base/community/roomTable.vue b/src/views/modules/base/community/roomTable.vue index a03e289c7..200139c66 100644 --- a/src/views/modules/base/community/roomTable.vue +++ b/src/views/modules/base/community/roomTable.vue @@ -425,6 +425,10 @@ export default { this.agencyLevel = "agency"; } + // if (fromTree) { + // this.agencyObj = treeObj + + // } let params = { pageSize: this.pageSize, pageNo: this.pageNo, @@ -438,12 +442,10 @@ export default { sortType: this.sortType, updateStartDate: this.updateStartDate, updateEndDate: this.updateEndDate, - // neighborHoodId: this.neighborHoodId, - // buildingId: this.buildingId, - // buildingUnitId: this.buildingUnitId, - // houseId: this.houseId, - orgType: this.orgType, - orgId: this.orgId, + neighborHoodId: this.neighborHoodId, + buildingId: this.buildingId, + buildingUnitId: this.buildingUnitId, + houseId: this.houseId, }; const url = "/gov/org/house/houselist"; @@ -958,14 +960,6 @@ export default { type: String, default: "", }, - orgType: { - type: String, - default: "", - }, - orgId: { - type: String, - default: "", - }, }, }; diff --git a/src/views/modules/base/communityYantai/buildDetail.vue b/src/views/modules/base/communityYantai/buildDetail.vue new file mode 100644 index 000000000..5fcec1356 --- /dev/null +++ b/src/views/modules/base/communityYantai/buildDetail.vue @@ -0,0 +1,271 @@ + + + + \ No newline at end of file diff --git a/src/views/modules/base/communityYantai/buildForm.vue b/src/views/modules/base/communityYantai/buildForm.vue new file mode 100644 index 000000000..271d1b91a --- /dev/null +++ b/src/views/modules/base/communityYantai/buildForm.vue @@ -0,0 +1,492 @@ + + + + \ No newline at end of file diff --git a/src/views/modules/base/communityYantai/buildTable.vue b/src/views/modules/base/communityYantai/buildTable.vue new file mode 100644 index 000000000..b28c2bd9a --- /dev/null +++ b/src/views/modules/base/communityYantai/buildTable.vue @@ -0,0 +1,886 @@ + + + + diff --git a/src/views/modules/base/communityYantai/community.vue b/src/views/modules/base/communityYantai/community.vue new file mode 100644 index 000000000..250bf2de0 --- /dev/null +++ b/src/views/modules/base/communityYantai/community.vue @@ -0,0 +1,721 @@ + + + + + + + + + + + + + diff --git a/src/views/modules/base/communityYantai/communityDetail.vue b/src/views/modules/base/communityYantai/communityDetail.vue new file mode 100644 index 000000000..f08478197 --- /dev/null +++ b/src/views/modules/base/communityYantai/communityDetail.vue @@ -0,0 +1,263 @@ + + + + + + + diff --git a/src/views/modules/base/communityYantai/communityForm.vue b/src/views/modules/base/communityYantai/communityForm.vue new file mode 100644 index 000000000..3b329ca7d --- /dev/null +++ b/src/views/modules/base/communityYantai/communityForm.vue @@ -0,0 +1,576 @@ + + + + + + + diff --git a/src/views/modules/base/communityYantai/communityTable.vue b/src/views/modules/base/communityYantai/communityTable.vue new file mode 100644 index 000000000..b7e916e4c --- /dev/null +++ b/src/views/modules/base/communityYantai/communityTable.vue @@ -0,0 +1,1050 @@ + + + + + + + diff --git a/src/views/modules/base/communityYantai/roomDetail.vue b/src/views/modules/base/communityYantai/roomDetail.vue new file mode 100644 index 000000000..f1b066107 --- /dev/null +++ b/src/views/modules/base/communityYantai/roomDetail.vue @@ -0,0 +1,303 @@ + + + + diff --git a/src/views/modules/base/communityYantai/roomForm.vue b/src/views/modules/base/communityYantai/roomForm.vue new file mode 100644 index 000000000..496095faa --- /dev/null +++ b/src/views/modules/base/communityYantai/roomForm.vue @@ -0,0 +1,473 @@ + + + + diff --git a/src/views/modules/base/communityYantai/roomTable.vue b/src/views/modules/base/communityYantai/roomTable.vue new file mode 100644 index 000000000..a03e289c7 --- /dev/null +++ b/src/views/modules/base/communityYantai/roomTable.vue @@ -0,0 +1,987 @@ + + + +