Browse Source

提交工时成本统计人员统计报错的问题

Lijy 1 year ago
parent
commit
4027fcf205

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

@@ -624,7 +624,7 @@
                         });
                         });
 
 
 
 
-                        console.log('==================>', list, nameObj);
+                        // console.log('==================>', list, nameObj);
 
 
                         for(var j in list) {
                         for(var j in list) {
                             var project = list[j].project , num = 0;
                             var project = list[j].project , num = 0;
@@ -682,7 +682,11 @@
                                     position: 'top',
                                     position: 'top',
                                     formatter: function(params) {
                                     formatter: function(params) {
                                         const { seriesName, data, name} = params
                                         const { seriesName, data, name} = params
+                                        if(!name) {
+                                            return ''
+                                        }
                                         const unit = yAxisValue == 0 ? '元' : '小时';
                                         const unit = yAxisValue == 0 ? '元' : '小时';
+                                        console.log(nameObj, name, nameObj[name], params)
                                         const totalValue = yAxisValue == 0 ? nameObj[name].moneyTol : nameObj[name].timeTol;
                                         const totalValue = yAxisValue == 0 ? nameObj[name].moneyTol : nameObj[name].timeTol;
                                         return seriesName === cerName ? `${totalValue ? totalValue.toFixed(0) : 0} ${unit}` : '';
                                         return seriesName === cerName ? `${totalValue ? totalValue.toFixed(0) : 0} ${unit}` : '';
                                     }
                                     }