Prechádzať zdrojové kódy

调整工时成本统计选择人员的bug

Lijy 2 rokov pred
rodič
commit
15449f563b

+ 26 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -196,6 +196,7 @@
                 total: 0,
                 personnelValue: '',
                 personnelAll: [],
+                personnelAllPlly: [],
                 yAxisValue: localStorage.yAxisValue?localStorage.yAxisValue:0,
                 parentDeptStack:[],
                 parentDeptId:null,
@@ -423,18 +424,33 @@
             personnel() {
                 this.page = 1
                 if(this.personnelValue) {
-                    var arrlist = JSON.parse(JSON.stringify(this.personnelAll))
+                    var arrlist = JSON.parse(JSON.stringify(this.personnelAllPlly))
                     var arr = []
                     for(var i in arrlist.list) {
+                        console.log(arrlist.list[i].name, this.personnelValue)
                         if(arrlist.list[i].name == this.personnelValue) {
                             arr.push(arrlist.list[i])
                         }
                     }
                     arrlist.list = arr
                     this.allListData = arrlist
-                    this.gtff()
+                    // this.gtff()
+                    if(this.user.userNameNeedTranslate == '1') {
+                        let list = arrlist.list
+                        let dealWithList = []
+                        for(var i in list) {
+                            let obj = {}
+                            obj.type = list[i].type
+                            obj.id = list[i].name
+                            dealWithList.push(obj)
+                        }
+                        this.dealWithTranslationPlone(dealWithList)
+                    } else {
+                        this.allListData = arrlist
+                        this.gtff()
+                    }
                 } else {
-                    this.allListData = this.personnelAll
+                    this.allListData = this.personnelAllPlly
                     this.gtff()
                 }
             },
@@ -464,9 +480,10 @@
                     if (res.code == "ok") {
                         // 
                             
-                        // 
+                        //
                         this.personnelAll = res.data
                         this.allListData = res.data
+                        this.personnelAllPlly = JSON.parse(JSON.stringify(res.data)) 
 
                         if(this.user.userNameNeedTranslate == '1') {
                             let list = res.data.list
@@ -858,6 +875,7 @@
                     myFunOne()
             },
             dealWithTranslationPlone(items, dataList) {
+                    console.log(items, '过来道德值')
                     if (WWOpenData.initCanvas) {
                         WWOpenData.initCanvas()
                     }
@@ -870,8 +888,11 @@
                                 })
                             }
                         })
+                        console.log('取到的值', result)
                         for(var i in this.allListData.list) {
-                            this.allListData.list[i].name = result.items[i].data
+                            if(result.items[i]) {  
+                                this.allListData.list[i].name = result.items[i].data
+                            }
                         }
                         this.gtff()
                     }