甘特图数量显示问题

This commit is contained in:
shijing 2024-03-20 10:12:33 +08:00
parent c0def9482e
commit be9af90e12
8 changed files with 67 additions and 32 deletions

View File

@ -371,6 +371,7 @@ export default {
obj.start_date__gte = start_date;
obj.end_date__lte = end_date;
obj.belong_dept__name = '7车间';
obj.page = 0;
this.paramsUtask = obj;
this.getGantt();
},

View File

@ -42,7 +42,7 @@
<el-col :lg="16">
<el-card shadow="never" style="position: relative;">
<el-button @click="handleExport('ZJ')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData" id="exportDivZJ">
<el-table :data="tableData" id="exportDivZJ" :height="300">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>
@ -69,7 +69,7 @@
<el-col :lg="16">
<el-card shadow="never" style="position: relative;">
<el-button @click="handleExport('ZB')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData" id="exportDivZB">
<el-table :data="tableData" id="exportDivZB" :height="300">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>
@ -96,7 +96,7 @@
<el-col :lg="16">
<el-card shadow="never" style="position: relative;">
<el-button @click="handleExport('AVG')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData" id="exportDivAVG">
<el-table :data="tableData" id="exportDivAVG" :height="300">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>

View File

@ -27,7 +27,7 @@
<el-col :lg="12">
<el-card shadow="never" style="position: relative;">
<el-button @click="handleExport('1')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData7" id="exportDiv1">
<el-table :data="tableData7" id="exportDiv1" :height="300">
<el-table-column type="index" width="50" />
<el-table-column label="物料名" prop="物料名">
</el-table-column>
@ -59,7 +59,7 @@
<el-col :lg="12">
<el-card shadow="never" style="position: relative;">
<el-button @click="handleExport('2')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData10" id="exportDiv2">
<el-table :data="tableData10" id="exportDiv2" :height="300">
<el-table-column type="index" width="50" />
<el-table-column label="物料名" prop="物料名">
</el-table-column>

View File

@ -31,7 +31,7 @@
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
</el-header>
<el-main>
<el-main id="elMain">
<el-row :gutter="15">
<el-col :lg="12">
<el-card shadow="never" style="margin-bottom: 8px;">
@ -53,9 +53,9 @@
<div id="bachart1" style="width:100%;height:300px;"></div>
<!-- <scEcharts height="300px" :option="option1"></scEcharts> -->
</el-col>
<el-card shadow="never" style="width: 100%;position: relative;">
<el-card shadow="never" style="width: 100%;position: relative;margin-top: 20px;">
<el-button @click="handleExport('ZJ')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData1" id="exportDivZJ">
<el-table :data="tableData1" id="exportDivZJ" :height="tableHeight">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>
@ -88,9 +88,9 @@
<div id="bachart2" style="width:100%;height:300px;"></div>
<!-- <scEcharts height="300px" :option="option2"></scEcharts> -->
</el-col>
<el-card shadow="never" style="width: 100%;position: relative;">
<el-card shadow="never" style="width: 100%;position: relative;margin-top: 20px;">
<el-button @click="handleExport('ZB')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData2" id="exportDivZB">
<el-table :data="tableData2" id="exportDivZB" :height="tableHeight">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>
@ -198,6 +198,7 @@
// barWidth: '15px',
// }]
// },
tableHeight:0,
tableData:[
{id:1,date:'2023-12-11',name:'ZJ2-1',count:200},
{id:1,date:'2023-12-11',name:'ZJ2-2',count:200},
@ -231,6 +232,9 @@
that.xAxisOrigin.push('第'+i+'周');
}
that.xAxisData = that.xAxisOrigin;
let height= document.getElementById('elMain').clientHeight-140;
let chartheight= document.getElementById('bachart1').clientHeight;
that.tableHeight = height-chartheight;
this.getTableData();
// this.getTableData2();
},

View File

