Browse Source

添加项目时添加有没有调查类型的判断

zhuliu 1 year ago
parent
commit
fe91871e3e

+ 19 - 8
src/views/patentMining/components/dialog/addAndEditProject.vue

@@ -715,15 +715,26 @@ export default {
           if (this.form.eventId) {
             this.form.events = []
             this.form.scenarioIds = []
-            this.form.matterIds.forEach(item => {
+            if(this.form.matterIds.length>0){
+              this.form.matterIds.forEach(item => {
+                this.form.events.push(
+                  {
+                    matterId: item,
+                    scenarioId: scenarioIds[0],
+                    eventId: this.form.eventId
+                  }
+                )
+              })
+            }else{
               this.form.events.push(
-                {
-                  matterId: item,
-                  scenarioId: scenarioIds[0],
-                  eventId: this.form.eventId
-                }
-              )
-            })
+                  {
+                    matterId: null,
+                    scenarioId: scenarioIds[0],
+                    eventId: this.form.eventId
+                  }
+                )
+            }
+            
           }
           if (this.form.adminIds && this.form.adminIds.length > 0) {
             this.form.involvedPersonIds = this.form.adminIds

+ 19 - 8
src/views/project/components/drawer/form.vue

@@ -618,15 +618,26 @@ export default {
           if(this.ruleForm.eventId){
             this.ruleForm.events = []
             this.ruleForm.scenarioIds = []
-            this.ruleForm.matterIds.forEach(item=>{
+            if(this.ruleForm.matterIds.length>0){
+              this.ruleForm.matterIds.forEach(item=>{
+                this.ruleForm.events.push(
+                  {
+                    matterId:item,
+                    scenarioId:scenarioIds[0],
+                    eventId:this.ruleForm.eventId
+                  }
+                )
+              })
+            }else{
               this.ruleForm.events.push(
-                {
-                  matterId:item,
-                  scenarioId:scenarioIds[0],
-                  eventId:this.ruleForm.eventId
-                }
-              )
-            })
+                  {
+                    matterId:null,
+                    scenarioId:scenarioIds[0],
+                    eventId:this.ruleForm.eventId
+                  }
+                )
+            }
+            
           }
          // 判断文件是否都上传完毕
          var guids = this.$commonJS.checkUploadFile(this.ruleForm.systemFile)

+ 19 - 8
src/views/report/components/dialog/addAndEditReport.vue

@@ -986,15 +986,26 @@ export default {
           if (this.form.eventId) {
             this.form.events = []
             this.form.scenarioIds = []
-            this.form.matterIds.forEach(item => {
+            if(this.form.matterIds.length>0){
+              this.form.matterIds.forEach(item => {
+                this.form.events.push(
+                  {
+                    matterId: item,
+                    scenarioId: scenarioIds[0],
+                    eventId: this.form.eventId
+                  }
+                )
+              })
+            }else{
               this.form.events.push(
-                {
-                  matterId: item,
-                  scenarioId: scenarioIds[0],
-                  eventId: this.form.eventId
-                }
-              )
-            })
+                  {
+                    matterId: null,
+                    scenarioId: scenarioIds[0],
+                    eventId: this.form.eventId
+                  }
+                )
+            }
+            
           }
           let formData = this.form
           if (!this.form.id) {//新增报告