zhanghongrui 11 mesi fa
parent
commit
bdc2c26d58
2 ha cambiato i file con 54 aggiunte e 16 eliminazioni
  1. 2 2
      config.js
  2. 52 14
      pages/bottom_leg/bottom_leg.vue

+ 2 - 2
config.js

@@ -1,9 +1,9 @@
 // 应用全局配置
 module.exports = {
 
-	baseUrl: 'https://www.xcx.cczdsz.cn/prod-api',
+	//baseUrl: 'https://www.xcx.cczdsz.cn/prod-api',
 	// baseUrl: 'http://192.168.4.88:8080',
-	//baseUrl: 'http://192.168.4.23:8080',
+	baseUrl: 'http://192.168.4.23:8080',
 	//baseUrl: 'http://192.168.4.20:8080',
 	// baseUrl: 'http://192.168.4.6:8080',
 

+ 52 - 14
pages/bottom_leg/bottom_leg.vue

@@ -249,6 +249,7 @@
 			getRoomProjectList,
 			getRoomProjectId,
 			getLowerStaging,
+			putHistory,
 		} from '@/api/common';
 		import {
 			getToken
@@ -296,6 +297,12 @@
 					loading: false,
 					historyList: {}, //历史数据
 					inputNumberValue: '',
+					isEdit: false,
+					nodeId: '',
+					NodeBoId: '',
+					InfoId: '',
+					MaterialBoId: '',
+
 					// inputIntegerNumberValue: '',
 					// inputDecimalNumberValue: '',
 				}
@@ -425,6 +432,7 @@
 
 						uni.showLoading()
 						let param = {
+							id: this.nodeId,
 							district: this.XZQValue.dictValue,
 							areaId: this.XQValue.id,
 							buildingId: this.LDValue.id,
@@ -434,8 +442,10 @@
 								.enginClassification, //写死  上一页面传过来的  //室内 - 庭院 - 架空
 							enginCycle: this.projectValue.dictValue, //工程周期
 							zEngineeringNodeBo: {
+								id: this.NodeBoId,
 								type: this.objValue.enginClassValue, //写死 上一页面传过来的  (拆旧管等 字典值)
 								zEngineeringInfoBo: {
+									id: this.InfoId,
 									constructTime: this.time, //施工时间
 									onTheDitch: this.imgArr0, //照片集合
 									beforeBottom: this.imgArr1, //照片集合
@@ -443,6 +453,7 @@
 									inferiorSulcus: this.imgArr3, //照片集合
 									constructAddre: this.positionKey,
 									zEngineeringMaterialBo: [{
+										id: this.MaterialBoId,
 										number: this.inputNumberValue, //米数
 										remark: this.projectContent, //施工内容
 									}]
@@ -451,21 +462,40 @@
 
 						}
 
-						addTearOldPipe(param).then(res => {
-							uni.hideLoading()
-							if (res.code == '200') {
-								uni.showToast({
-									title: res.msg,
-									icon: 'none',
-									//显示持续时间为 3秒
-									duration: 2000
-								});
-								setTimeout(function() {
-									uni.navigateBack();
-								}, 1000)
+						if (this.isEdit) {
+							//修改
+							putHistory(param).then(res => {
+								uni.hideLoading()
+								if (res.code == '200') {
+									uni.showToast({
+										title: res.msg,
+										icon: 'none',
+										//显示持续时间为 3秒
+										duration: 2000
+									});
+									setTimeout(function() {
+										uni.navigateBack();
+									}, 1000)
 
-							}
-						})
+								}
+							})
+						} else {
+							addTearOldPipe(param).then(res => {
+								uni.hideLoading()
+								if (res.code == '200') {
+									uni.showToast({
+										title: res.msg,
+										icon: 'none',
+										//显示持续时间为 3秒
+										duration: 2000
+									});
+									setTimeout(function() {
+										uni.navigateBack();
+									}, 1000)
+
+								}
+							})
+						}
 						//提交接口执行逻辑
 					}
 				},
@@ -789,6 +819,12 @@
 					getLowerStaging(param).then(res => {
 						if (res.data != null) {
 							if (res.data.zEngineeringNodeBo != null) {
+								this.nodeId = res.data.id;
+								this.NodeBoId = res.data.zEngineeringNodeBo.id;
+								this.InfoId = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0].id,
+									this.MaterialBoId = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0]
+									.zEngineeringMaterialBo[0].id,
+									this.isEdit = true;
 								this.imgArr0 = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0]
 									.onTheDitch;
 								this.imgArr1 = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0]
@@ -798,10 +834,12 @@
 								this.imgArr3 = res.data.zEngineeringNodeBo.zEngineeringInfoBoList[0]
 									.inferiorSulcus;
 							} else {
+								this.isEdit = false;
 								this.$modal.msg("暂无数据")
 							}
 
 						} else {
+							this.isEdit = false;
 							this.$modal.msg("暂无数据")
 						}