Browse Source

房屋管理bug

V1.0
jiangyuying 2 years ago
parent
commit
ed0dfdc354
  1. 57
      src/assets/scss/modules/management/edit-main.scss
  2. 189
      src/views/modules/base/community/buildForm.vue
  3. 45
      src/views/modules/base/community/buildTable.vue
  4. 883
      src/views/modules/base/community/community copy.vue
  5. 475
      src/views/modules/base/community/community.vue
  6. 27
      src/views/modules/base/community/communityForm.vue
  7. 1302
      src/views/modules/base/community/communityTable copy.vue
  8. 2403
      src/views/modules/base/community/communityTable.vue

57
src/assets/scss/modules/management/edit-main.scss

@ -1,54 +1,50 @@
@import '@/assets/scss/c/config.scss';
@import '@/assets/scss/c/function.scss';
@import "@/assets/scss/c/config.scss";
@import "@/assets/scss/c/function.scss";
.g-edit-form{
.g-edit-form {
margin-top: 30px;
/deep/ .el-form-item{
margin-bottom:19px;
/deep/ .el-form-item {
margin-bottom: 19px;
}
//编辑框-普通form宽度
.u-edit-width-normal{
width:320px;
.u-edit-width-normal {
width: 320px;
}
//编辑框-房屋级联选择 楼号-单元-放号宽度
.u-edit-width-build{
width:100px;
.u-edit-width-build {
width: 100px;
}
.u-edit-width-radiolong{
/deep/ .el-radio-group{
margin-top:10px;
.u-edit-width-radiolong {
/deep/ .el-radio-group {
margin-top: 10px;
line-height: 30px;
}
}
.m-edit-map{
.m-edit-map-search{
.m-edit-map {
.m-edit-map-search {
margin-bottom: 8px;
}
.m-map-item{
.m-map-item {
// margin-top:10px;
height:225px;
width:400px;
padding-bottom:10px;
height: 225px;
width: 400px;
padding-bottom: 10px;
}
}
}
.m-edit-btn{
.m-edit-btn {
display: flex;
justify-content: flex-end;
padding-right: 16px;
height: 50px;
height: 70px;
align-items: center;
}
//取消按钮
::v-deep .el-button--default {
font-size: 14px !important;
font-size: 14px !important;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0056d6 !important;
@ -56,12 +52,11 @@
min-width: 60px !important;
height: 30px !important;
// padding:0 8px !important;
background: #FFFFFF !important;
background: #ffffff !important;
border-radius: 2px !important;
border: 1px solid #0056d6 !important;
}
::v-deep .el-button--default:hover{
border: 1px solid #0042a3 !important;
color: #0042a3 !important;
}
::v-deep .el-button--default:hover {
border: 1px solid #0042a3 !important;
color: #0042a3 !important;
}

189
src/views/modules/base/community/buildForm.vue

@ -2,24 +2,47 @@
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :inline="true" :model="dataForm" :rules="dataRule" label-width="150px" class="g-edit-form">
<el-form-item label="所属小区" style="display: block">
<span>{{ dataForm.agencyName }}{{ agencyObj.gridName }}{{ agencyObj.label }}</span>
<el-form ref="ref_form"
:inline="true"
:model="dataForm"
:rules="dataRule"
label-width="150px"
class="g-edit-form">
<el-form-item label="所属小区"
style="display: block">
<!-- <span>{{ dataForm.agencyName }}{{ agencyObj.gridName }}{{ agencyObj.label }}</span> -->
<span>{{ agencyObj.label }}</span>
</el-form-item>
<el-form-item label="楼栋名称" prop="buildingName" style="display: block">
<el-input class="u-edit-width-normal" maxlength="10" placeholder="请输入楼栋名称" v-model="dataForm.buildingName">
<el-form-item label="楼栋名称"
prop="buildingName"
style="display: block">
<el-input class="u-edit-width-normal"
maxlength="10"
placeholder="请输入楼栋名称"
v-model="dataForm.buildingName">
</el-input>
</el-form-item>
<el-form-item label="楼栋编码" prop="coding" style="display: block">
<el-input class="u-edit-width-normal" maxlength="50" placeholder="请输入楼栋编码" v-model="dataForm.coding">
<el-form-item label="楼栋编码"
prop="coding"
style="display: block">
<el-input class="u-edit-width-normal"
maxlength="50"
placeholder="请输入楼栋编码"
v-model="dataForm.coding">
</el-input>
<el-button style="margin-left: 10px" type="text" class="div-table-button--blue" icon="el-icon-upload2"
size="small" @click="handleCode">生成</el-button>
<el-button style="margin-left: 10px"
type="text"
class="div-table-button--blue"
icon="el-icon-upload2"
size="small"
@click="handleCode">生成</el-button>
</el-form-item>
<el-form-item label="楼栋类型" prop="type" style="display: block">
<el-form-item label="楼栋类型"
prop="type"
style="display: block">
<el-radio-group v-model="buildType">
<el-radio :label="'1'">商品房</el-radio>
@ -35,54 +58,103 @@
v-model="dataForm.sort"
label="排序"></el-input-number>
</el-form-item> -->
<el-form-item label="单元数" style="display: block" prop="totalUnitNum">
<el-input-number class="item_width_4" v-model="dataForm.totalUnitNum" :min="1" :max="9999"
label="单元数"></el-input-number>
<el-form-item label="单元数"
style="display: block"
prop="totalUnitNum">
<el-input-number class="item_width_4"
v-model="dataForm.totalUnitNum"
:min="1"
:max="9999"
label="单元数"></el-input-number>
</el-form-item>
<el-form-item label="层数" style="display: block" prop="totalFloorNum">
<el-input-number class="item_width_4" v-model="dataForm.totalFloorNum" :min="0" :max="9999"
label="层数"></el-input-number>
<el-form-item label="层数"
style="display: block"
prop="totalFloorNum">
<el-input-number class="item_width_4"
v-model="dataForm.totalFloorNum"
:min="0"
:max="9999"
label="层数"></el-input-number>
</el-form-item>
<el-form-item label="总户数" style="display: block" prop="totalHouseNum">
<el-input-number class="item_width_4" v-model="dataForm.totalHouseNum" :min="0" :max="9999"
label="总户数"></el-input-number>
<el-form-item label="总户数"
style="display: block"
prop="totalHouseNum">
<el-input-number class="item_width_4"
v-model="dataForm.totalHouseNum"
:min="0"
:max="9999"
label="总户数"></el-input-number>
</el-form-item>
<el-form-item label="人口数" style="display: block" prop="realPerson">
<el-input-number class="item_width_4" v-model="dataForm.realPerson" :min="0" :max="9999"
label="人口数"></el-input-number>
<el-form-item label="人口数"
style="display: block"
prop="realPerson">
<el-input-number class="item_width_4"
v-model="dataForm.realPerson"
:min="0"
:max="9999"
label="人口数"></el-input-number>
</el-form-item>
<el-form-item label="楼长姓名" prop="buildingLeaderName" style="display: block">
<el-input class="u-edit-width-normal" placeholder="请输入楼长姓名" v-model="dataForm.buildingLeaderName">
<el-form-item label="楼长姓名"
prop="buildingLeaderName"
style="display: block">
<el-input class="u-edit-width-normal"
placeholder="请输入楼长姓名"
v-model="dataForm.buildingLeaderName">
</el-input>
</el-form-item>
<el-form-item label="楼长电话" prop="buildingLeaderMobile" style="display: block">
<el-input class="u-edit-width-normal" type='number' placeholder="请输入楼长电话"
v-model="dataForm.buildingLeaderMobile">
<el-form-item label="楼长电话"
prop="buildingLeaderMobile"
style="display: block">
<el-input class="u-edit-width-normal"
type='number'
placeholder="请输入楼长电话"
v-model="dataForm.buildingLeaderMobile">
</el-input>
</el-form-item>
<el-form-item label="地图位置" prop="longitude" style="display: block">
<el-form-item label="地图位置"
prop="longitude"
style="display: block">
<div class="u-edit-width-normal m-edit-map">
<el-select v-model="searchValue" filterable class="u-edit-width-normal m-edit-map-search" remote
:reserve-keyword="true" placeholder="请输入关键词" :remote-method="remoteMethod" :loading="loading">
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)" :key="item.value"
:label="item.label" :value="item.value">
<el-select v-model="searchValue"
filterable
class="u-edit-width-normal m-edit-map-search"
remote
:reserve-keyword="true"
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option v-for="(item, index) in searchOptions"
@click.native="handleClickKey(index)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div id="app_build" class="m-map-item"></div>
<div id="app_build"
class="m-map-item"></div>
</div>
</el-form-item>
<el-form-item label="楼栋地址" prop="coordinatePosition" style="display: block">
<el-form-item label="楼栋地址"
prop="coordinatePosition"
style="display: block">
<!-- <span>{{ dataForm.coordinatePosition }}</span> -->
<el-input class="u-edit-width-normal" placeholder="请选择楼栋地址" v-model="dataForm.coordinatePosition" />
<el-input class="u-edit-width-normal"
placeholder="请选择楼栋地址"
v-model="dataForm.coordinatePosition" />
</el-form-item>
</el-form>
</div>
<div class="m-edit-btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button size="small" type="primary" class="diy-button--blue" :disabled="btnDisable" @click="handleComfirm">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
type="primary"
class="diy-button--blue"
:disabled="btnDisable"
@click="handleComfirm">
</el-button>
</div>
</div>
@ -99,7 +171,7 @@ var markers
var infoWindowList
let loading //
export default {
data() {
data () {
return {
formType: 'add', // addeditdetail
searchOptions: [],
@ -138,12 +210,13 @@ export default {
}
},
components: {},
mounted() {
mounted () {
},
methods: {
async initForm(type, row, agencyObj) {
async initForm (type, row, agencyObj) {
console.log(agencyObj)
this.$refs.ref_form.resetFields();
let { latitude, longitude } = this.$store.state.user;
this.agencyObj = agencyObj
@ -153,7 +226,8 @@ export default {
this.formType = type
if (row) {
this.dataForm = JSON.parse(JSON.stringify(row))
this.dataForm = { ...JSON.parse(JSON.stringify(row)) }
this.buildingId = this.dataForm.buildingId
// this.buildType = this.dataForm.buildingTypeKey
this.buildType = this.dataForm.type
@ -162,18 +236,19 @@ export default {
this.dataForm.latitude = latitude
this.dataForm.longitude = longitude
}
console.log(this.dataForm)
this.$nextTick(() => {
const latitudeParam = this.dataForm.latitude !== undefined && this.dataForm.latitude != 0
? this.dataForm.latitude
: latitude;
? this.dataForm.latitude
: latitude;
const longitudeParam = this.dataForm.longitude !== undefined && this.dataForm.longitude != 0
? this.dataForm.longitude
: longitude;
? this.dataForm.longitude
: longitude;
this.initMap(latitudeParam, longitudeParam);
})
},
async handleComfirm() {
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
@ -189,7 +264,7 @@ export default {
})
},
async handleCode() {
async handleCode () {
const { data, code, msg } = await requestPost(
"/actual/base/communityBuilding/getBuildingCoding/" + this.dataForm.neighborHoodId);
if (msg == "success" && code == 0) {
@ -198,7 +273,7 @@ export default {
}
},
async addBuild() {
async addBuild () {
if (this.dataForm.buildingLeaderMobile) {
const regPhone = /^1(3|4|5|6|7|8|9)\d{9}$/; //
if (this.dataForm.buildingLeaderMobile && regPhone.test(this.dataForm.buildingLeaderMobile) === false) {
@ -237,13 +312,13 @@ export default {
},
handleCancle() {
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
// init
initMap(latitude, longitude) {
initMap (latitude, longitude) {
map = new daiMap(
document.getElementById("app_build"),
{ latitude, longitude },
@ -265,7 +340,7 @@ export default {
},
async handleMoveCenter() {
async handleMoveCenter () {
//
const { lat, lng } = map.getCenter();
this.dataForm.latitude = lat;
@ -281,7 +356,7 @@ export default {
}
},
async remoteMethod(query) {
async remoteMethod (query) {
if (query !== '') {
this.loading = true;
@ -312,7 +387,7 @@ export default {
}
},
handleClickKey(index) {
handleClickKey (index) {
let selPosition = this.resultList[index]
let lonlat = selPosition.lonlat.split(" ")
map.setCenter(lonlat[1], lonlat[0]);
@ -323,7 +398,7 @@ export default {
},
resetData() {
resetData () {
this.searchValue = ''
this.searchOptions = []
this.resultList = []
@ -352,7 +427,7 @@ export default {
}
},
//
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
@ -360,7 +435,7 @@ export default {
})
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
@ -368,7 +443,7 @@ export default {
}
},
computed: {
dataRule() {
dataRule () {
return {
buildingName: [
{ required: true, message: '楼栋名称不能为空', trigger: 'blur' },

45
src/views/modules/base/community/buildTable.vue

@ -7,6 +7,7 @@
class="diy-button--blue"
icon="el-icon-plus"
size="small"
:disabled="addDisabled"
@click="handleAdd">新增楼栋</el-button>
<div class="u-btn-upload"
@ -233,15 +234,13 @@
class="div-table-button--blue"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button
v-if="scope.row.showBtn"
<el-button v-if="scope.row.showBtn"
type="text"
class="div-table-button--blue"
size="small"
@click="handleEdit(scope.row)">编辑</el-button>
<el-button
v-if="scope.row.showBtn"
<el-button v-if="scope.row.showBtn"
type="text"
class="div-table-button--blue"
size="small"
@ -321,6 +320,7 @@ export default {
validTableDataNum: 0,//
selection: [],
addDisabled: true,
//form
@ -347,7 +347,7 @@ export default {
},
computed: {
tableHeight () {
console.log(this.searchHeight)
let height = this.searchHeight + 270
return this.$store.state.inIframe ? this.clientHeight - height + this.iframeHeight : this.clientHeight - height
@ -382,7 +382,7 @@ export default {
return index + 1;
},
handleSortOrderChange (value) {
console.log(value.column, value.prop, value.order)
this.sortType = value.order === 'ascending' ? 'asc' : 'desc'
this.loadTable()
@ -401,7 +401,7 @@ export default {
async handleChangeSort (row, index) {
// row.isChange = false
console.log(row.sort)
let params = {
id: row.buildingId,
sort: row.sort,
@ -438,6 +438,7 @@ export default {
},
async loadTable (fromTree, treeObj) {
this.addDisabled = true
this.tableLoading = true
if (fromTree) {
this.sortType = 'asc'
@ -450,8 +451,6 @@ export default {
// }
}
console.log(this.agencyObj)
const url = "/actual/base/communityBuilding/listBuildings"
let params = {
pageSize: this.pageSize,
@ -478,6 +477,7 @@ export default {
});
this.tableData = data.list
this.addDisabled = false
} else {
this.$message.error(msg)
}
@ -498,7 +498,7 @@ export default {
// })
this.detailShow = true
console.log(this.agencyObj);
const _data = await this.detail(row)
this.$nextTick(() => {
this.$refs.ref_form_detail.initForm(_data, this.agencyObj)
@ -515,6 +515,7 @@ export default {
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('add', null, this.agencyObj)
})
},
@ -812,15 +813,15 @@ export default {
return false
}
this.$message({
showClose: true,
dangerouslyUseHTMLString: true,
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000
});
let than = this
document.getElementById('clickA').addEventListener('click',function(){
than.$router.replace('/main/importRecord-index');
})
showClose: true,
dangerouslyUseHTMLString: true,
message: "导入中,请到系统管理-<a id='clickA' style='cursor: pointer;'>导入记录</a>中查看进度",
duration: 3000
});
let than = this
document.getElementById('clickA').addEventListener('click', function () {
than.$router.replace('/main/importRecord-index');
})
//
@ -991,7 +992,7 @@ export default {
padding-left: 0px;
padding-right: 0px;
}
::v-deep .el-dialog__body{
padding: 0;
}
::v-deep .el-dialog__body {
padding: 0;
}
</style>

883
src/views/modules/base/community/community copy.vue

@ -1,883 +0,0 @@
<template>
<div class="div_main">
<div :style="{height:rowHeight}"
class="div_tree">
<el-input placeholder="输入关键字进行过滤"
v-model="filterText">
</el-input>
<el-scrollbar :style="{height:treeHeight}"
class="scrollar">
<el-tree ref="ref_tree"
v-loading="treeLoading"
class="filter_tree"
:data="treeData"
:props="defaultProps"
:highlight-current="true"
node-key="id"
:default-expanded-keys="openNodes"
:expand-on-click-node="false"
:filter-node-method="filterNode"
@node-click="handleNodeClick">
<span slot-scope="{ node, data }"
class="custom-tree-node">
<span :id="data.id">{{ data.showName }}</span>
</span>
</el-tree>
</el-scrollbar>
</div>
<div :style="{height:rowHeight}"
class=div_left>
<div class="div_search">
<el-form :inline="true"
ref="ref_searchform"
:label-width="'100px'">
<el-form-item label="房主姓名"
prop="ownerName">
<el-input v-model="ownerName"
class="item_width_normal"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="联系方式"
prop="ownerPhone">
<el-input v-model="ownerPhone"
class="item_width_normal"
size="small"
clearable
placeholder="请输入联系电话">
</el-input>
</el-form-item>
<el-form-item label="房屋状态"
prop="rentFlag">
<el-select class="item_width_normal"
v-model="rentFlag"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in rentList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="房屋用途"
prop="purpose">
<el-select v-model="purpose"
class="item_width_normal"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in purposeArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="备注"
prop="remark">
<el-input v-model="remark"
class="item_width_normal"
size="small"
clearable
placeholder="请输入备注">
</el-input>
</el-form-item>
<el-form-item label="更新时间"
prop="updateStartDate">
<el-date-picker v-model="updateStartDate"
:picker-options="startPickerOptions"
class="item_width_daterange"
size="small"
type="date"
value-format="yyyyMMdd"
value="yyyy-MM-dd"
placeholder="开始时间">
</el-date-picker>
<span class="data-tag"></span>
<el-date-picker v-model="updateEndDate"
:picker-options="endPickerOptions"
class="item_width_daterange data-tag"
size="small"
type="date"
value-format="yyyyMMdd"
value="yyyy-MM-dd"
placeholder="结束时间">
</el-date-picker>
</el-form-item>
<span class="div_search_label">所属房屋</span>
<!-- <el-form-item label="所属房屋"> -->
<el-form-item prop="neighborHoodId">
<el-select v-model.trim="neighborHoodId"
:disabled="vDisabled"
placeholder="小区"
size="small"
clearable
class="item_width_buildcascader"
@change="handleChangeV">
<el-option v-for="item in optionsV"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="buildingId">
<el-select v-model.trim="buildingId"
placeholder="楼号"
:disabled="!neighborHoodId || bDisabled"
size="small"
clearable
class="item_width_buildcascader"
@change="handleChangeB">
<el-option v-for="item in optionsB"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="buildingUnitId">
<el-select v-model.trim="buildingUnitId"
placeholder="单元"
size="small"
:disabled="!buildingId"
clearable
class="item_width_buildcascader"
@change="handleChangeD">
<el-option v-for="item in optionsD"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="houseId">
<el-select v-model.trim="houseId"
placeholder="房号"
:disabled="!buildingUnitId"
size="small"
clearable
class="item_width_buildcascader">
<el-option v-for="item in optionsH"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<!-- </el-form-item> -->
<div class="div_search_btn">
<el-button style="margin-left:30px"
size="small"
class="diy-button--blue"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
size="small"
class="diy-button--gray"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<build-table v-if="selTreeObj.level==='neighborHood'&&!showRoomTable"
ref="ref_neighTable"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
@toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table>
<room-table v-if="showRoomTable||selTreeObj.level==='building'"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:neighborHoodId="neighborHoodId"
:buildingId="buildingId"
:buildingUnitId="buildingUnitId"
:houseId="houseId"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table>
<community-table v-if="selTreeObj.level!=='building'&&selTreeObj.level!=='neighborHood'&&!showRoomTable"
@toNextLevel="toNextLevel"
:staffAgencyId="staffAgencyId"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
ref="ref_communityTable"
@refreshTree="refreshTree"></community-table>
</div>
</div>
</div>
</template>
<script>
import CDialog from '@c/CDialog'
import communityTable from './communityTable'
import buildTable from './buildTable'
import roomTable from './roomTable'
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
import nextTick from 'dai-js/tools/nextTick'
let loading //
export default {
data () {
let endDisabledDate = (time) => {//datareturn
let nowData = Date.now()
if (this.updateStartDate) {
let startTime = new Date(this.updateStartDate)
return time.getTime() > nowData || time.getTime() < startTime || time.getTime() === startTime
} else {
return time.getTime() > nowData
}
}
let startDisabledDate = (time) => {//datareturn
let nowData = Date.now()
return time.getTime() > nowData
}
return {
filterText: '',
treeLoading: true,
treeData: [],
openNodes: [],
defaultProps: {
children: 'children',
label: 'showName'
},
selTreeObj: {},
centerPoint: [],
staffAgencyId: localStorage.getItem("agencyId"),
showImportBtn: false,
rentList: [
{
value: '1',
label: '出租'
},
{
value: '2',
label: '闲置'
},
{
value: '0',
label: '自住'
},
{
value: '3',
label: '未出售'
},
],
ownerName: '',
ownerPhone: '',
rentFlag: '',
purpose: '',
remark: '',
updateStartDate: '',
updateEndDate: '',
showRoomTable: false,
selObj: {},
purposeArr: [
{ dictValue: '1', dictName: '住宅' },
{ dictValue: '2', dictName: '商业' },
{ dictValue: '3', dictName: '办公' },
{ dictValue: '4', dictName: '工业' },
{ dictValue: '5', dictName: '仓储' },
{ dictValue: '6', dictName: '商住混用' },
{ dictValue: '7', dictName: '其他' }
],
endPickerOptions: {
disabledDate: endDisabledDate
},
startPickerOptions: {
disabledDate: startDisabledDate
},
optionsV: [],
optionsB: [],
optionsH: [],
optionsD: [],
neighborHoodId: "",
buildingId: "",
buildingUnitId: "",
houseId: "",
selGridId: '',
selAgencyId: '',
vDisabled: false,
bDisabled: false,
}
},
components: {
CDialog
},
async mounted () {
this.treeLoading = true
await this.loadOrgData()
await this.loadTree()
// await this.loadOpenNode()
this.getValiheList('', '')
await this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
if (this.treeData.length > 0) {
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.treeData[0].id);
});
}
this.treeLoading = false
},
computed: {
rowHeight () {
return this.$store.state.inIframe ? this.clientHeight - 160 + this.iframeHeight + 'px' : this.clientHeight - 160 + 'px'
},
treeHeight () {
return this.$store.state.inIframe ? this.clientHeight - 215 + this.iframeHeight + 'px' : this.clientHeight - 215 + 'px'
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
methods: {
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.optionsV = data;
this.neighborHoodId = ""
this.buildingId = "";
this.buildingUnitId = "";
this.houseId = "";
} else {
this.$message.error(msg);
}
},
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.$message.error(msg);
}
},
async getUniList () {
const url = "/gov/org/icbuildingunit/unitoption";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page"
let params = {
buildingId: this.buildingId,
};
const { data, code, msg } = await requestPost(url, params);
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) {
this.showRoomTable = true
this.$nextTick(() => {
this.$refs['ref_buildingTable'].loadTable('search', this.selTreeObj)
})
// } else {
// this.$message.warning('')
// }
},
//
resetSearch () {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.purpose = ''
this.remark = ''
this.updateStartDate = ''
this.updateEndDate = ''
this.neighborHoodId = ''
this.buildingId = ''
this.buildingUnitId = ''
this.houseId = ''
this.pageSize = 10
this.pageNo = 1
// this.handleNodeClick(this.selObj)
// this.loadTable()
},
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/treelist"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.openNodes = []
this.openNodes.push(data[0].id)
this.treeData = data
if (!isRefresh && data.length > 0) {
this.selTreeObj = data[0]
if (!this.selTreeObj.latitude) {
this.selTreeObj.latitude = this.centerPoint[0]
}
if (!this.selTreeObj.longitude) {
this.selTreeObj.longitude = this.centerPoint[1]
}
}
} else {
this.$message.error(msg)
}
},
//
async loadOrgData () {
const url = "/gov/org/agency/maporg"
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.centerPoint = []
this.centerPoint.push(data.latitude)
this.centerPoint.push(data.longitude)
} else {
this.$message.error(msg)
}
},
async handleNodeClick (obj) {
this.ownerName = ''
this.ownerPhone = ''
this.rentFlag = ''
this.purpose = ''
this.remark = ''
this.updateStartDate = ''
this.updateEndDate = ''
this.showRoomTable = false
this.selObj = JSON.parse(JSON.stringify(obj))
this.getTreeObj(obj)
await nextTick(1000)
this.vDisabled = false
this.bDisabled = false
if (obj.level === 'building') {//
this.$refs['ref_buildingTable'].loadTable('tree', this.selTreeObj)
this.selAgencyId = ''
this.selGridId = ''
await this.getValiheList()
this.neighborHoodId = this.selTreeObj.pid
await this.getBuildList()
this.buildingId = this.selTreeObj.id
await this.getUniList()
this.vDisabled = true
this.bDisabled = true
} else if (obj.level === 'neighborHood') {//
this.$refs['ref_neighTable'].loadTable(true, this.selTreeObj)
this.selAgencyId = ''
this.selGridId = ''
await this.getValiheList()
this.neighborHoodId = this.selTreeObj.id
await this.getBuildList()
this.vDisabled = true
} else {
this.$refs['ref_communityTable'].loadTable(true, this.selTreeObj)
if (obj.level === 'grid') {
this.selAgencyId = ''
this.selGridId = this.selTreeObj.id
} else {
this.selAgencyId = this.selTreeObj.id
this.selGridId = ''
}
this.getValiheList('', '')
}
},
//
async refreshTree () {
this.treeLoading = true
await this.loadTree(this.selTreeObj.id)
this.$nextTick(() => {
// ref_tree ref value node-key
this.$refs.ref_tree.setCurrentKey(this.selTreeObj.id);
});
this.treeLoading = false
},
//
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 = this.$refs.ref_tree.getNode(row.buildingId).data
}
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) // Iddom
setTimeout(() => {
if (node) {
this.$nextTick(() => {
node.scrollIntoView({ block: 'center' }) // scrollIntoViewdom block: 'center'
})
}
}, 100)
},
//
getTreeObj (obj) {
//
// idtype
// idtypeidid
// idtypeid
if (obj.level === 'building') {//
let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid)//
let gridNode = this.$refs.ref_tree.getNode(neighborHoodNode.data.pid)//
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)//
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.neighborHoodId = neighborHoodNode.data.id
obj.neighborHoodName = neighborHoodNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else if (obj.level === 'neighborHood') {//
let gridNode = this.$refs.ref_tree.getNode(obj.pid)
let agencyNode = this.$refs.ref_tree.getNode(gridNode.data.pid)
obj.gridId = gridNode.data.id
obj.gridName = gridNode.data.label
obj.agencyId = agencyNode.data.id
obj.agencyName = agencyNode.data.label
if (obj.agencyId === this.staffAgencyId) {
this.showImportBtn = true
} else {
this.showImportBtn = false
}
} else {
}
if (!obj.latitude) {
obj.latitude = this.centerPoint[0]
}
if (!obj.longitude) {
obj.longitude = this.centerPoint[1]
}
this.selTreeObj = obj
console.log('selTreeObj', this.selTreeObj)
},
filterNode (value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
watch: {
filterText (val) {
this.$refs.ref_tree.filter(val);
}
},
components: {
communityTable, buildTable, roomTable
}
}
</script>
<style>
/* .aui-content > .el-tabs > .el-tabs__content {
padding: 0px;
} */
.el-tree-node:focus > .el-tree-node__content {
/* background-color: #ccc !important; */
color: #2195fe;
}
</style>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManage.scss";
@import "@/assets/scss/modules/management/list-main.scss";
</style>
<style lang="scss" scoped >
.div_main {
display: flex;
}
.scrollar {
margin-top: 10px;
/deep/
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
background-color: #e1ecff;
border-radius: 3px;
}
/deep/ .el-tree-node:focus > .el-tree-node__content {
color: #0043c8;
// background-color: #fff;
}
/deep/ .el-tree-node__expand-icon {
color: #0043c8;
border: 1px solid #e1ecff;
background-color: #e1ecff;
padding: 0px;
margin-right: 8px;
font-size: 9px;
}
/deep/.el-tree {
flex: 1;
.el-tree-node {
margin-left: 2px;
}
//
.el-icon svg {
display: none;
height: 0;
width: 0;
}
//
.el-tree-node__expand-icon {
// position: absolute;
// left: 2px;
// 90
.expanded {
transform: rotate(90deg);
}
//
&:before {
// content: "\008B";
// content: "\008B";
font-size: 12px;
color: #0043c8;
}
}
//
.is-leaf.el-tree-node__expand-icon::before {
// display: none;
// background: none !important;
// border: 0px;
// content: "";
// width: 18px;
// height: 18px;
}
}
}
.div_tree {
margin: 7px 8px 7px 7px;
/deep/ .el-scrollbar__wrap {
overflow-x: hidden !important;
}
//
/deep/ .el-input--medium .el-input__inner {
height: 27px;
border-radius: 0;
}
flex: 0 0 280px;
background-color: #f6f6f6;
border: 1px solid #d3dce6;
// border-radius: 5px;
padding: 19px 15px;
overflow-y: hidden;
}
.filter_tree {
overflow-x: auto;
background-color: #f6f6f6;
margin-top: 5px;
}
.div_left {
// flex: 1;
width: calc(100% - 300px);
}
</style>

475
src/views/modules/base/community/community.vue

@ -1,30 +1,29 @@
<template>
<div class="g-main">
<div :style="{ height: rowHeight }" class="div_tree">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
@keydown.native.enter="handleChangeSerch()"
>
<div :style="{ height: rowHeight }"
class="div_tree">
<el-input placeholder="输入关键字进行过滤"
v-model="filterText"
@keydown.native.enter="handleChangeSerch()">
</el-input>
<el-scrollbar :style="{ height: treeHeight }" class="scrollar">
<el-tree
ref="ref_tree"
v-loading="treeLoading"
class="filter_tree"
:data="treeData"
:props="defaultProps"
:highlight-current="true"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
@node-click="handleNodeClick"
lazy
:auto-expand-parent="true"
:default-expanded-keys="autoOpenArr"
:load="lazyLoadTree"
>
<span slot-scope="{ node, data }" class="custom-tree-node">
<el-scrollbar :style="{ height: treeHeight }"
class="scrollar">
<el-tree ref="ref_tree"
v-loading="treeLoading"
class="filter_tree"
:data="treeData"
:props="defaultProps"
:highlight-current="true"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
@node-click="handleNodeClick"
lazy
:auto-expand-parent="true"
:default-expanded-keys="autoOpenArr"
:load="lazyLoadTree">
<span slot-scope="{ node, data }"
class="custom-tree-node">
<!-- <img
v-if="showIcons(data)"
src="@/assets/images/index/abnormal.png"
@ -43,117 +42,99 @@
<span style="color: red">{{ data.showNum }}</span>
<span>{{ ")" }}</span>
</span> -->
<span
:id="data.id"
:style="{ color: showIcons(data) ? '#ff4d4f' : '' }"
>{{ data.showName }}</span
>
<span :id="data.id"
:style="{ color: showIcons(data) ? '#ff4d4f' : '' }">{{ data.showName }}</span>
</span>
</el-tree>
</el-scrollbar>
</div>
<div class="div_left">
<div class="m-search" style="flex-direction: column">
<section
:class="boxHeight ? 'm-form-box-height' : 'm-form-box-height-auto'"
>
<el-form
:inline="true"
class="communityHeight"
ref="ref_searchform"
:label-width="'100px'"
>
<el-form-item label="房主姓名" prop="ownerName">
<el-input
v-model="ownerName"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入内容"
>
<div class="m-search"
style="flex-direction: column">
<section :class="boxHeight ? 'm-form-box-height' : 'm-form-box-height-auto'">
<el-form :inline="true"
class="communityHeight"
ref="ref_searchform"
:label-width="'100px'">
<el-form-item label="房主姓名"
prop="ownerName">
<el-input v-model="ownerName"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-form-item label="联系电话" prop="ownerPhone">
<el-input
v-model="ownerPhone"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入联系电话"
>
<el-form-item label="联系电话"
prop="ownerPhone">
<el-input v-model="ownerPhone"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入联系电话">
</el-input>
</el-form-item>
<el-form-item label="房屋状态" prop="rentFlag">
<el-select
class="u-item-width-normal"
v-model="rentFlag"
placeholder="请选择"
size="small"
clearable
>
<el-option
v-for="item in rentList"
:key="item.value"
:label="item.label"
:value="item.value"
>
<el-form-item label="房屋状态"
prop="rentFlag">
<el-select class="u-item-width-normal"
v-model="rentFlag"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in rentList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="房屋用途" prop="purpose">
<el-select
v-model="purpose"
class="u-item-width-normal"
placeholder="请选择"
size="small"
clearable
>
<el-option
v-for="item in purposeArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue"
>
<el-form-item label="房屋用途"
prop="purpose">
<el-select v-model="purpose"
class="u-item-width-normal"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in purposeArr"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="更新时间" prop="updateStartDate">
<el-date-picker
v-model="updateStartDate"
:picker-options="startPickerOptions"
class="u-item-width-daterange"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd"
placeholder="开始时间"
>
<el-form-item label="更新时间"
prop="updateStartDate">
<el-date-picker v-model="updateStartDate"
:picker-options="startPickerOptions"
class="u-item-width-daterange"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd"
placeholder="开始时间">
</el-date-picker>
<span class="u-data-tag"></span>
<el-date-picker
v-model="updateEndDate"
:picker-options="endPickerOptions"
class="u-item-width-daterange u-data-tag"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd"
placeholder="结束时间"
>
<el-date-picker v-model="updateEndDate"
:picker-options="endPickerOptions"
class="u-item-width-daterange u-data-tag"
size="small"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd"
placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="remark"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入备注"
>
<el-form-item label="备注"
prop="remark">
<el-input v-model="remark"
class="u-item-width-normal"
size="small"
clearable
placeholder="请输入备注">
</el-input>
</el-form-item>
@ -243,90 +224,74 @@
</el-form>
</section>
<el-row>
<el-col :span="24" align="right">
<el-button
style="margin-left: 10px"
size="small"
type="primary"
@click="handleSearch"
>查询</el-button
>
<el-button
size="small"
class="diy-button--white"
@click="resetSearch"
>重置</el-button
>
<el-button
style="margin: 0 6px 0 10px"
size="small"
class="div-table-button--blue"
type="text"
@click="boxHeight = !boxHeight"
>{{ boxHeight ? "展开" : "收起"
}}<i
:class="boxHeight ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
></i
></el-button>
<el-col :span="24"
align="right">
<el-button style="margin-left: 10px"
size="small"
type="primary"
@click="handleSearch">查询</el-button>
<el-button size="small"
class="diy-button--white"
@click="resetSearch">重置</el-button>
<el-button style="margin: 0 6px 0 10px"
size="small"
class="div-table-button--blue"
type="text"
@click="boxHeight = !boxHeight">{{ boxHeight ? "展开" : "收起"
}}<i :class="boxHeight ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"></i></el-button>
</el-col>
</el-row>
</div>
<div class="">
<build-table
v-if="selTreeObj.level === 'neighborHood' && !showRoomTable"
ref="ref_neighTable"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
:searchHeight="searchHeight"
@toNextLevel="toNextLevel"
@refreshTree="refreshTree"
></build-table>
<room-table
v-if="showRoomTable || selTreeObj.level === 'building'"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:neighborHoodId="neighborHoodId"
:buildingId="buildingId"
:buildingUnitId="buildingUnitId"
:houseId="houseId"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
ref="ref_buildingTable"
@refreshTree="refreshTree"
></room-table>
<community-table
v-if="
<build-table v-if="selTreeObj.level === 'neighborHood' && !showRoomTable"
ref="ref_neighTable"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
:searchHeight="searchHeight"
@toNextLevel="toNextLevel"
@refreshTree="refreshTree"></build-table>
<room-table v-if="showRoomTable || selTreeObj.level === 'building'"
:staffAgencyId="staffAgencyId"
:showImportBtn="showImportBtn"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:neighborHoodId="neighborHoodId"
:buildingId="buildingId"
:buildingUnitId="buildingUnitId"
:houseId="houseId"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
ref="ref_buildingTable"
@refreshTree="refreshTree"></room-table>
<community-table v-if="
selTreeObj.level !== 'building' &&
selTreeObj.level !== 'neighborHood' &&
!showRoomTable
"
@toNextLevel="toNextLevel"
:staffAgencyId="staffAgencyId"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
ref="ref_communityTable"
@refreshTree="refreshTree"
></community-table>
@toNextLevel="toNextLevel"
:staffAgencyId="staffAgencyId"
:ownerName="ownerName"
:ownerPhone="ownerPhone"
:rentFlag="rentFlag"
:purpose="purpose"
:remark="remark"
:updateStartDate="updateStartDate"
:updateEndDate="updateEndDate"
ref="ref_communityTable"
@refreshTree="refreshTree"></community-table>
</div>
</div>
</div>
@ -344,7 +309,7 @@ import nextTick from "dai-js/tools/nextTick";
import debounce from "lodash/debounce";
let loading; //
export default {
data() {
data () {
let endDisabledDate = (time) => {
//datareturn
let nowData = Date.now();
@ -465,6 +430,8 @@ export default {
vDisabled: false,
bDisabled: false,
treeIsOk: true,//
};
},
components: {
@ -473,7 +440,7 @@ export default {
buildTable,
roomTable,
},
async mounted() {
async mounted () {
this.searchHeight = this.$refs.ref_searchform.offsetHeight;
this.treeLoading = true;
@ -493,22 +460,22 @@ export default {
this.treeLoading = false;
},
computed: {
rowHeight() {
rowHeight () {
return this.$store.state.inIframe
? this.clientHeight - 140 + this.iframeHeight + "px"
: this.clientHeight - 140 + "px";
},
treeHeight() {
treeHeight () {
return this.$store.state.inIframe
? this.clientHeight - 245 + this.iframeHeight + "px"
: this.clientHeight - 245 + "px";
},
...mapGetters(["clientHeight", "iframeHeight"]),
showIcons() {
showIcons () {
return function (data) {
if (data.level == "building") {
let arr = data.showNum.split("/");
console.log(arr);
if (arr[0] !== arr[1]) {
return true;
} else {
@ -522,10 +489,10 @@ export default {
// filterText (val) {
// this.$refs.ref_tree.filter(val);
// },
updateStartDate(){}
updateStartDate () { }
},
methods: {
handleChangeV(val) {
handleChangeV (val) {
this.buildingId = "";
this.buildingUnitId = "";
this.houseId = "";
@ -533,28 +500,19 @@ export default {
// this.getUniList();
// this.getHouseList();
},
// handleChangeSerchAgency(val){
// console.log(val);
// // this.optionsV = this.optionsV.filter(item=>item.label == val)
// this.optionsV.forEach( function(item){
// if(item.label==val){
// console.log(1);
// }
// })
// console.log(this.optionsV );
// },
handleChangeB(val) {
handleChangeB (val) {
this.buildingUnitId = "";
this.houseId = "";
this.getUniList();
// this.getHouseList();
},
handleChangeD() {
handleChangeD () {
this.houseId = "";
this.getHouseList();
},
async lazyLoadTree(node, resolve) {
console.log(node);
async lazyLoadTree (node, resolve) {
const url = `/actual/base/communityBuilding/tree/nextTreeNode?id=${node.data.id}&level=${node.data.level}`;
const { data, code, msg } = await requestGet(url);
if (code === 0) {
@ -569,7 +527,7 @@ export default {
}
// }
},
async getValiheList() {
async getValiheList () {
const { user } = this.$store.state;
if (!this.selGridId) {
this.selAgencyId = this.selAgencyId ? this.selAgencyId : user.agencyId;
@ -596,7 +554,7 @@ export default {
this.$message.error(msg);
}
},
async getBuildList() {
async getBuildList () {
const url = "/actual/base/communityBuilding/buildingoption";
let params = {
quartersId: this.neighborHoodId,
@ -613,7 +571,7 @@ export default {
}
},
//
async handleChangeSerch() {
async handleChangeSerch () {
this.startLoading();
this.$refs.ref_tree.$data.store.lazy = !this.filterText;
if (this.filterText.length > 0 && this.filterText != "") {
@ -639,7 +597,7 @@ export default {
}
this.endLoading();
},
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -647,13 +605,13 @@ export default {
});
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
async getUniList() {
async getUniList () {
const url = "/actual/base/communityBuildingUnit/unitoption";
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/epidemicPrevention/page"
let params = {
@ -670,7 +628,7 @@ export default {
this.$message.error(msg);
}
},
getHouseList() {
getHouseList () {
let params = {
buildingId: this.buildingId,
unitId: this.buildingUnitId,
@ -690,7 +648,7 @@ export default {
});
},
handleSearch() {
handleSearch () {
// if (this.ownerName || this.ownerPhone || this.rentFlag || this.purpose || this.remark) {
this.showRoomTable = true;
this.$nextTick(() => {
@ -702,7 +660,7 @@ export default {
},
//
resetSearch() {
resetSearch () {
this.ownerName = "";
this.ownerPhone = "";
this.rentFlag = "";
@ -717,14 +675,13 @@ export default {
this.pageSize = 10;
this.pageNo = 1;
// this.handleNodeClick(this.selTreeObj)
this.$nextTick(() => {
this.$refs.ref_buildingTable.loadTable("search", this.selTreeObj);
});
},
async loadOpenNode() {
async loadOpenNode () {
const url = "/gov/org/building/tree-ids";
let params = {};
@ -736,7 +693,7 @@ export default {
this.$message.error(msg);
}
},
async loadTree(isRefresh) {
async loadTree (isRefresh) {
const url = "/actual/base/communityBuilding/tree/initTree";
const { data, code, msg } = await requestGet(url);
if (code === 0) {
@ -759,7 +716,7 @@ export default {
}
},
handleTreeData(treeData) {
handleTreeData (treeData) {
for (let i in treeData) {
treeData[i].showIcon = false;
if (treeData[i].level === "building") {
@ -779,7 +736,7 @@ export default {
},
//
async loadOrgData() {
async loadOrgData () {
const url = "/gov/org/agency/maporg";
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/agency/maporg"
let params = {};
@ -796,8 +753,14 @@ export default {
}
},
async handleNodeClick(obj) {
//
async handleNodeClick (obj) {
if (!this.treeIsOk) {
setTimeout(() => {
this.handleNodeClick(obj);
}, 200);
return false
}
this.treeIsOk = false
this.ownerName = "";
this.ownerPhone = "";
this.rentFlag = "";
@ -811,36 +774,39 @@ export default {
await nextTick(1000);
this.vDisabled = false;
this.bDisabled = false;
if (obj.level === "building") {
//
console.log(this.selTreeObj,'传给子组件');
this.$nextTick(()=>{
this.$refs["ref_buildingTable"].loadTable("tree", this.selTreeObj);
this.buildingId = this.selTreeObj.id;
this.neighborHoodId = this.selTreeObj.pid;
})
await this.$refs["ref_buildingTable"].loadTable(true, this.selTreeObj,);
this.buildingId = this.selTreeObj.id;
this.neighborHoodId = this.selTreeObj.pid;
this.selAgencyId = "";
this.selGridId = "";
await this.getValiheList();
await this.getBuildList();
// await nextTick(2000);
// this.buildingId = this.selTreeObj.id;
await this.getUniList();
this.vDisabled = true;
this.bDisabled = true;
this.treeIsOk = true
} else if (obj.level === "neighborHood") {
//
this.$refs["ref_neighTable"].loadTable(true, this.selTreeObj);
await this.$refs["ref_neighTable"].loadTable(true, this.selTreeObj);
this.selAgencyId = "";
this.selGridId = "";
await this.getValiheList();
this.neighborHoodId = this.selTreeObj.id;
await this.getBuildList();
this.vDisabled = true;
this.treeIsOk = true
} else {
this.$refs["ref_communityTable"].loadTable(true, this.selTreeObj);
await this.$refs["ref_communityTable"].loadTable(true, this.selTreeObj);
if (obj.level === "grid") {
this.selAgencyId = "";
this.selGridId = this.selTreeObj.id;
@ -849,11 +815,15 @@ export default {
this.selGridId = "";
}
this.getValiheList("", "");
this.treeIsOk = true
}
},
//
async refreshTree() {
async refreshTree () {
this.treeLoading = true;
await this.loadTree(this.selTreeObj.id);
this.$nextTick(() => {
@ -864,10 +834,10 @@ export default {
},
//
async toNextLevel(row, level) {
console.log(row);
async toNextLevel (row, level) {
this.autoOpenArr = [];
console.log(this.$refs.ref_tree);
const {
agencyId,
gridId,
@ -878,14 +848,11 @@ export default {
pid,
streetId
} = row;
let arr = [agencyId, gridId, neighborHoodId,pid,streetId];
console.log(arr,'展开的数组');
let arr = [agencyId, gridId, neighborHoodId, pid, streetId];
this.autoOpenArr = arr;
// this.$nextTick(()=>{
// console.log( this.$refs.ref_tree.getNode("d167076e825e75edda6540c5b9717c79"));
// })
// this.selTreeObj = this.$refs.ref_tree.getNode(row.neighborHoodId) || {};
if (level == "community") {
this.selTreeObj = {
id: neighborHoodId,
@ -898,7 +865,7 @@ export default {
} else if (level == "building") {
// this.selTreeObj = this.$refs.ref_tree.getNode(row.buildingId).data
this.selTreeObj = {
id:buildingId,
id: buildingId,
neighborHoodId: neighborHoodId,
level: "building",
pid: neighborHoodId,
@ -924,13 +891,13 @@ export default {
},
//
getTreeObj(obj) {
getTreeObj (obj) {
//
// idtype
// idtypeidid
// idtypeid
if (obj.level === "building") {
console.log(obj);
this.selTreeObj = obj;
//
// let neighborHoodNode = this.$refs.ref_tree.getNode(obj.pid); //
@ -974,16 +941,16 @@ export default {
obj.longitude = this.centerPoint[1];
}
this.selTreeObj = obj;
console.log("selTreeObj", this.selTreeObj);
},
filterNode(value, data) {
filterNode (value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
startLoading() {
startLoading () {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
@ -991,7 +958,7 @@ export default {
});
},
//
endLoading() {
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close();
@ -1112,7 +1079,7 @@ export default {
// flex: 1;
width: calc(100% - 300px);
}
::v-deep .el-dialog__body{
padding: 0;
}
::v-deep .el-dialog__body {
padding: 0;
}
</style>

27
src/views/modules/base/community/communityForm.vue

@ -225,7 +225,7 @@ export default {
neighborHoodId: '', //ID
quartersType: '0',
propertyId:'',
propertyId: '',
dataForm: {
neighborHoodName: '', // 50
agencyId: '', // ID
@ -254,8 +254,10 @@ export default {
}
},
components: {},
mounted () {
async created () {
await this.loadAgency()
await this.loadGrid()
await this.loadProperty()
},
methods: {
@ -263,6 +265,7 @@ export default {
this.dataForm.gridName = this.gridList[index].gridName
},
async initForm (type, row, agencyObj) {
this.$refs.ref_form.resetFields();
this.agencyObj = agencyObj
let { latitude, longitude } = this.$store.state.user;
@ -273,24 +276,24 @@ export default {
this.dataForm.neighborHoodId = this.dataForm.id
this.neighborHoodId = this.dataForm.neighborHoodId
this.quartersType = this.dataForm.quartersType
this.propertyId = this.dataForm.propertyList[0].id
// this.propertyId = this.propertyList[0].id
} else {
this.dataForm.latitude = latitude
this.dataForm.longitude = longitude
}
// if (!map) {
this.initMap(this.dataForm.latitude, this.dataForm.longitude);
this.initMap(this.dataForm.latitude, this.dataForm.longitude);
// } else {
// map.setCenter(this.dataForm.latitude, this.dataForm.longitude);
// map.setMarker(this.dataForm.latitude, this.dataForm.longitude);
// }
await this.loadAgency()
await this.loadGrid()
await this.loadProperty()
if(agencyObj.level == 'grid'){
this.dataForm.gridId = agencyObj.id
}
if (agencyObj.level == 'grid') {
console.log(agencyObj)
this.dataForm.gridId = agencyObj.id
this.dataForm.gridName = agencyObj.label
}
},
// init
initMap (latitude, longitude) {
@ -480,7 +483,7 @@ export default {
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else if (code>=8000){
} else if (code >= 8000) {
this.btnDisable = false
this.$message.error(msg)
}

1302
src/views/modules/base/community/communityTable copy.vue

File diff suppressed because it is too large

2403
src/views/modules/base/community/communityTable.vue

File diff suppressed because it is too large
Loading…
Cancel
Save