|
@@ -35,14 +35,20 @@
|
|
|
<el-radio-button label="部门"></el-radio-button>
|
|
|
<el-radio-button label="人员" 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>
|
|
|
+<!--
|
|
|
+ <el-select v-model="customName" filterable placeholder="请选择" style="margin-top: 10px;width: 350px" v-if="theCustomListFlg" @change="jieliu()">
|
|
|
+ <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="请选择人员" style="margin-top: 10px;width: 350px" v-if="radio == '人员'" @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="showExportDialog">报表导出</el-button>
|
|
|
+ <el-button @click="exportProjectData" v-if="theCustomListFlg">报表导出</el-button>
|
|
|
+ <el-button @click="showExportDialog" v-else>报表导出</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<!-- <div id="clearfix" :style="'width:'+widthHtval+'px;position: relative; height:'+containerHeight+'px;'">
|
|
@@ -160,7 +166,15 @@
|
|
|
jichu: [],
|
|
|
namess: '',
|
|
|
timers: null, // 点击的时间
|
|
|
- zhishin: 0
|
|
|
+ zhishin: 0,
|
|
|
+ theCustomList: [], // 自定义数据来源
|
|
|
+ theCustomListFlg: false, // 判断是否点击的是自定义配置的数据来源
|
|
|
+ theCustomListId: '',
|
|
|
+ theCustomListPlantLIst: [],
|
|
|
+ theCustomListPlant: '',
|
|
|
+ customId: '',
|
|
|
+ customName: '',
|
|
|
+ customList: []
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -297,7 +311,16 @@
|
|
|
param.projectSum = this.exportParam.projectSum;
|
|
|
}
|
|
|
}
|
|
|
- param.type = this.exportParam.type*1
|
|
|
+ if(!this.theCustomListFlg) {
|
|
|
+ param.type = this.exportParam.type*1
|
|
|
+ }
|
|
|
+ if(this.theCustomListFlg) {
|
|
|
+ url = '/project/exportTimeCostByUserCustom'
|
|
|
+ fileName = this.radio + '统计.xls'
|
|
|
+ // param.subCustomName = this.customName
|
|
|
+ param.customId = this.theCustomListId
|
|
|
+ param.fieldName = this.theCustomListPlant
|
|
|
+ }
|
|
|
this.http.post(url, param,
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
@@ -703,17 +726,45 @@
|
|
|
yanjiu() {
|
|
|
console.log('触发')
|
|
|
},
|
|
|
- getEchart(){
|
|
|
+ getEchart(e){
|
|
|
var that = this
|
|
|
- // that.timers = setTimeout(()=>{
|
|
|
- // clearTimeout(that.timers)
|
|
|
- // console.log(that.timers)
|
|
|
- that.jieliu()
|
|
|
- // },100);
|
|
|
- // this.jieliu()
|
|
|
- // if(this.radio == '项目分类'){
|
|
|
- // this.getCategoryList()
|
|
|
- // }
|
|
|
+ // 更具选中的名字筛选出对应的自定义id
|
|
|
+ that.theCustomListFlg = false
|
|
|
+ let ints = null
|
|
|
+ for(var i in that.theCustomList) {
|
|
|
+ if(that.radio == that.theCustomList[i].name) {
|
|
|
+ that.theCustomListId = that.theCustomList[i].id
|
|
|
+ that.theCustomListPlant = that.theCustomListPlantLIst[i]
|
|
|
+ that.theCustomListFlg = true
|
|
|
+ ints = i
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(that.theCustomListFlg) {
|
|
|
+ that.customList = that.theCustomList[ints].subUserCustomList
|
|
|
+ that.customName = that.theCustomList[ints].subUserCustomList[0].name
|
|
|
+ // that.getCusTom()
|
|
|
+ }
|
|
|
+ that.jieliu()
|
|
|
+ },
|
|
|
+ getCusTom() {
|
|
|
+ this.http.post('/sub-user-custom/list',{
|
|
|
+ userCustomId: this.theCustomListId
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.customList = res.data
|
|
|
+ this.customName = res.data[0].name
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
getCategoryList(){
|
|
|
this.http.post('/project-category/list',{},
|
|
@@ -776,7 +827,13 @@
|
|
|
return;
|
|
|
} else if (this.radio == this.namess) {
|
|
|
url = '/project/getDegreeCost'
|
|
|
- }
|
|
|
+ } else if (this.theCustomListFlg) {
|
|
|
+ url = '/project/getTimeCostByUserCustom'
|
|
|
+ // param.subCustomName = this.customName
|
|
|
+ param.customId = this.theCustomListId
|
|
|
+ param.fieldName = this.theCustomListPlant
|
|
|
+ console.log(param, '要传的数据')
|
|
|
+ }
|
|
|
this.http.post(url, param,
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
@@ -864,7 +921,31 @@
|
|
|
yList.push(item);
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else if(this.theCustomListFlg) {
|
|
|
+ list = res.data.list
|
|
|
+
|
|
|
+ for(var i in list) {
|
|
|
+ // console.log(list[i].name, list[i].costMoney, list[i].cost)
|
|
|
+ xList.push(list[i].name);
|
|
|
+ let item = {
|
|
|
+ "value": this.yAxisValue==0?list[i].costMoney:list[i].cost,
|
|
|
+ "id": list[i].id || i,
|
|
|
+ }
|
|
|
+ if(this.permissions.countCost){
|
|
|
+ // item.money = list[i].costMoney.toFixed(2)
|
|
|
+ item.money = list[i].costMoney ? list[i].costMoney.toFixed(2) : 0
|
|
|
+ totalMoneyCost += parseFloat(list[i].costMoney);
|
|
|
+ }
|
|
|
+ if(this.permissions.countHours){
|
|
|
+ item.cost = list[i].cost
|
|
|
+ totalHours += parseFloat(list[i].cost);
|
|
|
+ }
|
|
|
+ yList.push(item);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
list = res.data
|
|
|
|
|
|
for(var i in list) {
|
|
@@ -1062,6 +1143,27 @@
|
|
|
event.preventDefault() // 阻止浏览器默认事件
|
|
|
this.domObj.scrollLeft = this.domObj.scrollLeft + step
|
|
|
},
|
|
|
+ // 判断后端给的字段
|
|
|
+ // 获取自定义
|
|
|
+ getZDY() {
|
|
|
+ this.http.post('/user-custom/getUserCustomTitle',{},res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ console.log(res, '数据来源')
|
|
|
+ this.theCustomList = res.data.result
|
|
|
+ this.theCustomListPlantLIst = res.data.field
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.myChart = null
|
|
@@ -1111,6 +1213,10 @@
|
|
|
this.getUsers()
|
|
|
this.jutishez()
|
|
|
this.scrollFunction()
|
|
|
+ // 判断
|
|
|
+ if(this.user.timeType.userCustomStatic) {
|
|
|
+ this.getZDY()
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy () {
|
|
|
var myChart = echarts.init(document.getElementById("container"));
|