Browse Source

调整选人组件的问题

Lijy 2 years ago
parent
commit
bc203d1fc0
1 changed files with 17 additions and 6 deletions
  1. 17 6
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

+ 17 - 6
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -178,6 +178,7 @@ export default {
             cursor: '', // 搜索的标记(需传给后端)
             time: null,//防抖
             fistArrList: [], // 第一次进来的人员数组
+            fistArrListOne: [], // 第一次进来的人员初始数组
         };
     },
     computed: {},
@@ -278,12 +279,17 @@ export default {
         }
         console.log(this.subject, this.subjectId)
 
-        let phoneArr = []
-        for(var s in this.subject) {
-            phoneArr.push(this.subject[s].optionsOId || this.subject[s].auditorId || this.subject[s].id) 
-        }
-        this.fistArrList = phoneArr
-        console.log(this.fistArrList)
+        var thats = this
+        var phoneArr = []
+        setTimeout(()=>{
+            for(var s in thats.subject) {
+                phoneArr.push(thats.subject[s].optionsOId || thats.subject[s].auditorId || thats.subject[s].id) 
+            }
+            thats.fistArrListOne = thats.subject
+        }, 500)
+        
+        thats.fistArrList = phoneArr
+        console.log(thats.fistArrList)
         this.dailyListIndex = this.idx
     },
     methods: {
@@ -360,6 +366,7 @@ export default {
                         name: this.selectName
                     }
                     this.$emit("selectCal", obj)
+                    this.options = this.fistArrListOne
                 }
             }
         },
@@ -378,6 +385,7 @@ export default {
                         idx: this.dailyListIndex
                     }
                     this.$emit("selectCatCli", obj);
+                    this.options = this.fistArrListOne
                 } else {
                     let obj = {
                         id: nameId,
@@ -387,6 +395,7 @@ export default {
                         name: this.selectName
                     }
                     this.$emit("selectCal", obj)
+                    this.options = this.fistArrListOne
                 }
                 this.transitionBoxLiIdx = ''
                 this.show = false
@@ -441,6 +450,7 @@ export default {
                     }
                 }
                 this.$emit("selectCal", obj)
+                this.options = this.fistArrListOne
             }
         },
         deleteMultiSelectList(str) {
@@ -468,6 +478,7 @@ export default {
                 name: this.selectName
             }
             this.$emit("selectCal", obj)
+            this.options = this.fistArrListOne
         },
         // searchBox() {
         //     this.selectCli()