zhnghongrui 1 vuosi sitten
vanhempi
commit
a0fc3a0bb7
4 muutettua tiedostoa jossa 393 lisäystä ja 91 poistoa
  1. 23 0
      api/common.js
  2. 124 17
      pages/oldrenovation/indoor/tearOldPipe.vue
  3. 245 73
      pages/work/index.vue
  4. 1 1
      utils/request.js

+ 23 - 0
api/common.js

@@ -1,6 +1,29 @@
 import request from '@/utils/request'
 
 
+// 材质规格下拉
+export function getEnginSpecificationsList(materId) {
+	const data = {
+		materId
+	}
+	return request({
+		'url': '/zdsz/enginSpecifications/getEnginSpecificationsList',
+		'method': 'get',
+		'data': data
+	})
+}
+
+// 工程材质下拉
+export function getEnginMaterialQualityList(enginType) {
+	const data = {
+		enginType
+	}
+	return request({
+		'url': '/zdsz/enginMaterialQuality/getEnginMaterialQualityList',
+		'method': 'get',
+		'data': data
+	})
+}
 // 新增拆旧管
 export function addTearOldPipe(param) {
 	return request({

+ 124 - 17
pages/oldrenovation/indoor/tearOldPipe.vue

@@ -91,6 +91,7 @@
 				<view class="container">
 
 					<view class="title">是否按照施工图纸施工</view>
+					<span style="color: black;">{{this.form}}</span>
 					<switch style="transform: scale(0.6,0.6);" @change="switchChange" checked="isChick" />
 
 				</view>
@@ -104,7 +105,7 @@
 			</view>
 
 			<view class="background">
-				<view>
+				<view v-if="objValue.enginClassValue=='dismantling_old_pipe'">
 					<view class="uni-list">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							拆旧管
@@ -128,6 +129,49 @@
 						</view>
 					</view>
 				</view>
+				<view v-if="objValue.enginClassValue=='vertical_bar'">
+					<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>
+						</view>
+
+						<view class="container">
+
+							<view>
+								材 质
+							</view>
+							<view v-if="this.isEmpty(this.materialValue.id)" style="margin-top: 10;"
+								@click="pickerShow('cz')">
+								<span style="color: darkgray;">请选择材质</span>
+							</view>
+							<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz')">
+								<span style="color: black;">{{materialValue.name}}</span>
+							</view>
+						</view>
+						<view class="container">
+
+							<view>
+								规 格
+							</view>
+							<view v-if="this.isEmpty(this.specificationValue.id)" style="margin-top: 10;"
+								@click="pickerShow('gg')">
+								<span style="color: darkgray;">请选择规格</span>
+							</view>
+							<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg')">
+								<span style="color: black;">{{specificationValue.name}}</span>
+							</view>
+						</view>
+						<view class="container">
+
+							<text>数 量</text>
+							<input class="uni-input" type="number" v-model="number" placeholder="请填写数量"
+								style="margin-left: 10px;text-align: right;"></input>
+						</view>
+					</view>
+				</view>
 				<view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
 					<view class="container" style="color: gainsboro;">*请上传照片</view>
 					<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
@@ -173,6 +217,8 @@
 			getUnitList,
 			getHousesList,
 			addTearOldPipe,
+			getEnginMaterialQualityList,
+			getEnginSpecificationsList,
 		} from '@/api/common'
 		import {
 			getToken
@@ -191,6 +237,7 @@
 					},
 					type: '',
 					open: false,
+					objValue: '', //上一页面传过来的值  新增接口用
 					openDict: false,
 					selectList: [],
 					dictOptions: [],
@@ -203,30 +250,47 @@
 					DYValue: {},
 					FJValue: {},
 					FSValue: {},
+					specificationValue: {}, //规格
+					materialValue: {}, //材质
+					materialList: '', //材质list
 					XQList: '',
 					LDList: '',
 					DYList: '',
 					FJList: '',
 					progress: 0, //上传图片进度百分比
 					loading: false,
-					isCheck: true //是否按照施工图纸施工
-
+					isCheck: true, //是否按照施工图纸施工
+					number: '',
+					title: '',
 
 				}
 			},
 
 			created() {
 
+			},
+
+			onLoad(options) {
+				if ('params' in options) {
+					this.objValue = JSON.parse(decodeURIComponent(options.params));
+
+					if (this.objValue.enginType == `old_renovation` && this.objValue.enginClassification == 'indoor_engin') {
+						this.title = '旧改工程-室内'
+
+					} else {
+						this.title = '新建工程-室内'
+
+					}
+					uni.setNavigationBarTitle({
+						title: this.title
+					})
+				}
 
 
-			},
-			onLoad() {
-				uni.setNavigationBarTitle({
-					title: '旧改工程-室内'
-				})
 			},
 			methods: {
 				//判断是否选择
+
 				isEmpty(str) {
 
 					return (!str || 0 === str.length);
@@ -237,7 +301,7 @@
 						current: index,
 						urls: this.imgArr,
 					})
