소스 검색

小区 楼栋 单元 房间接口

zhnghongrui 1 년 전
부모
커밋
bdc2019ca4
2개의 변경된 파일44개의 추가작업 그리고 107개의 파일을 삭제
  1. 1 1
      components/selectPicker/select_picker.vue
  2. 43 106
      pages/oldrenovation/indoor/tearOldPipe.vue

+ 1 - 1
components/selectPicker/select_picker.vue

@@ -25,7 +25,7 @@
 								</view>
 								<view class="liy-search-title" v-else>未选择标题
 								</view>
-								<view class="liy-search-desc" v-if="subtitleKey">{{item[subtitleKey]}}</view>
+							<!-- 	<view class="liy-search-desc" v-if="subtitleKey">{{item[subtitleKey]}}</view> -->
 							</view>
 							<view class="liy-search-icon" v-if="mapSelectIndex == index">
 								<image class="lsi-icon" src="../../static/images/check_mark.png" mode="widthFix">

+ 43 - 106
pages/oldrenovation/indoor/tearOldPipe.vue

@@ -46,8 +46,8 @@
 				<switch checked @change="switch2Change" />
 
 			</view>
-			<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="communityName"
-				subtitleKey="address" v-model="communityName"></SelectPicker>
+			<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+				subtitleKey="id" v-model="name"></SelectPicker>
 		</view>
 	</template>
 
@@ -55,6 +55,12 @@
 
 	<script>
 		import SelectPicker from '../../../components/selectPicker/select_picker.vue'
+		import {
+			getAreaList,
+			getBuildingList,
+			getUnitList,
+			getHousesList
+		} from '@/api/common'
 
 		export default {
 			components: {
@@ -72,115 +78,25 @@
 					LDValue: {},
 					DYValue: {},
 					FJValue: {},
-					XQList: [{
-						"communityName": "乐彩花园",
-						"address": "乐彩花园(新华路东100米)",
-						"id": "00"
-					}, {
-						"communityName": "进行蓉城",
-						"address": "运河城万佳广场(兴隆桥北街)",
-						"id": "01"
-					}, {
-						"communityName": "万达华府1、2号院",
-						"address": "万达华府",
-						"id": "02"
-					}, {
-						"communityName": "万达华府8--10号楼",
-						"address": "万达华府",
-						"id": "03"
-					}, {
-						"communityName": "万达华府2--8号楼",
-						"address": "万达华府",
-						"id": "04"
-					}, {
-						"communityName": "万达华府1--3号楼",
-						"address": "万达华府",
-						"id": "05"
-					}],
+					XQList: '',
 					index: 0,
 					address: null,
 					title: 'picker',
 					transformerValue: '请选择楼栋',
 
-					LDList: [{
-						"communityName": "1栋",
-						"address": "乐彩花园(新华路东100米)",
-						"id": "000"
-					}, {
-						"communityName": "2栋",
-						"address": "运河城万佳广场(兴隆桥北街)",
-						"id": "001"
-					}, {
-						"communityName": "3栋",
-						"address": "万达华府",
-						"id": "002"
-					}, {
-						"communityName": "4栋",
-						"address": "万达华府",
-						"id": "003"
-					}, {
-						"communityName": "5栋",
-						"address": "万达华府",
-						"id": "004"
-					}, {
-						"communityName": "6栋",
-						"address": "万达华府",
-						"id": "005"
-					}],
-					DYList: [{
-						"communityName": "一单元",
-						"address": "乐彩花园(新华路东100米)",
-						"id": "011"
-					}, {
-						"communityName": "二单元",
-						"address": "运河城万佳广场(兴隆桥北街)",
-						"id": "012"
-					}, {
-						"communityName": "三单元",
-						"address": "万达华府",
-						"id": "013"
-					}, {
-						"communityName": "四单元",
-						"address": "万达华府",
-						"id": "014"
-					}, {
-						"communityName": "五单元",
-						"address": "万达华府",
-						"id": "015"
-					}, {
-						"communityName": "六单元",
-						"address": "万达华府",
-						"id": "016"
-					}],
-					FJList: [{
-						"communityName": "101",
-						"address": "乐彩花园(新华路东100米)",
-						"id": "021"
-					}, {
-						"communityName": "201",
-						"address": "运河城万佳广场(兴隆桥北街)",
-						"id": "022"
-					}, {
-						"communityName": "301",
-						"address": "万达华府",
-						"id": "023"
-					}, {
-						"communityName": "401",
-						"address": "万达华府",
-						"id": "024"
-					}, {
-						"communityName": "501",
-						"address": "万达华府",
-						"id": "025"
-					}, {
-						"communityName": "601",
-						"address": "万达华府",
-						"id": "026"
-					}],
+					LDList: '',
+					DYList: '',
+					FJList: '',
 
 
 				}
 			},
+			created() {
+				getAreaList().then(res => {
+					this.XQList = res;
+				})
+
+			},
 			onLoad() {
 				uni.setNavigationBarTitle({
 					title: '旧改工程-室内'
@@ -188,17 +104,17 @@
 			},
 			computed: {
 				attributeXQ() {
-					return this.XQValue.communityName ? this.XQValue.communityName : "请选择小区"
+					return this.XQValue.name ? this.XQValue.name : "请选择小区"
 
 				},
 				attributeLD() {
-					return this.LDValue.communityName ? this.LDValue.communityName : "请选择楼栋"
+					return this.LDValue.name ? this.LDValue.name : "请选择楼栋"
 				},
 				attributeDY() {
-					return this.DYValue.communityName ? this.DYValue.communityName : "请选择单元"
+					return this.DYValue.name ? this.DYValue.name : "请选择单元"
 				},
 				attributeFJ() {
-					return this.FJValue.communityName ? this.FJValue.communityName : "请选择房间"
+					return this.FJValue.name ? this.FJValue.name : "请选择房间"
 				}
 			},
 			methods: {
@@ -272,10 +188,31 @@
 					this.open = false;
 					if (this.type == 'xq') {
 						this.XQValue = item;
+						//根据小区id 获取楼栋数据
+						this.LDValue.name = ''; //重置楼栋数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getBuildingList(item.id).then(res => {
+							this.LDList = res
+							// console.log("楼栋=", res)
+						})
 					} else if (this.type == 'ld') {
 						this.LDValue = item;
+						//根据楼栋ID 获取单元数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getUnitList(item.id).then(res => {
+							this.DYList = res
+							// console.log("单元=", res)
+						})
 					} else if (this.type == 'dy') {
 						this.DYValue = item;
+						//根据单元数据 获取房间数据 
+						this.FJValue.name = ''; //重置房间数据
+						getHousesList(item.id).then(res => {
+							this.FJList = res
+							// console.log("房间=", res)
+						})
 					} else if (this.type == 'fj') {
 						this.FJValue = item;
 					}