Browse Source

统计

master
songguoqiang 8 months ago
parent
commit
e00d51e981
  1. 5
      src/api/tjanalysis/index.ts
  2. 7
      src/views/tjanalysis/electricdata/index.vue
  3. 33
      src/views/tjanalysis/energyconsumption/index.vue
  4. 9
      src/views/tjanalysis/irealdatatotal/index.vue

5
src/api/tjanalysis/index.ts

@ -130,3 +130,8 @@ export const exportSizingmillDay = async (params) => {
export const queryEnergyConsumption = async (params) => { export const queryEnergyConsumption = async (params) => {
return await request.get({ url: `/tjanalysis/queryEnergyConsumption`, params }) return await request.get({ url: `/tjanalysis/queryEnergyConsumption`, params })
} }
// 导出能耗统计报表
export const exportEnergyConsumption = async (params) => {
return await request.download({ url: `/tjanalysis/exportEnergyConsumption`, params })
}

7
src/views/tjanalysis/electricdata/index.vue

@ -1,6 +1,6 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 智能电表日统计搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="日期" prop="date"> <el-form-item label="日期" prop="date">
<el-date-picker <el-date-picker
@ -77,7 +77,8 @@ const dataList = reactive({dList: [] , days: 0})
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag: '2' flag: '2',
iname:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
@ -99,6 +100,8 @@ const getDbTypes = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = dbTypes.typeList.find(map=>map.mcode == queryParams.mcode);
const res = await TjanalysisApi.queryElectricdataTj(queryParams) const res = await TjanalysisApi.queryElectricdataTj(queryParams)
if (res != null && res.trList != null) { if (res != null && res.trList != null) {
dataList.days = res.days dataList.days = res.days

33
src/views/tjanalysis/energyconsumption/index.vue

@ -36,13 +36,19 @@
v-loading="loading" :data="dataList" border="true" highlight-current-row="true" v-loading="loading" :data="dataList" border="true" highlight-current-row="true"
header-row-style="height: 50px; text-align: center" :span-method="arraySpanMethod" header-row-style="height: 50px; text-align: center" :span-method="arraySpanMethod"
:row-class-name="tableRowClassName" :cell-class-name="tableCellClassName"> :row-class-name="tableRowClassName" :cell-class-name="tableCellClassName">
<el-table-column label="" prop="name" align="right" :show-overflow-tooltip="true" width="150" /> <el-table-column label="生产单位" prop="name" align="right" :show-overflow-tooltip="true" width="150" />
<el-table-column label="00:00-08:00" prop="num0008" align="center" :show-overflow-tooltip="true" /> <el-table-column label="班组" prop="tiemFrame" align="center" :show-overflow-tooltip="true" />
<el-table-column label="08:00-16:00" prop="num0816" align="center" :show-overflow-tooltip="true" /> <el-table-column label="生产水耗1" prop="fields" align="center" :show-overflow-tooltip="true" />
<el-table-column label="16:00-24:00" prop="num1624" align="center" :show-overflow-tooltip="true" /> <el-table-column label="生产水耗2" prop="fields1" align="center" :show-overflow-tooltip="true" />
<el-table-column label="00:00-12:00" prop="num0012" align="center" :show-overflow-tooltip="true" /> <el-table-column label="循环水" prop="fields2" align="center" :show-overflow-tooltip="true" />
<el-table-column label="12:00-24:00" prop="num1224" align="center" :show-overflow-tooltip="true" /> <el-table-column label="煤量" prop="fields3" align="center" :show-overflow-tooltip="true" />
<el-table-column label="总(00:00-24:00)" prop="num0024" align="center" :show-overflow-tooltip="true" /> <el-table-column label="天然气" prop="fields4" align="center" :show-overflow-tooltip="true" />
<!-- <el-table-column label="班组用电量" prop="fields5" align="center" :show-overflow-tooltip="true" /> -->
<el-table-column label="峰期电量" prop="fields6" align="center" :show-overflow-tooltip="true" />
<el-table-column label="谷期电量" prop="fields7" align="center" :show-overflow-tooltip="true" />
<el-table-column label="平期电量" prop="fields8" align="center" :show-overflow-tooltip="true" />
<el-table-column label="尖峰电量" prop="fields8" align="center" :show-overflow-tooltip="true" />
<el-table-column label="合计电量" prop="fields5" align="center" :show-overflow-tooltip="true" />
</el-table> </el-table>
</ContentWrap> </ContentWrap>
@ -66,13 +72,16 @@ const dataList = ref([])
const names = ref(''); const names = ref('');
const queryParams = reactive({ const queryParams = reactive({
dateRange: [], dateRange: [],
flag: '1' flag: '0',
iname:''
}) })
const flagList =ref([]) const flagList =ref([])
const handleQuery = async () => { const handleQuery = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag); const ll = flagList.value.find(map=>map.value == queryParams.flag);
names.value = ll?.label names.value = ll?.label
queryParams.iname= ll?.label
dataList.value = []; dataList.value = [];
getList() getList()
} }
@ -99,7 +108,8 @@ const resetQuery = async () => {
const getList = async () => { const getList = async () => {
const res = await TjanalysisApi.queryEnergyConsumption(queryParams) const res = await TjanalysisApi.queryEnergyConsumption(queryParams)
dataList.value = res.dataList
dataList.value = res
loading.value = false loading.value = false
} }
@ -138,13 +148,13 @@ function tableCellClassName({row, column, rowIndex, columnIndex}) {
} }
const exportElecTotal = async () => { const exportElecTotal = async () => {
const res = await TjanalysisApi.exportHrpuncherDay(queryParams) const res = await TjanalysisApi.exportEnergyConsumption(queryParams)
if (res != null) { if (res != null) {
let url = window.URL.createObjectURL(new Blob([res])); let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
link.setAttribute("download", "热轧穿孔机日统计.xlsx"); link.setAttribute("download", "能耗日统计.xlsx");
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
} }
@ -167,6 +177,7 @@ onMounted(async () => {
if (res != null && res.length>0) { if (res != null && res.length>0) {
flagList.value = res flagList.value = res
queryParams.flag= flagList.value[0].value; queryParams.flag= flagList.value[0].value;
queryParams.iname= flagList.value[0].label;
const ll = flagList.value.find(map=>map.value == queryParams.flag); const ll = flagList.value.find(map=>map.value == queryParams.flag);
names.value = ll?.label names.value = ll?.label
} }

9
src/views/tjanalysis/irealdatatotal/index.vue

@ -1,6 +1,6 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 智能电表统计表搜索工作栏 --> <!-- 一次主表统计搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="日期" prop="dateRange"> <el-form-item label="日期" prop="dateRange">
<el-date-picker <el-date-picker
@ -63,7 +63,8 @@ const dataList = reactive({dList: [] , total: 0})
const queryParams = reactive({ const queryParams = reactive({
dateRange: [], dateRange: [],
flag:'0' flag:'0',
iname:''
}) })
const typeList= ref([{"flag":"0","mname":"主变1号"},{"flag":"1","mname":"主变2号"}]); const typeList= ref([{"flag":"0","mname":"主变1号"},{"flag":"1","mname":"主变2号"}]);
@ -94,6 +95,8 @@ let today = new Date();
} }
const getList = async () => { const getList = async () => {
const ll = typeList.value.find(map=>map.flag == queryParams.flag);
queryParams.iname = ll?.mname
const res = await TjanalysisApi.queryIrealdataTimeTj(queryParams) const res = await TjanalysisApi.queryIrealdataTimeTj(queryParams)
console.log(res) console.log(res)
if (res != null && res.dataList != null) { if (res != null && res.dataList != null) {
@ -109,7 +112,7 @@ const exportElecTotal = async () => {
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
link.setAttribute("download", "一次主表统计数据.xlsx"); link.setAttribute("download", "一次主表统计数据.xlsx");
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
} }

Loading…
Cancel
Save