浏览代码

调整报表的弹窗显示

Lijy 2 年之前
父节点
当前提交
189b32aab7

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -448,7 +448,7 @@
   "financialcoststatement": "Financial Cost Statement",
   "financialcoststatement": "Financial Cost Statement",
   "costintotal": "total cost",
   "costintotal": "total cost",
   "projectpersonnelcostincluded": "With or without project personnel costs",
   "projectpersonnelcostincluded": "With or without project personnel costs",
-  "yuan": "Yuan",
+  "yuan": "dollors",
   "workcost": "work cost",
   "workcost": "work cost",
   "financialcoststatisticss": "Financial cost statistics",
   "financialcoststatisticss": "Financial cost statistics",
   "waiforverification": "Import successful, please wait for review",
   "waiforverification": "Import successful, please wait for review",
@@ -810,8 +810,8 @@
   "designatedpersonnel": "designated person",
   "designatedpersonnel": "designated person",
   "deleteit": "Are you sure you want to delete?",
   "deleteit": "Are you sure you want to delete?",
   "chartY": "Chart Y axis:",
   "chartY": "Chart Y axis:",
-  "accordingtothecost": "show cost",
-  "accordingtoworkinghours": "Show hours",
+  "accordingtothecost": "cost",
+  "accordingtoworkinghours": "hours",
   "projectclassification": "classification",
   "projectclassification": "classification",
   "zhu-xiang-mu": "main project",
   "zhu-xiang-mu": "main project",
   "returnsuperior": "Return to the upper level",
   "returnsuperior": "Return to the upper level",

+ 29 - 20
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -656,13 +656,13 @@
                     })
                     })
                     // 设置宽度
                     // 设置宽度
                     _this.myChart = myChart;
                     _this.myChart = myChart;
-                    var option = {
+                    var option = { 
                         //总成本
                         //总成本
                         title: {
                         title: {
                             // text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
                             // text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
                             text: this.$t('otalhourscost')+ ':' + 
                             text: this.$t('otalhourscost')+ ':' + 
-                            ((this.permissions.countCost) ? this.$t('costof') + totalMoneyCost.toFixed(2) + this.$t('yuan') + ',' : '') + 
-                            ((this.permissions.countHours) ? this.$t('time.duration') + totalHours + this.$t('time.hour') : ''),
+                            ((this.permissions.countCost) ? this.$t('costof') + ' ' + totalMoneyCost.toFixed(2) + ' ' + this.$t('yuan') + ',' : '') + 
+                            ((this.permissions.countHours) ? this.$t('time.duration') + ' ' +totalHours + ' ' + this.$t('time.hour') : ''),
                             left:'left',
                             left:'left',
                         },
                         },
                         // 工具箱
                         // 工具箱
@@ -708,17 +708,17 @@
                                 var res = "";
                                 var res = "";
                                 for(var i in params) {
                                 for(var i in params) {
                                     if (params[i].data.value > 0) {
                                     if (params[i].data.value > 0) {
-                                        res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>" + this.$t('headerTop.projectName') + ":" + params[i].seriesName 
+                                        res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>" + _this.$t('headerTop.projectName') + ":" + params[i].seriesName 
                                             + "</font><br/>" + 
                                             + "</font><br/>" + 
-                                            ((_this.permissions.countCost) ? this.$t('workcost')+ ":" + params[i].data.money + this.$t('yuan') + "</br>" : '') + 
-                                            ((_this.permissions.countHours) ? this.$t('screening.workTime') + ":" + params[i].data.cost + this.$t('time.hour') + "</br>" : '') + "</div>";
+                                            ((_this.permissions.countCost) ? _this.$t('workcost')+ ":" + params[i].data.money + _this.$t('yuan') + "</br>" : '') + 
+                                            ((_this.permissions.countHours) ? _this.$t('screening.workTime') + ":" + params[i].data.cost + _this.$t('time.hour') + "</br>" : '') + "</div>";
                                         totalTime += Number(params[i].data.cost);
                                         totalTime += Number(params[i].data.cost);
                                         totalCost += Number(params[i].data.money);
                                         totalCost += Number(params[i].data.money);
                                     }
                                     }
                                 }
                                 }
-                                res = res +'<br/>'+ params[0].name+ '<br/>' +this.$t('zong-ji') + ':' + 
-                                ((_this.permissions.countHours) ? totalTime.toFixed(1) + this.$t('time.hour') : '') + 
-                                ((_this.permissions.countCost) ? totalCost.toFixed(2) + this.$t('yuan') : '') + 
+                                res = res +'<br/>'+ params[0].name+ '<br/>' + _this.$t('zong-ji') + ':' + 
+                                ((_this.permissions.countHours) ? totalTime.toFixed(1) + _this.$t('time.hour') : '') + 
+                                ((_this.permissions.countCost) ? totalCost.toFixed(2) + _this.$t('yuan') : '') + 
                                 "<br/>";
                                 "<br/>";
                                 return res;
                                 return res;
                             }
                             }
@@ -733,6 +733,7 @@
                             type : 'value',
                             type : 'value',
                             axisLabel: {
                             axisLabel: {
                                 formatter:this.yAxisValue==0?'{value} ('+this.$t('yuan')+')':'{value} ('+this.$t('time.hour')+')'
                                 formatter:this.yAxisValue==0?'{value} ('+this.$t('yuan')+')':'{value} ('+this.$t('time.hour')+')'
+                                // formatter:this.yAxisValue==0?'{value} (元)':'{value} (小时)'
                             }
                             }
                         }],
                         }],
                         series: series,
                         series: series,
