Commit 407f011b authored by qjeslks's avatar qjeslks
parents e7f8cf6f d032ca7b
export const ExternalSERVEICE='http://218.69.97.198:8001' // export const ExternalSERVEICE='http://218.69.97.198:8001'
export const WithinSERVEICE='http://192.168.1.252:8001' // export const WithinSERVEICE='http://192.168.1.252:8001'
// export const ExternalSERVEICE='http://localhost:5013' export const ExternalSERVEICE='http://localhost:5013'
// export const WithinSERVEICE='http://localhost:5013' export const WithinSERVEICE='http://localhost:5013'
export const CURRLOGO="LOGO_gangyi.png" export const CURRLOGO="LOGO_gangyi.png"
...@@ -2,85 +2,97 @@ ...@@ -2,85 +2,97 @@
"hash": "76d29559", "hash": "76d29559",
"configHash": "2effb732", "configHash": "2effb732",
"lockfileHash": "415b4f88", "lockfileHash": "415b4f88",
"browserHash": "685fa378", "browserHash": "5ddfa83a",
"optimized": { "optimized": {
"vue": { "vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js", "src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js", "file": "vue.js",
"fileHash": "6309e73d", "fileHash": "6e724a88",
"needsInterop": false "needsInterop": false
}, },
"element-plus": { "element-plus": {
"src": "../../element-plus/es/index.mjs", "src": "../../element-plus/es/index.mjs",
"file": "element-plus.js", "file": "element-plus.js",
"fileHash": "146301e4", "fileHash": "db311218",
"needsInterop": false "needsInterop": false
}, },
"@element-plus/icons-vue": { "@element-plus/icons-vue": {
"src": "../../@element-plus/icons-vue/dist/index.js", "src": "../../@element-plus/icons-vue/dist/index.js",
"file": "@element-plus_icons-vue.js", "file": "@element-plus_icons-vue.js",
"fileHash": "93e2c300", "fileHash": "466ff16a",
"needsInterop": false "needsInterop": false
}, },
"vue3-smooth-scroll": { "vue3-smooth-scroll": {
"src": "../../vue3-smooth-scroll/dist/vue-smooth-scroll.min.js", "src": "../../vue3-smooth-scroll/dist/vue-smooth-scroll.min.js",
"file": "vue3-smooth-scroll.js", "file": "vue3-smooth-scroll.js",
"fileHash": "27f6c3ba", "fileHash": "73ac546b",
"needsInterop": true "needsInterop": true
}, },
"@kyvg/vue3-notification": { "@kyvg/vue3-notification": {
"src": "../../@kyvg/vue3-notification/dist/index.es.js", "src": "../../@kyvg/vue3-notification/dist/index.es.js",
"file": "@kyvg_vue3-notification.js", "file": "@kyvg_vue3-notification.js",
"fileHash": "c12b6fc2", "fileHash": "7913f170",
"needsInterop": false "needsInterop": false
}, },
"jquery": { "jquery": {
"src": "../../jquery/dist/jquery.js", "src": "../../jquery/dist/jquery.js",
"file": "jquery.js", "file": "jquery.js",
"fileHash": "e06fd542", "fileHash": "953bbb02",
"needsInterop": true "needsInterop": true
}, },
"element-plus/dist/locale/zh-cn.mjs": { "element-plus/dist/locale/zh-cn.mjs": {
"src": "../../element-plus/dist/locale/zh-cn.mjs", "src": "../../element-plus/dist/locale/zh-cn.mjs",
"file": "element-plus_dist_locale_zh-cn__mjs.js", "file": "element-plus_dist_locale_zh-cn__mjs.js",
"fileHash": "42051261", "fileHash": "7c795d35",
"needsInterop": false "needsInterop": false
}, },
"axios": { "axios": {
"src": "../../axios/index.js", "src": "../../axios/index.js",
"file": "axios.js", "file": "axios.js",
"fileHash": "00e1ad23", "fileHash": "67fae377",
"needsInterop": false "needsInterop": false
}, },
"vue-router": { "vue-router": {
"src": "../../vue-router/dist/vue-router.mjs", "src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js", "file": "vue-router.js",
"fileHash": "e89cca3b", "fileHash": "036d0e44",
"needsInterop": false "needsInterop": false
}, },
"vuex": { "vuex": {
"src": "../../vuex/dist/vuex.esm-bundler.js", "src": "../../vuex/dist/vuex.esm-bundler.js",
"file": "vuex.js", "file": "vuex.js",
"fileHash": "fb2c9771", "fileHash": "9c4ab673",
"needsInterop": false "needsInterop": false
}, },
"echarts": { "echarts": {
"src": "../../echarts/index.js", "src": "../../echarts/index.js",
"file": "echarts.js", "file": "echarts.js",
"fileHash": "9784809e", "fileHash": "a587f8e5",
"needsInterop": false "needsInterop": false
}, },
"@amap/amap-jsapi-loader": { "@amap/amap-jsapi-loader": {
"src": "../../@amap/amap-jsapi-loader/dist/index.js", "src": "../../@amap/amap-jsapi-loader/dist/index.js",
"file": "@amap_amap-jsapi-loader.js", "file": "@amap_amap-jsapi-loader.js",
"fileHash": "70af1a04", "fileHash": "58817286",
"needsInterop": true "needsInterop": true
}, },
"mitt": { "mitt": {
"src": "../../mitt/dist/mitt.mjs", "src": "../../mitt/dist/mitt.mjs",
"file": "mitt.js", "file": "mitt.js",
"fileHash": "3e8c4b6d", "fileHash": "a116a557",
"needsInterop": false "needsInterop": false
},
"jsencrypt": {
"src": "../../jsencrypt/lib/index.js",
"file": "jsencrypt.js",
"fileHash": "5f3dd49a",
"needsInterop": false
},
"lodash/cloneDeep": {
"src": "../../lodash/cloneDeep.js",
"file": "lodash_cloneDeep.js",
"fileHash": "7a95577d",
"needsInterop": true
} }
}, },
"chunks": { "chunks": {
......
// export const ExternalSERVEICE='http://218.69.97.198:8001' export const ExternalSERVEICE='http://218.69.97.198:8001'
// export const WithinSERVEICE='http://192.168.1.252:8001' export const WithinSERVEICE='http://192.168.1.252:8001'
export const ExternalSERVEICE='http://localhost:5013' // export const ExternalSERVEICE='http://localhost:5013'
export const WithinSERVEICE='http://localhost:5013' // export const WithinSERVEICE='http://localhost:5013'
export const CURRLOGO="LOGO_gangyi.png" export const CURRLOGO="LOGO_gangyi.png"
...@@ -243,18 +243,18 @@ ...@@ -243,18 +243,18 @@
transferName:"", transferName:"",
isDisabled: true, isDisabled: true,
transferStatus: 0, transferStatus: 0,
holidayAction: null, holidayAction: false,
holidayMonStart: null, holidayMonStart: 0,
holidayDayStart: null, holidayDayStart: 0,
holidayHourStart: null, holidayHourStart: 0,
holidayMonEnd: null, holidayMonEnd: 0,
holidayDayEnd: null, holidayDayEnd: 0,
holidayHourEnd: null, holidayHourEnd: 0,
holidayWeekStart: null, holidayWeekStart: 0,
holidayWeekEnd: null, holidayWeekEnd: 0,
holidayConstantTemp: null, holidayConstantTemp: 0,
weekHourStart: null, weekHourStart: 0,
weekHourEnd: null weekHourEnd: 0
}); });
onMounted(() => { onMounted(() => {
...@@ -419,46 +419,46 @@ ...@@ -419,46 +419,46 @@
try{ try{
//console.log("write row:"+element.transferName); //console.log("write row:"+element.transferName);
var writeValue = ""; var writeValue = "";
if(forms.holidayAction != null && forms.holidayAction != ""){ //if(forms.holidayAction != null && forms.holidayAction != ""){
element.holidayAction=forms.holidayAction; element.holidayAction=forms.holidayAction;
writeValue +="HolidayAction:"+forms.holidayAction + ";"; writeValue ="HolidayAction:"+ (forms.holidayAction===true ? "1;":"0;");
} // }
if(element.holidayMonStart != null && forms.holidayMonStart != ""){ // if(element.holidayMonStart != null && forms.holidayMonStart != ""){
element.holidayMonStart=forms.holidayMonStart; element.holidayMonStart=forms.holidayMonStart;
writeValue +="HolidayMonStart:"+forms.holidayMonStart + ";"; writeValue +="HolidayMonStart:"+forms.holidayMonStart + ";";
} // }
if(element.holidayDayStart != null && forms.holidayDayStart != ""){ // if(element.holidayDayStart != null && forms.holidayDayStart != ""){
element.holidayDayStart=forms.holidayDayStart; element.holidayDayStart=forms.holidayDayStart;
writeValue +="HolidayDayStart:"+forms.holidayDayStart + ";"; writeValue +="HolidayDayStart:"+forms.holidayDayStart + ";";
} //}
if(element.holidayHourStart != null && forms.holidayHourStart != ""){ //if(element.holidayHourStart != null && forms.holidayHourStart != ""){
element.holidayHourStart=forms.holidayHourStart; element.holidayHourStart=forms.holidayHourStart;
writeValue +="HolidayHourStart:"+forms.holidayHourStart + ";"; writeValue +="HolidayHourStart:"+forms.holidayHourStart + ";";
} //}
if(element.holidayMonEnd != null && forms.holidayMonEnd != ""){ //if(element.holidayMonEnd != null && forms.holidayMonEnd != ""){
element.holidayMonEnd=forms.holidayMonEnd; element.holidayMonEnd=forms.holidayMonEnd;
writeValue +="HolidayMonEnd:"+forms.holidayMonEnd + ";"; writeValue +="HolidayMonEnd:"+forms.holidayMonEnd + ";";
} //}
if(element.holidayDayEnd != null && forms.holidayDayEnd != ""){ //if(element.holidayDayEnd != null && forms.holidayDayEnd != ""){
element.holidayDayEnd=forms.holidayDayEnd; element.holidayDayEnd=forms.holidayDayEnd;
writeValue +="HolidayDayEnd:"+forms.holidayDayEnd + ";"; writeValue +="HolidayDayEnd:"+forms.holidayDayEnd + ";";
} //}
if(element.holidayHourEnd != null && forms.holidayHourEnd != ""){ //if(element.holidayHourEnd != null && forms.holidayHourEnd != ""){
element.holidayHourEnd=forms.holidayHourEnd; element.holidayHourEnd=forms.holidayHourEnd;
writeValue +="HolidayHourEnd:"+forms.holidayHourEnd + ";"; writeValue +="HolidayHourEnd:"+forms.holidayHourEnd + ";";
} //}
if(element.holidayWeekStart != null && forms.holidayWeekStart != ""){ //if(element.holidayWeekStart != null && forms.holidayWeekStart != ""){
element.holidayWeekStart=forms.holidayWeekStart; element.holidayWeekStart=forms.holidayWeekStart;
writeValue +="HolidayWeekStart:"+forms.holidayWeekStart + ";"; writeValue +="HolidayWeekStart:"+forms.holidayWeekStart + ";";
} //}
if(element.holidayWeekEnd != null && forms.holidayWeekEnd != ""){ //if(element.holidayWeekEnd != null && forms.holidayWeekEnd != ""){
element.holidayWeekEnd=forms.holidayWeekEnd; element.holidayWeekEnd=forms.holidayWeekEnd;
writeValue +="HolidayWeekEnd:"+forms.holidayWeekEnd + ";"; writeValue +="HolidayWeekEnd:"+forms.holidayWeekEnd + ";";
} //}
if(element.holidayConstantTemp != null && forms.holidayConstantTemp != ""){ //if(element.holidayConstantTemp != null && forms.holidayConstantTemp != ""){
element.holidayConstantTemp=forms.holidayConstantTemp; element.holidayConstantTemp=forms.holidayConstantTemp;
writeValue +="HolidayConstantTemp:"+forms.holidayConstantTemp + ";"; writeValue +="HolidayConstantTemp:"+forms.holidayConstantTemp + ";";
} //}
if(element.weekHourStart != null && forms.weekHourStart != ""){ if(element.weekHourStart != null && forms.weekHourStart != ""){
element.weekHourStart=forms.weekHourStart; element.weekHourStart=forms.weekHourStart;
writeValue +="WeekHourStart:"+forms.weekHourStart + ";"; writeValue +="WeekHourStart:"+forms.weekHourStart + ";";
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<el-form-item label="4#电调阀给定:" v-if="forms.ecv4OpeningSet != null"> <el-form-item label="4#电调阀给定:" v-if="forms.ecv4OpeningSet != null">
<el-input v-model="forms.ecv4OpeningSet" style="width: 200px;" v-float-number/> <el-input v-model="forms.ecv4OpeningSet" style="width: 200px;" v-float-number/>
</el-form-item> </el-form-item>
<el-form-item label="1#循环泵频率给定" v-if="forms.criclePump1FreqGiven != null"> <el-form-item label="1#循环泵频率给定" v-if="forms.criclePump1FreqGiven != null">
<el-input v-model="forms.criclePump1FreqGiven" style="width: 200px;" v-float-number/> <el-input v-model="forms.criclePump1FreqGiven" style="width: 200px;" v-float-number/>
</el-form-item> </el-form-item>
<el-form-item label="2#循环泵频率给定:" v-if="forms.criclePump2FreqGiven != null"> <el-form-item label="2#循环泵频率给定:" v-if="forms.criclePump2FreqGiven != null">
......
...@@ -392,6 +392,14 @@ const routes = [ ...@@ -392,6 +392,14 @@ const routes = [
title: "循环泵压差控制", title: "循环泵压差控制",
}, },
}, },
{
path: "/Remote/CtrlSecondTemp",
name: "CtrlSecondTemp",
component: () => import("@/views/RemotePage/CtrlSecondTemp.vue"),
meta: {
title: "二次网方案",
},
},
{ {
path: "/Video", path: "/Video",
name: "VideoPage", name: "VideoPage",
......
<template>
<el-card class="card-contianer">
<label>二次网供水方案列表:</label>
<!-- <el-select v-model="value" class="m-2" placeholder="Select" size="large">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> -->
</el-card>
</template>
\ No newline at end of file
<template> <template>
<div class="contentBlock"> <div
<div class="contentBlockInn"> class="contentBlock"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<div class="contentBlockInn" id="printBlock">
<el-card class="card-contianer"> <el-card class="card-contianer">
<table <table
cellpadding="0" cellpadding="0"
...@@ -70,25 +74,26 @@ ...@@ -70,25 +74,26 @@
</table> </table>
</td> </td>
<th rowspan="3"> <th rowspan="3">
<div> <div class="printHidden">
<div class="btngrounp"> <div class="btngrounp">
<el-button type="primary" @click="postTransferAreaFun" <el-button type="primary" @click="postTransferAreaFun"
>查询</el-button >查询</el-button
><el-button ><el-button
type="primary" type="primary"
@click="exportTableToExcel" v-print="printObj"
style="margin: 0 0 0 5px" style="margin: 0 0 0 10px"
>打印</el-button >打印</el-button
><el-button >
<!-- <el-button
type="primary" type="primary"
@click="exportTableToExcel" @click="exportTableToExcel"
style="margin: 0 0 0 5px" style="margin: 0 0 0 5px"
>打印预览</el-button >打印预览</el-button
> > -->
<el-button <el-button
type="primary" type="primary"
@click="exportTableToExcel" @click="exportTableToExcel"
style="margin: 0 0 0 5px" style="margin: 0 0 0 10px"
>导出</el-button >导出</el-button
> >
</div> </div>
...@@ -110,7 +115,11 @@ ...@@ -110,7 +115,11 @@
</td> </td>
</tr> </tr>
</table> </table>
<el-table :data="tableData" style="width: 100%; margin-top: 10px"> <el-table
:data="tableData"
empty-text="暂无数据"
style="width: 100%; margin-top: 10px"
>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="jurisdictionName" label="区域名称" /> <el-table-column prop="jurisdictionName" label="区域名称" />
...@@ -135,6 +144,71 @@ ...@@ -135,6 +144,71 @@
</el-table> </el-table>
</el-card> </el-card>
</div> </div>
<table
cellpadding="0"
cellspacing="1"
class="exlBlock"
id="exlBlock"
style="background-color: #99bbe8"
>
<tr>
<td colspan="3">年度:{{ enertyInfo.supplyYear }}</td>
<td colspan="2">
类型:{{ enertyInfo.nature == -1 ? "全部" : ""
}}{{ enertyInfo.nature == 0 ? "民用" : ""
}}{{ enertyInfo.nature == 1 ? "公建" : "" }}
</td>
<td colspan="3">
节能方式:{{ enertyInfo.energyType == -1 ? "全部" : ""
}}{{ enertyInfo.energyType == 1 ? "一步节能" : ""
}}{{ enertyInfo.energyType == 2 ? "二步节能" : ""
}}{{ enertyInfo.energyType == 3 ? "三步节能" : ""
}}{{ enertyInfo.energyType == 4 ? "四步节能" : "" }}
</td>
<td colspan="6">
供热站:<span v-for="item in areaName" :key="item"
>{{ item }}&nbsp;&nbsp;&nbsp;&nbsp;</span
>
</td>
</tr>
<tr>
<td rowspan="2">序号</td>
<td rowspan="2">区域名称</td>
<td rowspan="2">换热站名称</td>
<td rowspan="2">年度</td>
<td colspan="2">居民(应供收费面积)</td>
<td colspan="2">大公建(应供建筑面积)</td>
<td colspan="2">小公建(应供建筑面积)</td>
<td rowspan="2">应供建筑面积</td>
<td rowspan="2">实供建筑面积C</td>
<td rowspan="2">实供收费面积D</td>
<td rowspan="2">计算面积</td>
</tr>
<tr>
<td>收费面积</td>
<td>停暖面积</td>
<td>实供建筑面积</td>
<td>停暖建筑面积</td>
<td>实供建筑面积</td>
<td>停暖建筑面积</td>
</tr>
<tr v-for="(item, index) in tableData" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ item.jurisdictionName }}</td>
<td>{{ item.stationName }}</td>
<td>{{ item.supplyYear }}</td>
<td>{{ item.realCostCiviled }}</td>
<td>{{ item.realCostSPB }}</td>
<td>{{ item.realBuildBPB }}</td>
<td>{{ item.stopBuildBPB }}</td>
<td>{{ item.realBuildSPB }}</td>
<td>{{ item.stopBuildSPB }}</td>
<td>{{ item.supplyArea }}</td>
<td>{{ item.realBuild }}</td>
<td>{{ item.realCost }}</td>
<td>{{ item.calculateArea }}</td>
</tr>
</table>
</div> </div>
</template> </template>
<script setup> <script setup>
...@@ -146,11 +220,14 @@ import { ElMessage } from "element-plus"; ...@@ -146,11 +220,14 @@ import { ElMessage } from "element-plus";
import { saveAs } from "file-saver"; import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style"; import XLSX from "xlsx-js-style";
import { postTransferArea } from "../../api/report"; import { postTransferArea } from "../../api/report";
import print from "vue3-print-nb";
const loading = ref(false);
const radioTitle = ref("供热站"); const radioTitle = ref("供热站");
const options = reactive([]); const options = reactive([]);
const enterpriseId = ref(null); const enterpriseId = ref(null);
const checkboxList = ref([]); const checkboxList = ref([]);
const tableData = ref([]); const tableData = ref([]);
const areaName = ref([]);
const yearList = [ const yearList = [
"2016-2017", "2016-2017",
"2017-2018", "2017-2018",
...@@ -178,7 +255,127 @@ const enertyInfo = reactive({ ...@@ -178,7 +255,127 @@ const enertyInfo = reactive({
energyType: -1, energyType: -1,
supplyYear: "2024-2025", supplyYear: "2024-2025",
}); });
const vPrint = print;
const printObj = {
id: "printBlock",
popTitle: "明日预测报表",
extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
zIndex: 20002,
};
function exportTableToExcel() {
const workbook = XLSX.utils.book_new();
var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
const border = {
top: {
style: "thin",
},
bottom: {
style: "thin",
},
left: {
style: "thin",
},
right: {
style: "thin",
},
};
const range = XLSX.utils.decode_range(ws["!ref"]);
const cellList = Object.keys(ws).filter((item) => item.indexOf("!") < 0);
for (let row = range.s.r; row <= range.e.r; row++) {
for (let col = range.s.c; col <= range.e.c; col++) {
const cell = XLSX.utils.encode_cell({ r: row, c: col });
if (cellList.indexOf(cell) < 0) {
ws[cell] = { t: "", v: "", s: { border } };
} else {
ws[cell].s = { border };
}
}
}
for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "B1" ||
key === "C1" ||
key === "D1" ||
key === "E1" ||
key === "F1" ||
key === "G1" ||
key === "H1" ||
key === "I1" ||
key === "J1" ||
key === "K1" ||
key === "L1" ||
key === "M1" ||
key === "N1" ||
ws[key].v === "序号" ||
ws[key].v === "区域名称" ||
ws[key].v === "换热站名称" ||
ws[key].v === "年度" ||
ws[key].v === "居民(应供收费面积)" ||
ws[key].v === "大公建(应供建筑面积)" ||
ws[key].v === "小公建(应供建筑面积)" ||
ws[key].v === "收费面积" ||
ws[key].v === "停暖面积" ||
ws[key].v === "实供建筑面积" ||
ws[key].v === "停暖建筑面积" ||
ws[key].v === "应供建筑面积" ||
ws[key].v === "实供建筑面积C" ||
ws[key].v === "实供收费面积D" ||
ws[key].v === "计算面积"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
}
ws["!cols"] = [{ wch: 5 }];
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
XLSX.utils.book_append_sheet(workbook, ws, "面积统计报表");
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
const dataBlob = new Blob([excelBuffer], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",
});
const downloadUrl = URL.createObjectURL(dataBlob);
saveAs(dataBlob, "面积统计报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
//根据权限初始化单选列表 //根据权限初始化单选列表
function initRadioList() { function initRadioList() {
var result = store.getters.getEnterprise(); var result = store.getters.getEnterprise();
...@@ -219,7 +416,14 @@ function initRadioList() { ...@@ -219,7 +416,14 @@ function initRadioList() {
} }
function postTransferAreaFun() { function postTransferAreaFun() {
console.log(enertyInfo); areaName.value.length = 0;
enertyInfo.jurisdictionIds.forEach((item) => {
options.forEach((item1) => {
if (item1.value == item) {
areaName.value.push(item1.lable);
}
});
});
var date = new Date(); var date = new Date();
let supplyYearSend = ref(); let supplyYearSend = ref();
if (date.getMonth() + 1 < 7) { if (date.getMonth() + 1 < 7) {
...@@ -227,7 +431,7 @@ function postTransferAreaFun() { ...@@ -227,7 +431,7 @@ function postTransferAreaFun() {
} else { } else {
supplyYearSend = enertyInfo.supplyYear.split("-")[1]; supplyYearSend = enertyInfo.supplyYear.split("-")[1];
} }
loading.value = true;
let params = { let params = {
jurisdictionIds: enertyInfo.jurisdictionIds, jurisdictionIds: enertyInfo.jurisdictionIds,
supplyYear: supplyYearSend, supplyYear: supplyYearSend,
...@@ -252,13 +456,13 @@ function postTransferAreaFun() { ...@@ -252,13 +456,13 @@ function postTransferAreaFun() {
} else { } else {
ElMessage.error(res.message); ElMessage.error(res.message);
} }
loading.value = false;
}); });
} }
onMounted(() => { onMounted(() => {
initRadioList(); initRadioList();
postTransferAreaFun(); postTransferAreaFun();
//postHeatForecastFun();
}); });
onUnmounted(() => {}); onUnmounted(() => {});
</script> </script>
...@@ -310,4 +514,20 @@ table.botList td { ...@@ -310,4 +514,20 @@ table.botList td {
text-align: left; text-align: left;
font-weight: bolder; font-weight: bolder;
} }
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style> </style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template> <template>
<div class="contentBlock"> <div
<div class="contentBlockInn"> class="contentBlock"
v-loading="loading"
element-loading-background="rgba(122, 122, 122, 0.6)"
>
<div class="contentBlockInn" id="printBlock">
<el-card class="card-contianer"> <el-card class="card-contianer">
<table <table
cellpadding="0" cellpadding="0"
cellspacing="1" cellspacing="1"
style="background-color: #99bbe8" style="background-color: #99bbe8"
empty-text="暂无数据"
> >
<tr> <tr>
<th style="width: 25%">起始时间</th> <th style="width: 25%">起始时间</th>
...@@ -39,7 +44,7 @@ ...@@ -39,7 +44,7 @@
</table> </table>
</td> </td>
<th rowspan="3"> <th rowspan="3">
<div> <div class="printHidden">
<div class="btngrounp"> <div class="btngrounp">
<el-button <el-button
type="primary" type="primary"
...@@ -48,15 +53,16 @@ ...@@ -48,15 +53,16 @@
>查询</el-button >查询</el-button
><el-button ><el-button
type="primary" type="primary"
@click="exportTableToExcel" v-print="printObj"
style="margin: 15px 0 0 10px" style="margin: 15px 0 0 10px"
>打印</el-button >打印</el-button
><el-button >
<!--<el-button
type="primary" type="primary"
@click="exportTableToExcel" @click="exportTableToExcel"
style="margin: 15px 0 0 10px" style="margin: 15px 0 0 10px"
>打印预览</el-button >打印预览</el-button
> >-->
<el-button <el-button
type="primary" type="primary"
@click="exportTableToExcel" @click="exportTableToExcel"
...@@ -84,7 +90,6 @@ ...@@ -84,7 +90,6 @@
v-for="(option, index) in options" v-for="(option, index) in options"
:key="index" :key="index"
:label="option.value" :label="option.value"
:name="option"
> >
{{ option.lable }} {{ option.lable }}
</el-checkbox> </el-checkbox>
...@@ -111,6 +116,52 @@ ...@@ -111,6 +116,52 @@
</el-table> </el-table>
</el-card> </el-card>
</div> </div>
<table
class="exlBlock"
id="exlBlock"
cellpadding="0"
cellspacing="1"
style="margin-top: 5px; background-color: #99bbe8"
>
<tr>
<td colspan="2">起始时间:{{ enertyInfo.startTime }}</td>
<td colspan="2">结束时间:{{ enertyInfo.endTime }}</td>
<td colspan="2">
面积:{{ enertyInfo.areaType == 0 ? "计算面积" : "实供建筑面积" }}
</td>
<td colspan="5">
片区:<span v-for="item in areaName" :key="item"
>{{ item }}&nbsp;&nbsp;&nbsp;&nbsp;</span
>
</td>
</tr>
<tr>
<td>序号</td>
<td>片区</td>
<td>换热站名称</td>
<td>面积</td>
<td>热量(GJ)</td>
<td>热耗(GJ/㎡)</td>
<td>热耗(W/㎡)</td>
<td>水量(T)</td>
<td>水耗(KG/㎡)</td>
<td>电量(KWH)</td>
<td>电量(KWH/㎡)</td>
</tr>
<tr v-for="item in tableData" :key="item.sn">
<td>{{ item.sn }}</td>
<td>{{ item.jurisdictionName }}</td>
<td>{{ item.transferName }}</td>
<td>{{ item.area }}</td>
<td>{{ item.heat }}</td>
<td>{{ item.heatG }}</td>
<td>{{ item.heatW }}</td>
<td>{{ item.water }}</td>
<td>{{ item.waterUsed }}</td>
<td>{{ item.electric }}</td>
<td>{{ item.electricUsed }}</td>
</tr>
</table>
</div> </div>
</template> </template>
<script setup> <script setup>
...@@ -122,6 +173,8 @@ import { ElMessage } from "element-plus"; ...@@ -122,6 +173,8 @@ import { ElMessage } from "element-plus";
import { saveAs } from "file-saver"; import { saveAs } from "file-saver";
import XLSX from "xlsx-js-style"; import XLSX from "xlsx-js-style";
import { postTransferEnergy } from "../../api/report"; import { postTransferEnergy } from "../../api/report";
import print from "vue3-print-nb";
const loading = ref(false);
const radioTitle = ref("供热站"); const radioTitle = ref("供热站");
const options = reactive([]); const options = reactive([]);
const enterpriseId = ref(null); const enterpriseId = ref(null);
...@@ -133,29 +186,125 @@ const enertyInfo = reactive({ ...@@ -133,29 +186,125 @@ const enertyInfo = reactive({
startTime: null, startTime: null,
endTime: null, endTime: null,
}); });
function timeFun() { const areaName = ref([]);
var date = new Date(); const vPrint = print;
var year = date.getFullYear(); const printObj = {
var dateArr = [ id: "printBlock",
date.getMonth() + 1, popTitle: "明日预测报表",
date.getDate(), extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
date.getHours(), zIndex: 20002,
date.getMinutes(), };
date.getSeconds(), function exportTableToExcel() {
]; const workbook = XLSX.utils.book_new();
var endTimeDay = parseInt(dateArr[1] - 1); var ws = XLSX.utils.table_to_sheet(document.getElementById("exlBlock"));
if (endTimeDay < 10) { const border = {
endTimeDay = "0" + endTimeDay; top: {
} style: "thin",
if (dateArr[0] < 10) { },
dateArr[0] = "0" + dateArr[0]; bottom: {
style: "thin",
},
left: {
style: "thin",
},
right: {
style: "thin",
},
};
const range = XLSX.utils.decode_range(ws["!ref"]);
const cellList = Object.keys(ws).filter((item) => item.indexOf("!") < 0);
for (let row = range.s.r; row <= range.e.r; row++) {
for (let col = range.s.c; col <= range.e.c; col++) {
const cell = XLSX.utils.encode_cell({ r: row, c: col });
if (cellList.indexOf(cell) < 0) {
ws[cell] = { t: "", v: "", s: { border } };
} else {
ws[cell].s = { border };
}
}
} }
if (dateArr[1] < 10) {
dateArr[1] = "0" + dateArr[1]; for (const key in ws) {
if (
key === "A1" ||
key === "A2" ||
key === "B1" ||
key === "C1" ||
key === "D1" ||
key === "E1" ||
key === "F1" ||
key === "G1" ||
ws[key].v === "序号" ||
ws[key].v === "片区" ||
ws[key].v === "换热站名称" ||
ws[key].v === "面积" ||
ws[key].v === "热量(GJ)" ||
ws[key].v === "热耗(GJ/㎡)" ||
ws[key].v === "热耗(W/㎡)" ||
ws[key].v === "水量(T)" ||
ws[key].v === "水耗(KG/㎡)" ||
ws[key].v === "电量(KWH)" ||
ws[key].v === "电量(KWH/㎡)"
) {
ws[key].s = {
alignment: {
horizontal: "center",
vertical: "center",
},
border: {
bottom: {
color: "#000000",
style: "thin",
},
left: {
color: "#000000",
style: "thin",
},
right: {
color: "#000000",
style: "thin",
},
top: {
color: "#000000",
style: "thin",
},
},
fill: {
fgColor: { rgb: "0097d5fd" },
},
font: {
bold: true,
family: 2,
size: 12,
},
};
}
} }
enertyInfo.startTime = year + "-" + dateArr[0] + "-" + endTimeDay;
enertyInfo.endTime = year + "-" + dateArr[0] + "-" + dateArr[1]; ws["!cols"] = [{ wch: 5 }];
console.log(enertyInfo);
XLSX.utils.sheet_add_aoa(ws, [], {
origin: "A1",
});
XLSX.utils.book_append_sheet(workbook, ws, "换热站能耗报表");
const excelBuffer = XLSX.write(workbook, { bookType: "xlsx", type: "array" });
const dataBlob = new Blob([excelBuffer], {
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8",
});
const downloadUrl = URL.createObjectURL(dataBlob);
saveAs(dataBlob, "换热站能耗报表.xlsx");
ElMessage.success("导出成功!请稍后。。。");
}
function timeFun() {
const today = new Date();
const preday = new Date(today);
preday.setDate(preday.getDate() - 1);
today.setDate(today.getDate());
enertyInfo.startTime =
preday.toISOString().split("T")[0];
enertyInfo.endTime = today.toISOString().split("T")[0];
} }
//根据权限初始化单选列表 //根据权限初始化单选列表
...@@ -196,16 +345,31 @@ function initRadioList() { ...@@ -196,16 +345,31 @@ function initRadioList() {
} }
function postTransferEnergyFun() { function postTransferEnergyFun() {
areaName.value.length = 0;
enertyInfo.jurisdictionIds.forEach((item) => {
options.forEach((item1) => {
if (item1.value == item) {
areaName.value.push(item1.lable);
}
});
});
if (enertyInfo.startTime == null) { if (enertyInfo.startTime == null) {
ElMessage.error("请选择开始时间"); ElMessage.error("请选择开始时间");
return false; return false;
} }
if (enertyInfo.endTime == null) {
ElMessage.error("请选择结束时间");
return false;
}
loading.value = true;
postTransferEnergy(enertyInfo).then((res) => { postTransferEnergy(enertyInfo).then((res) => {
if (res.success === true) { if (res.success === true) {
tableData.value = res.data; tableData.value = res.data;
} else { } else {
ElMessage.error(res.message); ElMessage.error(res.message);
} }
loading.value = false;
}); });
} }
...@@ -232,7 +396,7 @@ function postPrintHeatForecastFun() { ...@@ -232,7 +396,7 @@ function postPrintHeatForecastFun() {
onMounted(() => { onMounted(() => {
timeFun(); timeFun();
initRadioList(); initRadioList();
postTransferEnergyFun() postTransferEnergyFun();
//postHeatForecastFun(); //postHeatForecastFun();
}); });
onUnmounted(() => {}); onUnmounted(() => {});
...@@ -285,4 +449,20 @@ table.botList td { ...@@ -285,4 +449,20 @@ table.botList td {
text-align: left; text-align: left;
font-weight: bolder; font-weight: bolder;
} }
.exlBlock {
display: none;
}
@media print {
.printHidden {
display: none;
}
@page {
size: auto;
margin: 3mm;
}
body,
html {
height: auto !important;
}
}
</style> </style>
\ No newline at end of file
...@@ -210,7 +210,8 @@ import { ...@@ -210,7 +210,8 @@ import {
getCurrentInstance, getCurrentInstance,
onMounted, onMounted,
onUpdated, onUpdated,
onBeforeUnmount onBeforeUnmount,
handleError
} from 'vue'; } from 'vue';
import { User, Lock } from '@element-plus/icons-vue' import { User, Lock } from '@element-plus/icons-vue'
...@@ -290,7 +291,7 @@ function login() { ...@@ -290,7 +291,7 @@ function login() {
} }
loading.value = true; loading.value = true;
userInfo.verificationCode = code.value; userInfo.verificationCode = code.value;
code.value='';
http.post('/api/user/login', userInfo, '正在登录....').then((result) => { http.post('/api/user/login', userInfo, '正在登录....').then((result) => {
if (!result.success) { if (!result.success) {
loading.value = false; loading.value = false;
...@@ -306,4 +307,11 @@ function login() { ...@@ -306,4 +307,11 @@ function login() {
}); });
} }
function handleKeyEvent(event){
if(event.key === 'Enter'){
login();
}
}
window.addEventListener('keydown',handleKeyEvent);
</script> </script>
\ 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