统计表y轴最小值更改

This commit is contained in:
shijing 2023-08-02 14:50:45 +08:00
parent 350254294b
commit 377f673f60
3 changed files with 94 additions and 37 deletions

View File

@ -67,54 +67,86 @@
goal_key__in:'pgoal_1,pgoal_2,pgoal_3,pgoal_4,pgoal_5',
belong_dept__in:''
},
query:{
year:'',
dept_type_name:'2级公司'
},
taskList:[],
heightTable:null,
listLoading:false
};
},
mounted(){
this.getOrgList();
let height = document.getElementsByClassName('app-main')[0].clientHeight;
this.heightTable = height-90;
debugger;
if (checkPermission(["record_confirm"])) {
this.getTableData();
} else {
this.getOrgList();
}
},
methods:{
checkPermission,
getOrgList() {
let that = this;
let ids = ''
if (that.checkPermission(["record_confirm"])) {
getOrgList({ can_supervision: true }).then((res) => {
let data = res.data;
debugger;
for(let i=0;i<data.length;i++){
ids= ids+data[i].id+',';
}
that.listQuery.belong_dept__in=ids;
that.getList();
});
} else {
getSubOrgList().then((res) => {
let data = res.data;
let that = this;
let ids = ''
getSubOrgList().then((res) => {
let data = res.data;
for(let i=0;i<data.length;i++){
ids= ids+data[i].id+',';
}
that.listQuery.belong_dept__in=ids;
that.getList();
});
},
getTableData(){
debugger;
for(let i=0;i<data.length;i++){
ids= ids+data[i].id+',';
let that = this;
if(that.listQuery.year==''){
let date = new Date();
that.query.year = date.getFullYear();
}else{
that.query.year =that.listQuery.year
}
that.listQuery.belong_dept__in=ids;
that.getList();
});
}
},
// getAnalyseList(){
// if(that.listQuery.year==''){
// let date = new Date();
// that.listQuery.year = date.getFullYear();
// }
// this.deptName = this.$store.getters.dept_name;
// taskAnalyse(that.listQuery).then(res=>{
// console.log(res)
// let data = res.data;
// })
// },
taskAnalyse(that.query).then(res=>{
console.log(res)
let data = res.data;
let arr = [];
if(data.length>0){
let firstObj = {};
firstObj.year=data[0].年份;
firstObj.dept_name=data[0].单位;
firstObj.pgoal_1=data[0].重大事故数基础值;
let pgoal_2 = data[0].报告证书合格率基础值+'';
let pgoal_3=data[0].报告证书及时率基础值+'';
let pgoal_4=data[0].能力验证满意率基础值+'';
let pgoal_5=data[0].客户投诉处理满意率基础值+'';
firstObj.pgoal_2=pgoal_2.indexOf('.')>-1?pgoal_2:pgoal_2+'.0';
firstObj.pgoal_3=pgoal_3.indexOf('.')>-1?pgoal_3:pgoal_3+'.0';
firstObj.pgoal_4=pgoal_4.indexOf('.')>-1?pgoal_4:pgoal_4+'.0';
firstObj.pgoal_5=pgoal_5.indexOf('.')>-1?pgoal_5:pgoal_5+'.0';
arr.push(firstObj);
data.forEach(item=>{
let obj = {};
obj.year=item.年份;
obj.dept_name=item.单位;
obj.pgoal_1=item.重大事故数设定值;
let pgoal2 = item.报告证书合格率设定值+'';
let pgoal3=item.报告证书及时率设定值+'';
let pgoal4=item.能力验证满意率设定值+'';
let pgoal5=item.客户投诉处理满意率设定值+'';
obj.pgoal_2=pgoal2.indexOf('.')>-1?pgoal2:pgoal2+'.0';
obj.pgoal_3=pgoal3.indexOf('.')>-1?pgoal3:pgoal3+'.0';
obj.pgoal_4=pgoal4.indexOf('.')>-1?pgoal4:pgoal4+'.0';
obj.pgoal_5=pgoal5.indexOf('.')>-1?pgoal5:pgoal5+'.0';
arr.push(obj);
})
}
that.dataList.results = arr;
})
},
//获取列表
getList(){
let that = this;
@ -133,6 +165,8 @@
let data =data0.filter(item=>{
return item.task2do!==null;
});
debugger;
console.log(data)
that.dataList.count = data.length;
if(data.length>0){
let alreadyId = ['000'];
@ -193,7 +227,11 @@
this.listQuery.year = year;
},
handleFilter(){
this.getList();
if (this.checkPermission(["record_confirm"])) {
this.getTableData();
} else {
this.getList();
}
},
handleExport() {
let filename = this.listQuery.year+'部门目标.xlsx'

View File

@ -114,7 +114,8 @@
formatter:"{value}%"
},
scale:true,
min:60,
min:85,
max:105,
},
series: [
{

View File

@ -623,7 +623,25 @@ export default {
getPgoalDeptList(this.listQuery)
.then((res) => {
this.listLoading2 = false;
this.recordList = res.data.results;
let data = res.data.results;
for(let i=0;i<data.length;i++){
if(data[i].goal_key!=="pgoal_1"){
let value_a = data[i].goal_value_a+'';
let value_b = data[i].goal_value_b+'';
if(value_a!=='null'){
data[i].goal_value_a=value_a.indexOf('.')>-1?value_a:value_a+'.0';
}else{
data[i].goal_value_a=''
}
if(value_b!='null'){
data[i].goal_value_b=value_b.indexOf('.')>-1?value_b:value_b+'.0';
}else{
data[i].goal_value_b='';
}
}
}
this.recordList = data;
})
.catch((e) => {
this.listLoading2 = false;