@ -31,7 +31,7 @@
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
</el-header>
<el-main>
<el-main id="elMain">
<el-row :gutter="15">
<el-col :lg="12">
<el-card shadow="never" style="margin-bottom: 8px;">
@ -53,9 +53,9 @@
<div id="bachart1" style="width:100%;height:300px;"></div>
<!-- <scEcharts height="300px" :option="option2"></scEcharts> -->
</el-col>
<el-card shadow="never" style="width: 100%;position: relative;">
<el-card shadow="never" style="width: 100%;position: relative;margin-top: 20px;">
<el-button @click="handleExport('1')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData1" id="exportDiv1">
<el-table :data="tableData1" id="exportDiv1" :height="tableHeight">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
<template #default="scope">
@ -93,9 +93,9 @@
<div id="bachart2" style="width:100%;height:300px;"></div>
<!-- <scEcharts height="300px" :option="option2"></scEcharts> -->
</el-col>
<el-card shadow="never" style="width: 100%;position: relative;">
<el-card shadow="never" style="width: 100%;position: relative;margin-top: 20px;">
<el-button @click="handleExport('2')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData2" id="exportDiv2">
<el-table :data="tableData2" id="exportDiv2" :height="tableHeight">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
<template #default="scope">
@ -168,6 +168,7 @@
barWidth: '15px',
}
},
tableHeight:0,
tableData1:[],
tableData2:[],
materialIn:'',
@ -177,7 +178,7 @@
inmData:[],
outData:[],
inmOption:[],
outOption:[],
outOption: [],
monthList:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']
}
},
@ -205,6 +206,9 @@
that.xAxisOrigin.push('第'+i+'周');
}
that.xAxisData = that.xAxisOrigin;
let height= document.getElementById('elMain').clientHeight-140;
let chartheight= document.getElementById('bachart1').clientHeight;
that.tableHeight = height-chartheight;
this.getInmOption();
},
methods:{

View File

@ -23,7 +23,7 @@
</el-col>
<el-col :lg="16" style="position: relative;">
<el-button @click="handleExport('7')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData7" id="exportDiv7">
<el-table :data="tableData7" id="exportDiv7" :height="300">
<el-table-column label="年" prop="年" v-if="queryType == '年'" width="60">
</el-table-column>
<el-table-column label="月" prop="月" v-else width="60">
@ -68,7 +68,7 @@
</el-col>
<el-col :lg="16" style="position: relative;">
<el-button @click="handleExport('10')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData10" id="exportDiv10">
<el-table :data="tableData10" id="exportDiv10" :height="300">
<el-table-column label="年" prop="年" v-if="queryType == '年'" width="60">
</el-table-column>
<el-table-column label="月" prop="月" v-else width="60">
@ -117,7 +117,7 @@
</el-col>
<el-col :lg="16" style="position: relative;">
<el-button @click="handleExport('8')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData8" id="exportDiv8">
<el-table :data="tableData8" id="exportDiv8" :height="300">
<el-table-column label="年" prop="年" v-if="queryType == '年'" width="60">
</el-table-column>
<el-table-column label="月" prop="月" v-else width="60">

View File

@ -50,8 +50,9 @@
<el-col :lg="8">
<scEcharts height="300px" :option="option1"></scEcharts>
</el-col>
<el-col :lg="16">
<el-table :data="tableData">
<el-col :lg="16" style="position: relative;">
<el-button @click="handleExport('1')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData" :height="300" id="exportDiv1">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>
@ -83,8 +84,9 @@
<el-col :lg="8">
<scEcharts height="300px" :option="option2"></scEcharts>
</el-col>
<el-col :lg="16">
<el-table :data="tableData">
<el-col :lg="16" style="position: relative;">
<el-button @click="handleExport('2')" class="tables" type="primary">导出</el-button>
<el-table :data="tableData" :height="300" id="exportDiv2">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
</el-table-column>
@ -239,9 +241,22 @@
this.getData();
this.getProductData();
},
handleExport(val) {
this.exportLoading = true;
let id = '#exportDiv' + val;
let name = val == '1' ? '各工序检验统计' : '成品检验统计';
this.$XLSX(id, name);
this.exportLoading = false;
},
},
}
</script>
<style>
<style scoped>
.tables {
position: absolute;
top: 4px;
right: 6px;
z-index: 10;
}
</style>

View File

@ -15,13 +15,15 @@
<el-main id="elMain">
<el-row :gutter="15" style="height: 100%;">
<el-col :lg="12">
<el-card shadow="never" style="height: 100%;">
<el-card shadow="never">
<scEcharts :height="chartHeight" :option="option" id="chartHeight"></scEcharts>
</el-card>
</el-col>
<el-col :lg="12">
<el-card shadow="never">
<el-table :data="tableData" style="width: 100%" :height="chartHeight">
<el-card shadow="never" style="position: relative;">
<el-button @click="handleExport" class="tables" type="primary">导出</el-button>
<el-table :data="tableData" id="exportDiv" style="width: 100%" :height="chartHeight">
<el-table-column type="index" width="50" />
<el-table-column label="日期" prop="date">
<template #default="scope">
{{ scope.row. }}-{{ scope.row. }}
@ -95,7 +97,6 @@ export default {
barWidth: '15px',
}
},
tableHeight: 0,
chartHeight:0,
}
},
@ -111,10 +112,8 @@ export default {
this.queryDate = year + '-' + month;
this.getData();
this.getDept();
let mainHeight = document.getElementById('elMain').clientHeight;
this.tableHeight = (mainHeight-30)+'px';
this.chartHeight = (mainHeight-50)+'px';
this.chartHeight = (mainHeight-40)+'px';
},
methods: {
getDept() {
@ -159,8 +158,20 @@ export default {
console.log('查询query', this.start_date, this.end_date)
this.getData();
},
handleExport() {
this.exportLoading = true;
this.$XLSX('#exportDiv', '人员统计');
this.exportLoading = false;
},
},
}
</script>
<style></style>
<style scoped>
.tables {
position: absolute;
top: 4px;
left: 4px;
z-index: 10;
}
</style>