Selaa lähdekoodia

民用工程室内-拆旧管、立杠、挂表、表后管、阀管新增接口以及历史接口调用完毕

zhnghongrui 1 vuosi sitten
vanhempi
commit
843ca73e65
5 muutettua tiedostoa jossa 409 lisäystä ja 32 poistoa
  1. 17 0
      api/common.js
  2. 259 0
      components/bottomSheet/bottomSheet.vue
  3. 1 0
      pages.json
  4. 103 32
      pages/oldrenovation/indoor/tearOldPipe.vue
  5. 29 0
      pages/work/index.vue

+ 17 - 0
api/common.js

@@ -1,6 +1,23 @@
 import request from '@/utils/request'
 
 
+// 获取房间工程历史
+export function getRoomProjectList(id,type) {
+
+	return request({
+		'url': '/zdsz/engineeringCivil/'+id+'/'+type,
+		'method': 'get',
+	})
+}
+// 查询房间是否有工程
+export function getRoomProjectId(room) {
+
+	return request({
+		'url': '/zdsz/engineeringCivil/query',
+		'method': 'post',
+		'data': room
+	})
+}
 // 材质规格下拉
 export function getEnginSpecificationsList(materId) {
 	const data = {

+ 259 - 0
components/bottomSheet/bottomSheet.vue

@@ -0,0 +1,259 @@
+<template>
+	<view class="share">
+		<view :class="{'share-box': shareState}" @click="handleHiddenShare">
+		</view>
+		<view class="share-item" :class="{'share-show': shareState}">
+			<view class="share-to">
+				<text style="font-size: 16px;color: #000;">{{title}}</text>
+			</view>
+
+
+			<scroll-view scroll-y="true" class="scroll-Y">
+				<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(value, key) in historyList"
+					:key="key">
+					<view class="uni-media-list">
+
+						<view class="uni-media-list-body" style="margin-left: 15px;">
+							<view v-if="title=='拆旧管'">
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									腐蚀等级:{{value.zEngineeringMaterialBo[0].corrosionLevel}}</view>
+							</view>
+							<view v-else-if="title=='立杠'">
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									材质:{{value.zEngineeringMaterialBo[0].materialQualityName}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									规格:{{value.zEngineeringMaterialBo[0].specificationsName}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+							</view>
+							<view v-else-if="title=='挂表'">
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									品牌:{{value.zEngineeringMaterialBo[0].brand}}</view>
+
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+							</view>
+							<view v-else-if="title=='表后管'">
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									材质:{{value.zEngineeringMaterialBo[0].materialQualityName}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									规格:{{value.zEngineeringMaterialBo[0].specificationsName}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+							</view>
+							<view v-else-if="title=='阀管'">
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									上门类型:{{value.zEngineeringMaterialBo[0].visitType}}</view>
+									<view class="uni-media-list-text-top"
+										style="font-size: 13px;color: #000;margin-top: 5px;">
+										自闭阀类型:{{value.zEngineeringMaterialBo[0].selfClosingValveType}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									材质:{{value.zEngineeringMaterialBo[0].materialQualityName}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									规格:{{value.zEngineeringMaterialBo[0].specificationsName}}</view>
+								<view class="uni-media-list-text-top"
+									style="font-size: 13px;color: #000;margin-top: 5px;">
+									数量:{{value.zEngineeringMaterialBo[0].number}}</view>
+							</view>
+							<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
+								<text style="margin-left: 30rpx;margin-top: 6rpx;">{{ value.published_at }}</text>
+								<view v-for="(item,index) in value.zEngiineeringPhotoBoList" :key="index"
+									style="position: relative;">
+									<view
+										v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'  || item.substring(item.length - 3) == 'jpeg'">
+										<image :src="item" mode=""
+											style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
+											@click="showPhoto(index)">
+										</image>
+									</view>
+									<view v-else>
+										<video :src="item"
+											style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
+									</view>
+
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</scroll-view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			data: {
+				type: Object,
+				default: {}
+			},
+
+		},
+		created() {
+			this.getParamsData();
+		},
+		watch: {
+			data(data) {
+				this.getParamsData();
+			}
+		},
+		data() {
+			return {
+				outPutData: {},
+				historyList: [], //历史数据
+				historyPhotoList: [], //历史图片数据
+				shareState: false,
+				title: '',
+			};
+		},
+		methods: {
+			showPhoto(index) {
+				uni.previewImage({
+					current: index,
+					urls: this.historyPhotoList,
+				})
+
+			},
+			getParamsData() {
+				var selectData = this.data;
+				this.outPutData = selectData;
+				this.title = selectData.zEngineeringNodeBo.type;
+				this.historyList = selectData.zEngineeringNodeBo.zEngineeringInfoBoList;
+				//this.historyPhotoList = selectData.zEngineeringNodeBo.zEngineeringInfoBoList.zEngiineeringPhotoBoList;
+
+
+			},
+			// 显示分享
+			handleShowShare() {
+				this.shareState = true;
+			},
+			// 隐藏分享
+			handleHiddenShare() {
+				this.shareState = false;
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.share {
+		width: 100%;
+		height: 100%;
+
+	}
+
+	.share-box {
+		width: 100%;
+		height: 100%;
+		position: fixed;
+		top: 0rpx;
+		left: 0rpx;
+		bottom: 0rpx;
+		right: 0rpx;
+		background-color: rgba(0, 0, 0, 0.4);
+		transition: .3s;
+		z-index: 999;
+	}
+
+	// 进入分享动画
+	.share-show {
+		transition: all 0.3s ease;
+		transform: translateY(0%) !important;
+		border-radius: 20px 20px 0px 0px;
+	}
+
+	.scroll-Y {
+		height: 750rpx;
+	}
+
+	// 离开分享动画
+	.share-item {
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		height: 70%;
+		background-color: #FFFFFF;
+		transition: all 0.3s ease;
+		transform: translateY(100%);
+		z-index: 1999;
+
+		.share-to {
+			width: 100%;
+			height: 30px;
+			display: flex;
+			justify-content: left;
+			margin-left: 15px;
+			align-items: center;
+
+			// &::after {
+			// 	content: '';
+			// 	width: 240rpx;
+			// 	height: 0rpx;
+			// 	border-top: 1px solid #E4E7ED;
+			// 	-webkit-transform: scaleY(0.5);
+			// 	transform: scaleY(0.5);
+			// 	margin-left: 30rpx;
+			// }
+
+			// &::before {
+			// 	content: '';
+			// 	width: 240rpx;
+			// 	height: 0rpx;
+			// 	border-top: 1px solid #E4E7ED;
+			// 	-webkit-transform: scaleY(0.5);
+			// 	transform: scaleY(0.5);
+			// 	margin-right: 30rpx;
+			// }
+		}
+
+		.content {
+			width: 100%;
+			height: auto;
+			display: flex;
+			flex-wrap: wrap;
+
+			.block {
+				width: 100%;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: left;
+				height: auto;
+
+				image {
+					width: 80rpx;
+					height: 80rpx;
+				}
+
+				text {
+					margin-top: 16rpx;
+					font-size: 28rpx;
+					color: #606266;
+				}
+			}
+		}
+
+		.cancel {
+			width: 100%;
+			height: 3rem;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			border-top: 1rpx solid #E4E7ED;
+		}
+	}
+</style>

+ 1 - 0
pages.json

@@ -130,6 +130,7 @@
 				"navigationBarTitleText": "sticky-list"
 			}
 		}
+		
 	],
 	"tabBar": {
 		"color": "#000000",

+ 103 - 32
pages/oldrenovation/indoor/tearOldPipe.vue

@@ -105,13 +105,14 @@
 			</view>
 			<!--拆旧管-->
 			<view class="background">
-				<view v-if="objValue.enginClassValue=='dismantling_old_pipe'">
+				<view v-if="objValue.enginClassValue=='拆旧管'">
 					<view class="uni-list">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							拆旧管
 
 							<span
-								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;"
+								@click="history">历史</span>
 						</view>
 
 						<view class="container" style="margin-bottom: 20PX;">
@@ -130,13 +131,14 @@
 					</view>
 				</view>
 				<!--立杠-->
-				<view v-else-if="objValue.enginClassValue=='vertical_bar'">
+				<view v-else-if="objValue.enginClassValue=='立杠'">
 					<view class="uni-list" style="margin-bottom: 20px;">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							立杠
 
 							<span
-								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;"
+								@click="history">历史</span>
 						</view>
 
 						<view class="container">
@@ -174,13 +176,14 @@
 					</view>
 				</view>
 				<!--挂表-->
-				<view v-else-if="objValue.enginClassValue=='pocket_watch'">
+				<view v-else-if="objValue.enginClassValue=='挂表'">
 					<view class="uni-list" style="margin-bottom: 20px;">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							挂表
 
 							<span
-								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;"
+								@click="history">历史</span>
 						</view>
 
 						<view class="container">
@@ -206,13 +209,14 @@
 					</view>
 				</view>
 				<!--表后管-->
-				<view v-else-if="objValue.enginClassValue=='posterior_tube'">
+				<view v-else-if="objValue.enginClassValue=='表后管'">
 					<view class="uni-list" style="margin-bottom: 20px;">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							表后管
 
 							<span
-								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;"
+								@click="history">历史</span>
 						</view>
 
 						<view class="container">
@@ -250,13 +254,14 @@
 					</view>
 				</view>
 				<!--阀管-->
-				<view v-else-if="objValue.enginClassValue=='valve_tube'">
+				<view v-else-if="objValue.enginClassValue=='阀管'">
 					<view class="uni-list" style="margin-bottom: 20px;">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							阀管
 
 							<span
-								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+								style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;"
+								@click="history">历史</span>
 						</view>
 						<view class="container">
 
@@ -345,6 +350,8 @@
 			<view class="action-btn">
 				<button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
 			</view>
+
+			<bottom-sheet ref="refShare" :data="historyList"></bottom-sheet>
 		</view>
 	</template>
 
@@ -352,6 +359,7 @@
 
 	<script>
 		import SelectPicker from '../../../components/selectPicker/select_picker.vue'
+		import bottomSheet from '../../../components/bottomSheet/bottomSheet.vue'
 
 		import uniIcons from '../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
 		import {
@@ -365,6 +373,8 @@
 			addTearOldPipe,
 			getEnginMaterialQualityList,
 			getEnginSpecificationsList,
+			getRoomProjectList,
+			getRoomProjectId,
 		} from '@/api/common'
 		import {
 			getToken
@@ -373,7 +383,8 @@
 		export default {
 			components: {
 				SelectPicker,
-				uniIcons
+				uniIcons,
+				bottomSheet
 			},
 			data() {
 
@@ -411,6 +422,7 @@
 					isCheck: true, //是否按照施工图纸施工
 					inputNumberValue: '',
 					title: '',
+					historyList: {} //历史数据
 
 				}
 			},
@@ -445,6 +457,15 @@
 					return (!str || 0 === str.length);
 
 				},
+
+				// 显示历史弹窗
+				handleShowSheet() {
+					this.shareState = true;
+				},
+				// 隐藏历史弹窗
+				handleHiddenShare() {
+					this.shareState = false;
+				},
 				showPhoto(index) {
 					uni.previewImage({
 						current: index,
@@ -627,7 +648,7 @@
 
 					} else if (e == 'cz') { //材质
 						this.open = true;
-						getEnginMaterialQualityList("0").then(response => {
+						getEnginMaterialQualityList("民用工程").then(response => {
 							this.selectList = response.data;
 						});
 
@@ -706,7 +727,7 @@
 
 
 				switchChange(e) {
-					console.log('switch2 发生 change 事件,携带值为', e.detail.value)
+					//'switch 发生 change 事件,携带值为', e.detail.value)
 					this.isCheck = e.detail.value;
 				},
 				changeSelectDict(item, index) {
@@ -747,9 +768,7 @@
 						this.materialValue = item;
 						this.specificationValue = ''; //重置规格
 						//根据材质ID 获取规格数据
-						console.log('材质id', item.id)
 						getEnginSpecificationsList(item.id).then(res => {
-							console.log("规格数据", res.data)
 							this.materialList = res.data
 						})
 					} else if (this.type == 'gg') {
@@ -810,14 +829,14 @@
 						this.$modal.msg("请选择单元")
 					} else if (this.isEmpty(this.FJValue.id)) {
 						this.$modal.msg("请选择房间")
-					} else if (this.objValue.enginClassValue == 'dismantling_old_pipe') {
+					} else if (this.objValue.enginClassValue == '拆旧管') {
 
 						if (this.isEmpty(this.LevelValue.dictValue)) {
 							this.$modal.msg("请选择腐蚀等级") //拆旧管  判断腐蚀等级
 						} else {
 							this.onsubmit();
 						}
-					} else if (this.objValue.enginClassValue == 'vertical_bar') {
+					} else if (this.objValue.enginClassValue == '立杠') {
 						//立杠  判断  材质  规格  数量
 						if (this.isEmpty(this.materialValue.id)) {
 							this.$modal.msg("请选择材质")
@@ -828,7 +847,7 @@
 						} else {
 							this.onsubmit();
 						}
-					} else if (this.objValue.enginClassValue == 'pocket_watch') {
+					} else if (this.objValue.enginClassValue == '挂表') {
 						//挂表  判断  品牌  数量
 						if (this.isEmpty(this.brandValue.dictValue)) {
 							this.$modal.msg("请选择品牌")
@@ -838,7 +857,7 @@
 							this.onsubmit();
 						}
 
-					} else if (this.objValue.enginClassValue == 'posterior_tube') {
+					} else if (this.objValue.enginClassValue == '表后管') {
 						//表后管  判断  材质  规格  数量 (为必须有一张照片和一个视频)
 						if (this.isEmpty(this.materialValue.id)) {
 							this.$modal.msg("请选择材质")
@@ -874,7 +893,7 @@
 											zEngiineeringPhotoBoList: this.imgArr, //照片集合
 
 											zEngineeringMaterialBo: [{
-												materialQuality: this.materialValue.dictValue, //材质
+												materialQuality: this.materialValue.id, //材质
 												specifications: this.specificationValue.id, //规格
 												number: this.inputNumberValue //数量
 											}]
@@ -898,7 +917,7 @@
 								this.$modal.msg('请至少上传一张照片和一个视频')
 							}
 						}
-					} else if (this.objValue.enginClassValue == 'valve_tube') {
+					} else if (this.objValue.enginClassValue == '阀管') {
 						//阀管  判断  材质  规格  数量
 						if (this.isEmpty(this.doorValue.dictValue)) {
 							this.$modal.msg("请选择上门类型")
@@ -926,7 +945,7 @@
 					} else {
 						//提交
 						let param = ';'
-						if (this.objValue.enginClassValue == 'dismantling_old_pipe') { //拆旧管
+						if (this.objValue.enginClassValue == '拆旧管') { //拆旧管
 							param = {
 								district: this.XZQValue.dictValue,
 								areaId: this.XQValue.id,
@@ -943,14 +962,14 @@
 										zEngiineeringPhotoBoList: this.imgArr, //照片集合
 
 										zEngineeringMaterialBo: [{
-											corrosionLevel: this.LevelValue.id //腐蚀等级
+											corrosionLevel: this.LevelValue.dictValue //腐蚀等级
 										}]
 									}
 								}
 
 							}
 							//this.onsubmit(param)
-						} else if (this.objValue.enginClassValue == 'vertical_bar') { //立杠
+						} else if (this.objValue.enginClassValue == '立杠') { //立杠
 							param = {
 								district: this.XZQValue.dictValue,
 								areaId: this.XQValue.id,
@@ -967,7 +986,7 @@
 										zEngiineeringPhotoBoList: this.imgArr, //照片集合
 
 										zEngineeringMaterialBo: [{
-											materialQuality: this.materialValue.dictValue, //材质
+											materialQuality: this.materialValue.id, //材质
 											specifications: this.specificationValue.id, //规格
 											number: this.inputNumberValue //数量
 										}]
@@ -977,7 +996,7 @@
 							}
 
 
-						} else if (this.objValue.enginClassValue == 'pocket_watch') { //挂表
+						} else if (this.objValue.enginClassValue == '挂表') { //挂表
 							param = {
 								district: this.XZQValue.dictValue,
 								areaId: this.XQValue.id,
@@ -1001,7 +1020,7 @@
 								}
 
 							}
-						} else if (this.objValue.enginClassValue == 'valve_tube') { //自闭阀
+						} else if (this.objValue.enginClassValue == '阀管') { //自闭阀
 							param = {
 								district: this.XZQValue.dictValue,
 								areaId: this.XQValue.id,
@@ -1020,7 +1039,7 @@
 										zEngineeringMaterialBo: [{
 											visitType: this.doorValue.dictValue, //上门类型
 											selfClosingValveType: this.SelfClosValve.dictValue, //自闭阀类型
-											materialQuality: this.materialValue.dictValue, //材质
+											materialQuality: this.materialValue.id, //材质
 											specifications: this.specificationValue.id, //规格
 											number: this.inputNumberValue //数量
 										}]
@@ -1032,18 +1051,70 @@
 
 						addTearOldPipe(param).then(res => {
 							if (res.code == '200') {
-
 								uni.showToast({
 									title: res.msg,
 									icon: 'none',
-									//显示持续时间为 1
-									duration: 1000
+									//显示持续时间为 3
+									duration: 2000
 								});
-								uni.navigateBack();
+								setTimeout(function() {
+									uni.navigateBack();
+								}, 1000)
+
 							}
 						})
 					}
 
+				},
+				history() {
+					if (this.isEmpty(this.projectValue.dictValue)) {
+						this.$modal.msg("请选择工程周期")
+					} else if (this.isEmpty(this.XZQValue.dictValue)) {
+						this.$modal.msg("请选择行政区")
+					} else if (this.isEmpty(this.XQValue.id)) {
+						this.$modal.msg("请选择小区")
+					} else if (this.isEmpty(this.LDValue.id)) {
+						this.$modal.msg("请选择楼栋")
+					} else if (this.isEmpty(this.DYValue.id)) {
+						this.$modal.msg("请选择单元")
+					} else if (this.isEmpty(this.FJValue.id)) {
+						this.$modal.msg("请选择房间")
+					} else {
+						let param = {
+							areaId: this.XQValue.id, // 小区id
+							buildingId: this.LDValue.id, // 楼宇id
+							unitId: this.DYValue.id, // 单元id
+							houseId: this.FJValue.id, // 房间id
+							enginCycle: this.projectValue.dictValue // 工程周期
+						}
+						getRoomProjectId(param).then(res => {
+
+							if (res.code == '200') {
+
+								if (res.data != null) {
+
+									getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(res => {
+
+										this.historyList = res.data
+										if (res.data.zEngineeringNodeBo != null) {
+											this.showHistoryList();
+										} else {
+											this.$modal.msg("暂无历史信息")
+										}
+
+									})
+
+								} else {
+									this.$modal.msg("暂无工程信息")
+								}
+							} else {
+								this.$modal.msg(res.msg)
+							}
+						})
+					}
+				},
+				showHistoryList() {
+					this.$refs.refShare.handleShowShare();
 				}
 
 			}

+ 29 - 0
pages/work/index.vue

@@ -173,11 +173,40 @@
 
 			NewProject(e) {
 				this.enginType = 'new_built'; //写死
+				this.enginClassification = e;
+				this.typeList = ''; //置空
+				console.log("新建",e)
+				if (e == 'indoor_engin') {
+					//新建室内
+					getDicts("new_built_indoor_engin").then(response => {
+				
+						this.typeList = response.data;
+					});
+				
+				} else if (e == 'courtyard') {
+					//新建庭院
+					getDicts("new_built_courtyard_engin").then(response => {
+						console.log("庭院", response.data)
+						this.typeList = response.data;
+				
+					});
+				} else if (e == 'overhead') {
+					//新建架空
+					getDicts("new_built_courtyard_engin").then(response => {
+						console.log("架空", response.data)
+						this.typeList = response.data;
+				
+				
+					});
+				}
+				
+				this.handleShowSheet();
 
 			},
 			OldProject(e) {
 				this.enginType = 'old_renovation'; //写死
 				this.enginClassification = e;
+				console.log("旧改",e)
 				this.typeList = ''; //置空
 				if (e == 'indoor_engin') {
 					//旧改室内