|
|
@@ -4,9 +4,9 @@
|
|
|
<view class="cu-bar bg-white flex" style="z-index: 100;width: 100%;position: fixed;top: -2rpx;">
|
|
|
<view class="u-line-1" @click="showDown(index)" v-for="(item,index) in filterMenu" :key="index" style="width: 20%;text-align: center;height: 100%;">
|
|
|
<text v-text="data[index]==''?item:data[index]" :class="data[index]==''?'':'text-red'"></text>
|
|
|
- <u-icon v-if="index!=4" name="arrow-down-fill" size="20" style="padding-left: 10rpx;"></u-icon>
|
|
|
+ <u-icon v-if="index!=3" name="arrow-down-fill" size="20" style="padding-left: 10rpx;"></u-icon>
|
|
|
<text class="cuIcon-filter padding-left-10" v-else></text>
|
|
|
- <u-badge :offset="[10, 8]" v-if="index==4" size="mini" type="error" :count="filterCount"></u-badge>
|
|
|
+ <u-badge :offset="[10, 8]" v-if="index==3" size="mini" type="error" :count="filterCount"></u-badge>
|
|
|
</view>
|
|
|
</view>
|
|
|
<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
|
|
|
@@ -19,7 +19,7 @@
|
|
|
<view class="fixed cu-bar search bg-white">
|
|
|
<view class="search-form round">
|
|
|
<text class="cuIcon-search"></text>
|
|
|
- <u-input style="width: 90%;" v-model="keyword" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
|
|
|
+ <u-input style="width: 90%;" v-model="agencyKeyword" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
<scroll-view v-if="!$isEmpty(searchList)" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
|
|
|
@@ -31,18 +31,18 @@
|
|
|
<u-empty v-else name="search"></u-empty>
|
|
|
</u-popup>
|
|
|
<!-- 楼栋 -->
|
|
|
- <u-popup border-radius="60" height="60%" mode="bottom" v-model="buildingShow">
|
|
|
+ <u-popup border-radius="60" height="60%" mode="bottom" v-model="residentailShow">
|
|
|
<view class="fixed cu-bar search bg-white">
|
|
|
<view class="search-form round">
|
|
|
<text class="cuIcon-search"></text>
|
|
|
- <u-input style="width: 90%;" v-model="buildingKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
|
|
|
+ <u-input style="width: 90%;" v-model="residentialKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <scroll-view v-if="!$isEmpty(buildingList)" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
|
|
|
- <view @click="buildingConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom" v-for="(item,index) in buildingList" :key="index">
|
|
|
+ <scroll-view v-if="!$isEmpty(residentialList)" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
|
|
|
+ <view @click="buildingConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom" v-for="(item,index) in residentialList" :key="index">
|
|
|
<text>{{item.name}}</text>
|
|
|
</view>
|
|
|
- <u-divider v-if="buildingList.length>=10" height="80">只显示十条数据</u-divider>
|
|
|
+ <u-divider v-if="residentialList.length>=10" height="80">只显示十条数据</u-divider>
|
|
|
</scroll-view>
|
|
|
<u-empty v-else name="search"></u-empty>
|
|
|
</u-popup>
|
|
|
@@ -54,15 +54,12 @@
|
|
|
<u-modal :show-cancel-button="true" cancel-text="重置" @cancel="reset" @confirm="filterConfirm" title="筛选" :mask-close-able="true" v-model="filterShow" >
|
|
|
<view class="slot-content" style="margin: 20rpx;">
|
|
|
<u-form label-width="150" :model="params" ref="uForm">
|
|
|
- <u-form-item label="房间名"><u-input v-model="params.name" /></u-form-item>
|
|
|
+ <u-form-item label="小区名"><u-input v-model="params.name" /></u-form-item>
|
|
|
<!-- <u-form-item :border-bottom="false" label="门牌号"><u-input v-model="params.houseNumber" /></u-form-item> -->
|
|
|
</u-form>
|
|
|
</view>
|
|
|
</u-modal>
|
|
|
|
|
|
- <!-- 单元选择器 -->
|
|
|
- <u-picker @confirm="unitConfirm" range-key="name" :range="unitList" v-model="unitShow" mode="selector"></u-picker>
|
|
|
-
|
|
|
<!-- 添加按钮 -->
|
|
|
<add-btn @click.native="add"></add-btn>
|
|
|
<!-- 通知alert -->
|
|
|
@@ -71,20 +68,20 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- // import card from "./card.vue"
|
|
|
+ import card from "./card.vue"
|
|
|
import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
|
|
|
let that;
|
|
|
export default {
|
|
|
- // components:{
|
|
|
- // card
|
|
|
- // },
|
|
|
+ components:{
|
|
|
+ card
|
|
|
+ },
|
|
|
mixins:[MescrollMixin],
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+
|
|
|
//顶部菜单栏
|
|
|
- filterMenu: ["地区","小区","楼栋","单元","筛选"],
|
|
|
- data:['','','','',''],
|
|
|
+ filterMenu: ["地区","所属机构","物业名称","筛选"],
|
|
|
+ data:['','','',''],
|
|
|
|
|
|
//地区
|
|
|
regionShow:false,
|
|
|
@@ -99,16 +96,12 @@
|
|
|
|
|
|
// 列表数据
|
|
|
params:{},
|
|
|
- keyword:'',
|
|
|
+ agencyKeyword:'',
|
|
|
|
|
|
- //单元
|
|
|
- unitShow:false,
|
|
|
- unitList:[],
|
|
|
-
|
|
|
- //楼栋
|
|
|
- buildingShow:false,
|
|
|
- buildingKeyWord:'',
|
|
|
- buildingList:[],
|
|
|
+ //小区
|
|
|
+ residentailShow:false,
|
|
|
+ residentialKeyWord:'',
|
|
|
+ residentialList:[],
|
|
|
|
|
|
list: [],
|
|
|
downOption: {
|
|
|
@@ -130,7 +123,7 @@
|
|
|
},
|
|
|
onLoad(){
|
|
|
that=this
|
|
|
- this.getResidentailList({isSelect:true})
|
|
|
+ this.getListByLikeName({isSelect:true})
|
|
|
},
|
|
|
onShow() {
|
|
|
if (this.canReset) {
|
|
|
@@ -139,7 +132,7 @@
|
|
|
this.canReset=true
|
|
|
},
|
|
|
watch:{
|
|
|
- keyword(){
|
|
|
+ agencyKeyword(){
|
|
|
let that=this
|
|
|
//节流函数
|
|
|
if (this.timer){
|
|
|
@@ -150,24 +143,24 @@
|
|
|
let params = {
|
|
|
isSelect: true,
|
|
|
regionArea: that.areaValue,
|
|
|
- name: that.keyword
|
|
|
+ agencyName: that.agencyKeyword
|
|
|
}
|
|
|
- this.getResidentailList(params)
|
|
|
+ this.getListByLikeName(params)
|
|
|
}, 500)
|
|
|
},
|
|
|
- buildingKeyWord(){
|
|
|
+ residentialKeyWord(){
|
|
|
let that=this
|
|
|
//节流函数
|
|
|
if (this.timer){
|
|
|
clearTimeout(this.timer)//阻止setTimeout函数的执行
|
|
|
}
|
|
|
this.timer = setTimeout(() => {
|
|
|
- that.buildingList=[]
|
|
|
+ that.residentialList=[]
|
|
|
let params={
|
|
|
- residentialId:that.params.residentialId,
|
|
|
- name:that.buildingKeyWord
|
|
|
+ agencyId:that.params.agencyId,
|
|
|
+ name:that.residentialKeyWord
|
|
|
}
|
|
|
- that.fetchBuildingList(params)
|
|
|
+ that.fetchresidentialList(params)
|
|
|
}, 500)
|
|
|
},
|
|
|
},
|
|
|
@@ -177,25 +170,20 @@
|
|
|
*/
|
|
|
getFilterCount(){
|
|
|
let n=0
|
|
|
- if (!this.$isEmpty(this.params.residentialId)) {
|
|
|
- //小区
|
|
|
- n++
|
|
|
- }
|
|
|
- if (!this.$isEmpty(this.params.buildingId)) {
|
|
|
- //楼栋
|
|
|
+ if (!this.$isEmpty(this.params.agencyId)) {
|
|
|
+ //机构
|
|
|
n++
|
|
|
}
|
|
|
- if (!this.$isEmpty(this.params.unitId)) {
|
|
|
- //单元
|
|
|
+ if (!this.$isEmpty(this.params.estatePid)) {
|
|
|
+ //物业
|
|
|
n++
|
|
|
}
|
|
|
if (!this.$isEmpty(this.params.name)) {
|
|
|
- //房间名
|
|
|
+ //小区名
|
|
|
n++
|
|
|
}
|
|
|
this.filterCount=n
|
|
|
},
|
|
|
-
|
|
|
/**
|
|
|
* 下拉回调
|
|
|
*/
|
|
|
@@ -213,8 +201,10 @@
|
|
|
params.current=mescroll.num
|
|
|
params.size=mescroll.size
|
|
|
this.getFilterCount()
|
|
|
+ console.log(111)
|
|
|
try{
|
|
|
- this.$api.room.page(params).then(res=>{
|
|
|
+ this.$api.residential.pageBycondition(params).then(res=>{
|
|
|
+ console.log(res)
|
|
|
let data=res.data.records
|
|
|
let length=data.length
|
|
|
let total=res.data.total
|
|
|
@@ -234,60 +224,26 @@
|
|
|
this.data=['','','','','']
|
|
|
this.areaValue=''
|
|
|
this.searchList=[]
|
|
|
- this.keyword=''
|
|
|
+ this.agencyKeyword=''
|
|
|
this.unitList=[]
|
|
|
- this.buildingKeyWord='',
|
|
|
- this.buildingList=[],
|
|
|
+ this.residentialKeyWord='',
|
|
|
+ this.residentialList=[],
|
|
|
this.list=[],
|
|
|
this.mescroll.resetUpScroll()
|
|
|
},
|
|
|
/**
|
|
|
- * 点击选择小区,获取楼栋列表
|
|
|
+ * 点击选择机构
|
|
|
*/
|
|
|
residentailConfirm(res){
|
|
|
//筛选标题
|
|
|
this.params.residentialId =res.value
|
|
|
this.data[1] = res.label
|
|
|
this.popupShow = false
|
|
|
- //获取楼栋列表
|
|
|
+ //获取机构
|
|
|
let params={
|
|
|
residentialId:this.params.residentialId
|
|
|
}
|
|
|
- this.fetchBuildingList(params)
|
|
|
- this.mescroll.resetUpScroll()
|
|
|
- },
|
|
|
- //点击选择楼栋,获取单元列表
|
|
|
- buildingConfirm(res){
|
|
|
- this.params.buildingId=res.id
|
|
|
- this.data[2] = res.name
|
|
|
- this.buildingShow = false
|
|
|
- let params={
|
|
|
- residentialId:this.params.residentialId,
|
|
|
- buildingId:res.id
|
|
|
- }
|
|
|
- this.getUnitByResidentialId(params)
|
|
|
- this.mescroll.resetUpScroll()
|
|
|
- },
|
|
|
- /**
|
|
|
- * 获取楼栋列表
|
|
|
- * @param {Object}
|
|
|
- */
|
|
|
- fetchBuildingList(params){
|
|
|
- this.$api.building.page(params).then(res=>{
|
|
|
- this.buildingList=res.data.records
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * 根据小区id获取单元列表
|
|
|
- */
|
|
|
- getUnitByResidentialId(params){
|
|
|
- this.$api.unit.page(params).then(res=>{
|
|
|
- this.unitList=res.list
|
|
|
- })
|
|
|
- },
|
|
|
- unitConfirm(index){
|
|
|
- this.data[3]=this.unitList[index].name
|
|
|
- this.params.unitId=this.unitList[index].id
|
|
|
+ this.fetchresidentialList(params)
|
|
|
this.mescroll.resetUpScroll()
|
|
|
},
|
|
|
/**
|
|
|
@@ -301,33 +257,17 @@
|
|
|
return
|
|
|
}
|
|
|
if(index==1){
|
|
|
- //小区
|
|
|
+ //机构
|
|
|
this.popupShow = true;
|
|
|
return;
|
|
|
}else if(index==2){
|
|
|
- //楼栋
|
|
|
- if (this.$isEmpty(this.data[1])) {
|
|
|
- this.$refs.uToast.show({
|
|
|
- title: '请先选择小区',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.buildingShow=true
|
|
|
+ //物业名称
|
|
|
+ this.residentailShow=true
|
|
|
}else if (index==3) {
|
|
|
- //单元
|
|
|
- if(this.$isEmpty(this.data[2])){
|
|
|
- this.$refs.uToast.show({
|
|
|
- title: '请先选择楼栋',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- this.unitShow=true
|
|
|
- }else if (index==4) {
|
|
|
//筛选
|
|
|
this.filterShow=true
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* 确认筛选
|
|
|
@@ -346,28 +286,30 @@
|
|
|
isSelect: true,
|
|
|
regionArea: this.areaValue
|
|
|
};
|
|
|
- this.getResidentailList(params);
|
|
|
+ this.getListByLikeName(params);
|
|
|
},
|
|
|
/**
|
|
|
- * 获取小区列表
|
|
|
+ * 获取机构列表
|
|
|
* @param {Object} params
|
|
|
*/
|
|
|
- getResidentailList(params){
|
|
|
+ getListByLikeName(params){
|
|
|
let list = [];
|
|
|
- this.$api.residential.page(params).then(res=>{
|
|
|
- let list=[]
|
|
|
- res.list.forEach(item=>{
|
|
|
- let obj={
|
|
|
- label:item.name,
|
|
|
- value:item.id
|
|
|
+ this.$api.permissions.orgList(params).then(res=>{
|
|
|
+ console.log(res)
|
|
|
+ let list = [];
|
|
|
+ for(let item of res.data.records){
|
|
|
+ let element = {
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ }
|
|
|
+ list.splice(list.length,0,element);
|
|
|
+ // list.push(obj);
|
|
|
}
|
|
|
- list.push(obj)
|
|
|
- })
|
|
|
- this.searchList = list;
|
|
|
+ this.searchList = list;
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
- * 添加房间
|
|
|
+ * 添加小区
|
|
|
*/
|
|
|
add(){
|
|
|
uni.navigateTo({
|