slowslo 5 jaren geleden
bovenliggende
commit
2082ab92e8
6 gewijzigde bestanden met toevoegingen van 145 en 170 verwijderingen
  1. 5 6
      assets/http/api.js
  2. 18 0
      pages.json
  3. 8 0
      pages/residential/add.vue
  4. 43 43
      pages/residential/card.vue
  5. 8 0
      pages/residential/detail.vue
  6. 63 121
      pages/residential/residential.vue

+ 5 - 6
assets/http/api.js

@@ -32,12 +32,11 @@ let residentialUrl={
 }
 const residential={
 	page:(params,header) => http.get(residentialUrl.page,{params:params,header: header}),
-	pageBycondition:(params,header) => http.get(estateUrl.residential.pageBycondition,{params:params,header: header}),
-	getListByLikeName:(params,header) => http.get(estateUrl.residential.getListByLikeName,{params:params,header: header}),
-	add: (params,header) => http.post(estateUrl.residential.add,params,{header: header}),
-	update: (params,header) => http.post(estateUrl.residential.update,params,{header: header}),
-	del: (params,header) => http.post(estateUrl.residential.del,params,{header: header}),
-	findListByPosition:(params,header) => http.get(estateUrl.residential.findListByPosition,{params:params,header: header}),
+	pageBycondition:(params,header) => http.get(residentialUrl.pageBycondition,{params:params,header: header}),
+	add: (params,header) => http.post(residentialUrl.add,params,{header: header}),
+	update: (params,header) => http.post(residentialUrl.update,params,{header: header}),
+	del: (params,header) => http.post(residentialUrl.del,params,{header: header}),
+	findListByPosition:(params,header) => http.get(residentialUrl.findListByPosition,{params:params,header: header}),
 }
 
 //楼栋管理

+ 18 - 0
pages.json

@@ -63,6 +63,24 @@
             }
             
         }
+		,{
+		    "path" : "pages/residential/detail",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "小区详情",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+		,{
+		    "path" : "pages/residential/add",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "添加小区",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
         ,{
             "path" : "pages/building/building",
             "style" :                                                                                    

+ 8 - 0
pages/residential/add.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 43 - 43
pages/residential/card.vue

@@ -1,52 +1,52 @@
 <template>
 	<view class="">
-		<view @click="goDetail(item)"  class="data" v-for="(item, index) in list" :key="index">
+		<view  class="data" v-for="(item, index) in list" :key="index">
 			<view class="top">
 				<view class="left">
 					<view class="title">
 						<u-icon name="fangjian" custom-prefix="custom-icon" size="30" color="#50baca"></u-icon>
-						<text class="padding-left-20">房间名称:{{item.name}}</text>
-						<!-- <text @click.stop="copy(item.name)" style="text-decoration: underline;" class="text-blue padding-left-20">复制</text> -->
+						<text style="padding: 0 10rpx;font-weight: 800;">小区名称:</text>
+						{{item.name}}
 					</view>
 				</view>
+				
+				<!-- cichu -->
+				<view class="right">
+					<text>{{item.estatePidName}}</text>
+				</view>
 			</view>
 			<view class="item">
 				<view class="left">
-					<view style="padding: 0 30rpx;">
-						<!-- <view class="content flex">
-							<u-icon name="menpaihao" custom-prefix="custom-icon" size="30" color="#fdb524"></u-icon>
-							<text class="text-bold  padding-left-10">门牌号:</text>
-							<text>{{item.houseNumber}}</text>
-						</view> -->
-						<view  class="content flex">
-							<u-icon name="xiaoqu" custom-prefix="custom-icon" size="30" color="#2fc500"></u-icon>
-							<text class="text-bold padding-left-10">所属小区:</text>
-							<text  v-text="item.residentialName?item.residentialName:'未知'"></text>
+					<view class="cu-list grid col-3 no-border" >
+						<view class="cu-item" >
+							<text  style="color:  #cb2d5d;font-size: 32rpx;">{{item.buildingNumber}}</text>
+							<text class="count">楼栋总数</text>
+						</view>
+						<view class="cu-item" >
+							<text  style="color:  #cb2d5d;font-size: 32rpx;">{{item.totalUnitNumber}}</text>
+							<text class="count">单元总数</text>
+						</view>
+						<view class="cu-item" >
+							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.floorNumber}}</text>
+							<text class="count">楼层总数</text>
 						</view>
-						<view  class="content flex">
-							<u-icon name="zhuhuzongshu" custom-prefix="custom-icon" size="30" color="#d4237a"></u-icon>
-							<text class="text-bold padding-left-10">所属楼栋:</text>
-							<text  v-text="item.buildingName" ></text>
+						<view class="cu-item" >
+							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.totalRoomNumber}}</text>
+							<text class="count">房间总数</text>
 						</view>
-						<view  class="content flex">
-							<u-icon name="danyuan" custom-prefix="custom-icon" size="30" color="#5ca8f0"></u-icon>
-							<text class="text-bold padding-left-10">所属单元:</text>
-							<text  v-text="item.unitName?item.unitName:'未知'" ></text>
+						<view class="cu-item" >
+							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.totalUserNumber}}</text>
+							<text class="count">住户总数</text>
 						</view>
-						<!-- <view  class="content flex">
-							<u-icon name="zhuhuzongshu" custom-prefix="custom-icon" size="30" color="#d4237a"></u-icon>
-							<text class="text-bold padding-left-10">住户总数:</text>
-							<text class="text-bold" v-text="item.userNumber" ></text>
-						</view> -->
 					</view>
 				</view>
 			</view>
-			<view class="bottom flex" >
-				<view @click.stop="edit(item)" class="cu-btn  sm round line-blue" style="margin: 0 10rpx;">
-					修改房间
+			<view class="bottom">
+				<view @click="edit(item)" class="cuIcon cu-btn round bg-blue light text-bold">
+					<text class="cuIcon-edit"></text>
 				</view>
-				<view @click.stop="delItem(item)" class="cu-btn  sm round bg-red" style="margin: 0 10rpx;">
-					删除房间
+				<view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
+					<text class="cuIcon-delete"></text>
 				</view>
 			</view>
 		</view>
@@ -78,15 +78,8 @@ export default {
 				data:data
 			})
 		},
-		goDetail(item){
-			uni.navigateTo({
-				url:"/pages/room/detail?id="+item.id
-			})
-		},
 		edit(item){
-			uni.navigateTo({
-				url:"/pages/room/add?id="+item.id
-			})
+			this.$emit('edit',item)
 		},
 		delItem(item){
 			this.$emit('delItem',item)
@@ -96,6 +89,14 @@ export default {
 </script>
 
 <style lang="scss">
+
+.count{
+	font-weight: 800;
+	padding-top: 10rpx;
+}
+
+
+	
 .data {
 	background-color: #ffffff;
 	margin: 10rpx ;
@@ -107,7 +108,7 @@ export default {
 		display: flex;
 		justify-content: space-between;
 		padding-bottom: 20rpx;
-		border-bottom: 1rpx solid #dedede;
+		border-bottom: 1rpx dashed   #dedede;
 		.left {
 			display: flex;
 			align-items: center;
@@ -121,15 +122,14 @@ export default {
 		}
 	}
 	.item {
-		margin: 5rpx 0 20rpx 0;
+		margin: 5rpx 0 10rpx 0;
 		.content {
 			border-bottom: 1rpx dashed #DDDDDD;
-			padding: 30rpx 0;
+			padding: 10rpx 0;
 		}
 	}
 	.bottom {
 		display: flex;
-		margin-top: 30rpx;
 		justify-content: flex-end;
 		align-items: center;
 	}

+ 8 - 0
pages/residential/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 63 - 121
pages/residential/residential.vue

@@ -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({