|
@@ -2,10 +2,10 @@
|
|
|
<section>
|
|
|
<el-row style="padding-bottom: 0px;text-align:center;margin-top:20px;z-index: 999;">
|
|
|
<el-col :span="6" >
|
|
|
- <div ><span style="color:#999;">图表Y轴: </span>
|
|
|
+ <div ><span style="color:#999;">{{ $t('chartY') }} </span>
|
|
|
<el-radio-group v-model="yAxisValue" @change="onYAxisChange" size="small">
|
|
|
- <el-radio-button label="0" v-if="permissions.countCost">显示成本</el-radio-button>
|
|
|
- <el-radio-button label="1" v-if="permissions.countHours">显示工时</el-radio-button>
|
|
|
+ <el-radio-button label="0" v-if="permissions.countCost">{{ $t('accordingtothecost') }}</el-radio-button>
|
|
|
+ <el-radio-button label="1" v-if="permissions.countHours">{{ $t('accordingtoworkinghours') }}</el-radio-button>
|
|
|
</el-radio-group></div>
|
|
|
</el-col>
|
|
|
<el-col :span="14" style="display: flex;flex-wrap: wrap;">
|
|
@@ -14,10 +14,10 @@
|
|
|
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-date-picker v-show="user.timeType.fixMonthcost==1"
|
|
@@ -29,11 +29,11 @@
|
|
|
></el-date-picker>
|
|
|
|
|
|
<el-radio-group v-model="radio" @change="getEchart" style="margin-left:10px;" size="small">
|
|
|
- <el-radio-button label="项目"></el-radio-button>
|
|
|
- <el-radio-button label="主项目" v-if="user.timeType.mainProjectState"></el-radio-button>
|
|
|
- <el-radio-button label="项目分类"></el-radio-button>
|
|
|
- <el-radio-button label="部门"></el-radio-button>
|
|
|
- <el-radio-button label="人员" v-if="permissions.countPersonnel"></el-radio-button>
|
|
|
+ <el-radio-button :label="$t('other.project')"></el-radio-button>
|
|
|
+ <el-radio-button :label="$t('zhu-xiang-mu')" v-if="user.timeType.mainProjectState"></el-radio-button>
|
|
|
+ <el-radio-button :label="$t('projectclassification')"></el-radio-button>
|
|
|
+ <el-radio-button :label="$t('lable.department')"></el-radio-button>
|
|
|
+ <el-radio-button :label="$t('ren-yuan')" v-if="permissions.countPersonnel"></el-radio-button>
|
|
|
<el-radio-button :label="namess" v-if="jichu.customDegreeActive == 1"></el-radio-button>
|
|
|
<el-radio-button v-for="item in theCustomList" :key="item.id" :label="item.name"></el-radio-button>
|
|
|
</el-radio-group>
|
|
@@ -42,33 +42,33 @@
|
|
|
<el-option v-for="item in customList" :key="item.id" :label="item.name" :value="item.name"></el-option>
|
|
|
</el-select> -->
|
|
|
|
|
|
- <el-select v-model="personnelValue" filterable clearable placeholder="请选择人员" size="small" style="margin-top: 10px;width: 350px" v-if="radio == '人员'" @change="personnel()">
|
|
|
+ <el-select v-model="personnelValue" filterable clearable :placeholder="$t('pleaseselectpersonnel')" size="small" style="margin-top: 10px;width: 350px" v-if="radio == $t('ren-yuan')" @change="personnel()">
|
|
|
<el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.name"></el-option>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-button @click="exportProjectData" v-if="theCustomListFlg" size="small">报表导出</el-button>
|
|
|
- <el-button @click="showExportDialog" v-else size="small">报表导出</el-button>
|
|
|
+ <el-button @click="exportProjectData" v-if="theCustomListFlg" size="small">{{ $t('reporderived') }}</el-button>
|
|
|
+ <el-button @click="showExportDialog" v-else size="small">{{ $t('reporderived') }}</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- <div id="clearfix" :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
|
|
|
<div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
|
|
|
</div> -->
|
|
|
- <div id="clearfix" :class="radio == '人员' ? 'ryuans' : ''" :style="'overflow-x: auto;width:100%;padding-bottom: 100px; position: relative; height:'+containerHeight+'px;'">
|
|
|
+ <div id="clearfix" :class="radio == $t('ren-yuan') ? 'ryuans' : ''" :style="'overflow-x: auto;width:100%;padding-bottom: 100px; position: relative; height:'+containerHeight+'px;'">
|
|
|
<div id="container" :style="'height:'+containerHeight+'px;width:100%'"></div>
|
|
|
</div>
|
|
|
<!-- <div>
|
|
|
<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">返回上级</el-button>
|
|
|
+ <div style="position:fixed;top:170px;left:600px;" v-show="radio==$t('lable.department') && parentDeptId != null">
|
|
|
+ <el-button @click="backToParentDept">{{ $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('timeReportExport')" 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="radio != '人员' && radio != '项目分类'">
|
|
|
- <el-select v-model="exportParam.projectId" placeholder="全部项目" clearable style="width:350px;" filterable="true" popper-class="projectSelectPopperClass">
|
|
|
+ <el-form-item prop="projectId" :label="$t('defaultText.selectProject')" v-if="radio != $t('ren-yuan') && radio != $t('projectclassification')">
|
|
|
+ <el-select v-model="exportParam.projectId" :placeholder="$t('other.allProject')" clearable style="width:350px;" filterable="true" popper-class="projectSelectPopperClass">
|
|
|
<el-option v-for="item in projectList" :key="item.id" :label="item.projectName + item.projectCode" :value="item.id">
|
|
|
<span style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
|
|
|
<span style="float: right;font-size: 13px;">{{ item.projectName }}</span>
|
|
@@ -76,32 +76,32 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="部门选择" v-if="radio == '项目'">
|
|
|
- <el-cascader v-model="exportParam.deptId" :options="departmentList" placeholder="请选择部门"
|
|
|
+ <el-form-item :label="$t('departmentchoice')" v-if="radio == $t('other.project')">
|
|
|
+ <el-cascader v-model="exportParam.deptId" :options="departmentList" :placeholder="$t('defaultText.pleaseChoose')"
|
|
|
:props="{ checkStrictly: true, expandTrigger: 'hover' }" clearable filterable style="width:350px;"
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item prop="projectCategoryId" label="项目分类" v-if="radio == '项目分类'">
|
|
|
- <el-select v-model="exportParam.projectCategoryId" placeholder="全部项目分类" clearable style="width:350px;" filterable="true">
|
|
|
+ <el-form-item prop="projectCategoryId" :label="$t('projectclassification')" v-if="radio == $t('projectclassification')">
|
|
|
+ <el-select v-model="exportParam.projectCategoryId" :placeholder="$t('classificationitems')" clearable style="width:350px;" filterable="true">
|
|
|
<el-option v-for="item in categoryList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="userIds" label="选择人员" v-if="radio == '人员'">
|
|
|
- <el-select v-model="exportParam.userIds" placeholder="全部人员" multiple="true" clearable style="width:350px;" filterable="true">
|
|
|
+ <el-form-item prop="userIds" :label="$t('screening.selectPeople')" v-if="radio == $t('ren-yuan')">
|
|
|
+ <el-select v-model="exportParam.userIds" :placeholder="$t('lable.allStaff')" multiple="true" clearable style="width:350px;" filterable="true">
|
|
|
<el-option v-for="item in hasReportUserList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
</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>
|
|
|
|
|
|
|
|
@@ -114,33 +114,33 @@
|
|
|
></el-date-picker>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="选择人员" v-if="radio == '项目' || radio == '部门' || radio == '项目分类'">
|
|
|
- <el-select v-model="exportParam.userId" placeholder="全部人员" style="width: 350px" filterable="true" clearable="true">
|
|
|
+ <el-form-item :label="$t('screening.selectPeople')" v-if="radio == $t('other.project') || radio == $t('lable.department') || radio == $t('projectclassification')">
|
|
|
+ <el-select v-model="exportParam.userId" :placeholder="$t('lable.allStaff')" style="width: 350px" filterable="true" clearable="true">
|
|
|
<span v-for="(item, index) in users" :key="index">
|
|
|
<el-option :label="item.name" :value="item.id"></el-option>
|
|
|
</span>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="type" label="选择样式" v-if="radio == '项目' || radio == '部门' || radio == '项目分类'">
|
|
|
- <el-select v-model="exportParam.type" placeholder="选择样式" style="width:350px;" >
|
|
|
- <el-option :label="radio == '项目分类' ? '项目分类在行上' : '项目在行上'" value="0"></el-option>
|
|
|
- <el-option :label="radio == '项目分类' ? '项目分类在列上' : '项目在列上'" value="1"></el-option>
|
|
|
+ <el-form-item prop="type" :label="$t('choosethestyle')" v-if="radio == $t('other.project') || radio == $t('lable.department') || radio == $t('projectclassification')">
|
|
|
+ <el-select v-model="exportParam.type" :placeholder="$t('choosethestyle')" style="width:350px;" >
|
|
|
+ <el-option :label="radio == $t('projectclassification') ? $t('classifiedontheline') : $t('Itemontheline')" value="0"></el-option>
|
|
|
+ <el-option :label="radio == $t('projectclassification') ? $t('classifiedcolumns') : $t('itemisonthecolumn')" value="1"></el-option>
|
|
|
</el-select>
|
|
|
<div class="prompt">
|
|
|
<el-popover placement="top" width="1200" trigger="hover">
|
|
|
- <img src="../../assets/image/hanglie.png" alt="" width="100%" v-if="this.radio != '项目分类'">
|
|
|
+ <img src="../../assets/image/hanglie.png" alt="" width="100%" v-if="this.radio != $t('projectclassification')">
|
|
|
<img src="../../assets/image/hanglie_corp.png" alt="" width="100%" v-else>
|
|
|
<i class="el-icon-question" slot="reference" />
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="(radio == '项目' || radio == '部门' || radio == '项目分类') && exportParam.type == '0'">
|
|
|
- <el-checkbox v-model="exportParam.projectSum" >含单个项目数据汇总</el-checkbox>
|
|
|
+ <el-form-item v-if="($t('other.project') || radio == $t('lable.department') || radio == $t('projectclassification')) && exportParam.type == '0'">
|
|
|
+ <el-checkbox v-model="exportParam.projectSum" >{{ $t('individualprojectdata') }}</el-checkbox>
|
|
|
</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>
|
|
@@ -164,7 +164,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,
|
|
@@ -247,10 +247,10 @@
|
|
|
this.exportDialog = true;
|
|
|
this.exportParam.dateRange = this.dateRange;
|
|
|
console.log(this.hasReportUserList)
|
|
|
- if (this.radio == '人员') {
|
|
|
+ if (this.radio == this.$t('ren-yuan')) {
|
|
|
// this.exportParam.userIds = [];
|
|
|
}
|
|
|
- if (this.radio == '项目') {
|
|
|
+ if (this.radio == this.$t('other.project')) {
|
|
|
this.exportParam.deptId = []
|
|
|
}
|
|
|
},
|
|
@@ -281,10 +281,10 @@
|
|
|
param = {startDate:this.exportParam.dateRange[0], endDate: this.exportParam.dateRange[1],stateKey: 1};
|
|
|
}
|
|
|
var url = "/project/exportTimeCost";
|
|
|
- var fileName = '项目工时成本统计.xls';
|
|
|
- if (this.radio == '人员' ) {
|
|
|
+ var fileName = this.$t('projectmanhourcoststatistics')+ '.xls';
|
|
|
+ if (this.radio == this.$t('ren-yuan') ) {
|
|
|
console.log(this.exportParam.userIds);
|
|
|
- fileName = '人员工时成本统计.xls';
|
|
|
+ fileName = this.$t('labortimecoststatistics')+ '.xls';
|
|
|
url = '/department/exportUserStatistic';
|
|
|
if (this.exportParam.userIds != null && this.exportParam.userIds.length > 0) {
|
|
|
var ids = '';
|
|
@@ -294,23 +294,23 @@
|
|
|
param.userIds = ids;
|
|
|
}
|
|
|
}
|
|
|
- if(this.radio == '项目分类'){
|
|
|
- fileName = '项目分类工时成本统计.xls';
|
|
|
+ if(this.radio == this.$t('projectclassification')){
|
|
|
+ fileName = this.$t('projectclassificationlaborosttatistics')+ '.xls';
|
|
|
url = '/project/exportTimeCostByCategory'
|
|
|
if(this.exportParam.projectCategoryId){
|
|
|
param.projectCategoryId = this.exportParam.projectCategoryId
|
|
|
}
|
|
|
}
|
|
|
- if(this.radio == '部门'){
|
|
|
- fileName = '部门工时成本统计.xls'
|
|
|
+ if(this.radio == this.$t('lable.department')){
|
|
|
+ fileName = this.$t('departmenthourscoststatistics')+ '.xls'
|
|
|
url = '/department/exportDeptStatistic'
|
|
|
}
|
|
|
|
|
|
- if (this.exportParam.projectId && this.radio != '人员' && this.radio != '项目分类') {
|
|
|
+ if (this.exportParam.projectId && this.radio != this.$t('ren-yuan') && this.radio != this.$t('projectclassification')) {
|
|
|
param.projectId = this.exportParam.projectId;
|
|
|
}
|
|
|
if (this.exportParam.userId) {
|
|
|
- if(this.radio == '项目' || this.radio == '部门' || this.radio == '人员' || this.radio == '项目分类'){
|
|
|
+ if(this.radio == this.$t('other.project') || this.radio == this.$t('lable.department') || this.radio == this.$t('ren-yuan') || this.radio == this.$t('projectclassification')){
|
|
|
param.userId = this.exportParam.userId;
|
|
|
}
|
|
|
}
|
|
@@ -318,7 +318,7 @@
|
|
|
this.exportParam.projectSum = null
|
|
|
}
|
|
|
if (this.exportParam.projectSum != null) {
|
|
|
- if(this.radio == '项目' || this.radio == '部门' || this.radio == '项目分类'){
|
|
|
+ if(this.radio == this.$t('other.project') || this.radio == this.$t('lable.department') || this.radio == this.$t('projectclassification')){
|
|
|
param.projectSum = this.exportParam.projectSum;
|
|
|
}
|
|
|
}
|
|
@@ -327,7 +327,7 @@
|
|
|
}
|
|
|
if(this.theCustomListFlg) {
|
|
|
url = '/project/exportTimeCostByUserCustom'
|
|
|
- fileName = this.radio + '统计.xls'
|
|
|
+ fileName = this.radio + this.$t('statistical') + '.xls'
|
|
|
// param.subCustomName = this.customName
|
|
|
param.customId = this.theCustomListId
|
|
|
param.fieldName = this.theCustomListPlant
|
|
@@ -660,9 +660,9 @@
|
|
|
//总成本
|
|
|
title: {
|
|
|
// text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
|
|
|
- text: '工时成本总计:' +
|
|
|
- ((this.permissions.countCost) ? '成本' + totalMoneyCost.toFixed(2) + '元,' : '') +
|
|
|
- ((this.permissions.countHours) ? '时长' + totalHours + '小时' : ''),
|
|
|
+ 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') : ''),
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -708,17 +708,17 @@
|
|
|
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.permissions.countCost) ? "工作成本 : " + params[i].data.money + "元<br/>" : '') +
|
|
|
- ((_this.permissions.countHours) ? "工作时长 : " + params[i].data.cost + "小时</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);
|
|
|
totalCost += Number(params[i].data.money);
|
|
|
}
|
|
|
}
|
|
|
- res = res +'<br/>'+ params[0].name+ '<br/>总计: ' +
|
|
|
- ((_this.permissions.countHours) ? totalTime.toFixed(1) + '小时 ' : '') +
|
|
|
- ((_this.permissions.countCost) ? totalCost.toFixed(2) + "元" : '') +
|
|
|
+ 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/>";
|
|
|
return res;
|
|
|
}
|
|
@@ -732,7 +732,7 @@
|
|
|
yAxis: [{
|
|
|
type : 'value',
|
|
|
axisLabel: {
|
|
|
- formatter:this.yAxisValue==0?'{value} (元)':'{value} (小时)'
|
|
|
+ formatter:this.yAxisValue==0?'{value} ('+this.$t('yuan')+')':'{value} ('+this.$t('time.hour')+')'
|
|
|
}
|
|
|
}],
|
|
|
series: series,
|
|
@@ -801,7 +801,7 @@
|
|
|
})
|
|
|
},
|
|
|
backToParentDept() {
|
|
|
- if (this.radio == '部门') {
|
|
|
+ if (this.radio == this.$t('lable.department')) {
|
|
|
if (this.parentDeptStack.length > 0) {
|
|
|
this.parentDeptStack.pop();
|
|
|
if (this.parentDeptStack.length > 0) {
|
|
@@ -826,19 +826,19 @@
|
|
|
// console.log(param);
|
|
|
}
|
|
|
var url = '';
|
|
|
- if (this.radio=='项目') {
|
|
|
+ if (this.radio==this.$t('other.project')) {
|
|
|
url = this.port.project.listCost;
|
|
|
- }else if(this.radio == '主项目'){
|
|
|
+ }else if(this.radio == this.$t('zhu-xiang-mu')){
|
|
|
url = '/project/getTimeCostByMainProject'
|
|
|
// param.userId = this.user.id
|
|
|
- }else if (this.radio=='项目分类') {
|
|
|
+ }else if (this.radio==this.$t('projectclassification')) {
|
|
|
url = '/project/getTimeCostByCategory';
|
|
|
// param.parentDeptId = this.parentDeptId;
|
|
|
// param.userId = this.user.id
|
|
|
- } else if (this.radio=='部门') {
|
|
|
+ } else if (this.radio==this.$t('lable.department')) {
|
|
|
url = this.port.project.depCost;
|
|
|
param.parentDeptId = this.parentDeptId;
|
|
|
- } else if (this.radio=='人员') {
|
|
|
+ } else if (this.radio==this.$t('ren-yuan')) {
|
|
|
this.getUserCostList();
|
|
|
return;
|
|
|
} else if (this.radio == this.namess) {
|
|
@@ -875,13 +875,13 @@
|
|
|
var list
|
|
|
var totalMoneyCost;
|
|
|
var totalHours = 0.0;
|
|
|
- if(this.radio == '项目' || this.radio == '项目分类' || this.radio=='部门' || this.radio == '主项目') {
|
|
|
+ if(this.radio == this.$t('other.project') || this.radio == this.$t('projectclassification') || this.radio==this.$t('lable.department') || this.radio == this.$t('zhu-xiang-mu')) {
|
|
|
list = res.data.costList
|
|
|
- totalMoneyCost = ((this.radio=='项目' || this.radio == '项目分类')?res.data.totalMoneyCost:res.data.totalCostMoney);
|
|
|
+ totalMoneyCost = ((this.radio==this.$t('other.project') || this.radio == this.$t('projectclassification'))?res.data.totalMoneyCost:res.data.totalCostMoney);
|
|
|
|
|
|
for(var i in list) {
|
|
|
- if(this.radio=='项目' || this.radio == '主项目') {
|
|
|
- if(this.radio == '项目'){
|
|
|
+ if(this.radio==this.$t('other.project') || this.radio == this.$t('zhu-xiang-mu')) {
|
|
|
+ if(this.radio == this.$t('other.project')){
|
|
|
xList.push(list[i].project);
|
|
|
}else{
|
|
|
xList.push(list[i].mainProjectName);
|
|
@@ -901,7 +901,7 @@
|
|
|
}
|
|
|
yList.push(item);
|
|
|
|
|
|
- } else if(this.radio == '部门'){
|
|
|
+ } else if(this.radio == this.$t('lable.department')){
|
|
|
xList.push(list[i].departmentName);
|
|
|
let item = {
|
|
|
// "value": this.yAxisValue==0 ? list[i].costMoney.toFixed(2) || list[i].costMoney: list[i].costTime.toFixed(1),
|
|
@@ -997,10 +997,10 @@
|
|
|
this.zhishin = totalMoneyCost.toFixed(2)
|
|
|
}
|
|
|
|
|
|
- if(this.radio == '项目' || this.radio == '主项目' || this.radio == '人员' || this.radio == '项目分类' || this.radio=='部门') {
|
|
|
+ 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 = {
|
|
|
title: {
|
|
|
- text: '工时成本总计:' + ((this.permissions.countCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countHours) ? '时长' + 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') : ''),
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -1017,9 +1017,9 @@
|
|
|
// + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
|
|
|
_this.params = params;
|
|
|
var res = params[0].name + "<br/>" +
|
|
|
- ((_this.permissions.countCost) ? "工作成本"+" : " + params[0].data.money
|
|
|
- + "元 <br/>" : '') +
|
|
|
- ((_this.permissions.countHours) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
|
|
|
+ ((_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') : '');
|
|
|
return res;
|
|
|
}
|
|
|
},
|
|
@@ -1032,11 +1032,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,
|
|
@@ -1049,7 +1049,7 @@
|
|
|
var option = {
|
|
|
title: {
|
|
|
// text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
|
|
|
- text: '工时成本总计:' + ((this.permissions.countCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countHours) ? '时长' + 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') : ''),
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -1063,9 +1063,9 @@
|
|
|
trigger:'axis',
|
|
|
formatter: function (params,ticket,callback) {
|
|
|
var res = params[0].name + "<br/>" +
|
|
|
- ((_this.permissions.countCost) ? "工作成本"+" : " + params[0].data.money
|
|
|
- + "元 <br/>" : '') +
|
|
|
- ((_this.permissions.countHours) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
|
|
|
+ ((_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;
|
|
|
return res;
|
|
|
}
|
|
@@ -1079,11 +1079,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,
|
|
@@ -1099,7 +1099,7 @@
|
|
|
const pointInPixel = [params.offsetX, params.offsetY];
|
|
|
if (myChart.containPixel('grid', pointInPixel)) {
|
|
|
console.log(_this.params)
|
|
|
- if(_this.radio=='项目') {
|
|
|
+ if(_this.radio==this.$t('other.project')) {
|
|
|
if (_this.dateRange != null) {
|
|
|
if (this.user.timeType.fixMonthcost == 0) {
|
|
|
_this.$router.push("/cost/" + _this.params[0].data.id + "/" + _this.params[0].name
|
|
@@ -1111,7 +1111,7 @@
|
|
|
} else {
|
|
|
_this.$router.push("/cost/" + _this.params[0].data.id + "/" + _this.params[0].name);
|
|
|
}
|
|
|
- } else if (_this.radio=='部门') {
|
|
|
+ } else if (_this.radio==this.$t('lable.department')) {
|
|
|
if (_this.params[0].data.hasSubDept) {
|
|
|
if (_this.parentDeptId != _this.params[0].data.id) {
|
|
|
_this.parentDeptId = _this.params[0].data.id;
|
|
@@ -1261,7 +1261,7 @@
|
|
|
}
|
|
|
this.exportParam.dateRange = this.dateRange;
|
|
|
}
|
|
|
- this.radio = '项目'
|
|
|
+ this.radio = this.$t('other.project')
|
|
|
this.getEchart();
|
|
|
var _this = this;
|
|
|
window.addEventListener("resize", function() {
|