Переглянути джерело

commit 危险作业工程

menchuang 1 рік тому
батько
коміт
d4b5295b71
4 змінених файлів з 160 додано та 156 видалено
  1. 15 0
      api/common.js
  2. 14 0
      pages.json
  3. 99 153
      pages/statistics/statistics.vue
  4. 32 3
      pages/work/index.vue

+ 15 - 0
api/common.js

@@ -1,4 +1,19 @@
 import request from '@/utils/request'
+//危险作业工程列表查询
+export function getDangerousWorkProjectList(param) {
+	return request({
+		'url': '/zdsz/engineeringDangerous/list',
+		'method': 'get',
+		'data': param
+	})
+}
+//查询危险作业工程详情
+export function getDangerousWorkProjectDetails(id) {
+	return request({
+		'url': '/zdsz/engineeringDangerous/query/'+id,
+		'method': 'get',
+	})
+}
 // 根据小区楼栋单元 获取工程用料统计(areaId(string) 小区ID realityQuality材质 realitySpecifications 规格)
 export function getMunicipalStatisticsData(param) {
 	return request({

+ 14 - 0
pages.json

@@ -124,6 +124,20 @@
 			"style": {
 				"navigationBarTitleText": "工业工程"
 			}
+		},
+		{
+			"path" : "pages/infrastructure/infrastructure",
+			"style" : 
+			{
+				"navigationBarTitleText" : "基建工程"
+			}
+		},
+		{
+			"path" : "pages/dangerous/dangerous",
+			"style" : 
+			{
+				"navigationBarTitleText" : "危险作业工程"
+			}
 		}
 
 	],

+ 99 - 153
pages/statistics/statistics.vue

@@ -80,14 +80,16 @@
 			<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-th width="20" align="left"></uni-th>
+					<uni-th width="20" align="right">预计用量</uni-th>
+					<uni-th width="20" align="right">实际用量</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-td>
+						<view class="name">{{ item.materialQuality }}</view>
+					</uni-td width="20" align="left">
+					<uni-td width="20" align="right">{{ item.estimatedSize }}</uni-td>
+					<uni-td width="20" align="right">{{ item.realitySize }}</uni-td>
 				</uni-tr>
 			</uni-table>
 		</view>
@@ -159,19 +161,34 @@
 					</view>
 
 				</view>
-				<!-- xx -->
 
 			</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 class="view_bg_build" v-if="roomList.length > 0">
+ 
+				<view v-for="(item,index) in roomList" :key="index">
+					<uni-grid :border="false" :column="roomCount" :highlight="true" @change="change">
+						<uni-grid-item v-for="(item2, index2) in roomList[index]" :index="index2" :key="index2">
+							<view :style="{backgroundColor: getColorByStatus(item2.roomStatus)}">
+								<text class="grid-text">{{item2.roomName}}</text>
+							</view>
+						</uni-grid-item>
+					</uni-grid>
+				</view>
+			</view>
+			<view  v-if="roomList.length == 0">暂无数据</view>
+			<view style="align-items: center;"> 
+				<view style="display: flex;align-items: center;">
+					<image class="block-iv" src="../../static/images/ic_legend.png"></image>
+					<text style="margin-right: 20px;margin-left: 5px;">图例: </text> 
+					<div class="block-iv" style="background-color: #80d9ae;"></div>
+					<text  style="margin-right: 20px;margin-left: 5px;">完工</text> 
+					<div class="block-iv" style="background-color: #5bd3ff;"></div>
+					<text  style="margin-right: 20px;margin-left: 5px;">未完工</text> 
+					<div class="block-iv" style="background-color: #ffc881;"></div>
+					<text  style="margin-right: 20px;margin-left: 5px;">未开工</text> 
+				</view>
+
 			</view>
 		</view>
 
@@ -236,136 +253,12 @@
 				specificationList: [],
 				materialValue: {},
 				materialList: [],
-				// 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'
-				}],
+				materialUsageList: [],
+				roomList: [],
 				roomCount: 4
 			}
 		},
