Commit 699392e2 authored by 朱超's avatar 朱超

换热站面积报表

parent 46f97192
...@@ -27,3 +27,10 @@ export const postTransferEnergy = params => { ...@@ -27,3 +27,10 @@ export const postTransferEnergy = params => {
console.log(error); console.log(error);
}) })
} }
//换热站面积报表
export const postTransferArea = params => {
return http.post(`/api/analysis/report/TransferArea`, params).then(res => res).catch(function (error) {
console.log(error);
})
}
\ No newline at end of file
<template>面积</template> <template>
\ No newline at end of file <div class="contentBlock">
<div class="contentBlockInn">
<el-card class="card-contianer">
<table
cellpadding="0"
cellspacing="1"
style="background-color: #99bbe8"
>
<tr>
<th>年度</th>
<td colspan="2" style="margin: 0; padding: 0; text-align: left">
<table cellpadding="0" cellspacing="0">
<tr>
<td style="text-align: left">
<el-select
v-model="enertyInfo.supplyYear"
placeholder="请选择年度"
style="width: 200px"
>
<el-option
v-for="item in yearList"
:label="item"
:key="item"
:value="item"
/>
</el-select>
</td>
<th
style="
border-left: #99bbe8 solid 1px;
border-right: #99bbe8 solid 1px;
"
>
类型
</th>
<td>
<el-select
v-model="enertyInfo.nature"
placeholder="请选择"
style="min-width: 130px"
multiple
collapse-tags
>
<el-option label="民用" key="0" value="民用" />
<el-option label="公建" key="1" value="公建" />
</el-select>
</td>
<th
style="
border-left: #99bbe8 solid 1px;
border-right: #99bbe8 solid 1px;
"
>
节能方式
</th>
<td>
<el-select
v-model="enertyInfo.energyType"
placeholder="请选择"
style="min-width: 130px"
multiple
collapse-tags
>
<el-option label="一步节能" key="1" value="一步节能" />
<el-option label="二步节能" key="2" value="二步节能" />
<el-option label="三步节能" key="3" value="三步节能" />
<el-option label="四步节能" key="4" value="四步节能" />
</el-select>
</td>
</tr>
</table>
</td>
<th rowspan="3">
<div>
<div class="btngrounp">
<el-button type="primary" @click="postTransferAreaFun"
>查询</el-button
><el-button
type="primary"
@click="exportTableToExcel"
style="margin: 0 0 0 5px"
>打印</el-button
><el-button
type="primary"
@click="exportTableToExcel"
style="margin: 0 0 0 5px"
>打印预览</el-button
>
<el-button
type="primary"
@click="exportTableToExcel"
style="margin: 0 0 0 5px"
>导出</el-button
>
</div>
</div>
</th>
</tr>
<tr>
<th>供热站</th>
<td style="text-align: left">
<el-checkbox-group v-model="enertyInfo.jurisdictionIds">
<el-checkbox
v-for="(option, index) in options"
:key="index"
:label="option.value"
>
{{ option.lable }}
</el-checkbox>
</el-checkbox-group>
</td>
</tr>
</table>
<el-table :data="tableData" style="width: 100%; margin-top: 10px">
<el-table-column type="index" width="60" label="序号" align="center">
</el-table-column>
<el-table-column prop="jurisdictionName" label="区域名称" />
<el-table-column prop="stationName" label="换热站名称" />
<el-table-column prop="supplyYear" label="年度" />
<el-table-column label="居民(应供收费面积)">
<el-table-column prop="realCostCiviled" label="收费面积" />
<el-table-column prop="realCostSPB" label="停暖面积" />
</el-table-column>
<el-table-column label="大公建(应供建筑面积)">
<el-table-column prop="realBuildBPB" label="实供建筑面积" />
<el-table-column prop="stopBuildBPB" label="停暖建筑面积" />
</el-table-column>
<el-table-column label="小公建(应供建筑面积)">
<el-table-column prop="realBuildSPB" label="实供建筑面积" />
<el-table-column prop="stopBuildSPB" label="停暖建筑面积" />
</el-table-column>
<el-table-column prop="supplyArea" label="应供建筑面积" />
<el-table-column prop="realBuild" label="实供建筑面积C" />
<el-table-column prop="realCost" label="实供收费面积D" />
<el-table-column prop="calculateArea" label="计算面积" />
</el-table>
</el-card>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, onUnmounted } from "vue";
import http from "../../api/http";
import store from "../../store/index";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage } from "element-plus";
import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style";
import { postTransferArea } from "../../api/report";
const radioTitle = ref("供热站");
const options = reactive([]);
const enterpriseId = ref(null);
const checkboxList = ref([]);
const tableData = ref([]);
const yearList = [
"2016-2017",
"2017-2018",
"2018-2019",
"2019-2020",
"2020-2021",
"2021-2022",
"2022-2023",
"2023-2024",
"2024-2025",
"2025-2026",
"2026-2027",
"2027-2028",
"2028-2029",
"2029-2030",
"2030-2031",
"2031-2032",
"2032-2033",
"2033-2034",
"2034-2035",
];
const enertyInfo = reactive({
jurisdictionIds: [],
nature: ["民用", "公建"],
energyType: ["一步节能", "二步节能", "三步节能", "四步节能"],
supplyYear: "2024-2025",
});
//根据权限初始化单选列表
function initRadioList() {
var result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
result.forEach((element) => {
if (element.enterpriseId === enterpriseId.value) {
if (
element.enterpriseId ===
"9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()
) {
radioTitle.value = "片区";
element.serviceCenterList.forEach((center) => {
center.supplyList.forEach((supply) => {
supply.jurisdictionList.forEach((jurisdiction) => {
options.push({
value: jurisdiction.jurisdictionId,
lable: jurisdiction.jurisdictionName,
});
});
});
});
} else {
radioTitle.value = "供热站";
element.supplyList.forEach((element) => {
options.push({
value: element.supplyId,
lable: element.supplyName,
});
});
}
}
});
options.forEach((element) => {
enertyInfo.jurisdictionIds.push(element.value);
});
}
}
function postTransferAreaFun() {
console.log(enertyInfo);
var date = new Date();
let supplyYearSend = ref();
if (date.getMonth() + 1 < 7) {
supplyYearSend = enertyInfo.supplyYear.split("-")[0];
} else {
supplyYearSend = enertyInfo.supplyYear.split("-")[1];
}
let natureSend = -1;
switch (enertyInfo.nature[0]) {
case "民用":
natureSend = 0;
break;
case "公建":
natureSend = 1;
break;
}
let energyTypeSend = -1;
if (enertyInfo.energyType.length < 4) {
enertyInfo.energyType.forEach((element) => {
switch (element) {
case "一步节能":
energyTypeSend.push(1);
break;
case "二步节能":
energyTypeSend.push(2);
break;
case "三步节能":
energyTypeSend.push(3);
break;
case "四步节能":
energyTypeSend.push(4);
break;
}
});
}
let params = {
jurisdictionIds: enertyInfo.jurisdictionIds,
supplyYear: supplyYearSend,
nature: natureSend,
energyType: energyTypeSend,
};
postTransferArea(params).then((res) => {
if (res.success === true) {
tableData.value = res.data;
tableData.value.forEach((element) => {
element.realCostCiviled = element.realCostCiviled.toFixed(2);
element.realCostSPB = element.realCostSPB.toFixed(2);
element.realBuildBPB = element.realBuildBPB.toFixed(2);
element.stopBuildBPB = element.stopBuildBPB.toFixed(2);
element.realBuildSPB = element.realBuildSPB.toFixed(2);
element.stopBuildSPB = element.stopBuildSPB.toFixed(2);
element.supplyArea = element.supplyArea.toFixed(4);
element.realBuild = element.realBuild.toFixed(4);
element.realCost = element.realCost.toFixed(4);
element.calculateArea = element.calculateArea.toFixed(4);
});
} else {
ElMessage.error(res.message);
}
});
}
onMounted(() => {
initRadioList();
postTransferAreaFun();
//postHeatForecastFun();
});
onUnmounted(() => {});
</script>
<style lang="less" scoped>
.contentBlock {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ffffff;
overflow: auto;
}
table {
width: 100%;
}
table,
tr,
th,
td {
font-size: 14px;
margin: 0;
padding: 0;
}
table {
width: 100%;
}
table th {
background-color: #dfe8f6;
text-align: center;
padding: 5px 10px;
}
table td {
text-align: center;
background-color: #ffffff;
padding: 5px 10px;
}
.btngrounp {
width: 300px;
}
.gc td {
background-color: #a6ffa6;
}
.gc td:first-child {
background-color: #ffffff;
}
table.botList td {
width: 33%;
text-align: left;
font-weight: bolder;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment