Kaynağa Gözat

车辆、小区

slowslo 5 yıl önce
ebeveyn
işleme
bfdd0cdfab

+ 19 - 3
assets/http/api.js

@@ -21,6 +21,14 @@ const permissions = {
 	getSubListByPid:(params)=>http.get(permissionsUrl.subList,{params:params,header:header})
 }
 
+//机构列表
+let agencyUrl={
+	page:"agency/agency/list"
+}
+const agency={
+	page:(params,header) => http.get(agencyUrl.page,{params:params,header:header})
+}
+
 //小区管理
 let residentialUrl={
 	page:"estate/residential/getListByLikeName",
@@ -28,7 +36,8 @@ let residentialUrl={
 	add: "/estate/residential/addResidential",
 	update: "/estate/residential/updateResidential",
 	del: "/estate/residential/deleteResidential",
-	findListByPosition:"/estate/unit/findListByPosition"
+	findListByPosition:"/estate/unit/findListByPosition",
+	pageByconditionNew:"/community/residential/listByAgencyId",//条件获取小区列表
 }
 const residential={
 	page:(params,header) => http.get(residentialUrl.page,{params:params,header: header}),
@@ -37,6 +46,7 @@ const residential={
 	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}),
+	pageByconditionNew:(params,header) => http.get(residentialUrl.pageByconditionNew,{params:params,header:header})
 }
 
 //楼栋管理
@@ -130,16 +140,22 @@ const estateRepair={
 //车辆管理
 let carManageUrl={
 	page:"/permissions/xq/device/admin/user/pagingQuery",
-	pageBycondition:"community/car/list"
+	pageBycondition:"/community/car/list",
+	submit:"/community/car/submit",
+	del:"/community/car/remove"
 }
 const carManage={
 	page:(params,header) => http.get(carManageUrl.page,{params:params,header: header}),
-	pageBycondition:(params,header) => http.get(carManageUrl.pageBycondition,{params:params,header:header})
+	pageBycondition:(params,header) => http.get(carManageUrl.pageBycondition,{params:params,header:header}),
+	submit:(params,header) => http.post(carManageUrl.submit,params,{header:header}),
+	del:(params,header) => http.post(carManage.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}})
 }
 
 export const api={
 	//权限管理
 	permissions,
+	//机构列表
+	agency,
 	//小区管理
 	residential,
 	//楼栋管理

+ 25 - 32
pages/car/add.vue

@@ -3,27 +3,27 @@
 		<u-toast ref="uToast"/>
 		<view class="bg-white" style="padding: 10rpx 30rpx;margin: 20rpx;border-radius: 12rpx;">
 			<u-form :label-style="labelStyle" label-width="150" :model="form" ref="uForm">
-				<u-form-item label="车主姓名" :required="true"><u-input v-model="form.personName" placeholder="车主姓名"/></u-form-item>
-				<u-form-item v-if="!$isEmpty(form.id)" label="手机号码" :required="true"><u-input type="number" v-model="form.personPhone" placeholder="请输入手机号码"/></u-form-item>
+				<u-form-item label="车主姓名" :required="true"><u-input v-model="form.userName" placeholder="车主姓名"/></u-form-item>
+				<u-form-item v-if="!$isEmpty(form.id)" label="手机号码" :required="true"><u-input type="number" v-model="form.userMobile" placeholder="请输入手机号码"/></u-form-item>
 				<u-form-item label="所属小区" :required="true">
 					<u-input v-if="$isEmpty(form.id)"  type="select" :select-open="residentialShow" v-model="residentialName"  placeholder="请选择小区" @click="residentialShow=true"></u-input>
-					<u-input v-else   disabled v-model="form.residentialName" ></u-input>
+					<u-input v-else   disabled v-model="form.xqName" ></u-input>
 				</u-form-item>
 				<u-form-item label="车牌号" :required="true">
-					<u-input v-model="form.number" placeholder="请填写车牌号"></u-input>
+					<u-input v-model="form.loginName" placeholder="请填写车牌号"></u-input>
 				</u-form-item>
 				<u-form-item label="车辆型号">
-					<u-input v-model="form.model"  placeholder="请填写车辆型号"></u-input>
+					<u-input v-model="form.loginPwd"  placeholder="请填写车辆型号"></u-input>
 				</u-form-item>
-				<u-form-item label="燃油类别">
+<!-- 				<u-form-item label="燃油类别">
 					<u-input v-model="form.fuelCategory"  placeholder="请填写燃油类别"></u-input>
-				</u-form-item>
+				</u-form-item> -->
 				<u-form-item label="车身颜色">
-					<u-input v-model="form.color"  placeholder="请填写车身颜色"></u-input>
+					<u-input v-model="form.remark"  placeholder="请填写车身颜色"></u-input>
 				</u-form-item>
-				<u-form-item label="车辆照片">
+<!-- 				<u-form-item label="车辆照片">
 					<u-input v-model="form.carImg"  placeholder="车辆照片"></u-input>
-				</u-form-item>
+				</u-form-item> -->
 			</u-form>
 		</view>
 		
@@ -61,14 +61,15 @@ export default {
 				"fontWeight":"600"
 			},
 			form:{
-				personName:'',
-				residentialId:'',
-				personPhone:'',
+				userName:'',
+				xqName:'',
+				userMobile:'',
 				fuelCategory:'',
-				number:'',
-				model:'',
-				carImg:'',
-				color:''
+				loginName:'',
+				loginPwd:'',
+				xqId:'',
+				// carImg:'',
+				remark:''
 			},
 			//小区
 			residentialName:'',
@@ -103,8 +104,10 @@ export default {
 	},
 	methods:{
 		fetchDataDetail(){
-			this.$api.room.pageBycondition({id:this.form.id}).then(res=>{
-				this.form=res.list[0]
+			console.log(this.form.id)
+			this.$api.carManage.page({id:this.form.id}).then(res=>{
+				console.log(res.data.records[0])
+				this.form=res.data.records[0]
 			})
 		},
 		
@@ -126,20 +129,10 @@ export default {
 			this.form.residentialId=item.id
 			//赋值给回显的名称
 			this.residentialName=item.name
-			let params={
-				residentialId:item.id
-			}
 			this.residentialShow=false
 		},
-		showBuilding(){
-			if (this.$isEmpty(this.residentialName)) {
-				this.$showToast('请先选择小区','warning')
-				return
-			}
-			this.buildingShow=true
-		},
 		confirm(){
-			if (this.$isEmpty(this.form.personName)) {
+			if (this.$isEmpty(this.form.userName)) {
 				this.$u.toast('请输入车主姓名')
 				return
 			}
@@ -150,7 +143,7 @@ export default {
 			console.log(this.form);
 			if (this.$isEmpty(this.form.id)) {
 				return
-				this.$api.room.add(this.form).then(res=>{
+				this.$api.carManage.submit(this.form).then(res=>{
 					if (res.data) {
 						this.$dialog.showModal('操作成功',false).then(res=>{
 							uni.navigateBack()
@@ -163,7 +156,7 @@ export default {
 			}else{
 				let {oldId,orgPosition,...params}=this.form
 				//修改
-				this.$api.room.update(params).then(res=>{
+				this.$api.carManage.submit(params).then(res=>{
 					if (res.data==true) {
 						this.$dialog.showModal('操作成功',false).then(res=>{
 							uni.navigateBack()

+ 39 - 75
pages/car/car.vue

@@ -138,7 +138,7 @@
 					clearTimeout(this.timer)//阻止setTimeout函数的执行
 				}
 				this.timer = setTimeout(() => {
-					that.searchList=[]
+					that.residentialList=[]
 					let params = {
 						isSelect: true,
 						regionArea: that.areaValue,
@@ -164,7 +164,7 @@
 			},
 			delItem(item){
 				this.$dialog.showModal('确定要删除此记录吗?').then(res=>{
-					this.$api.building.del({id:item.id}).then(res=>{
+					this.$api.carManage.del({id:item.id}).then(res=>{
 						if (res.data==true) {
 							this.$u.toast('删除成功')
 							this.mescroll.resetUpScroll()
@@ -174,59 +174,6 @@
 					})
 				})
 			},
-			
-			submit(){
-				if (this.$isEmpty(this.form.name)) {
-					this.$u.toast('请输入楼栋名')
-					return
-				}
-				if (this.$isEmpty(this.form.residentialId) || this.$isEmpty(this.form.residentialName)) {
-					this.$u.toast('请选择所属小区')
-					return
-				}
-				if (!this.$isEmpty(this.form.personTel)) {
-					if (!this.$verify.phone(this.form.personTel)&&!this.$verify.landline(this.form.personTel)) {
-						this.$u.toast('请输入正确的联系方式')
-						return
-					}
-				}
-				console.log(this.form);
-				if (this.$isEmpty(this.form.id)) {
-					console.log('我是新增');
-					this.$api.building.add(this.form).then(res=>{
-						if (res.code==200) {
-							this.popupShow=false
-							this.$u.toast('添加成功')
-							this.mescroll.resetUpScroll()
-						}
-					})
-				}else{
-					let {createAccountId,createDate,floorNumber,roomNumber,status,unitNumber,personNumber,...params}=this.form
-					console.log(params);
-					this.$api.building.update(params).then(res=>{
-						if (res.data==true) {
-							this.popupShow=false
-							this.$u.toast('修改成功')
-							this.mescroll.resetUpScroll()
-						}
-					})
-				}
-			},
-			//获取小区列表
-			getResidentailList(params){
-				let list = [];
-				this.$api.residential.page(params).then(res=>{
-					let list=[]
-					res.list.forEach(item=>{
-						let obj={
-							label:item.name,
-							value:item.id
-						}
-						list.push(obj)
-					})
-					this.residentialList =  list;
-				})
-			},
 			/**
 			 * 获取筛选的条件数
 			 */
@@ -274,7 +221,7 @@
 						})						
 					}else{
 						console.log(222)
-						this.$api.carManage.pageBycondition(params).then(res=>{
+						this.$api.carManage.page(params).then(res=>{
 							let data=res.data.records
 							let length=data.length
 							let total=res.data.total
@@ -305,24 +252,6 @@
 				this.getResidentailList()
 				this.mescroll.resetUpScroll()
 			},
-			/**
-			 * 点击选择小区,重新获取楼栋列表
-			 */
-			residentailConfirm(res){
-				if (this.operaType==0) {
-					// 筛选楼栋列表的选择小区
-					this.params.residentialId =res.value
-					this.data[1] = res.label
-					this.residentialShow = false
-					this.mescroll.resetUpScroll()
-				}else if(this.operaType==1){
-					// 添加操作的选择小区
-					this.form.residentialName=res.label
-					this.form.residentialId=res.value
-					this.residentialShow=false
-					this.operaType=0
-				}
-			},
 			/**
 			 * 顶部菜单选择
 			 * @param {Object} index 菜单下标
@@ -356,9 +285,44 @@
 					isSelect: true,
 					regionArea: this.areaValue
 				};
-				this.getFilterCount()
+				// this.getFilterCount()
 				this.getResidentailList(params);
 			},
+			/**
+			 * 获取小区列表
+			 * @param {Object} params
+			 */
+			getResidentailList(params){
+				console.log(params)
+				let list = [];
+				this.$api.residential.page(params).then(res=>{
+					console.log(res)
+					let list=[]
+					res.list.forEach(item=>{
+						let obj={
+							label:item.name,
+							value:item.id
+						}
+						list.push(obj)
+					})
+					this.residentialList =  list;
+					console.log(list)
+				})
+			},
+			/**
+			 * 点击选择小区刷新列表
+			 */
+			residentailConfirm(res){
+				//筛选标题
+				this.params.residentialId =res.value
+				this.data[1] = res.label
+				this.residentialShow = false
+				//获取楼栋列表
+				let params={
+					residentialId:this.params.residentialId
+				}
+				this.mescroll.resetUpScroll()
+			},
 		}
 	}
 </script>

+ 2 - 2
pages/car/card.vue

@@ -37,14 +37,14 @@
 					</view>
 				</view>
 			</view>
-<!-- 			<view class="bottom flex" >
+			<view class="bottom flex" >
 				<view @click="edit(item)" class="cu-btn  sm round line-blue" style="margin: 0 10rpx;">
 					修改车辆
 				</view>
 				<view @click="delItem(item)" class="cu-btn  sm round bg-red" style="margin: 0 10rpx;">
 					删除车辆
 				</view>
-			</view> -->
+			</view>
 		</view>
 	</view>
 </template>

+ 102 - 1
pages/residential/detail.vue

@@ -1,8 +1,109 @@
 <template>
+	<view class="">
+		<view class="card">
+			<scroll-view  style="margin: 40rpx;">
+				<u-form :label-style="labelStyle" label-width="150" :model="form" ref="uForm">
+					<u-form-item label="小区名称"><u-input v-model="form.name" placeholder="暂无信息" disabled/></u-form-item>
+					<u-form-item label="所属机构">
+						<u-input  v-model="form.agencyName"  placeholder="暂无信息" disabled></u-input>
+					</u-form-item>
+					<u-form-item label="物业服务">
+						<u-input  v-model="form.estatePidName"  placeholder="暂无信息" disabled></u-input>
+					</u-form-item>
+					<u-form-item label="楼栋总数">
+						<u-input v-model="form.buildingNumber" placeholder="暂无信息" disabled ></u-input>
+					</u-form-item>
+					<u-form-item label="单元总数">
+						<u-input v-model="form.totalUnitNumber"  placeholder="暂无信息" disabled></u-input>
+					</u-form-item>
+					<u-form-item label="楼层总数">
+						<u-input v-model="form.floorNumber"  placeholder="暂无信息" disabled></u-input>
+					</u-form-item>
+					<u-form-item label="房间总数">
+						<u-input v-model="form.totalRoomNumber"  placeholder="暂无信息" disabled></u-input>
+					</u-form-item>
+				</u-form>
+			</scroll-view>
+		</view>
+		<view class="" style="height: 150rpx;"></view>
+		<view class="footer-fixed">
+			<u-grid :col="3">
+				<u-grid-item @click="add">
+					<u-icon name="plus-circle-fill" color='#19be6b' :size="50"></u-icon>
+					<view class="grid-text">新增</view>
+				</u-grid-item>
+				<u-grid-item @click="edit">
+					<u-icon name="edit-pen-fill" color="#2979ff" :size="50"></u-icon>
+					<view class="grid-text">修改</view>
+				</u-grid-item>
+				<u-grid-item @click="deleteResidential">
+					<u-icon name="trash-fill" color="#fa3534" :size="50"></u-icon>
+					<view class="grid-text">删除</view>
+				</u-grid-item>
+			</u-grid>
+		</view>
+		<navigator url="../index/index" open-type="switchTab"  class="cuIcon cu-btn round" style="background-color: rgba(0,0,0,.2);color: #FFFFFF;position: fixed;right: 3%;bottom: 20%;width: 80rpx;height: 80rpx;">
+			<text class="cuIcon-home" style="font-size: 40rpx;"></text>
+		</navigator>
+	</view>
 </template>
 
 <script>
+	export default {
+		data() {
+			return {
+				labelStyle:{
+					"fontWeight":"600"
+				},
+				form:{}
+			}
+		},
+		onLoad(options) {
+			this.fetchDetail(options.id)
+		},
+		methods: {
+			//获取详情
+			fetchDetail(id){
+				this.$api.residential.page({id}).then(res=>{
+					this.form=res.list[0]
+				})
+			},
+			//新增
+			add(){
+				uni.navigateTo({
+					url:"add"
+				})
+			},
+			//修改
+			edit(){
+				uni.navigateTo({
+					url:"./add?id="+this.form.id
+				})
+			},
+			//删除
+			deleteResidential(){
+				let item =this.form
+				this.$dialog.showModal('确定要删除此项吗?').then(res=>{
+					this.$api.residential.del({id:this.form.id}).then(res=>{
+						if (res.data) {
+							this.$dialog.showModal('删除',false).then(res=>{
+								uni.navigateBack({
+									delta:1
+								})
+							})
+						}
+					})
+				})
+			}
+			
+		}
+	}
 </script>
 
-<style>
+<style lang="scss">
+	.card{
+		background-color: #FFFFFF;
+		margin: 30rpx;
+		border-radius: 20rpx;
+	}
 </style>

+ 63 - 30
pages/residential/residential.vue

@@ -23,14 +23,14 @@
 				</view>
 			</view>
 			<scroll-view v-if="!$isEmpty(searchList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
-				<view @click="residentailConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in searchList" :key="index">
+				<view @click="agencyConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in searchList" :key="index">
 					<text>{{item.label}}</text>
 				</view>
 				<u-divider v-if="searchList.length>=10" height="80">只显示十条数据</u-divider>
 			</scroll-view>
 			<u-empty v-else name="search"></u-empty>
 		</u-popup>
-		<!-- 楼栋 -->
+		<!-- 小区名字筛选 -->
 		<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">
@@ -38,11 +38,11 @@
 					<u-input style="width: 90%;" v-model="residentialKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
 				</view>
 			</view>
-			<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">
+			<scroll-view v-if="!$isEmpty(list)"  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 list" :key="index">
 					<text>{{item.name}}</text>
 				</view>
-				<u-divider v-if="residentialList.length>=10" height="80">只显示十条数据</u-divider>
+				<u-divider v-if="list.length>=10" height="80">只显示十条数据</u-divider>
 			</scroll-view>
 			<u-empty v-else name="search"></u-empty>
 		</u-popup>
@@ -80,7 +80,7 @@
 			return {
 
 				//顶部菜单栏
-				filterMenu: ["地区","所属机构","物业名称","筛选"],
+				filterMenu: ["地区","归属","物业名称","筛选"],
 				data:['','','',''],
 				
 				//地区
@@ -101,8 +101,6 @@
 				//小区
 				residentailShow:false,
 				residentialKeyWord:'',
-				residentialList:[],
-				
 				list: [],
 				downOption: { 
 					use: true,
@@ -123,7 +121,7 @@
 		},
 		onLoad(){
 			that=this
-			this.getListByLikeName({isSelect:true})
+			this.getResidentailList()
 		},
 		onShow() {
 			if (this.canReset) {
@@ -145,7 +143,7 @@
 						regionArea: that.areaValue,
 						agencyName: that.agencyKeyword
 					}
-					this.getListByLikeName(params)
+					this.getAgencyList(params)
 				}, 500)
 			},
 			residentialKeyWord(){
@@ -160,7 +158,7 @@
 						agencyId:that.params.agencyId,
 						name:that.residentialKeyWord
 					}
-					that.fetchresidentialList(params)
+					that.getResidentailList(params)
 				}, 500)
 			},
 		},
@@ -221,30 +219,25 @@
 			 */
 			reset(){
 				this.params={}
-				this.data=['','','','','']
+				this.data=['','','','']
 				this.areaValue=''
 				this.searchList=[]
 				this.agencyKeyword=''
 				this.unitList=[]
 				this.residentialKeyWord='',
-				this.residentialList=[],
 				this.list=[],
 				this.mescroll.resetUpScroll()
 			},
 			/**
-			 * 点击选择机构
+			 * 获取小区列表
+			 * @param {Object} params
 			 */
-			residentailConfirm(res){
-				//筛选标题
-				this.params.residentialId =res.value
-				this.data[1] = res.label
-				this.popupShow = false
-				//获取机构
-				let params={
-					residentialId:this.params.residentialId
-				}
-				this.fetchresidentialList(params)
-				this.mescroll.resetUpScroll()
+			getResidentailList(params){
+				console.log(params)
+				this.$api.residential.page(params).then(res=>{
+					console.log(122,res)
+					this.list =  res.list;
+				})
 			},
 			/**
 			 * 顶部菜单选择
@@ -257,7 +250,7 @@
 					return
 				}
 				if(index==1){
-					//机构
+					//归属
 					this.popupShow = true;
 				 return;
 				}else if(index==2){
@@ -286,27 +279,67 @@
 					isSelect: true,
 					regionArea: this.areaValue
 				};
-				this.getListByLikeName(params);
+				this.getAgencyList(params);
 			},
 			/**
 			 * 获取机构列表
 			 * @param {Object} params
 			 */
-			getListByLikeName(params){
+			// getListByLikeName(params){
+			// 	let list = [];
+			// 	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);
+			// 			}
+			// 			this.searchList = list;
+			// 	})
+			// },
+			/**
+			 * 获取机构列表
+			 * @param {Object} params
+			 */
+			getAgencyList(params){
 				let list = [];
 				this.$api.permissions.orgList(params).then(res=>{
 					console.log(res)
 					let list = [];
 						for(let item of res.data.records){
 							let element = {
-								label: item.name,
+								label: item.parentName,
 								value: item.id
 							}
 							list.splice(list.length,0,element);
 							// list.push(obj);
 						}
 						this.searchList = list;
+						this.mescroll.resetUpScroll()
+				})
+			},
+			/**
+			 * 点击确认选择归属
+			 */
+			agencyConfirm(res){
+				//筛选标题
+				this.params.agencyId =res.value
+				this.data[1] = res.label
+				this.popupShow = false
+				console.log(res)
+				//获取小区
+				let params={
+					agencyId:this.params.agencyId
+				}
+				this.$api.residential.pageBycondition(params).then(res=>{
+					console.log(333,res)
+					this.list =  res.data.records;
 				})
+				this.mescroll.resetUpScroll()
 			},
 			/**
 			 * 添加小区
@@ -318,7 +351,7 @@
 			},
 			delItem(item){
 				this.$dialog.showModal('确定要删除此项吗?').then(res=>{
-					this.$api,room.del({id:item.id}).then(res=>{
+					this.$api.residential.del({id:item.id}).then(res=>{
 						if (res.data) {
 							this.$showToast('删除成功')
 							that.mescroll.resetUpScroll()