Bläddra i källkod

解决创建项目选择参与人数据错误问题

zhuliu 1 år sedan
förälder
incheckning
e63633ad60
2 ändrade filer med 23 tillägg och 5 borttagningar
  1. 2 0
      src/views/components/dialog/ClientTable.vue
  2. 21 5
      src/views/components/dialog/person.vue

+ 2 - 0
src/views/components/dialog/ClientTable.vue

@@ -155,9 +155,11 @@ export default {
     },
     //保存
     submit() {
+      
       this.$emit("getPersonIds", {
         personIds: this.personIds,
         persons: this.persons,
+        submit:true
       });
     },
     //选择

+ 21 - 5
src/views/components/dialog/person.vue

@@ -26,7 +26,8 @@ export default {
     return {
         dialogVisible:false,
         personIds:[],
-        persons:[]
+        persons:[],
+        submit:false
     };
   },
   watch: {},
@@ -39,17 +40,32 @@ export default {
     //关闭弹窗
     handleClose(){
         this.dialogVisible = false
-        this.$emit('getPersonIds',{personIds:this.personIds,persons:this.persons})
+        if(this.submit){
+          this.$emit('getPersonIds',{personIds:this.personIds,persons:this.persons})
+        }
+        
     },
     //打开弹窗
     open(personIds,persons){
-        this.personIds = personIds || []
-        this.persons = persons || []
+      if(personIds){
+        this.personIds = JSON.parse(JSON.stringify(personIds))
+      }else{
+        this.personIds = []
+      }
+      if(persons){
+        this.persons = JSON.parse(JSON.stringify(persons))
+      }else{
+        this.persons = []
+      }
+      this.submit= false
+        // this.personIds = personIds || []
+        // this.persons = persons || []
         this.dialogVisible = true
     },
-    getPersonIds({personIds,persons}){
+    getPersonIds({personIds,persons,submit}){
         this.personIds = personIds
         this.persons = persons
+        this.submit = submit
         this.handleClose()
     }
   },