-		created() {
-		},
+		created() {},
 		methods: {
 			isEmpty(str) {
 				return (!str || 0 === str.length);
@@ -548,6 +441,7 @@
 
 				} else if (this.type == 'dy2') {
 					this.DYValue2 = item;
+					this.queryProjectStatisticsList();
 				} else if (this.type == 'gg') { //规格
 					this.specificationValue = item;
 					this.queryMaterialsUsedList();
@@ -568,26 +462,49 @@
 			closeDict(e) {
 				this.openDict = false
 			},
-			queryMaterialsUsedList(){
-				debugger
-				if(this.isEmpty(this.XQValue.id)){
+			queryMaterialsUsedList() {
+				if (this.isEmpty(this.XQValue.id)) {
 					this.$modal.msg('请选择小区')
 					return;
 				}
-				debugger
 				if (this.isEmpty(this.specificationValue.id)) {
 					this.$modal.msg('请选择规格')
 					return;
 				}
-				let param={
-					areaId:this.XQValue.id,
-					realityQuality:this.materialValue.id,
-					realitySpecifications:this.specificationValue.id,
+				let param = {
+					enginCycle: this.projectValue.dictValue, //工程周期
+					areaId: this.XQValue.id,
+					realityQuality: this.materialValue.id,
+					realitySpecifications: this.specificationValue.id,
 				};
-				getMunicipalStatisticsData(param).then(res=>{
-					this.materialUsageList=res.data;
+				getMunicipalStatisticsData(param).then(res => {
+					this.materialUsageList = res.data;
 				})
 			},
+			queryProjectStatisticsList() {
+				let param = {
+					enginCycle: this.projectValue.dictValue, //工程周期
+					areaId: this.XQValue2.id,
+					buildingId: this.LDValue2.id,
+					unitId: this.DYValue2.id,
+				};
+				getObtainRoomcCompletionInformationList(param).then(res => {
+					this.roomList = res.data[0].roomStatusVoList;
+					this.roomCount = res.data[0].roomStatusVoList.length;
+				})
+			},
+			getColorByStatus(status) {
+				if (this.isEmpty(status)) {
+					return "#fff";
+				}
+				if (status == '未完工') {
+					return "#5bd3ff";
+				} else if (status == '未开工') {
+					return "#ffc881";
+				} else if (status == '完工') {
+					return "#80d9ae";
+				}
+			}
 		}
 	}
 </script>
@@ -657,4 +574,33 @@
 		padding: 10rpx;
 		margin: 20rpx;
 	}
+
+	.grid-text {
+		font-size: 14px;
+		color: #000000;
+		text-align: center;
+		padding-left: 30rpx;
+		padding-right: 30rpx;
+		padding-top: 20rpx;
+		padding-bottom: 20rpx;
+	}
+
+	.name {
+		flex: 0;
+		font-size: 14px;
+		color: #000000;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
+
+	.table-item {
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
+	.block-iv{
+		width: 10px;
+		height: 10px;
+	}
 </style>

+ 32 - 3
pages/work/index.vue

@@ -38,7 +38,7 @@
 				</uni-grid-item>
 				<uni-grid-item>
 					<view class="grid-item-box">
-						<uni-icons type="settings-filled" size="30"></uni-icons>
+						<uni-icons type="settings-filled" size="30" @click="showDangerous"></uni-icons>
 						<text class="text">危险作业工程</text>
 					</view>
 				</uni-grid-item>
@@ -50,7 +50,7 @@
 				</uni-grid-item>
 				<uni-grid-item>
 					<view class="grid-item-box">
-						<uni-icons type="bars" size="30"></uni-icons>
+						<uni-icons type="bars" size="30" @click="showInfrastructureDialog"></uni-icons>
 						<text class="text">基建工程</text>
 					</view>
 				</uni-grid-item>
@@ -288,6 +288,17 @@
 							.stringify(
 								obj))
 					})
+				} else if (this.projectType == 'JiJian') {
+					console.log("基建", item)
+					let obj = {
+						value: item.dictValue
+					};
+					this.handleHiddenShare();
+					uni.navigateTo({
+						url: '/pages/infrastructure/infrastructure?params=' + encodeURIComponent(JSON
+							.stringify(
+								obj))
+					})
 				}
 
 			},
@@ -302,7 +313,25 @@
 
 				});
 				this.handleShowSheet();
-			}
+			},
+			showInfrastructureDialog() {
+				this.projectType = 'JiJian';
+				//基建工程
+				getDicts("engineering_infrastructure").then(response => {
+					console.log("基建工程", response.data)
+					this.typeList = response.data;
+
+					console.log("基建工程", response.data)
+
+				});
+				this.handleShowSheet();
+			},
+			showDangerous(){
+				console.log("危险作业工程")
+				uni.navigateTo({
+					url: '/pages/dangerous/dangerous'
+				})
+			},
 		}
 	}
 </script>