|
@@ -4,8 +4,8 @@
|
|
|
<el-col :span="6" >
|
|
|
<div ><span style="color:#999;">图表Y轴: </span>
|
|
|
<el-radio-group v-model="yAxisValue" @change="onYAxisChange">
|
|
|
- <el-radio-button label="0" v-if="permissions.countAllCost || permissions.countResCost">显示成本</el-radio-button>
|
|
|
- <el-radio-button label="1" v-if="permissions.countAllWorkTime || permissions.countResWorkTime">显示工时</el-radio-button>
|
|
|
+ <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-group></div>
|
|
|
</el-col>
|
|
|
<el-col :span="14" style="display: flex;flex-wrap: wrap;">
|
|
@@ -273,6 +273,10 @@
|
|
|
param.projectCategoryId = this.exportParam.projectCategoryId
|
|
|
}
|
|
|
}
|
|
|
+ if(this.radio == '部门'){
|
|
|
+ fileName = '部门工时成本统计.xls'
|
|
|
+ url = '/department/exportDeptStatistic'
|
|
|
+ }
|
|
|
|
|
|
if (this.exportParam.projectId && this.radio != '人员' && this.radio != '项目分类') {
|
|
|
param.projectId = this.exportParam.projectId;
|
|
@@ -552,10 +556,10 @@
|
|
|
let item = {
|
|
|
"value": this.yAxisValue==0?project[k].money:project[k].time,
|
|
|
}
|
|
|
- if(this.permissions.countAllCost || this.permissions.countResCost){
|
|
|
+ if(this.permissions.countCost){
|
|
|
item.money = project[k].money
|
|
|
}
|
|
|
- if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
|
|
|
+ if(this.permissions.countHours){
|
|
|
item.cost = project[k].time
|
|
|
totalHours += parseFloat(project[k].time);
|
|
|
}
|
|
@@ -604,8 +608,8 @@
|
|
|
title: {
|
|
|
// text: '工时成本总计' + totalMoneyCost.toFixed(2) + '元, 时长'+totalHours+'小时',
|
|
|
text: '工时成本总计:' +
|
|
|
- ((this.permissions.countAllCost || this.permissions.countResCost) ? '成本' + totalMoneyCost.toFixed(2) + '元,' : '') +
|
|
|
- ((this.permissions.countAllWorkTime || this.permissions.countResWorkTime) ? '时长' + totalHours + '小时' : ''),
|
|
|
+ ((this.permissions.countCost) ? '成本' + totalMoneyCost.toFixed(2) + '元,' : '') +
|
|
|
+ ((this.permissions.countHours) ? '时长' + totalHours + '小时' : ''),
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -653,15 +657,15 @@
|
|
|
if (params[i].data.value > 0) {
|
|
|
res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName
|
|
|
+ "</font><br/>" +
|
|
|
- ((_this.permissions.countAllCost || _this.permissions.countResCost) ? "工作成本 : " + params[i].data.money + "元<br/>" : '') +
|
|
|
- ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? "工作时长 : " + params[i].data.cost + "小时</br>" : '') + "</div>";
|
|
|
+ ((_this.permissions.countCost) ? "工作成本 : " + params[i].data.money + "元<br/>" : '') +
|
|
|
+ ((_this.permissions.countHours) ? "工作时长 : " + params[i].data.cost + "小时</br>" : '') + "</div>";
|
|
|
totalTime += Number(params[i].data.cost);
|
|
|
totalCost += Number(params[i].data.money);
|
|
|
}
|
|
|
}
|
|
|
res = res +'<br/>'+ params[0].name+ '<br/>总计: ' +
|
|
|
- ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? totalTime.toFixed(1) + '小时 ' : '') +
|
|
|
- ((_this.permissions.countAllCost || _this.permissions.countResCost) ? totalCost.toFixed(2) + "元" : '') +
|
|
|
+ ((_this.permissions.countHours) ? totalTime.toFixed(1) + '小时 ' : '') +
|
|
|
+ ((_this.permissions.countCost) ? totalCost.toFixed(2) + "元" : '') +
|
|
|
"<br/>";
|
|
|
return res;
|
|
|
}
|
|
@@ -784,10 +788,10 @@
|
|
|
"value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
|
|
|
"id": list[i].id || i,
|
|
|
}
|
|
|
- if(this.permissions.countAllCost || this.permissions.countResCost){
|
|
|
+ if(this.permissions.countCost){
|
|
|
item.money = list[i].costMoney.toFixed(2)
|
|
|
}
|
|
|
- if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
|
|
|
+ if(this.permissions.countHours){
|
|
|
item.cost = list[i].cost
|
|
|
totalHours += parseFloat(list[i].cost);
|
|
|
}
|
|
@@ -800,10 +804,10 @@
|
|
|
"id": list[i].departmentId,
|
|
|
"hasSubDept": list[i].hasSubDept
|
|
|
}
|
|
|
- if(this.permissions.countAllCost || this.permissions.countResCost){
|
|
|
+ if(this.permissions.countCost){
|
|
|
item.money = list[i].costMoney.toFixed(2)
|
|
|
}
|
|
|
- if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
|
|
|
+ if(this.permissions.countHours){
|
|
|
item.cost = list[i].costTime
|
|
|
totalHours += parseFloat(list[i].costTime);
|
|
|
}
|
|
@@ -815,10 +819,10 @@
|
|
|
"value": this.yAxisValue==0?list[i].costMoney.toFixed(2) || list[i].costMoney:list[i].cost.toFixed(1),
|
|
|
"id": list[i].id || i,
|
|
|
}
|
|
|
- if(this.permissions.countAllCost || this.permissions.countResCost){
|
|
|
+ if(this.permissions.countCost){
|
|
|
item.money = list[i].costMoney.toFixed(2)
|
|
|
}
|
|
|
- if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
|
|
|
+ if(this.permissions.countHours){
|
|
|
item.cost = list[i].cost
|
|
|
totalHours += parseFloat(list[i].cost);
|
|
|
}
|
|
@@ -835,11 +839,11 @@
|
|
|
"value": this.yAxisValue==0?list[i].costMoney:list[i].cost,
|
|
|
"id": list[i].id || i,
|
|
|
}
|
|
|
- if(this.permissions.countAllCost || this.permissions.countResCost){
|
|
|
+ if(this.permissions.countCost){
|
|
|
item.money = list[i].costMoney.toFixed(2)
|
|
|
totalMoneyCost += parseFloat(list[i].costMoney);
|
|
|
}
|
|
|
- if(this.permissions.countAllWorkTime || this.permissions.countResWorkTime){
|
|
|
+ if(this.permissions.countHours){
|
|
|
item.cost = list[i].cost
|
|
|
totalHours += parseFloat(list[i].cost);
|
|
|
}
|
|
@@ -864,7 +868,7 @@
|
|
|
if(this.radio == '项目' || this.radio == '人员' || this.radio == '项目分类' || this.radio=='部门') {
|
|
|
var option = {
|
|
|
title: {
|
|
|
- text: '工时成本总计:' + ((this.permissions.countAllCost || this.permissions.countResCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countAllWorkTime || this.permissions.countResWorkTime) ? '时长' + totalHours + '小时' : ''),
|
|
|
+ text: '工时成本总计:' + ((this.permissions.countCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countHours) ? '时长' + totalHours + '小时' : ''),
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -881,9 +885,9 @@
|
|
|
// + "元 <br/>工作时长"+" : " + params[0].data.cost + "小时";
|
|
|
// _this.params = params;
|
|
|
var res = params[0].name + "<br/>" +
|
|
|
- ((_this.permissions.countAllCost || _this.permissions.countResCost) ? "工作成本"+" : " + params[0].data.money
|
|
|
+ ((_this.permissions.countCost) ? "工作成本"+" : " + params[0].data.money
|
|
|
+ "元 <br/>" : '') +
|
|
|
- ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
|
|
|
+ ((_this.permissions.countHours) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
|
|
|
return res;
|
|
|
}
|
|
|
},
|
|
@@ -910,7 +914,7 @@
|
|
|
var option = {
|
|
|
title: {
|
|
|
// text: '工时成本总计' + this.zhishin + '元, 时长'+totalHours+'小时',
|
|
|
- text: '工时成本总计:' + ((this.permissions.countAllCost || this.permissions.countResCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countAllWorkTime || this.permissions.countResWorkTime) ? '时长' + totalHours + '小时' : ''),
|
|
|
+ text: '工时成本总计:' + ((this.permissions.countCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countHours) ? '时长' + totalHours + '小时' : ''),
|
|
|
left:'left',
|
|
|
},
|
|
|
// 工具箱
|
|
@@ -924,9 +928,9 @@
|
|
|
trigger:'axis',
|
|
|
formatter: function (params,ticket,callback) {
|
|
|
var res = params[0].name + "<br/>" +
|
|
|
- ((_this.permissions.countAllCost || _this.permissions.countResCost) ? "工作成本"+" : " + params[0].data.money
|
|
|
+ ((_this.permissions.countCost) ? "工作成本"+" : " + params[0].data.money
|
|
|
+ "元 <br/>" : '') +
|
|
|
- ((_this.permissions.countAllWorkTime || _this.permissions.countResWorkTime) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
|
|
|
+ ((_this.permissions.countHours) ? "工作时长"+" : " + params[0].data.cost + "小时" : '');
|
|
|
_this.params = params;
|
|
|
return res;
|
|
|
}
|
|
@@ -1033,7 +1037,7 @@
|
|
|
this.containerHeight = window.innerHeight - 130
|
|
|
// this.containerHeight = window.innerHeight - 200
|
|
|
};
|
|
|
- if(this.permissions.countAllCost || this.permissions.countResCost){
|
|
|
+ if(this.permissions.countCost){
|
|
|
this.yAxisValue = '0'
|
|
|
}else{
|
|
|
this.yAxisValue = '1'
|