heyang vor 6 Monaten
Ursprung
Commit
20cc51f6e9

+ 6 - 0
pages_safetyCheck/component/checkItemModule.vue

@@ -186,6 +186,7 @@
 		},
 		mounted() {
 			this.$set(this, 'optionData', JSON.parse(JSON.stringify(this.propsData)));
+			console.log('检查项列表',this.optionData)
 			this.$nextTick(() => {
 				this.securityCheckOptionSelAllList();
 			})
@@ -303,6 +304,9 @@
 						let minList = JSON.parse(JSON.stringify(data.data))
 						this.cascadeData(maxList, minList);
 					}
+					if(this.optionData.editStatus){
+						data.data.unshift(this.optionData.editItem);
+					}
 					if (data.data[0]) {
 						data.data.forEach(function(item) {
 							if (item.hazardCheckPoint) {
@@ -310,6 +314,7 @@
 							}
 						})
 					}
+					
 					//查询数据
 					let map = new Map();
 					for (let item of data.data) {
@@ -329,6 +334,7 @@
 					let finalResult = Array.from(map.values());
 					this.$set(this, 'dataList', finalResult);
 					
+					
 				}
 			},
 			

+ 26 - 0
pages_safetyCheck/views/inspectManage/conductInspections.vue

@@ -217,6 +217,20 @@
 					let obj = {
 						infoType: this.pageType,
 						checkType: 0,
+						editStatus:this.optionData.editStatus,
+						editItem:{
+							hazardCheckName:this.newData.hazardCheckName,
+							hazardCheckName1:this.newData.hazardCheckName1,
+							hazardCheckName2:this.newData.hazardCheckName2,
+							hazardCheckCode:this.newData.hazardCheckCode,
+							hazardCheckCode1:this.newData.hazardCheckCode1,
+							hazardCheckCode2:this.newData.hazardCheckCode2,
+							hazardCheckPoint:this.newData.hazardCheckPoint,
+							hazardCheckPro:this.newData.hazardCheckPro,
+							hazardCheckPro1:this.newData.hazardCheckPro1,
+							hazardCheckPro2:this.newData.hazardCheckPro2,
+							setOptionId:this.newData.setOptionId,
+						}
 					}
 					if (this.pageType == 0) {
 						//检查
@@ -239,6 +253,13 @@
 					this.$set(this.optionData, 'hazardCheckPro', item.hazardCheckPro);
 					this.$set(this, 'checkItemModuleType', false);
 					this.securityAppCheckPhotoGetCheckNumBySub();
+					//编辑的时候
+					if(this.optionData.editStatus){
+						if(this.optionData.setOptionId!=this.newData.setOptionId){
+							this.$set(this.form, 'photoList', []);
+						}
+						
+					}
 				}
 			},
 			//提交
@@ -271,6 +292,11 @@
 					photoList: this.form.photoList,
 					voiceList: this.form.voiceList,
 				}
+				if(this.optionData.editStatus){
+					if(this.optionData.setOptionId!=this.newData.setOptionId){
+						obj.delSetOptionId=this.newData.setOptionId;
+					}
+				}
 				const {
 					data
 				} = await securityAppCheckSetOptionCheckCommit(obj);