-					console.log('sss')
+
 				},
 				remove(index) {
 					uni.showModal({
@@ -396,7 +460,25 @@
 				},
 				pickerShow(e) {
 					this.type = e; //赋值类型
-					if (e == 'fsdj') {
+
+					if (e == 'cz') { //材质
+						this.open = true;
+						getEnginMaterialQualityList("0").then(response => {
+							console.log(response.data)
+							this.selectList = response.data;
+						});
+
+					} else if (e == 'gg') { //规格
+						if (this.isEmpty(this.materialValue.id)) {
+							this.$modal.msg('请选择材质')
+
+						} else {
+							this.open = true;
+							this.selectList = this.materialList;
+
+						}
+
+					} else if (e == 'fsdj') {
 						//腐蚀等级
 						this.openDict = true;
 						//腐蚀等级
@@ -490,7 +572,19 @@
 					// this.address = item.communityName;
 					this.open = false;
 
-					if (this.type == 'xq') {
+					if (this.type == 'cz') {
+						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') {
+						this.specificationValue = item;
+
+					} else if (this.type == 'xq') {
 						this.XQValue = item;
 						//根据小区id 获取楼栋数据
 						this.LDValue = ''; //重置楼栋数据
@@ -532,6 +626,7 @@
 				},
 				//提交数据
 				submit() {
+
 					if (this.isEmpty(this.projectValue.dictValue)) {
 						this.$modal.msg("请选择工程周期")
 					} else if (this.isEmpty(this.XZQValue.dictValue)) {
@@ -558,11 +653,11 @@
 							buildingId: this.LDValue.id,
 							unitId: this.DYValue.id,
 							houseId: this.FJValue.id,
-							enginType: 'old_renovation', //写死
-							enginClassification: 'indoor_engineering', //写死
+							enginType: this.objValue.enginType, //写死 上一页面传过来的 
+							enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
 							enginCycle: this.projectValue.dictValue, //工程周期
 							zEngineeringNodeBo: {
-								type: "dismantling_old_pipes",
+								type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
 								zEngineeringInfoBo: {
 									constructAccordingDrawings: this.isCheck, //是否按图纸施工
 									zEngiineeringPhotoBoList: this.imgArr, //照片集合
@@ -577,13 +672,14 @@
 
 						addTearOldPipe(param).then(res => {
 							if (res.code == '200') {
+								uni.navigateBack();
 								uni.showToast({
 									title: res.msg,
 									icon: 'none',
-									//显示持续时间为 2
+									//显示持续时间为 1
 									duration: 1000
-								})
-								uni.navigateBack();
+								});
+
 							}
 						})
 					}
@@ -623,4 +719,15 @@
 			margin-left: 20px;
 			height: 45px;
 		}
+
+		.number {
+			display: flex;
+			/* 水平居中显示子元素 */
+			align-items: flex-start;
+			/* 垂直居中显示子元素 */
+			justify-content: space-between;
+			/* 左右间距等于间距大小 */
+			padding: 10px;
+			/* 设置padding以提高视觉效果 */
+		}
 	</style>

+ 245 - 73
pages/work/index.vue

@@ -62,19 +62,20 @@
 					<view class="line1">
 						<view>旧改工程</view>
 					</view>
-					<view class="line2">
-						<view @click="Indoor(0)">室内</view>
-						<view @click="Courtyard(0)">庭院</view>
-						<view @click="Overhead(0)">架空</view>
+					<view class="line2" v-for="(item, index) in OldProjectList" :key="index">
+						<view @click="OldProject(item.dictValue)">{{item.dictLabel}}</view>
+						<!-- <view @click="Courtyard(0)">庭院</view>
+						<view @click="Overhead(0)">架空</view> -->
 
 					</view>
 					<view class="line1">
 						<view>新建工程</view>
 					</view>
-					<view class="line2">
-						<view @click="Indoor(1)">室内</view>
-						<view @click="Courtyard(1)">庭院</view>
-						<view @click="Overhead(1)">架空</view>
+					<view class="line2" v-for="(item, index) in NewProjectList" :key="index">
+						<view @click="NewProject(item.dictValue)">{{item.dictLabel}}</view>
+						<!-- <view @click="Courtyard(0)">庭院</view>
+						<view @click="Overhead(0)">架空</view> -->
+
 					</view>
 				</view>
 
@@ -86,16 +87,47 @@
 			</view>
 			<view v-if="showPopup" class="mask" @click="showMinYong"></view>
 		</view>
+
+
+		<view class="share">
+			<view :class="{'share-box': shareState}" @click="handleHiddenShare">
+			</view>
+			<view class="share-item" :class="{'share-show': shareState}">
+				<view class="share-to">
+					<text>请选择</text>
+				</view>
+				<view class="content">
+					<view class="block" v-for="(item, index) in typeList" :key="index" @click="showTypeSheet(item)">
+						<!-- <image :src="item.image" mode="aspectFill"></image> -->
+						<text>{{item.dictLabel}}</text>
+					</view>
+				</view>
+				<view class="cancel" @click.stop="handleHiddenShare">
+					<text>取消</text>
+				</view>
+			</view>
+		</view>
 	</view>
 	</view>
 </template>
 
 <script>
+	import {
+		getDicts
+	} from "@/api/system/dict/data";
 	export default {
+
 		data() {
 			return {
 				showPopup: false,
-
+				shareState: false,
+				array: [],
+				OldProjectList: '', //旧改工程
+				NewProjectList: '', //民用工程
+				typeList: '', //二次弹窗数据
+				enginType: '',
+				enginClassification: '', // 旧改节点 数据字典
+				enginClassValue: '', //二次节点  数据字典
 				current: 0,
 				swiperDotIndex: 0,
 				data: [{
@@ -111,6 +143,14 @@
 			}
 		},
 		methods: {
+			// 显示二次弹窗
+			handleShowSheet() {
+				this.shareState = true;
+			},
+			// 隐藏二次弹窗
+			handleHiddenShare() {
+				this.shareState = false;
+			},
 			clickBannerItem(item) {
 				console.info(item)
 			},
@@ -121,78 +161,112 @@
 				this.$modal.showToast('模块建设中~')
 			},
 			showMinYong() {
+				getDicts("old_renovation").then(response => {
+					console.log("旧改", response.data)
+					this.OldProjectList = response.data;
+				});
+				getDicts("new_built").then(response => {
+					this.NewProjectList = response.data;
+					console.log("新建", response.data)
+				});
 				this.showPopup = !this.showPopup;
 
 			},
-			//室内
-			Indoor(e) {
-				if (e == 0) {
-					//旧改
-					this.showTypeSheet(0);
-				} else if (e == 1) {
-					//新建
-					this.showTypeSheet(1);
-				}
-			},
-			//庭院
-			Courtyard(e) {
-				if (e === 0) {
-
-					this.showTypeSheet(0);
-					//旧改
-				} else if (e == 1) {
-					//新建
-					this.showTypeSheet(1);
-				}
+
+			NewProject(e) {
+				this.enginType = 'new_built'; //写死
+
 			},
-			//架空
-			Overhead(e) {
-				if (e == 0) {
-					//旧改
-					this.showTypeSheet(0);
-				} else if (e == 1) {
-					//新建
-					this.showTypeSheet(1);
+			OldProject(e) {
+				this.enginType = 'old_renovation'; //写死
+				this.enginClassification = e;
+				this.typeList = ''; //置空
+				if (e == 'indoor_engin') {
+					//旧改室内
+					getDicts("old_renovation_indoor_engin").then(response => {
+
+						this.typeList = response.data;
+					});
+
+				} else if (e == 'courtyard') {
+					//旧改庭院
+					getDicts("old_renovation_courtyard_engin").then(response => {
+						console.log("庭院", response.data)
+						this.typeList = response.data;
+
+					});
+				} else if (e == 'overhead') {
+					//旧改架空
+					getDicts("old_renovation_overhead").then(response => {
+						console.log("架空", response.data)
+						this.typeList = response.data;
+
+
+					});
 				}
 
+				this.handleShowSheet();
 			},
-			//二次弹窗 选择类型
-			showTypeSheet(e) {
-				uni.showActionSheet({
-					itemList: ['拆旧管', '立杠', '挂表', '表后管', '阀管'],
-					success: (res) => {
-						console.log('选择了第' + (res.tapIndex + 1) + '个选项');
-						if (e == 0 && res.tapIndex == 0) {
-							uni.navigateTo({
-								url: '/pages/oldrenovation/indoor/tearOldPipe'
-							})
-						}
-						if (e == 0 && res.tapIndex == 1) {
-							uni.navigateTo({
-								url: '/pages/oldrenovation/indoor/verticalBar'
-							})
-						}
-						if (e == 0 && res.tapIndex == 2) {
-							uni.navigateTo({
-								url: '/pages/oldrenovation/indoor/putUpWatch'
-							})
-						}
-						if (e == 0 && res.tapIndex == 3) {
-							uni.navigateTo({
-								url: '/pages/oldrenovation/indoor/watchAfterPipe'
-							})
-						}
-						if (e == 0 && res.tapIndex == 4) {
-							uni.navigateTo({
-								url: '/pages/oldrenovation/indoor/valveTube'
-							})
-						}
 
-					},
-					fail: (err) => {
-						console.log('弹窗取消');
-					}
-				});
+
+
+
+
+
+			//二次弹窗 选择类型
+			showTypeSheet(item) {
+				this.showPopup = !this.showPopup; //隐藏第一次痰喘
+				console.log(item)
+				this.enginClassValue = item.dictValue; //二次节点赋值
+				const obj = {
+					enginClassValue: this.enginClassValue, //(拆旧管等 字典值)
+					enginType: this.enginType, //旧改 还是新建  写死
+					enginClassification: this.enginClassification //室内  庭院  架空
+
+				};
+
+				//拆旧管
+				this.handleHiddenShare();
+				uni.navigateTo({
+					url: '/pages/oldrenovation/indoor/tearOldPipe?params=' + encodeURIComponent(JSON.stringify(
+						obj))
+				})
+
+				// uni.showActionSheet({
+				// 	itemList: ['拆旧管', '立杠', '挂表', '表后管', '阀管'],
+				// 	success: (res) => {
+				// 		console.log('选择了第' + (res.tapIndex + 1) + '个选项');
+				// 		if (e == 0 && res.tapIndex == 0) {
+				// 			uni.navigateTo({
+				// 				url: '/pages/oldrenovation/indoor/tearOldPipe?description=OldIndoor&form=Pipe'
+				// 			})
+				// 		}
+				// 		if (e == 0 && res.tapIndex == 1) {
+				// 			uni.navigateTo({
+				// 				url: '/pages/oldrenovation/indoor/tearOldPipe?description=OldIndoor&form=verticalBar'
+				// 			})
+				// 		}
+				// 		if (e == 0 && res.tapIndex == 2) {
+				// 			uni.navigateTo({
+				// 				url: '/pages/oldrenovation/indoor/putUpWatch'
+				// 			})
+				// 		}
+				// 		if (e == 0 && res.tapIndex == 3) {
+				// 			uni.navigateTo({
+				// 				url: '/pages/oldrenovation/indoor/watchAfterPipe'
+				// 			})
+				// 		}
+				// 		if (e == 0 && res.tapIndex == 4) {
+				// 			uni.navigateTo({
+				// 				url: '/pages/oldrenovation/indoor/valveTube'
+				// 			})
+				// 		}
+
+				// 	},
+				// 	fail: (err) => {
+				// 		console.log('弹窗取消');
+				// 	}
+				// });
 
 			}
 		}
@@ -341,4 +415,102 @@
 		}
 
 	}
+
+	.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;
+	}
+
+	// 离开分享动画
+	.share-item {
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		height: auto;
+		background-color: #FFFFFF;
+		transition: all 0.3s ease;
+		transform: translateY(100%);
+		z-index: 1999;
+
+		.share-to {
+			width: 100%;
+			height: 3rem;
+			display: flex;
+			justify-content: center;
+			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: 50%;
+			display: flex;
+			flex-wrap: wrap;
+
+			.block {
+				width: 100%;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				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 - 1
utils/request.js

@@ -35,7 +35,7 @@ const request = config => {
           reject('后端接口连接异常')
           return
         }
-		console.log("dddd",res)
+		//console.log("dddd",res)
         const code = res.data.code || 200
         const msg = errorCode[code] || res.data.msg || errorCode['default']
         if (code === 401) {