Explorar o código

拆旧管、立杠、挂表、表后管、阀管新增接口调用

zhnghongrui hai 1 ano
pai
achega
8e329845b6
Modificáronse 2 ficheiros con 397 adicións e 38 borrados
  1. 397 36
      pages/oldrenovation/indoor/tearOldPipe.vue
  2. 0 2
      pages/work/index.vue

+ 397 - 36
pages/oldrenovation/indoor/tearOldPipe.vue

@@ -103,7 +103,7 @@
 				<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
 					titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
 			</view>
-
+			<!--拆旧管-->
 			<view class="background">
 				<view v-if="objValue.enginClassValue=='dismantling_old_pipe'">
 					<view class="uni-list">
@@ -129,7 +129,8 @@
 						</view>
 					</view>
 				</view>
-				<view v-if="objValue.enginClassValue=='vertical_bar'">
+				<!--立杠-->
+				<view v-else-if="objValue.enginClassValue=='vertical_bar'">
 					<view class="uni-list" style="margin-bottom: 20px;">
 						<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
 							立杠
@@ -167,8 +168,153 @@
 						<view class="container">
 
 							<text>数 量</text>
-							<input class="uni-input" type="number" v-model="number" placeholder="请填写数量"
-								style="margin-left: 10px;text-align: right;"></input>
+							<input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
+								maxlength="11" style="margin-left: 10px;text-align: right;"></input>
+						</view>
+					</view>
+				</view>
+				<!--挂表-->
+				<view v-else-if="objValue.enginClassValue=='pocket_watch'">
+					<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.brandValue.dictValue)" style="margin-top: 10;"
+								@click="pickerShow('brand')">
+								<span style="color: darkgray;">请选择品牌</span>
+							</view>
+							<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('brand')">
+								<span style="color: black;">{{brandValue.dictLabel}}</span>
+							</view>
+						</view>
+
+						<view class="container">
+
+							<text>数 量</text>
+							<input class="uni-input" type="number" v-model="inputNumberValue" placeholder="请填写数量"
+								maxlength="11" style="margin-left: 10px;text-align: right;"></input>
+						</view>
+					</view>
+				</view>
+				<!--表后管-->
+				<view v-else-if="objValue.enginClassValue=='posterior_tube'">
+					<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="inputNumberValue" placeholder="请填写数量"
+								maxlength="11" style="margin-left: 10px;text-align: right;"></input>
+						</view>
+					</view>
+				</view>
+				<!--阀管-->
+				<view v-else-if="objValue.enginClassValue=='valve_tube'">
+					<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.doorValue.dictValue)" style="margin-top: 10;"
+								@click="pickerShow('door')">
+								<span style="color: darkgray;">请选择上门类型</span>
+							</view>
+							<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('door')">
+								<span style="color: black;">{{doorValue.dictLabel}}</span>
+							</view>
+						</view>
+						<view class="container">
+
+							<view>
+								自闭阀类型
+							</view>
+							<view v-if="this.isEmpty(this.SelfClosValve.dictValue)" style="margin-top: 10;"
+								@click="pickerShow('zbf')">
+								<span style="color: darkgray;">请选择自闭阀类型</span>
+							</view>
+							<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('zbf')">
+								<span style="color: black;">{{SelfClosValve.dictLabel}}</span>
+							</view>
+						</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="inputNumberValue" placeholder="请填写数量"
+								maxlength="11" style="margin-left: 10px;text-align: right;"></input>
 						</view>
 					</view>
 				</view>
@@ -252,6 +398,9 @@
 					FSValue: {},
 					specificationValue: {}, //规格
 					materialValue: {}, //材质
+					brandValue: {}, //品牌
+					doorValue: {}, //上门类型
+					SelfClosValve: {}, //自闭阀类型
 					materialList: '', //材质list
 					XQList: '',
 					LDList: '',
@@ -260,7 +409,7 @@
 					progress: 0, //上传图片进度百分比
 					loading: false,
 					isCheck: true, //是否按照施工图纸施工
-					number: '',
+					inputNumberValue: '',
 					title: '',
 
 				}
