Browse Source

Merge branch 'zdsz3.0' of http://192.168.10.18:3000/wangtong/zd_wechatApp into zdsz3.0

zhnghongrui 1 year ago
parent
commit
030f301c96
2 changed files with 516 additions and 0 deletions
  1. 368 0
      pages/statistics/index.vue
  2. 148 0
      pages/statistics/sss.vue

+ 368 - 0
pages/statistics/index.vue

@@ -0,0 +1,368 @@
+<template>
+	<view>
+		<view class="view-bg">
+			<text class="title-txt">工程用料统计</text>
+			<view>
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						小区
+					</view>
+					<view class="uni-list-cell-db">
+						<picker @change="bindPickerVillageChange" :value="villageIndex" :range="villageList"
+							range-key="name">
+							<view class="uni-input">{{villageList[villageIndex].name}}</view>
+						</picker>
+					</view>
+				</view>
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						规格
+					</view>
+					<view class="uni-list-cell-db">
+						<picker @change="bindPickerSpecificationChange" :value="specificationIndex"
+							:range="specificationList" range-key="name">
+							<view class="uni-input">{{specificationList[specificationIndex].name}}</view>
+						</picker>
+					</view>
+				</view>
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						材料
+					</view>
+					<view class="uni-list-cell-db">
+						<picker @change="bindPickerMaterialChange" :value="materialIndex" :range="materialList"
+							range-key="name">
+							<view class="uni-input">{{materialList[materialIndex].name}}</view>
+						</picker>
+					</view>
+				</view>
+			</view>
+			<uni-divider></uni-divider>
+			<uni-table ref="table">
+				<uni-tr>
+					<uni-th width="20" align="center"></uni-th>
+					<uni-th width="20" align="center">预计用量</uni-th>
+					<uni-th width="20" align="center">实际用量</uni-th>
+				</uni-tr>
+				<uni-tr v-for="(item, index) in materialUsageList" :key="index">
+					<uni-td>{{ item.name }}</uni-td>
+					<uni-td>{{ item.estimatedUsage }}</uni-td>
+					<uni-td>{{ item.actualUsage }}</uni-td>
+				</uni-tr>
+			</uni-table>
+		</view>
+
+		<view class="view-bg">
+			<text class="title-txt">工程进度统计</text>
+			<view>
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						小区
+					</view>
+					<view class="uni-list-cell-db">
+						<picker @change="bindPickerVillageChange2" :value="villageIndex2" :range="villageList"
+							range-key="name">
+							<view class="uni-input">{{villageList[villageIndex2].name}}</view>
+						</picker>
+					</view>
+				</view>
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						楼栋
+					</view>
+					<view class="uni-list-cell-db">
+						<picker @change="bindPickerBuildChange" :value="buildIndex" :range="buildList" range-key="name">
+							<view class="uni-input">{{buildList[buildIndex].name}}</view>
+						</picker>
+					</view>
+				</view>
+				<view class="uni-list-cell">
+					<view class="uni-list-cell-left">
+						单元
+					</view>
+					<view class="uni-list-cell-db">
+						<picker @change="bindPickerUnitChange" :value="unitIndex" :range="unitList" range-key="name">
+							<view class="uni-input">{{unitList[unitIndex].name}}</view>
+						</picker>
+					</view>
+				</view>
+			</view>
+			<uni-divider></uni-divider>
+			<view class="view_bg_build">
+				<uni-grid :column="roomCount" :highlight="true" @change="change">
+					<uni-grid-item v-for="(item, index) in roomList" :index="index" :key="index">
+						<view class="centered" style="background-color: #fff;">
+							<!-- <uni-icons type="image" :size="30" color="#777" /> -->
+							<text>{{item.roomNumber}}</text>
+						</view>
+					</uni-grid-item>
+				</uni-grid>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {getAreaList,getBuildingList,getUnitList,getHousesList} from '@/api/common'
+
+	export default {
+		data() {
+			return {
+				villageIndex: 0,
+				specificationIndex: 0,
+				materialIndex: 0,
+				villageIndex2: 0,
+				buildIndex: 0,
+				unitIndex: 0,
+				villageList: [{
+					name: '小区001'
+				}, {
+					name: '小区002'
+				}, {
+					name: '小区003'
+				}, {
+					name: '小区004'
+				}],
+				specificationList: [{
+					name: '规格001'
+				}, {
+					name: '规格002'
+				}, {
+					name: '规格003'
+				}, {
+					name: '规格004'
+				}],
+				materialList: [{
+					name: '材料001'
+				}, {
+					name: '材料002'
+				}, {
+					name: '材料003'
+				}, {
+					name: '材料004'
+				}],
+				buildList: [{
+					name: '楼栋001'
+				}, {
+					name: '楼栋002'
+				}, {
+					name: '楼栋003'
+				}, {
+					name: '楼栋004'
+				}],
+				unitList: [{
+					name: '单元001'
+				}, {
+					name: '单元002'
+				}, {
+					name: '单元003'
+				}, {
+					name: '单元004'
+				}],
+
+				materialUsageList: [{
+					name: '0.5cm钢',
+					estimatedUsage: 1210,
+					actualUsage: 6852
+				}, {
+					name: '1.0cm钢',
+					estimatedUsage: 1680,
+					actualUsage: 6852
+				}, {
+					name: '1.5cm钢',
+					estimatedUsage: 1503,
+					actualUsage: 6852
+				}],
+				roomList: [{
+					roomNumber: '601',
+					status: '0'
+				}, {
+					roomNumber: '602',
+					status: '0'
+				}, {
+					roomNumber: '603',
+					status: '0'
+				}, {
+					roomNumber: '604',
+					status: '0'
+				}, {
+					roomNumber: '501',
+					status: '0'
+				}, {
+					roomNumber: '502',
+					status: '0'
+				}, {
+					roomNumber: '503',
+					status: '0'
+				}, {
+					roomNumber: '504',
+					status: '0'
+				}, {
+					roomNumber: '401',
+					status: '0'
+				}, {
+					roomNumber: '402',
+					status: '0'
+				}, {
+					roomNumber: '403',
+					status: '0'
+				}, {
+					roomNumber: '404',
+					status: '0'
+				}, {
+					roomNumber: '301',
+					status: '0'
+				}, {
+					roomNumber: '302',
+					status: '0'
+				}, {
+					roomNumber: '303',
+					status: '0'
+				}, {
+					roomNumber: '304',
+					status: '0'
+				}, {
+					roomNumber: '201',
+					status: '0'
+				}, {
+					roomNumber: '202',
+					status: '0'
+				}, {
+					roomNumber: '203',
+					status: '0'
+				}, {
+					roomNumber: '204',
+					status: '0'
+				}, {
+					roomNumber: '101',
+					status: '0'
+				}, {
+					roomNumber: '102',
+					status: '0'
+				}, {
+					roomNumber: '103',
+					status: '0'
+				}, {
+					roomNumber: '104',
+					status: '0'
+				}],
+				roomCount: 4
+			}
+		},
+		created() {
+			// this.chooseVillage()
+			// this.getDicts("district").then(response =>{
+			// 	// this.xxx=response.data
+			// })
+			// getAreaList().then(res => {
+			// 	debugger
+			// 	console.log(res)
+			// })
+			// getBuildingList('100').then(res => {
+			// 	debugger
+			// 	console.log(res)
+			// })
+			
+			// getUnitList('1098').then(res => {
+			// 	debugger
+			// 	console.log(res)
+			// })
+			getHousesList('13631').then(res => {
+				debugger
+				console.log(res)
+			})
+		},
+		methods: {
+			bindPickerVillageChange: function(e) {
+				console.log('picker发送选择改变,携带值为:' + e.detail.value)
+				this.villageIndex = e.detail.value
+			},
+			bindPickerSpecificationChange: function(e) {
+				console.log('picker发送选择改变,携带值为:' + e.detail.value)
+				this.specificationIndex = e.detail.value
+			},
+			bindPickerMaterialChange: function(e) {
+				console.log('picker发送选择改变,携带值为:' + e.detail.value)
+				this.materialIndex = e.detail.value
+			},
+			bindPickerVillageChange2: function(e) {
+				console.log('picker发送选择改变,携带值为:' + e.detail.value)
+				this.villageIndex2 = e.detail.value
+			},
+			bindPickerBuildChange: function(e) {
+				console.log('picker发送选择改变,携带值为:' + e.detail.value)
+				this.buildIndex = e.detail.value
+			},
+			bindPickerUnitChange: function(e) {
+				console.log('picker发送选择改变,携带值为:' + e.detail.value)
+				this.unitIndex = e.detail.value
+			},
+		}
+	}
+</script>
+
+<style>
+	.marginLeft5 {
+		margin-left: 5px;
+	}
+
+	.title-txt {
+		font-size: 15px;
+		font-weight: bold;
+		color: black;
+	}
+
+	.content-txt {
+		font-size: 10px;
+		font-weight: bold;
+		color: black;
+	}
+
+	.view-bg {
+		margin-left: 8px;
+		margin-right: 8px;
+		margin-top: 8px;
+		padding: 10px;
+		background-color: #fff;
+		border-radius: 5px;
+	}
+
+	.uni-list {
+		background-color: #FFFFFF;
+		position: relative;
+		width: 100%;
+		display: flex;
+		flex-direction: column;
+	}
+
+	.uni-list-cell-db,
+	.uni-list-cell {
+		position: relative;
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+		align-items: center;
+	}
+
+	.uni-list-cell-left {
+		white-space: nowrap;
+		font-size: 28rpx;
+	}
+
+	.centered {
+		text-align: center;
+		background-color: #e2f4ff;
+
+	}
+
+	.text {
+		background-color: #e2f4ff;
+		height: 20rpx;
+	}
+
+	.view_bg_build {
+		background-color: #e2f4ff;
+		padding: 10rpx;
+		margin: 20rpx;
+	}
+</style>

