Jelajahi Sumber

调整提交

Lijy 2 tahun lalu
induk
melakukan
01ed616ef6

+ 45 - 45
fhKeeper/formulahousekeeper/timesheet/src/views/project/custom_data.vue

@@ -10,36 +10,36 @@
             format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
             @change="getEchart" 
             :clearable="true" 
-            range-separator="至"
+            :range-separator="$t('other.to')"
             type="daterange" 
-            start-placeholder="开始日期"
-            end-placeholder="结束日期"
+            :start-placeholder="$t('time.startDate')"
+            :end-placeholder="$t('time.endDate')"
             ></el-date-picker>
 
             <el-radio-group v-model="radio" @change="getEchart" style="margin-left:10px;"  size="small">
-                <el-radio-button label="项目" v-if="permissions.customDataAll"></el-radio-button>
-                <!-- <el-radio-button label="部门"></el-radio-button> -->
-                <el-radio-button label="人员"></el-radio-button>
-                <el-radio-button label="部门"></el-radio-button>
+                <el-radio-button :label="$t('other.project')" v-if="permissions.customDataAll"></el-radio-button>
+                <!-- <el-radio-button :label="部门"></el-radio-button> -->
+                <el-radio-button :label="$t('ren-yuan')"></el-radio-button>
+                <el-radio-button :label="$t('lable.department')"></el-radio-button>
                 <!-- <el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button> -->
             </el-radio-group>
         </el-col>
         <el-col :span="6">
-            <el-button @click="showExportDialog"  size="small">报表导出</el-button>
+            <el-button @click="showExportDialog"  size="small">{{ $t('reporderived') }}</el-button>
         </el-col>
         </el-row>
         <div :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
              <div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
         </div>
-        <div style="position:fixed;top:170px;left:600px;" v-show="radio=='部门' && parentDeptId != null">
-            <el-button @click="backToParentDept"  size="small">返回上级</el-button>
+        <div style="position:fixed;top:170px;left:600px;" v-show="radio==$t('lable.department') && parentDeptId != null">
+            <el-button @click="backToParentDept"  size="small">{{ $t('returnsuperior') }}</el-button>
         </div>
 
         <!--导出报表条件选择 -->
-        <el-dialog title="数据导出" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
+        <el-dialog :title="$t('Exportdata')" v-if="exportDialog" :visible.sync="exportDialog" :close-on-click-modal="false" customClass="customWidth" width="500px">
             <el-form ref="form3" :model="exportParam" >
-                <el-form-item prop="projectId" label="选择项目" v-if="permissions.customDataAll">
-                    <el-select v-model="exportParam.projectId" placeholder="全部项目"  clearable style="width:350px;" filterable="true">
+                <el-form-item prop="projectId" :label="$t('defaultText.selectProject')" v-if="permissions.customDataAll">
+                    <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')"  clearable style="width:350px;" filterable="true">
                         <el-option v-for="item in projectList"  :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
                             <span style="float: left;color: #8492a6; font-size: 13px">{{ item.projectCode }}</span>
                             <span style="float: right;margin-left: 20px">{{ item.projectName }}</span>
@@ -52,15 +52,15 @@
                     </el-select>
                 </el-form-item> -->
 
-                <el-form-item prop="projectId" :label="user.timeType.fixMonthcost==0?'日期范围':'选择月份'">
+                <el-form-item prop="projectId" :label="user.timeType.fixMonthcost==0?$t('time.dateRange'):$t('Selectmonth')">
                     <el-date-picker v-show="user.timeType.fixMonthcost==0"
                         v-model="exportParam.dateRange" :editable="false" 
                         format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
                         :clearable="false" 
-                        range-separator="至"
+                        :range-separator="$t('other.to')"
                         type="daterange" 
-                        start-placeholder="开始日期"
-                        end-placeholder="结束日期"
+                        :start-placeholder="$t('time.startDate')"
+                        :end-placeholder="$t('time.endDate')"
                     ></el-date-picker>
                 </el-form-item>
                 
@@ -73,7 +73,7 @@
                 </el-form-item> -->
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="exportProjectData" style="width:100%;" >导出</el-button>
+                <el-button type="primary" @click="exportProjectData" style="width:100%;" >{{ $t('export.export') }}</el-button>
             </div>
         </el-dialog>
     </section>
@@ -94,7 +94,7 @@
                 dateRange:[],
                 user: JSON.parse(sessionStorage.getItem("user")),
                 permissions: JSON.parse(sessionStorage.getItem("permissions")),
