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

材质规格暂存不判断

zhanghongrui 9 місяців тому
батько
коміт
ed2be3b3ab

+ 25 - 20
pages/oldrenovation/courtyard/courtyard.vue

@@ -792,33 +792,34 @@
 
 
 
+					if (e == 'submit') {
 
-
-					try {
-						this.czggslList.forEach((list) => {
-							if (this.isEmpty(list.cz.id)) {
-								this.$modal.msg('材质不能为空')
+						try {
+							this.czggslList.forEach((list) => {
+								if (this.isEmpty(list.cz.id)) {
+									this.$modal.msg('材质不能为空')
 
 
-								throw new Error('End Loop')
+									throw new Error('End Loop')
 
-							}
-							if (this.isEmpty(list.gg.id)) {
-								this.$modal.msg('规格不能为空')
-								throw new Error('End Loop')
+								}
+								if (this.isEmpty(list.gg.id)) {
+									this.$modal.msg('规格不能为空')
+									throw new Error('End Loop')
 
-							}
-							if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
-								this.$modal.msg("请输入米数")
-								throw new Error('End Loop')
-							}
+								}
+								if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
+									this.$modal.msg("请输入米数")
+									throw new Error('End Loop')
+								}
 
 
 
 
-						})
-					} catch (e) {
-						if (e.message === 'End Loop') throw e
+							})
+						} catch (e) {
+							if (e.message === 'End Loop') throw e
+						}
 					}
 					this.zEngineeringMaterialBo = [];
 					this.czggslList.forEach((list) => {
@@ -830,6 +831,7 @@
 						})
 					})
 
+					console.log("====", this.zEngineeringMaterialBo)
 					// if (this.imgPipelineArr.length <= 0) {
 					// 	this.$modal.msg('请上传管道施工记录照片')
 					// 	return
@@ -979,6 +981,7 @@
 												this.zEngineeringMaterialBo = dataJson.zEngineeringMaterialBo;
 
 												this.zEngineeringMaterialBo.forEach((item) => {
+													
 													this.czggslList.push({
 														cz: {
 															id: item.materialQuality,
@@ -990,8 +993,8 @@
 														},
 
 														sl: {
-															inputIntegerNumberValue: this.getIntegerPart(item.number, 0),
-															inputDecimalNumberValue: this.getIntegerPart(item.number, 1)
+															inputIntegerNumberValue: this.isEmpty(item.number) ? '' : this.getIntegerPart(item.number, 0),
+															inputDecimalNumberValue: this.isEmpty(item.number) ? '' : this.getIntegerPart(item.number, 1)
 														}
 													})
 												})
@@ -1061,6 +1064,8 @@
 				showHistoryList() {
 					this.$refs.refShare.handleShowShare();
 				}
+
+
 			}
 		}
 	</script>

+ 95 - 66
pages/oldrenovation/indoor/indoor.vue

@@ -1213,6 +1213,10 @@
 						return
 					}
 