+ 148 - 0
pages/statistics/sss.vue

@@ -0,0 +1,148 @@
+<template>
+	<list :id="parentListId" class="page" :bounce="false" isSwiperList="true">
+		<refresh class="refresh" @refresh="onrefresh" @pullingdown="onpullingdown"
+			:display="refreshing ? 'show' : 'hide'">
+			<div class="refresh-view">
+				<text class="loading-text">{{refreshText}}</text>
+			</div>
+		</refresh>
+		<cell>
+			<view id="head" class="header">
+				<text class="header-title">header</text>
+			</view>
+		</cell>
+		<cell>
+			<view class="main-content" :style="'height:' + pageHeight + 'px'">
+				<view class="sticky-view">
+					<text class="sticky-title">Sticky view</text>
+				</view>
+				<list ref="sublist" class="list" :offset-accuracy="5" :bounce="false" isSwiperList="true">
+					<cell v-for="(item, index) in dataList" :key="item.id" :ref="'item'+index" @click="onclick">
+						<view class="list-item">
+							<text>{{item.name}}</text>
+						</view>
+					</cell>
+				</list>
+			</view>
+		</cell>
+	</list>
+</template>
+
+<script>
+	// #ifdef APP-PLUS
+	const dom = weex.requireModule('dom');
+	// #endif
+
+	export default {
+		data() {
+			return {
+				parentListId: "parentListId",
+				pageHeight: 300,
+				dataList: [],
+				refreshing: false,
+				refreshText: "",
+				refreshFlag: false
+			}
+		},
+		created() {
+			for (var i = 1; i <= 32; i++) {
+				this.dataList.push({
+					id: i,
+					name: i
+				});
+			}
+		},
+		onReady() {
+			this.pageHeight = uni.getSystemInfoSync().windowHeight;
+			uni.createSelectorQuery().in(this).select('#head').boundingClientRect().exec(rect => {
+				this.$refs.sublist.setSpecialEffects({
+					id: this.parentListId,
+					headerHeight: rect[0].height
+				});
+			});
+		},
+		methods: {
+			onrefresh(e) {
+				this.refreshing = true;
+				this.refreshText = "刷新中...";
+				setTimeout(() => {
+					this.refreshing = false;
+					this.refreshFlag = false;
+					this.refreshText = "已刷新";
+				}, 2000)
+			},
+			onpullingdown(e) {
+				if (this.refreshing) {
+					return;
+				}
+
+				this.pulling = false;
+				if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {
+					this.refreshFlag = true;
+					this.refreshText = "释放立即刷新";
+				} else {
+					this.refreshFlag = false;
+					this.refreshText = "下拉可以刷新";
+				}
+			}
+		}
+	}
+</script>
+
+<style>
+	/* #ifndef APP-PLUS */
+	page {
+		width: 100%;
+		min-height: 100%;
+		display: flex;
+	}
+
+	/* #endif */
+
+	.page {
+		flex: 1;
+	}
+
+	.refresh-view {
+		width: 750rpx;
+		height: 80px;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.header {
+		height: 160px;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		background-color: #f4f4f4;
+	}
+
+	.header-title {
+		font-size: 30px;
+		font-weight: bold;
+		color: #444;
+	}
+
+	.sticky-view {
+		margin-left: 12px;
+		margin-right: 12px;
+		padding: 20px;
+		background-color: #EBEBEB;
+		border-radius: 5px;
+	}
+
+	.list {
+		flex: 1;
+	}
+
+	.list-item {
+		margin-left: 12px;
+		margin-right: 12px;
+		margin-top: 12px;
+		padding: 20px;
+		background-color: #fff;
+		border-radius: 5px;
+	}
+</style>