-                radio: sessionStorage.radio!=null?sessionStorage.radio:'项目',
+                radio: sessionStorage.radio!=null?sessionStorage.radio:this.$t('other.project'),
                 containerHeight: 0,    
                 myChart: null,
                 params: null,
@@ -194,7 +194,7 @@
                     param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1]};
                  }
                  var url = "/project/exportCustomDataSum";
-                 var fileName = this.user.timeType.customDataName + '统计.xls';
+                 var fileName = this.user.timeType.customDataName + this.$t('statistical')+'.xls';
                 //  if (this.radio == '人员' ) {
                 //      console.log(this.exportParam.userIds);
                 //      fileName = '人员工时成本统计.xls';
@@ -238,7 +238,7 @@
             //获取人员成本统计列表
             getUserCostList() {
                 this.listLoading = true;
-                let url = this.radio == '人员' ? '/department/getUserCustomDataStatistic' : '/department/getDeptCustomDataStatistic'
+                let url = this.radio == this.$t('ren-yuan') ? '/department/getUserCustomDataStatistic' : '/department/getDeptCustomDataStatistic'
                 this.http.post(url, {
                     startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
                     endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange
@@ -248,11 +248,11 @@
                     var _this = this;
                     this.hasReportUserList = [];
                     if (res.code == "ok") {
-                        if(this.user.userNameNeedTranslate == 1 && (this.radio == '人员' || this.radio == '部门')) {
+                        if(this.user.userNameNeedTranslate == 1 && (this.radio == this.$t('ren-yuan') || this.radio == this.$t('lable.department'))) {
                             let arr = []
                             for(var i in res.data.list) {
                                 let obj = {}
-                                if(this.radio == '人员') {
+                                if(this.radio == this.$t('ren-yuan')) {
                                     obj.type = 'userName'
                                 } else {
                                     obj.type = 'departmentName'
@@ -307,7 +307,7 @@
                     // this.hasReportUserList = this.radio == '人员' ? res.data.userList : res.data.department;
                     // var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
 
-                    this.hasReportUserList = this.radio == '人员' ? data.data.userList : data.data.department;
+                    this.hasReportUserList = this.radio == this.$t('ren-yuan') ? data.data.userList : data.data.department;
                     var xList = [] , yList = [] , list = data.data.list, array = [] , series = [];
 
                     var totalHours = 0.0;
@@ -369,7 +369,7 @@
                     var option = {
                         //总成本
                         title: {
-                            text: _this.user.timeType.customDataName + '总计' + totalHours,
+                            text: _this.user.timeType.customDataName + this.$t('zong-ji') + totalHours,
                             left:'left',
                         },
                         
@@ -412,18 +412,18 @@
                                 var res = "";
                                 for(var i in params) {
                                     if (params[i].data.value > 0) {
-                                        res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName 
+                                        res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>"+_this.$t('headerTop.projectName')+":" + params[i].seriesName 
                                             + "</font><br/>"+_this.user.timeType.customDataName+" : " + params[i].data.cost+"</div>";
                                         totalTime += Number(params[i].data.cost);
                                     }
                                 }
                                 if(_this.user.userNameNeedTranslate != 1) {
-                                    res = res +'<br/>'+ params[0].name+ '<br/>总计: ' + totalTime.toFixed(1);
+                                    res = res +'<br/>'+ params[0].name+ '<br/>'+_this.$t('zong-ji')+': ' + totalTime.toFixed(1);
                                 } else {
-                                    if(_this.radio == '人员' || _this.radio == '部门') {
-                                        res = res +'<br/>'+ '' + '<br/>总计: ' + totalTime.toFixed(1);
+                                    if(_this.radio == _this.$t('ren-yuan') || _this.radio == _this.$t('lable.department')) {
+                                        res = res +'<br/>'+ '' + '<br/>'+_this.$t('zong-ji')+': ' + totalTime.toFixed(1);
                                     } else {
-                                        res = res +'<br/>'+ params[0].name+ '<br/>总计: ' + totalTime.toFixed(1);
+                                        res = res +'<br/>'+ params[0].name+ '<br/>'+_this.$t('zong-ji')+': ' + totalTime.toFixed(1);
                                     }
                                 }
                                 return res;
@@ -458,7 +458,7 @@
                 // this.jieliu()
             },
             backToParentDept() {
-                if (this.radio == '部门') {
+                if (this.radio == this.$t('lable.department')) {
                     if (this.parentDeptStack.length > 0) {
                         this.parentDeptStack.pop();
                         if (this.parentDeptStack.length > 0) {
@@ -481,11 +481,11 @@
                     // console.log(param);
                 }
                 var url = '';
-                if (this.radio=='项目') {
+                if (this.radio==this.$t('other.project')) {
                     url = '/project/getCustomDataSum';
                 // } else if (this.radio=='部门') {
                 //     url = '/department/getDeptCustomDataStatistic';
-                } else if (this.radio=='人员' || this.radio == '部门') {
+                } else if (this.radio==this.$t('ren-yuan') || this.radio == this.$t('lable.department')) {
                     this.getUserCostList();
                     return;
                 } else if (this.radio == this.namess) {
@@ -509,12 +509,12 @@
                         var list
                         var totalMoneyCost;
                         var totalHours = 0.0;
-                        if(this.radio == '项目' || this.radio=='部门') {
+                        if(this.radio == this.$t('other.project') || this.radio==this.$t('lable.department')) {
                             list = res.data.costList
-                            totalMoneyCost = ((this.radio=='项目')?res.data.totalMoneyCost:res.data.totalCostMoney);
+                            totalMoneyCost = ((this.radio==this.$t('other.project'))?res.data.totalMoneyCost:res.data.totalCostMoney);
                             for(var i in list) {
-                                if(this.radio=='项目') {
-                                    xList.push(this.radio=='项目'?list[i].project:list[i].name);
+                                if(this.radio==this.$t('other.project')) {
+                                    xList.push(this.radio==this.$t('other.project')?list[i].project:list[i].name);
                                     yList.push({
                                         "value": list[i].cost.toFixed(1),
                                         "id": list[i].id || i,
@@ -560,10 +560,10 @@
                         if(totalMoneyCost) {
                             this.zhishin = totalMoneyCost.toFixed(2)
                         } 
-                        if(this.radio == '项目' || this.radio == '人员' || this.radio=='部门') {
+                        if(this.radio == this.$t('other.project') || this.radio == this.$t('ren-yuan') || this.radio==this.$t('lable.department')) {
                             var option = {
                                 title: {
-                                    text: _this.user.timeType.customDataName+'总计:' + totalHours,
+                                    text: _this.user.timeType.customDataName+_this.$t('zong-ji')+':' + totalHours,
                                     left:'left',
                                 },
                                 // 工具箱
@@ -603,7 +603,7 @@
                         } else {
                             var option = {
                                 title: {
-                                    text: '工时成本总计' + _this.zhishin + '元, 时长'+totalHours+'小时',
+                                    text: _this.$t('otalhourscost') + _this.zhishin + _this.$t('yuan')+','+_this.$t('time.duration')+totalHours+_this.$t('time.hour'),
                                     left:'left',
                                 },
                                 // 工具箱
@@ -616,8 +616,8 @@
                                 tooltip:{
                                     trigger:'axis',
                                     formatter: function (params,ticket,callback) {
-                                        var res = params[0].name + "<br/>工作成本"+" : " + params[0].data.money 
-                                        + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
+                                        var res = params[0].name + "<br/>"+_this.$t('workcost')+" : " + params[0].data.money 
+                                        + _this.$t('yuan')+"<br/>"+_this.$t('screening.workTime')+" : " + params[0].data.cost + _this.$t('time.hour');
                                         _this.params = params;
                                         return res;
                                     }
@@ -631,11 +631,11 @@
                                 yAxis: [{
                                     type : 'value',
                                     axisLabel: {
-                                        formatter:this.yAxisValue==0?'{value} (元)':'{value}小时'
+                                        formatter:this.yAxisValue==0?'{value} ('+this.$t('yuan')+')':'{value}'+this.$t('time.hour')
                                     }
                                 }],
                                 series: [{
-                                    name: this.yAxisValue==0?'工作成本(元)':'工作时长(小时)',
+                                    name: this.yAxisValue==0?this.$t('workcost')+'('+this.$t('yuan')+')':this.$t('screening.workTime')+'('+this.$t('time.hour')+')',
                                     type: 'bar',
                                     barMaxWidth: 30,
                                     data: yList,
@@ -723,7 +723,7 @@
                 }
                 this.exportParam.dateRange = this.dateRange;
             }
-            this.radio = this.permissions.customDataAll?'项目':'人员';
+            this.radio = this.permissions.customDataAll?this.$t('other.project'):this.$t('ren-yuan');
             this.getEchart();
             var _this = this;
             window.addEventListener("resize", function() {