Эх сурвалжийг харах

Merge branch 'master' of ssh://1582597470426922.onaliyun.com@s1.nsloop.com:29418/web_TracerMethodology

yuwenfen 4 жил өмнө
parent
commit
1616345dcb

+ 8 - 2
pages/creatingSituations/creatingSituations.vue

@@ -42,6 +42,7 @@
 		data() {
 			return {
 				saveType: 'POST',
+				editID: '',
 				options: [
 					{id: 'theme', title: '主题', component: theme},
 					{id: 'condition', title: '条件', component: condition, hint: '追踪条件'},
@@ -82,6 +83,7 @@
 		onLoad:function({id,type}){
 			this.saveType = type ? type : 'POST';
 			if(id) {
+				this.editID = id;
 				this.dispatch('detialConfig',{id}).then((data)=>{
 					if(data) {
 						const {topic} = data;
@@ -131,7 +133,7 @@
 					});
 					return;
 				}
-				this.dispatch(`save${this.saveType}`, {
+				let data = {
 					name: sitName,
 					topic: this.theme.id,
 					checkPlanStartDate: dateObj.start,
@@ -156,7 +158,11 @@
 							endDate: i === checkList.length - 1 ? dateObj.end : checkList[i+1]
 						}
 					})
-				}).then((data)=>{
+				};
+				if(this.saveType === 'PUT') {
+					data.id = this.editID;
+				}
+				this.dispatch(`save${this.saveType}`, data).then((data)=>{
 					if(data) {
 						uni.navigateTo({
 							url: '/pages/situationsCenter/situationsCenter'