@@ -426,13 +575,13 @@
 											console.log('_this.progress', _this.progress)
 											_this.imgArr.push(data.data.url)
 											console.log('imgArr', _this.imgArr)
-											_this.$UTILS.showPrompt('上传成功!')
+											_this.$modal.msg('上传成功!')
 											_this.photo = false;
 										}
 									}
 								},
 								fail: e => {
-									_this.$UTILS.showPrompt('上传失败!')
+									_this.$modal.msg('上传失败!')
 									this.uploadError(index, e);
 								},
 								complete: res => {
@@ -460,11 +609,25 @@
 				},
 				pickerShow(e) {
 					this.type = e; //赋值类型
+					if (e == 'door') { //上门类型
+						this.openDict = true;
+						getDicts("visit_type").then(response => {
+							this.dictOptions = response.data;
+						});
+					} else if (e == 'zbf') { //自闭阀类型
+						this.openDict = true;
+						getDicts("self_closing_valve_type").then(response => {
+							this.dictOptions = response.data;
+						});
+					} else if (e == 'brand') { //品牌
+						this.openDict = true;
+						getDicts("brand").then(response => {
+							this.dictOptions = response.data;
+						});
 
-					if (e == 'cz') { //材质
+					} else if (e == 'cz') { //材质
 						this.open = true;
 						getEnginMaterialQualityList("0").then(response => {
-							console.log(response.data)
 							this.selectList = response.data;
 						});
 
@@ -483,7 +646,6 @@
 						this.openDict = true;
 						//腐蚀等级
 						getDicts("corrosion_level").then(response => {
-							console.log(response)
 							this.dictOptions = response.data;
 						});
 
@@ -549,7 +711,16 @@
 				},
 				changeSelectDict(item, index) {
 					this.openDict = false;
-					if (this.type == 'gczq') {
+					if (this.type == 'door') {
+						this.doorValue = item
+
+					} else if (this.type == 'zbf') {
+						this.SelfClosValve = item
+
+					} else if (this.type == 'brand') {
+						this.brandValue = item
+
+					} else if (this.type == 'gczq') {
 						this.projectValue = item
 
 					} else if (this.type == 'xzq') {
@@ -639,50 +810,240 @@
 						this.$modal.msg("请选择单元")
 					} else if (this.isEmpty(this.FJValue.id)) {
 						this.$modal.msg("请选择房间")
-					} else if (this.isEmpty(this.LevelValue.dictValue)) {
-						this.$modal.msg("请选择腐蚀等级")
-					} else if (this.imgArr.length <= 0) {
-						this.$modal.msg('请上传照片')
+					} else if (this.objValue.enginClassValue == 'dismantling_old_pipe') {
+
+						if (this.isEmpty(this.LevelValue.dictValue)) {
+							this.$modal.msg("请选择腐蚀等级") //拆旧管  判断腐蚀等级
+						} else {
+							this.onsubmit();
+						}
+					} else if (this.objValue.enginClassValue == 'vertical_bar') {
+						//立杠  判断  材质  规格  数量
+						if (this.isEmpty(this.materialValue.id)) {
+							this.$modal.msg("请选择材质")
+						} else if (this.isEmpty(this.specificationValue.id)) {
+							this.$modal.msg("请选择规格")
+						} else if (this.isEmpty(this.inputNumberValue)) {
+							this.$modal.msg("请输入数量")
+						} else {
+							this.onsubmit();
+						}
+					} else if (this.objValue.enginClassValue == 'pocket_watch') {
+						//挂表  判断  品牌  数量
+						if (this.isEmpty(this.brandValue.dictValue)) {
+							this.$modal.msg("请选择品牌")
+						} else if (this.isEmpty(this.inputNumberValue)) {
+							this.$modal.msg("请输入数量")
+						} else {
+							this.onsubmit();
+						}
+
+					} else if (this.objValue.enginClassValue == 'posterior_tube') {
+						//表后管  判断  材质  规格  数量 (为必须有一张照片和一个视频)
+						if (this.isEmpty(this.materialValue.id)) {
+							this.$modal.msg("请选择材质")
+						} else if (this.isEmpty(this.specificationValue.id)) {
+							this.$modal.msg("请选择规格")
+						} else if (this.isEmpty(this.inputNumberValue)) {
+							this.$modal.msg("请输入数量")
+						} else if (this.imgArr.length <= 0) {
+							this.$modal.msg('请上传照片或视频')
+						} else if (this.loading == false) {
+							this.$modal.msg('照片或视频未上传完毕,无法提交!')
+						} else {
+							const hasImage = this.imgArr.some(item => item.endsWith('.jpg') || item.endsWith('.png') || item
+								.endsWith('.jpeg'));
+							const hasVideo = this.imgArr.some(item => item.endsWith('.mp4') || item.endsWith('.avi') || item
+								.endsWith('.mov'));
+
+							if (hasImage && hasVideo) {
+								//表后管  特殊  提交
+								let param = {
+									district: this.XZQValue.dictValue,
+									areaId: this.XQValue.id,
+									buildingId: this.LDValue.id,
+									unitId: this.DYValue.id,
+									houseId: this.FJValue.id,
+									enginType: this.objValue.enginType, //写死 上一页面传过来的 
+									enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
+									enginCycle: this.projectValue.dictValue, //工程周期
+									zEngineeringNodeBo: {
+										type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
+										zEngineeringInfoBo: {
+											constructAccordingDrawings: this.isCheck, //是否按图纸施工
+											zEngiineeringPhotoBoList: this.imgArr, //照片集合
+
+											zEngineeringMaterialBo: [{
+												materialQuality: this.materialValue.dictValue, //材质
+												specifications: this.specificationValue.id, //规格
+												number: this.inputNumberValue //数量
+											}]
+										}
+									}
+
+								}
+								addTearOldPipe(param).then(res => {
+									if (res.code == '200') {
+
+										uni.showToast({
+											title: res.msg,
+											icon: 'none',
+											//显示持续时间为 1秒
+											duration: 1000
+										});
+										uni.navigateBack();
+									}
+								})
+							} else {
+								this.$modal.msg('请至少上传一张照片和一个视频')
+							}
+						}
+					} else if (this.objValue.enginClassValue == 'valve_tube') {
+						//阀管  判断  材质  规格  数量
+						if (this.isEmpty(this.doorValue.dictValue)) {
+							this.$modal.msg("请选择上门类型")
+						} else if (this.isEmpty(this.SelfClosValve.dictValue)) {
+							this.$modal.msg("请选择自闭阀类型")
+						} else if (this.isEmpty(this.materialValue.id)) {
+							this.$modal.msg("请选择材质")
+						} else if (this.isEmpty(this.specificationValue.id)) {
+							this.$modal.msg("请选择规格")
+						} else if (this.isEmpty(this.inputNumberValue)) {
+							this.$modal.msg("请输入数量")
+						} else {
+							this.onsubmit();
+						}
+					}
+				},
+
+
+				onsubmit() {
+
+					if (this.imgArr.length <= 0) {
+						this.$modal.msg('请上传照片或视频')
 					} else if (this.loading == false) {
-						this.$modal.msg('照片未上传完毕,无法提交!')
+						this.$modal.msg('照片或视频未上传完毕,无法提交!')
 					} else {
 						//提交
-						let param = {
-							district: this.XZQValue.dictValue,
-							areaId: this.XQValue.id,
-							buildingId: this.LDValue.id,
-							unitId: this.DYValue.id,
-							houseId: this.FJValue.id,
-							enginType: this.objValue.enginType, //写死 上一页面传过来的 
-							enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
-							enginCycle: this.projectValue.dictValue, //工程周期
-							zEngineeringNodeBo: {
-								type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
-								zEngineeringInfoBo: {
-									constructAccordingDrawings: this.isCheck, //是否按图纸施工
-									zEngiineeringPhotoBoList: this.imgArr, //照片集合
-									zEngineeringMaterialBo: [{
-										corrosionLevel: this.LevelValue.dictValue
-									}]
+						let param = ';'
+						if (this.objValue.enginClassValue == 'dismantling_old_pipe') { //拆旧管
+							param = {
+								district: this.XZQValue.dictValue,
+								areaId: this.XQValue.id,
+								buildingId: this.LDValue.id,
+								unitId: this.DYValue.id,
+								houseId: this.FJValue.id,
+								enginType: this.objValue.enginType, //写死 上一页面传过来的 
+								enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
+								enginCycle: this.projectValue.dictValue, //工程周期
+								zEngineeringNodeBo: {
+									type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
+									zEngineeringInfoBo: {
+										constructAccordingDrawings: this.isCheck, //是否按图纸施工
+										zEngiineeringPhotoBoList: this.imgArr, //照片集合
+
+										zEngineeringMaterialBo: [{
+											corrosionLevel: this.LevelValue.id //腐蚀等级
+										}]
+									}
 								}
+
 							}
+							//this.onsubmit(param)
+						} else if (this.objValue.enginClassValue == 'vertical_bar') { //立杠
+							param = {
+								district: this.XZQValue.dictValue,
+								areaId: this.XQValue.id,
+								buildingId: this.LDValue.id,
+								unitId: this.DYValue.id,
+								houseId: this.FJValue.id,
+								enginType: this.objValue.enginType, //写死 上一页面传过来的 
+								enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
+								enginCycle: this.projectValue.dictValue, //工程周期
+								zEngineeringNodeBo: {
+									type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
+									zEngineeringInfoBo: {
+										constructAccordingDrawings: this.isCheck, //是否按图纸施工
+										zEngiineeringPhotoBoList: this.imgArr, //照片集合
+
+										zEngineeringMaterialBo: [{
+											materialQuality: this.materialValue.dictValue, //材质
+											specifications: this.specificationValue.id, //规格
+											number: this.inputNumberValue //数量
+										}]
+									}
+								}
 
-						}
+							}
 
 
+						} else if (this.objValue.enginClassValue == 'pocket_watch') { //挂表
+							param = {
+								district: this.XZQValue.dictValue,
+								areaId: this.XQValue.id,
+								buildingId: this.LDValue.id,
+								unitId: this.DYValue.id,
+								houseId: this.FJValue.id,
+								enginType: this.objValue.enginType, //写死 上一页面传过来的 
+								enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
+								enginCycle: this.projectValue.dictValue, //工程周期
+								zEngineeringNodeBo: {
+									type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
+									zEngineeringInfoBo: {
+										constructAccordingDrawings: this.isCheck, //是否按图纸施工
+										zEngiineeringPhotoBoList: this.imgArr, //照片集合
+
+										zEngineeringMaterialBo: [{
+											brand: this.brandValue.dictValue, //品牌
+											number: this.inputNumberValue //数量
+										}]
+									}
+								}
+
+							}
+						} else if (this.objValue.enginClassValue == 'valve_tube') { //自闭阀
+							param = {
+								district: this.XZQValue.dictValue,
+								areaId: this.XQValue.id,
+								buildingId: this.LDValue.id,
+								unitId: this.DYValue.id,
+								houseId: this.FJValue.id,
+								enginType: this.objValue.enginType, //写死 上一页面传过来的 
+								enginClassification: this.objValue.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
+								enginCycle: this.projectValue.dictValue, //工程周期
+								zEngineeringNodeBo: {
+									type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
+									zEngineeringInfoBo: {
+										constructAccordingDrawings: this.isCheck, //是否按图纸施工
+										zEngiineeringPhotoBoList: this.imgArr, //照片集合
+
+										zEngineeringMaterialBo: [{
+											visitType: this.doorValue.dictValue, //上门类型
+											selfClosingValveType: this.SelfClosValve.dictValue, //自闭阀类型
+											materialQuality: this.materialValue.dictValue, //材质
+											specifications: this.specificationValue.id, //规格
+											number: this.inputNumberValue //数量
+										}]
+									}
+								}
+
+							}
+						}
+
 						addTearOldPipe(param).then(res => {
 							if (res.code == '200') {
-								uni.navigateBack();
+
 								uni.showToast({
 									title: res.msg,
 									icon: 'none',
 									//显示持续时间为 1秒
 									duration: 1000
 								});
-
+								uni.navigateBack();
 							}
 						})
 					}
+
 				}
 
 			}

+ 0 - 2
pages/work/index.vue

@@ -162,12 +162,10 @@
 			},
 			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;