修改工作台开户建筑必填和优化报错信息,账单支持峰谷

This commit is contained in:
2025-04-22 18:00:12 +08:00
parent 721937fa5b
commit fb9e727efd
9 changed files with 360 additions and 65 deletions

View File

@@ -1,5 +1,5 @@
import { getReportDetail } from "../../../service/report";
import { alertInfo, alertSuccess, getPixelRatio } from "../../../utils/index";
import { alertInfo, alertSuccess, getPixelRatio, loadingFunc } from "../../../utils/index";
import request from '../../../utils/request'
import * as echarts from '../../components/echarts/echarts';
const { OK } = request
@@ -15,20 +15,20 @@ Page({
time: "",
detail: {},
meters: [],
header1: [
{ key: 'address', title: '电表地址' },
{ title: '起码',renderBody: (item) => { return item?.startNumber } },
{ title: '止码',renderBody: (item) => { return item?.endNumber } },
{ title: '倍率',renderBody: (item) => { return item?.displayRatio } },
],
header2: [
{ title: '用电量', renderBody: (item) => item?.overall?.amount },
{ title: '线损电量',renderBody: (item) => item?.loss?.amount },
{ title: '公摊电量',renderBody: (item) => item?.publicAmount },
{ title: '合计电量',renderBody: (item) => {
// header1: [
// { key: 'address', title: '电表地址' },
// { title: '起码',renderBody: (item) => { return item?.startNumber } },
// { title: '止码',renderBody: (item) => { return item?.endNumber } },
// { title: '倍率',renderBody: (item) => { return item?.displayRatio } },
// ],
// header2: [
// { title: '用电量', renderBody: (item) => item?.overall?.amount },
// { title: '线损电量',renderBody: (item) => item?.loss?.amount },
// { title: '公摊电量',renderBody: (item) => item?.publicAmount },
// { title: '合计电量',renderBody: (item) => {
} },
]
// } },
// ]
},
/**
@@ -36,7 +36,10 @@ Page({
*/
onLoad(options) {
const { id, time } = options;
this.init(id, time);
const that = this;
loadingFunc(async () => {
await that.init(id, time);
})
},
async init(id, time) {
const { code, message, detail, amount } = await getReportDetail(id)
@@ -55,40 +58,84 @@ Page({
return item;
})
})
const option = {
tooltip: {
trigger: 'item'
},
legend: {
top: 10,
left: 'center'
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{value|{c} }',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
if (detail?.park?.meter04kvType === 0) {
const option = {
tooltip: {
trigger: 'item'
},
legend: {
top: 10,
left: 'center'
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{value|{c} }',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
}
}
}
},
series: [
{
type: 'pie',
radius: '50%',
data: [
{ value: detail.comprehensive.lossAmount, name: '本期线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
{ value: detail.comprehensive.consumption, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } },
],
}
]
};
this.init_pieCharts(option);
},
series: [
{
type: 'pie',
radius: '50%',
data: [
{ value: detail.comprehensive.lossAmount, name: '线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
{ value: detail.comprehensive.consumption, name: '电度电量', itemStyle: { color: 'rgb(80,135,236)' } },
],
}
]
};
this.init_pieCharts(option);
} else {
// const option = {
// tooltip: {
// trigger: 'item'
// },
// legend: {
// top: 10,
// left: 'center'
// },
// label: {
// alignTo: 'edge',
// formatter: '{name|{b}}\n{value|{c} }',
// minMargin: 5,
// edgeDistance: 10,
// lineHeight: 15,
// rich: {
// time: {
// fontSize: 10,
// color: '#999'
// }
// }
// },
// series: [
// {
// type: 'pie',
// radius: '50%',
// data: [
// {
// value: detail.comprehensive.lossAmount,
// name: '线损电量',
// },
// {
// value: detail.comprehensive.consumption,
// name: '电度电量',
// },
// ],
// }
// ]
// };
// this.init_pieCharts(option);
}
const that = this;
wx.getSystemInfo({
success: function (res) {