Bladeren bron

事件详情添加专利挖掘项目时默认事件

zhuliu 8 maanden geleden
bovenliggende
commit
e235671da6

+ 35 - 42
src/views/patentMining/components/dialog/addAndEditProject.vue

@@ -655,60 +655,52 @@ export default {
 
 
     //打开弹窗
-    async open(form) {
+    async open(form={}){
+      this.form = JSON.parse(JSON.stringify(form))
       this.personnelList.data = []
-      if (form && form.id) {
-        this.form = JSON.parse(JSON.stringify(form))
-        // 负责人
-        if (this.form.headId) {
-          this.personnelList.queryParams.id = this.form.headId
-          await this.getPermissionPersonnel(1)
-          this.personnelList.queryParams.id = null
-        }
-        // 部门委托客户
-        if (this.form.entrustId) {
-          
-          // this.personnelList.queryParams.id = this.form.entrustId
-          // await this.getPermissionPersonnel(1)
-          // this.personnelList.queryParams.id = null
-        }
-        // 参与人
-        if (this.form.involvedPersons && this.form.involvedPersons.length) {
-          this.form.adminPersons = []
-          this.form.adminIds = []
-          this.form.involvedPersons.forEach(item => {
-            let a = {
-              id: item.personId,
-              name: item.personName
-            }
-            this.form.adminPersons.push(a)
-            this.form.adminIds.push(a.id)
-          })
-        }
+
+      //获取title
+      if(this.form.id){
         this.title = '编辑专利挖掘项目'
-      } else {
-        // this.eventList.disabled = false
-        // if (this.form.eventId) {
-        //   this.eventList.disabled = true
-        //   this.eventList.data.push({
-        //     id: this.form.eventId,
-        //     name: this.form.eventName,
-        //   })
-        // }
+      }else{
         this.title = '新增专利挖掘项目'
       }
+      //负责人
+      if (this.form.headId) {
+        this.personnelList.queryParams.id = this.form.headId
+        await this.getPermissionPersonnel(1)
+        this.personnelList.queryParams.id = null
+      }
+      // 部门委托客户
+      if (this.form.entrustId) {
+      }
+      // 参与人
+      if (this.form.involvedPersons && this.form.involvedPersons.length) {
+        this.form.adminPersons = []
+        this.form.adminIds = []
+        this.form.involvedPersons.forEach(item => {
+          let a = {
+            id: item.personId,
+            name: item.personName
+          }
+          this.form.adminPersons.push(a)
+          this.form.adminIds.push(a.id)
+        })
+      }
+
+      //事件
       this.eventList.data = []
       this.eventList.name = ''
       this.eventList.disabled = false
       var hasEvent = false
-      if(this.form.eventId){
-        this.eventList.disabled = true
-        hasEvent = true
-      }
       if(this.form.eventIds && this.form.eventIds.length>0){
         this.form.eventId = this.form.eventIds[0]
         hasEvent = true
       }
+      if(this.form.eventId){
+        this.eventList.disabled = true
+        hasEvent = true
+      }
       if(hasEvent){
         if(this.form.eventId){
           let params = {
@@ -738,6 +730,7 @@ export default {
       }
       this.getPermissionPersonnel()
       this.dialogVisible = true
+
     },
     //关闭弹窗
     handleClose() {

+ 1 - 1
src/views/patentMining/components/viewIndex.vue

@@ -320,7 +320,7 @@ export default {
         eventName:this.eventName,
         eventId:this.eventId
       }
-      this.$refs.addAndEditProject.open()
+      this.$refs.addAndEditProject.open(form)
     },
     // 创建项目按钮下拉菜单内容
     handleCommand(ev) {