+					if (this.currentResidentsPhoe.length <= 0) {
+						this.$modal.msg('现住人电话不能为空');
+						return
+					}
 					try {
 						this.currentResidentsPhoe.forEach((list) => {
 							if (this.isEmpty(list.phone)) {
@@ -1235,10 +1239,14 @@
 					this.FJValue.newPhone = this.currentResidentsPhoe.map(item => item.phone).join();
 					uni.setStorageSync("FJValue", this.FJValue)
 					if (this.objValue.enginClassValue == '报警器' || this.objValue.enginClassValue == '切断阀') {
-						if (this.isEmpty(this.brandValue.id)) {
-							this.$modal.msg("请选择厂家")
+						if (e == 'submit') {
+							if (this.isEmpty(this.brandValue.id)) {
+								this.$modal.msg("请选择厂家")
+							} else {
+								this.onsubmit(e);
+							}
 						} else {
-							this.onsubmit(e);
+							this.onsubmit(e); //暂存
 						}
 
 					} else if (this.objValue.enginClassValue == '打孔') {
@@ -1248,57 +1256,59 @@
 						this.onsubmit(e);
 						//}
 					} else if (this.objValue.enginClassValue == '拆旧管') {
+						if (e == 'submit') {
+							if (this.isEmpty(this.LevelValue.id)) {
+								this.$modal.msg("请选择腐蚀等级") //拆旧管  判断腐蚀等级
 
-						if (this.currentResidentsPhoe.length == 0) {
-							this.$modal.msg('现住人电话不能为空')
-						} else if (this.isEmpty(this.LevelValue.id)) {
-							this.$modal.msg("请选择腐蚀等级") //拆旧管  判断腐蚀等级
+							} else {
+								this.onsubmit(e);
+							}
 						} else {
-							this.onsubmit(e);
+							this.onsubmit(e); //暂存
 						}
 					} else if (this.objValue.enginClassValue == '立杠') {
 						//立杠  判断  材质  规格  米数
-						if (this.isEmpty(this.materialValue.id)) {
-							this.$modal.msg("请选择材质")
-						} else if (this.isEmpty(this.specificationValue.id)) {
-							this.$modal.msg("请选择规格")
-						} else if (this.isEmpty(this.inputIntegerNumberValue)) {
-							this.$modal.msg("请输入米数")
-						} else {
-
-							if (this.isEmpty(this.inputDecimalNumberValue)) {
-								this.inputNumberValue = this.inputIntegerNumberValue;
+						if (e == 'submit') {
+							if (this.isEmpty(this.materialValue.id)) {
+								this.$modal.msg("请选择材质")
+							} else if (this.isEmpty(this.specificationValue.id)) {
+								this.$modal.msg("请选择规格")
+							} else if (this.isEmpty(this.inputIntegerNumberValue)) {
+								this.$modal.msg("请输入米数")
 							} else {
-								this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
+
+								if (this.isEmpty(this.inputDecimalNumberValue)) {
+									this.inputNumberValue = this.inputIntegerNumberValue;
+								} else {
+									this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
+								}
+								this.onsubmit(e);
 							}
-							this.onsubmit(e);
+						} else {
+							this.onsubmit(e); //暂存
 						}
 					} else if (this.objValue.enginClassValue == '挂表') {
 						//挂表  判断  品牌
-						if (this.isEmpty(this.brandValue.id)) {
-							this.$modal.msg("请选择品牌")
+						if (e == 'submit') {
+							if (this.isEmpty(this.brandValue.id)) {
+								this.$modal.msg("请选择品牌")
+							} else {
+								this.onsubmit(e);
+							}
 						} else {
 							this.onsubmit(e);
 						}
 
 					} else if (this.objValue.enginClassValue == '表后管') {
 						//表后管  判断  材质  规格  米数 (为必须有一张照片和一个视频)
-						if (this.isEmpty(this.materialValue.id)) {
-							this.$modal.msg("请选择材质")
-						} else if (this.isEmpty(this.specificationValue.id)) {
-							this.$modal.msg("请选择规格")
-						} else if (this.isEmpty(this.inputIntegerNumberValue)) {
-							this.$modal.msg("请输入米数")
-						}
-						// else if (this.imgArr.length <= 0) {
-						// 	this.$modal.msg('请上传照片或视频')
-						// }
-						// else if (this.loading == false) {
-						// 	this.$modal.msg('照片或视频未上传完毕,无法提交!')
-						// }
-						else {
-							if (e == 'submit') {
-
+						if (e == 'submit') {
+							if (this.isEmpty(this.materialValue.id)) {
+								this.$modal.msg("请选择材质")
+							} else if (this.isEmpty(this.specificationValue.id)) {
+								this.$modal.msg("请选择规格")
+							} else if (this.isEmpty(this.inputIntegerNumberValue)) {
+								this.$modal.msg("请输入米数")
+							} else {
 								const hasImage = this.imgArr.some(item => item.endsWith('.jpg') || item.endsWith(
 										'.png') || item
 									.endsWith('.jpeg') || item.endsWith('.JPG') || item.endsWith('.PNG') || item
@@ -1313,34 +1323,35 @@
 								} else {
 									this.$modal.msg('请至少上传一张照片和一个视频')
 								}
-							} else {
-
-								//暂存
-								this.againSubmitBHG();
 							}
+						} else {
+
+							//暂存
+							this.againSubmitBHG();
+
 						}
 					} else if (this.objValue.enginClassValue == '阀管') {
 						//阀管  判断  材质  规格  米数
-						if (this.isEmpty(this.doorValue.dictValue)) {
-							this.$modal.msg("请选择上门类型")
-						} else if (this.isEmpty(this.SelfClosValve.id)) {
-							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.inputIntegerNumberValue)) {
-						// 	this.$modal.msg("请输入米数")
-						// }
-						else {
-
-							if (this.isEmpty(this.inputDecimalNumberValue)) {
-								this.inputNumberValue = this.inputIntegerNumberValue;
+						if (e == 'submit') {
+							if (this.isEmpty(this.doorValue.dictValue)) {
+								this.$modal.msg("请选择上门类型")
+							} else if (this.isEmpty(this.SelfClosValve.id)) {
+								this.$modal.msg("请选择自闭阀厂家")
+							} else if (this.isEmpty(this.materialValue.id)) {
+								this.$modal.msg("请选择灶具管厂家")
+							} else if (this.isEmpty(this.specificationValue.id)) {
+								this.$modal.msg("请选择规格")
 							} else {
-								this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
+
+								if (this.isEmpty(this.inputDecimalNumberValue)) {
+									this.inputNumberValue = this.inputIntegerNumberValue;
+								} else {
+									this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
+								}
+								this.onsubmit(e);
 							}
-							this.onsubmit(e);
+						} else {
+							this.onsubmit(e); //暂存
 						}
 					}
 				},
@@ -1551,7 +1562,10 @@
 
 						}
 					} else if (this.objValue.enginClassValue == '阀管') { //自闭阀
-						var onlyNumbers = this.specificationValue.name.replace(/[^\d.]/g, '');
+						if (!this.isEmpty(this.specificationValue.name)) {
+							var onlyNumbers = this.specificationValue.name.replace(/[^\d.]/g, '');
+						}
+
 
 						param = {
 							district: this.XZQValue.dictValue,
@@ -1692,6 +1706,12 @@
 												.enginClassValue == '表后管') {
 												this.materialValue.id = dataJson.zEngineeringMaterialBo[0].materialQuality;
 
+												if (!this.isEmpty(this.materialValue.id) && this.materialValue.id != null) {
+													//根据材质ID 获取规格数据
+													getEnginSpecificationsList(this.materialValue.id).then(res => {
+														this.materialList = res.data
+													})
+												}
 												this.specificationValue.id = dataJson
 													.zEngineeringMaterialBo[0]
 													.specifications;
@@ -1699,11 +1719,14 @@
 													.materialQualityName;
 												this.specificationValue.name = dataJson
 													.zEngineeringMaterialBo[0].specificationsName;
-												this.inputIntegerNumberValue = this.getIntegerPart(
-													dataJson
-													.zEngineeringMaterialBo[0].number, 0);
-												this.inputDecimalNumberValue = this.getIntegerPart(dataJson
-													.zEngineeringMaterialBo[0].number, 1);
+												if (dataJson.zEngineeringMaterialBo[0].number != null) {
+													this.inputIntegerNumberValue = this.getIntegerPart(
+														dataJson
+														.zEngineeringMaterialBo[0].number, 0);
+													this.inputDecimalNumberValue = this.getIntegerPart(dataJson
+														.zEngineeringMaterialBo[0].number, 1);
+												}
+
 											} else if (this.objValue.enginClassValue == '报警器' || this.objValue
 												.enginClassValue == '切断阀' || this.objValue
 												.enginClassValue == '挂表') {
@@ -1730,6 +1753,12 @@
 												this.materialValue.id = dataJson
 													.zEngineeringMaterialBo[0]
 													.materialQuality;
+												if (!this.isEmpty(this.materialValue.id) && this.materialValue.id != null) {
+													//根据材质ID 获取规格数据
+													getEnginSpecificationsList(this.materialValue.id).then(res => {
+														this.materialList = res.data
+													})
+												}
 												this.specificationValue.id = dataJson
 													.zEngineeringMaterialBo[0]
 													.specifications;

+ 19 - 19
pages/oldrenovation/overhead/newoverhead.vue

@@ -731,33 +731,33 @@
 						this.$modal.msg("请选择楼栋")
 					}
 
+					if (e == 'submit') {
+						try {
+							this.czggslList.forEach((list) => {
+								if (this.isEmpty(list.cz.id)) {
+									this.$modal.msg('材质不能为空')
 
-					try {
-						this.czggslList.forEach((list) => {
-							if (this.isEmpty(list.cz.id)) {
-								this.$modal.msg('材质不能为空')
 
+									throw new Error('End Loop')
 
-								throw new Error('End Loop')
+								}
+								if (this.isEmpty(list.gg.id)) {
+									this.$modal.msg('规格不能为空')
+									throw new Error('End Loop')
 
-							}
-							if (this.isEmpty(list.gg.id)) {
-								this.$modal.msg('规格不能为空')
-								throw new Error('End Loop')
+								}
+								if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
+									this.$modal.msg("请输入米数")
+									throw new Error('End Loop')
+								}
 
-							}
-							if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
-								this.$modal.msg("请输入米数")
-								throw new Error('End Loop')
-							}
 
 
+							})
+						} catch (e) {
+							if (e.message === 'End Loop') throw e
+						}
 
-						})
-					} catch (e) {
-						if (e.message === 'End Loop') throw e
-					}
-					if (e == 'submit') {
 						if (this.imgArr.length <= 0) {
 							this.$modal.msg('请上传照片或视频')
 							return