@@ -996,11 +997,10 @@
                         if(totalMoneyCost) {
                         if(totalMoneyCost) {
                             this.zhishin = totalMoneyCost.toFixed(2)
                             this.zhishin = totalMoneyCost.toFixed(2)
                         } 
                         } 
-
                         if(this.radio == this.$t('other.project') || this.radio == this.$t('zhu-xiang-mu') || this.radio == this.$t('ren-yuan') || this.radio == this.$t('projectclassification') || this.radio==this.$t('lable.department')) {
                         if(this.radio == this.$t('other.project') || this.radio == this.$t('zhu-xiang-mu') || this.radio == this.$t('ren-yuan') || this.radio == this.$t('projectclassification') || this.radio==this.$t('lable.department')) {
                             var option = {
                             var option = {
                                 title: {
                                 title: {
-                                    text: this.$t('otalhourscost') + ':' + ((this.permissions.countCost) ? this.$t('costof') + this.zhishin + this.$t('yuan') + ',' : '') + ((this.permissions.countHours) ? this.$t('time.duration') + totalHours + this.$t('time.hour') : ''),
+                                    text: this.$t('otalhourscost') + ':' + ((this.permissions.countCost) ? this.$t('costof') + ' ' + this.zhishin + ' ' +this.$t('yuan') + ',' : '') + ((this.permissions.countHours) ? this.$t('time.duration') + ' ' +totalHours+ ' ' +this.$t('time.hour') : ''),
                                     left:'left',
                                     left:'left',
                                 },
                                 },
                                 // 工具箱
                                 // 工具箱
@@ -1013,15 +1013,24 @@
                                 tooltip:{
                                 tooltip:{
                                     trigger:'axis',
                                     trigger:'axis',
                                     formatter: function (params,ticket,callback) {
                                     formatter: function (params,ticket,callback) {
-                                        // var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.money 
-                                        // + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
                                         _this.params = params;
                                         _this.params = params;
                                         var res = params[0].name + "<br/>" + 
                                         var res = params[0].name + "<br/>" + 
-                                        ((_this.permissions.countCost) ? this.$t('workcost')+" : " + params[0].data.money 
-                                        + this.$t('yuan')+"<br/>" : '') + 
-                                        ((_this.permissions.countHours) ? this.$t('screening.workTime')+" : " + params[0].data.cost + this.$t('time.hour') : '');
+                                        ((_this.permissions.countCost) ? _this.$t('workcost')+" : " + params[0].data.money 
+                                        + _this.$t('yuan')+"<br/>" : '') + 
+                                        ((_this.permissions.countHours) ? _this.$t('screening.workTime')+" : " + params[0].data.cost + _this.$t('time.hour') : '');
+                                        console.log(res, '将要渲染的数据')
                                         return res;
                                         return res;
                                     }
                                     }
+                                    // trigger:'axis',
+                                    //  formatter: function (params,ticket,callback) {
+                                    //      _this.params = params;
+                                    //      var res = params[0].name + "<br/>" + 
+                                    //      ((_this.permissions.countCost) ? "工作成本"+" : " + params[0].data.money 
+                                    //      + "元 <br/>" : '') + 
+                                    //      ((_this.permissions.countHours) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
+                                    //      return res;
+                                    //  }
+
                                 },
                                 },
                                 xAxis: {
                                 xAxis: {
                                     data: xList,
                                     data: xList,
@@ -1049,7 +1058,7 @@
                             var option = {
                             var option = {
                                 title: {
                                 title: {
                                     // text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
                                     // text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
-                                    text: this.$t('otalhourscost')+ ':' + ((this.permissions.countCost) ? this.$t('costof') + this.zhishin + this.$t('yuan')+ ',' : '') + ((this.permissions.countHours) ? this.$t('time.duration') + totalHours + this.$t('time.hour') : ''),
+                                    text: this.$t('otalhourscost')+ ':' + ((this.permissions.countCost) ? this.$t('costof') + ' ' + this.zhishin + ' ' + this.$t('yuan')+ ',' : '') + ((this.permissions.countHours) ? this.$t('time.duration') + ' ' + totalHours + ' ' + this.$t('time.hour') : ''),
                                     left:'left',
                                     left:'left',
                                 },
                                 },
                                 // 工具箱
                                 // 工具箱
@@ -1063,9 +1072,9 @@
                                     trigger:'axis',
                                     trigger:'axis',
                                     formatter: function (params,ticket,callback) {
                                     formatter: function (params,ticket,callback) {
                                         var res = params[0].name + "<br/>" + 
                                         var res = params[0].name + "<br/>" + 
-                                        ((_this.permissions.countCost) ? this.$t('workcost')+" : " + params[0].data.money 
-                                        + this.$t('yuan')+"<br/>" : '') + 
-                                        ((_this.permissions.countHours) ? this.$t('screening.workTime')+" : " + params[0].data.cost + this.$t('time.hour') : '');
+                                        ((_this.permissions.countCost) ? _this.$t('workcost')+" : " + params[0].data.money 
+                                        + _this.$t('yuan')+"<br/>" : '') + 
+                                        ((_this.permissions.countHours) ? _this.$t('screening.workTime')+" : " + params[0].data.cost + _this.$t('time.hour') : '');
                                         _this.params = params;
                                         _this.params = params;
                                         return res;
                                         return res;
                                     }
                                     }