全系統新增千分位、電站報表: 區間選項顯示"區間報表"

This commit is contained in:
wanling040@gmail.com 2022-07-24 00:50:56 +08:00
parent c78802b387
commit 02cb87ae78
7 changed files with 124 additions and 115 deletions

View File

@ -544,9 +544,11 @@
}, { }, {
"data": "endAt" "data": "endAt"
}, { }, {
"data": "kwh" "data": "kwh",
"render": $.fn.DataTable.render.number(",")
}, { }, {
"data": "money" "data": "money",
"render": $.fn.DataTable.render.number(",")
}, { }, {
"data": "createdDay" "data": "createdDay"
}, { }, {

View File

@ -567,19 +567,19 @@
str += "<td>" + val.endAt + "</td>"; str += "<td>" + val.endAt + "</td>";
str += "<td>" + days + "天" + "</td>"; str += "<td>" + days + "天" + "</td>";
str += "<td>" + val.cbAeff + "%" + "</td>"; str += "<td>" + val.cbAeff + "%" + "</td>";
str += "<td>" + (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01).toFixed(2) + "</td>"; str += "<td>" + toThousands((val.cbAkwh * val.cbAeff * days * val.capacity * 0.01).toFixed(2)) + "</td>";
str += "<td>" + (val.rate * (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01)).toFixed(2) + "</td>"; str += "<td>" + toThousands((val.rate * (val.cbAkwh * val.cbAeff * days * val.capacity * 0.01)).toFixed(2)) + "</td>";
str += "<td>" + val.realKWH.toFixed(2) + "</td>"; str += "<td>" + toThousands(val.realKWH.toFixed(2)) + "</td>";
str += "<td>" + Math.round(val.realMoney) + "</td>"; str += "<td>" + toThousands(Math.round(val.realMoney)) + "</td>";
str += "<td>" + val.actualkwh.toFixed(2) + "</td>"; str += "<td>" + toThousands(val.actualkwh.toFixed(2)) + "</td>";
str += "<td>" + Math.round(val.actualMoney) + "</td>"; str += "<td>" + toThousands(Math.round(val.actualMoney)) + "</td>";
var cba = val.cbAkwh * val.cbAeff * days * val.capacity * 0.01 / days / val.capacity; var cba = val.cbAkwh * val.cbAeff * days * val.capacity * 0.01 / days / val.capacity;
str += "<td>" + cba.toFixed(2) + "</td>"; str += "<td>" + toThousands(cba.toFixed(2)) + "</td>";
var real = val.realKWH / days / val.capacity; var real = val.realKWH / days / val.capacity;
str += "<td>" + real.toFixed(2) + "</td>"; str += "<td>" + toThousands(real.toFixed(2)) + "</td>";
str += "<td>" + ((cba == 0) ? 0 : ((real / cba - 1) * 100 ).toFixed(2)) + "%" + "</td>"; str += "<td>" + ((cba == 0) ? 0 : ((real / cba - 1) * 100 ).toFixed(2)) + "%" + "</td>";
var act = val.actualkwh / days / val.capacity; var act = val.actualkwh / days / val.capacity;
str += "<td>" + act.toFixed(2) + "</td>"; str += "<td>" + toThousands(act.toFixed(2)) + "</td>";
str += "<td>" + ((cba == 0) ? 0 : ((act / cba - 1) * 100 ).toFixed(2)) + "%" + "</td>"; str += "<td>" + ((cba == 0) ? 0 : ((act / cba - 1) * 100 ).toFixed(2)) + "%" + "</td>";
str += "</tr>"; str += "</tr>";
}) })
@ -590,18 +590,18 @@
} }
var stra = ""; var stra = "";
stra += "<tr>"; stra += "<tr>";
stra += "<td>" + capacity.toFixed(3) + "</td>"; stra += "<td>" + toThousands(capacity.toFixed(3)) + "</td>";
stra += "<td>" + cbAkwh.toFixed(2) + "</td>"; stra += "<td>" + toThousands(cbAkwh.toFixed(2)) + "</td>";
stra += "<td>" + rate.toFixed(2) + "</td>"; stra += "<td>" + toThousands(rate.toFixed(2)) + "</td>";
stra += "<td>" + capacity.toFixed(3) + "</td>"; stra += "<td>" + toThousands(capacity.toFixed(3)) + "</td>";
stra += "<td>" + rate.toFixed(2) + "</td>"; stra += "<td>" + toThousands(rate.toFixed(2)) + "</td>";
stra += "<td>" + capacity.toFixed(3) + "</td>"; stra += "<td>" + toThousands(capacity.toFixed(3)) + "</td>";
stra += "<td>" + rate.toFixed(2) + "</td>"; stra += "<td>" + toThousands(rate.toFixed(2)) + "</td>";
stra += "<td>" + (checkvalue ? 0 : (totalcbAkwh / totaldays / capacity).toFixed(2)) + "</td>"; stra += "<td>" + (checkvalue ? 0 : toThousands((totalcbAkwh / totaldays / capacity).toFixed(2))) + "</td>";
stra += "<td>" + ((totaldays == 0) ? 0 : (totalrealKWH / totaldays / capacity).toFixed(2)) + "</td>"; stra += "<td>" + ((totaldays == 0) ? 0 : toThousands((totalrealKWH / totaldays / capacity).toFixed(2))) + "</td>";
stra += "<td>" + (checkvalue ? 0 : ((( (totalrealKWH / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2) ) + "%" + "</td>"; stra += "<td>" + (checkvalue ? 0 : toThousands(((( (totalrealKWH / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2)) ) + "%" + "</td>";
stra += "<td>" + ((totaldays == 0) ? 0 : (totalactualkwh / totaldays / capacity).toFixed(2)) + "</td>"; stra += "<td>" + ((totaldays == 0) ? 0 : toThousands((totalactualkwh / totaldays / capacity).toFixed(2))) + "</td>";
stra += "<td>" + (checkvalue ? 0 : ( (((totalactualkwh / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2) ) + "%" + "</td>"; stra += "<td>" + (checkvalue ? 0 : toThousands(( (((totalactualkwh / totaldays / capacity) / (totalcbAkwh / totaldays / capacity)) - 1) * 100).toFixed(2)) ) + "%" + "</td>";
stra += "</tr>"; stra += "</tr>";
$('#totalbody').append(stra); $('#totalbody').append(stra);
$('#asbody').append(str); $('#asbody').append(str);

View File

@ -353,8 +353,8 @@
$('#solarTable' + val.cityId).find('tbody').append('<tr data-id="' + val.id + '" datacity-id="' + val.cityId + '"">' + $('#solarTable' + val.cityId).find('tbody').append('<tr data-id="' + val.id + '" datacity-id="' + val.cityId + '"">' +
'<td><a href="' + localurl + '/edit?stationId=' + val.id +'">' + val.name + '</td>' + '<td><a href="' + localurl + '/edit?stationId=' + val.id +'">' + val.name + '</td>' +
'<td>' + val.generatingCapacity.toFixed(3) + '</td>' + '<td>' + toThousands(val.generatingCapacity.toFixed(3)) + '</td>' +
'<td>' + val.inverterAmount + '</td>' + '<td>' + toThousands(val.inverterAmount) + '</td>' +
'<td>' + val.electricityMeterAt + '</td>' + '<td>' + val.electricityMeterAt + '</td>' +
'<td>' + ((val.status == 0) ? "停用" : "啟用") + '</td>' + '<td>' + ((val.status == 0) ? "停用" : "啟用") + '</td>' +

View File

@ -456,17 +456,17 @@
$('#solarTable').find('tbody').append('<tr>' + $('#solarTable').find('tbody').append('<tr>' +
'<td>' + val.code + '</td>' + '<td>' + val.code + '</td>' +
'<td>' + val.name + '</td>' + '<td>' + val.name + '</td>' +
'<td>' + val.generatingCapacity.toFixed(3) + '</td>' + '<td>' + (toThousands(val.generatingCapacity.toFixed(3))) + '</td>' +
'<td>' + val.total_kWh.toFixed(2) + '</td>' + '<td>' + (toThousands(val.total_kWh.toFixed(2))) + '</td>' +
'<td>' + val.today_kWh.toFixed(2) + '</td>' + '<td>' + (toThousands(val.today_kWh.toFixed(2))) + '</td>' +
'<td>' + val.solarHour.toFixed(2) + '</td>' + '<td>' + (toThousands(val.solarHour.toFixed(2))) + '</td>' +
'<td>' + val.today_PR + '</td>' + '<td>' + (toThousands(val.today_PR.toFixed(2))) + '</td>' +
'<td>' + val.today_irradiance.toFixed(2) + '</td>' + '<td>' + (toThousands(val.today_irradiance.toFixed(2))) + '</td>' +
'<td>' + val.avg_irradiance.toFixed(2) + '</td>' + '<td>' + (toThousands(val.avg_irradiance.toFixed(2))) + '</td>' +
@if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney"))
{ {
<text> <text>
'<td>' + val.today_Money.toFixed() + '</td>' + '<td>' + (toThousands(val.today_Money.toFixed())) + '</td>' +
</text> </text>
} }
'<td>' + val.electricityMeterAt + '</td>' + '<td>' + val.electricityMeterAt + '</td>' +

View File

@ -1866,7 +1866,7 @@
$("#escrow_name_text").html(powerStationData.escrowName); $("#escrow_name_text").html(powerStationData.escrowName);
$("#created_by_text").html(powerStationData.creatorName); $("#created_by_text").html(powerStationData.creatorName);
$("#generating_capacity_text").html(powerStationData.generatingCapacity.toFixed(3)); $("#generating_capacity_text").html(toThousands(powerStationData.generatingCapacity.toFixed(3)));
$("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime); $("#estimated_recovery_time_text").html(powerStationData.estimatedRecoveryTime);
$("#coordinate_text").html(powerStationData.coordinate); $("#coordinate_text").html(powerStationData.coordinate);
@ -1874,8 +1874,8 @@
$("#power_station_operation_personnel").attr("disabled", true); $("#power_station_operation_personnel").attr("disabled", true);
$("#line_token_text").html(powerStationData.line_token); $("#line_token_text").html(powerStationData.line_token);
$("#estimate_kwh_text").html(powerStationData.estimate_kwh); $("#estimate_kwh_text").html(toThousands(powerStationData.estimate_kwh));
$("#estimate_efficacy_text").html(powerStationData.estimateEfficacy); $("#estimate_efficacy_text").html(toThousands(powerStationData.estimateEfficacy));
$("#created_at_text").html(powerStationData.createdAt); $("#created_at_text").html(powerStationData.createdAt);
@if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser) @if (ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformAdmin || ViewBag.myUser.Role.Layer == (int)RoleLayerEnum.PlatformUser)
@ -1901,7 +1901,7 @@
$("#photovoltaic_panel_brand_text").html(powerStationData.photovoltaicPanelBrand); $("#photovoltaic_panel_brand_text").html(powerStationData.photovoltaicPanelBrand);
$("#photovoltaic_panel_product_model_text").html(powerStationData.photovoltaicPanelProductModel); $("#photovoltaic_panel_product_model_text").html(powerStationData.photovoltaicPanelProductModel);
$("#photovoltaic_panel_specification_text").html(powerStationData.photovoltaicPanelSpecification); $("#photovoltaic_panel_specification_text").html(powerStationData.photovoltaicPanelSpecification);
$("#photovoltaic_panel_amount_text").html(powerStationData.photovoltaicPanelAmount); $("#photovoltaic_panel_amount_text").html(toThousands(powerStationData.photovoltaicPanelAmount));
//#endregion //#endregion
//#region 電站基本資料 input //#region 電站基本資料 input
@ -2612,12 +2612,12 @@
diffSOLARHOURALL = val.solarhour; diffSOLARHOURALL = val.solarhour;
$('#HistoryDetailTable').append('<tr>' + $('#HistoryDetailTable').append('<tr>' +
'<td>' + val.timestamp + '</td>' + '<td>' + val.timestamp + '</td>' +
'<td>' + val.kwh.toFixed(2) + '</td>' + '<td>' + (toThousands(val.kwh.toFixed(2))) + '</td>' +
'<td>' + val.kwhkwp.toFixed(2) + '</td>' + '<td>' + (toThousands(val.kwhkwp.toFixed(2))) + '</td>' +
'<td>' + val.irrDay.toFixed(2) + '</td>' + '<td>' + (toThousands(val.irrDay.toFixed(2))) + '</td>' +
//'<td>' + val.irradiance.toFixed(2) + '</td>' + //'<td>' + val.irradiance.toFixed(2) + '</td>' +
'<td>' + val.pr.toFixed(2) + '</td>' + '<td>' + (toThousands(val.pr.toFixed(2))) + '</td>' +
'<td>' + val.temp.toFixed(2) + '</td>' + '<td>' + (toThousands(val.temp.toFixed(2))) + '</td>' +
'</tr>'); '</tr>');
listmonth.push(val.timestamp); listmonth.push(val.timestamp);
listkwh.push(parseFloat(val.kwh.toFixed(2))); listkwh.push(parseFloat(val.kwh.toFixed(2)));
@ -2642,12 +2642,12 @@
diffSOLARHOURALL += val.diffSOLARHOUR; diffSOLARHOURALL += val.diffSOLARHOUR;
$('#HistoryDetailTable').append('<tr>' + $('#HistoryDetailTable').append('<tr>' +
'<td>' + val.timestamp + '</td>' + '<td>' + val.timestamp + '</td>' +
'<td>' + val.kwh.toFixed(2) + '</td>' + '<td>' + (toThousands(val.kwh.toFixed(2))) + '</td>' +
'<td>' + val.kwhkwp.toFixed(2) + '</td>' + '<td>' + (toThousands(val.kwhkwp.toFixed(2))) + '</td>' +
//'<td>' + val.irradiance.toFixed(2) + '</td>' + //'<td>' + val.irradiance.toFixed(2) + '</td>' +
'<td>' + val.pr.toFixed(2) + '</td>' + '<td>' + (toThousands(val.pr.toFixed(2))) + '</td>' +
'<td>' + val.temp.toFixed(2) + '</td>' + '<td>' + (toThousands(val.temp.toFixed(2))) + '</td>' +
'</tr>'); '</tr>');
listmonth.push(val.timestamp); listmonth.push(val.timestamp);
listkwh.push(parseFloat(val.kwh.toFixed(2))); listkwh.push(parseFloat(val.kwh.toFixed(2)));
@ -2781,12 +2781,12 @@
{ {
$('#HistoryTotalTable').append('<tr>' + $('#HistoryTotalTable').append('<tr>' +
'<td>' + TimestampALL + '</td>' + '<td>' + TimestampALL + '</td>' +
'<td>' + kwhALL.toFixed(2) + '</td>' + '<td>' + (toThousands(kwhALL.toFixed(2))) + '</td>' +
'<td>' + kwhkwp + '</td>' + '<td>' + (toThousands(kwhkwp)) + '</td>' +
//'<td>' + irradianceALL.toFixed(2) + '</td>' + // 改成累積日照 by jiahao 2022-04-30 00:444 //'<td>' + irradianceALL.toFixed(2) + '</td>' + // 改成累積日照 by jiahao 2022-04-30 00:444
'<td>' + avgIrr_day.toFixed(2) + '</td>' + '<td>' + (toThousands(avgIrr_day.toFixed(2))) + '</td>' +
'<td>' + avgPR.toFixed(2) + '</td>' + '<td>' + (toThousands(avgPR.toFixed(2))) + '</td>' +
'<td>' + tempALL.toFixed(2) + '</td>' + '<td>' + (toThousands(tempALL.toFixed(2))) + '</td>' +
'</tr>'); '</tr>');
} }
$('#all').show(); $('#all').show();
@ -2809,15 +2809,15 @@
return; return;
} }
$("#Invertercard-Name").html(rel.data.name); $("#Invertercard-Name").html(rel.data.name);
$("#Invertercard-kwh").html(rel.data.today_kWh.toFixed(2)); $("#Invertercard-kwh").html(toThousands(rel.data.today_kWh.toFixed(2)));
@if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney"))
{ {
<text> <text>
$("#Invertercard-money").html(rel.data.today_Money.toFixed()); $("#Invertercard-money").html(toThousands(rel.data.today_Money.toFixed()));
</text> </text>
} }
$("#Invertercard-Capacity").html(rel.data.generatingCapacity.toFixed(3)); $("#Invertercard-Capacity").html(toThousands(rel.data.generatingCapacity.toFixed(3)));
$("#Invertercard-pr").html(rel.data.today_PR.toFixed(2)); $("#Invertercard-pr").html(toThousands(rel.data.today_PR.toFixed(2)));
var str = "<div class='progress progress-sm ' id='prbar'>" + var str = "<div class='progress progress-sm ' id='prbar'>" +
"<div class='progress-bar bg-info' role = 'progressbar' style = 'width: " + rel.data.today_PR + "%;' aria - valuenow='" + rel.data.today_PR + "' aria - valuemin='0' aria - valuemax='100' ></div > </div >" "<div class='progress-bar bg-info' role = 'progressbar' style = 'width: " + rel.data.today_PR + "%;' aria - valuenow='" + rel.data.today_PR + "' aria - valuemin='0' aria - valuemax='100' ></div > </div >"
$('#prbar').remove(); $('#prbar').remove();
@ -2924,29 +2924,29 @@
str += '<div class="list-group-item px-2 bg-info-20">'; str += '<div class="list-group-item px-2 bg-info-20">';
str += '<div class=" d-flex justify-content-between">'; str += '<div class=" d-flex justify-content-between">';
str += '<p class="mb-0">輸出功率</p>'; str += '<p class="mb-0">輸出功率</p>';
str += '<p class="mb-0">' + rel.data[a].output.toFixed(2) + '</p>'; str += '<p class="mb-0">' + toThousands(rel.data[a].output.toFixed(2)) + '</p>';
str += '<p class="mb-0">kw</p>'; str += '<p class="mb-0">kw</p>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
str += '<div class="list-group-item px-2">'; str += '<div class="list-group-item px-2">';
str += '<div class=" d-flex justify-content-between">'; str += '<div class=" d-flex justify-content-between">';
str += '<p class="mb-0">輸入功率</p>'; str += '<p class="mb-0">輸入功率</p>';
str += '<p class="mb-0">' + rel.data[a].input.toFixed(2) + '</p>'; str += '<p class="mb-0">' + toThousands(rel.data[a].input.toFixed(2)) + '</p>';
str += '<p class="mb-0">kw</p>'; str += '<p class="mb-0">kw</p>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
str += '<div class="list-group-item px-2 bg-info-20">'; str += '<div class="list-group-item px-2 bg-info-20">';
str += '<div class="d-flex">'; str += '<div class="d-flex">';
str += 'PR <span class="d-inline-block ml-auto">' + rel.data[a].pr.toFixed(2) + '%</span>'; str += 'PR <span class="d-inline-block ml-auto">' + toThousands(rel.data[a].pr.toFixed(2)) + '%</span>';
str += '</div>'; str += '</div>';
str += '<div class="progress progress-sm mb-3">'; str += '<div class="progress progress-sm mb-3">';
str += '<div class="progress-bar bg-info-400" role="progressbar" style="width: ' + rel.data[a].pr.toFixed(2) + '%;" aria-valuenow="' + rel.data[a].pr.toFixed(2) + '" aria-valuemin="0" aria-valuemax="100"></div>'; str += '<div class="progress-bar bg-info-400" role="progressbar" style="width: ' + toThousands(rel.data[a].pr.toFixed(2)) + '%;" aria-valuenow="' + toThousands(rel.data[a].pr.toFixed(2)) + '" aria-valuemin="0" aria-valuemax="100"></div>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
str += '<div class="list-group-item px-2">'; str += '<div class="list-group-item px-2">';
str += '<div class=" d-flex justify-content-between">'; str += '<div class=" d-flex justify-content-between">';
str += '<p class="mb-0">日發電量</p>'; str += '<p class="mb-0">日發電量</p>';
str += '<p class="mb-0">' + rel.data[a].todaykwh.toFixed(2) + '</p>'; str += '<p class="mb-0">' + toThousands(rel.data[a].todaykwh.toFixed(2)) + '</p>';
str += '<p class="mb-0">kWh</p>'; str += '<p class="mb-0">kWh</p>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
@ -2986,29 +2986,29 @@
str += '<div class="list-group-item px-2 bg-info-20">'; str += '<div class="list-group-item px-2 bg-info-20">';
str += '<div class=" d-flex justify-content-between">'; str += '<div class=" d-flex justify-content-between">';
str += '<p class="mb-0">輸出功率</p>'; str += '<p class="mb-0">輸出功率</p>';
str += '<p class="mb-0">' + rel.data[a].output.toFixed(2) + '</p>'; str += '<p class="mb-0">' + toThousands(rel.data[a].output.toFixed(2)) + '</p>';
str += '<p class="mb-0">kw</p>'; str += '<p class="mb-0">kw</p>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
str += '<div class="list-group-item px-2">'; str += '<div class="list-group-item px-2">';
str += '<div class=" d-flex justify-content-between">'; str += '<div class=" d-flex justify-content-between">';
str += '<p class="mb-0">輸入功率</p>'; str += '<p class="mb-0">輸入功率</p>';
str += '<p class="mb-0">' + rel.data[a].input.toFixed(2) + '</p>'; str += '<p class="mb-0">' + toThousands(rel.data[a].input.toFixed(2)) + '</p>';
str += '<p class="mb-0">kw</p>'; str += '<p class="mb-0">kw</p>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
str += '<div class="list-group-item px-2 bg-info-20">'; str += '<div class="list-group-item px-2 bg-info-20">';
str += '<div class="d-flex">'; str += '<div class="d-flex">';
str += 'PR <span class="d-inline-block ml-auto">' + rel.data[a].pr.toFixed(2) + '%</span>'; str += 'PR <span class="d-inline-block ml-auto">' + toThousands(rel.data[a].pr.toFixed(2)) + '%</span>';
str += '</div>'; str += '</div>';
str += '<div class="progress progress-sm mb-3">'; str += '<div class="progress progress-sm mb-3">';
str += '<div class="progress-bar bg-info-400" role="progressbar" style="width: ' + rel.data[a].pr.toFixed(2) + '%;" aria-valuenow="' + rel.data[a].pr.toFixed(2) + '" aria-valuemin="0" aria-valuemax="100"></div>'; str += '<div class="progress-bar bg-info-400" role="progressbar" style="width: ' + toThousands(rel.data[a].pr.toFixed(2)) + '%;" aria-valuenow="' + toThousands(rel.data[a].pr.toFixed(2)) + '" aria-valuemin="0" aria-valuemax="100"></div>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
str += '<div class="list-group-item px-2">'; str += '<div class="list-group-item px-2">';
str += '<div class=" d-flex justify-content-between">'; str += '<div class=" d-flex justify-content-between">';
str += '<p class="mb-0">日發電量</p>'; str += '<p class="mb-0">日發電量</p>';
str += '<p class="mb-0">' + rel.data[a].todaykwh.toFixed(2) + '</p>'; str += '<p class="mb-0">' + toThousands(rel.data[a].todaykwh.toFixed(2)) + '</p>';
str += '<p class="mb-0">kWh</p>'; str += '<p class="mb-0">kWh</p>';
str += '</div>'; str += '</div>';
str += '</div>'; str += '</div>';
@ -3049,15 +3049,15 @@
{ {
ACDetail += "<tr>"; ACDetail += "<tr>";
ACDetail += "<td>" + a + "</td>"; ACDetail += "<td>" + a + "</td>";
ACDetail += "<td>" + rel.data['aC' + a + 'V'].toFixed(2) + "</td>"; ACDetail += "<td>" + toThousands(rel.data['aC' + a + 'V'].toFixed(2)) + "</td>";
ACDetail += "<td>" + rel.data['aC' + a + 'A'].toFixed(2) + "</td>"; ACDetail += "<td>" + toThousands(rel.data['aC' + a + 'A'].toFixed(2)) + "</td>";
ACDetail += "</tr>"; ACDetail += "</tr>";
} }
ACDetail += "<tr>"; ACDetail += "<tr>";
ACDetail += "<td colspan='3'>輸出功率 <span class='color-info-700 font-weight-bold'>" + ((rel.data.aC1W + rel.data.aC2W + rel.data.aC3W) / 1000).toFixed(2) + "</span> KW</td>"; ACDetail += "<td colspan='3'>輸出功率 <span class='color-info-700 font-weight-bold'>" + ((rel.data.aC1W + rel.data.aC2W + rel.data.aC3W) / 1000).toFixed(2) + "</span> KW</td>";
ACDetail += "</tr>"; ACDetail += "</tr>";
ACDetail += "<tr>"; ACDetail += "<tr>";
ACDetail += "<td colspan='3'>PR <span class='color-info-700 font-weight-bold'>" + rel.data.pr.toFixed(2) + "</span> %</td>"; ACDetail += "<td colspan='3'>PR <span class='color-info-700 font-weight-bold'>" + toThousands(rel.data.pr.toFixed(2)) + "</span> %</td>";
ACDetail += "</tr>"; ACDetail += "</tr>";
$('#inverterInfo-AC').empty(); $('#inverterInfo-AC').empty();
@ -3070,10 +3070,10 @@
for (var a = 1; a < 6; a++) { for (var a = 1; a < 6; a++) {
DCDetail += "<tr>"; DCDetail += "<tr>";
DCDetail += "<td>" + a + "</td>"; DCDetail += "<td>" + a + "</td>";
DCDetail += "<td>" + rel.data['dC' + a + 'V'].toFixed(2) + "</td>"; DCDetail += "<td>" + toThousands(rel.data['dC' + a + 'V'].toFixed(2)) + "</td>";
DCDetail += "<td>" + rel.data['dC' + a + 'A'].toFixed(2) + "</td>"; DCDetail += "<td>" + toThousands(rel.data['dC' + a + 'A'].toFixed(2)) + "</td>";
DCDetail += "<td>" + rel.data['dC' + a + 'KW'].toFixed(2) + "</td>"; DCDetail += "<td>" + toThousands(rel.data['dC' + a + 'KW'].toFixed(2)) + "</td>";
DCDetail += "<td>" + rel.data['rA' + a ].toFixed(2) + "</td>"; DCDetail += "<td>" + toThousands(rel.data['rA' + a ].toFixed(2)) + "</td>";
DCDetail += "</tr>"; DCDetail += "</tr>";
DCTOTAL += rel.data['dC' + a + 'W']; DCTOTAL += rel.data['dC' + a + 'W'];
} }

View File

@ -210,6 +210,7 @@
<button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(0,this)" id="daybtn">日報表</button> <button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(0,this)" id="daybtn">日報表</button>
<button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(1,this)" id="monthbtn">月報表</button> <button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(1,this)" id="monthbtn">月報表</button>
<button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(3,this)" id="year2btn">年報表</button> <button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(3,this)" id="year2btn">年報表</button>
<button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(1,this)" id="intervalbtn">區間報表</button>
<button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(2,this)" id="yearbtn">綜合報表</button> <button type="button" class="btn btn-primary waves-effect waves-themed ml-1 btn-report" onclick="Dateform(2,this)" id="yearbtn">綜合報表</button>
</div> </div>
</div> </div>
@ -328,6 +329,7 @@
$('#yearbtn').show(); $('#yearbtn').show();
$('#daybtn').show(); $('#daybtn').show();
$('#year2btn').hide(); $('#year2btn').hide();
$('#intervalbtn').hide();
//document.getElementById("monthbtn").disabled = true;//月報表鎖定 //document.getElementById("monthbtn").disabled = true;//月報表鎖定
//document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 //document.getElementById("yearbtn").disabled = false;//綜合報表鎖定
//document.getElementById("daybtn").disabled = false;//日報表鎖定 //document.getElementById("daybtn").disabled = false;//日報表鎖定
@ -358,6 +360,7 @@
$('#yearbtn').show(); $('#yearbtn').show();
$('#daybtn').show(); $('#daybtn').show();
$('#year2btn').hide(); $('#year2btn').hide();
$('#intervalbtn').hide();
@*document.getElementById("monthbtn").disabled = true;//月報表鎖定 @*document.getElementById("monthbtn").disabled = true;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定
document.getElementById("daybtn").disabled = false;//日報表鎖定*@ document.getElementById("daybtn").disabled = false;//日報表鎖定*@
@ -396,9 +399,10 @@
//#endregion //#endregion
$('#DateGettext').val(dateLimit_format + ' - ' + today_format); $('#DateGettext').val(dateLimit_format + ' - ' + today_format);
$('#daybtn').hide(); $('#daybtn').hide();
$('#monthbtn').show(); $('#monthbtn').hide();
$('#yearbtn').show(); $('#yearbtn').show();
$('#year2btn').hide(); $('#year2btn').hide();
$('#intervalbtn').show();
@*document.getElementById("daybtn").disabled = true;//日報表鎖定 @*document.getElementById("daybtn").disabled = true;//日報表鎖定
document.getElementById("monthbtn").disabled = false;//月報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@
@ -412,6 +416,7 @@
$('#monthbtn').show(); $('#monthbtn').show();
$('#yearbtn').show(); $('#yearbtn').show();
$('#year2btn').hide(); $('#year2btn').hide();
$('#intervalbtn').hide();
@*document.getElementById("daybtn").disabled = true;//日報表鎖定 @*document.getElementById("daybtn").disabled = true;//日報表鎖定
document.getElementById("monthbtn").disabled = false;//月報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@
@ -426,6 +431,7 @@
$('#monthbtn').hide(); $('#monthbtn').hide();
$('#yearbtn').show(); $('#yearbtn').show();
$('#year2btn').show(); $('#year2btn').show();
$('#intervalbtn').hide();
@*document.getElementById("daybtn").disabled = true;//日報表鎖定 @*document.getElementById("daybtn").disabled = true;//日報表鎖定
document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("monthbtn").disabled = true;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@
@ -930,13 +936,13 @@
if (inverter[i] == null) { if (inverter[i] == null) {
sta += "<td>" + 0 + "</td>"; sta += "<td>" + 0 + "</td>";
} else { } else {
sta += "<td>" + Number(inverter[i]).toFixed(2) + "</td>"; sta += "<td>" + toThousands(Number(inverter[i]).toFixed(2)) + "</td>";
} }
}); });
sta += "<td>" + Number(inverter.hourKWH) + "</td>"; sta += "<td>" + toThousands(Number(inverter.hourKWH)) + "</td>";
sta += "<td>" + Number(inverter.hourKWHp) + "</td>"; sta += "<td>" + toThousands(Number(inverter.hourKWHp)) + "</td>";
sta += "<td>" + Number(inverter.irradiance) + "</td>"; // body 小時平均日照度 sta += "<td>" + toThousands(Number(inverter.irradiance)) + "</td>"; // body 小時平均日照度
sta += "<td>" + Number(inverter.temperature) + "</td>"; //body 小時平均模組溫度 sta += "<td>" + toThousands(Number(inverter.temperature)) + "</td>"; //body 小時平均模組溫度
if (showmoney == 1) { if (showmoney == 1) {
sta += "<td>" + toThousands(Math.round(Number(inverter.hourmoney))) + "</td>"; sta += "<td>" + toThousands(Math.round(Number(inverter.hourmoney))) + "</td>";
} }
@ -964,10 +970,10 @@
var stb = "<tr>"; var stb = "<tr>";
/* stb += "<td>" + thour + "</td>";*/ /* stb += "<td>" + thour + "</td>";*/
stb += "<td>" + kWhkwp + "</td>"; //header - 有效發電小時 stb += "<td>" + toThousands(kWhkwp) + "</td>"; //header - 有效發電小時
stb += "<td>" + tpr + "</td>"; // stb += "<td>" + toThousands(tpr) + "</td>"; //
stb += "<td>" + tkwh + "</td>"; stb += "<td>" + toThousands(tkwh) + "</td>";
stb += "<td>" + GeneratingCapacity + "</td>"; stb += "<td>" + toThousands(GeneratingCapacity) + "</td>";
if (showmoney == 1) { if (showmoney == 1) {
stb += "<td>" + toThousands(Math.round(ntd)) + "</td>"; stb += "<td>" + toThousands(Math.round(ntd)) + "</td>";
stb += "<td>" + Math.round(ntdone * 10000) / 10000 + "</td>"; stb += "<td>" + Math.round(ntdone * 10000) / 10000 + "</td>";
@ -1000,15 +1006,15 @@
if (inverter[i] == null) { if (inverter[i] == null) {
sta += "<td>" + 0 + "</td>"; sta += "<td>" + 0 + "</td>";
} else { } else {
sta += "<td>" + inverter[i] + "</td>"; sta += "<td>" + toThousands(inverter[i]) + "</td>";
} }
}); });
sta += "<td>" + inverter.dayKWH + "</td>"; sta += "<td>" + toThousands(inverter.dayKWH) + "</td>";
sta += "<td>" + ((inverter.dayKWHp == null) ? 0 : inverter.dayKWHp) + "</td>"; sta += "<td>" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp)) + "</td>";
sta += "<td>" + inverter.tothour + "</td>"; sta += "<td>" + inverter.tothour + "</td>";
sta += "<td>" + inverter.KWHKWP + "</td>"; sta += "<td>" + toThousands(inverter.KWHKWP) + "</td>";
sta += "<td>" + ((inverter.PR == null) ? 0 : inverter.PR.toFixed(2)) + "</td>"; sta += "<td>" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + "</td>";
sta += "<td>" + ((inverter.IrrDay == null) ? 0 : inverter.IrrDay) + "</td>"; sta += "<td>" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay)) + "</td>";
sta += "<td>" + inverter.temperature + "</td>"; sta += "<td>" + inverter.temperature + "</td>";
if (showmoney == 1) { if (showmoney == 1) {
sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>"; sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>";
@ -1060,13 +1066,13 @@
} }
else { else {
/*stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";*/ /*stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";*/
stb += "<td>" + (avgKWHKWP / monthday).toFixed(2) + "</td>"; stb += "<td>" + toThousands((avgKWHKWP / monthday).toFixed(2)) + "</td>";
stb += "<td>" + (avgdayKWH / monthday).toFixed(2) + "</td>"; stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
stb += "<td>" + monthKWH + "</td>"; stb += "<td>" + toThousands(monthKWH) + "</td>";
stb += "<td>" + GeneratingCapacity + "</td>"; stb += "<td>" + toThousands(GeneratingCapacity) + "</td>";
if (showmoney == 1) { if (showmoney == 1) {
stb += "<td>" + (monthmoney / GeneratingCapacity).toFixed(3) + "</td>"; stb += "<td>" + toThousands((monthmoney / GeneratingCapacity).toFixed(3)) + "</td>";
stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>"; stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>";
stb += "<td>" + Math.round(monthmoneyone / monthday*10000)/10000 + "</td>"; stb += "<td>" + Math.round(monthmoneyone / monthday*10000)/10000 + "</td>";
} }
@ -1126,16 +1132,16 @@
if (inverter[i] == null) { if (inverter[i] == null) {
sta += "<td>" + 0 + "</td>"; sta += "<td>" + 0 + "</td>";
} else { } else {
sta += "<td>" + inverter[i] + "</td>"; sta += "<td>" + toThousands(inverter[i]) + "</td>";
} }
}); });
sta += "<td>" + inverter.dayKWH + "</td>"; sta += "<td>" + toThousands(inverter.dayKWH) + "</td>";
sta += "<td>" + inverter.dayKWHp + "</td>"; sta += "<td>" + toThousands(inverter.dayKWHp) + "</td>";
sta += "<td>" + inverter.tothour + "</td>"; sta += "<td>" + toThousands(inverter.tothour) + "</td>";
sta += "<td>" + inverter.KWHKWP + "</td>"; sta += "<td>" + toThousands(inverter.KWHKWP) + "</td>";
sta += "<td>" + inverter.PR.toFixed(2) + "</td>"; sta += "<td>" + toThousands(inverter.PR.toFixed(2)) + "</td>";
sta += "<td>" + inverter.irradiance + "</td>"; sta += "<td>" + toThousands(inverter.irradiance) + "</td>";
sta += "<td>" + inverter.temperature + "</td>"; sta += "<td>" + toThousands(inverter.temperature) + "</td>";
if (showmoney == 1) { if (showmoney == 1) {
sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>"; sta += "<td>" + toThousands(Math.round(inverter.soldmoney)) + "</td>";
} }
@ -1143,7 +1149,7 @@
avghour += inverter.tothour ? inverter.tothour : 0; avghour += inverter.tothour ? inverter.tothour : 0;
avgKWHKWP += inverter.KWHKWP ? inverter.KWHKWP : 0; avgKWHKWP += inverter.KWHKWP ? inverter.KWHKWP : 0;
avgdayKWH += inverter.dayKWH ? inverter.dayKWH : 0; avgdayKWH += inverter.dayKWH ? inverter.dayKWH : 0;
monthKWH = inverter.monthKWH ? inverter.monthKWH : 0; monthKWH = inverter.monthKWH ? toThousands(inverter.monthKWH) : 0;
monthmoney = inverter.monthmoney ? inverter.monthmoney : 0; monthmoney = inverter.monthmoney ? inverter.monthmoney : 0;
monthmoneyone += inverter.monthmoneyone ? inverter.monthmoneyone : 0; monthmoneyone += inverter.monthmoneyone ? inverter.monthmoneyone : 0;
@ -1184,7 +1190,7 @@
else { else {
stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>"; stb += "<td>" + (avghour / monthday).toFixed(2) + "</td>";
stb += "<td>" + (avgKWHKWP / monthday).toFixed(2) + "</td>"; stb += "<td>" + (avgKWHKWP / monthday).toFixed(2) + "</td>";
stb += "<td>" + (avgdayKWH / monthday).toFixed(2) + "</td>"; stb += "<td>" + toThousands((avgdayKWH / monthday).toFixed(2)) + "</td>";
stb += "<td>" + monthKWH + "</td>"; stb += "<td>" + monthKWH + "</td>";
if (showmoney == 1) { if (showmoney == 1) {
stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>"; stb += "<td>" + toThousands(Math.round(monthmoney)) + "</td>";
@ -1210,7 +1216,7 @@
$.each(rel.data, function (index, value) { $.each(rel.data, function (index, value) {
std += "<tr>"; std += "<tr>";
std += "<td>" + value.landowner + "</td>"; std += "<td>" + value.landowner + "</td>";
std += "<td>" + value.leaseRate + "%" + "</td>"; std += "<td>" + toThousands(value.leaseRate) + "%" + "</td>";
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100)) + "</td>"; std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100)) + "</td>";
std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100 * 1.05)) + "</td>"; std += "<td>" + toThousands(Math.round(monthmoney * value.leaseRate / 100 * 1.05)) + "</td>";
std += "</tr>"; std += "</tr>";
@ -1361,17 +1367,17 @@
StrInfoBody += "<tr>"; StrInfoBody += "<tr>";
StrInfoBody += "<td>" + data.cityName + data.areaName + "</td>"; StrInfoBody += "<td>" + data.cityName + data.areaName + "</td>";
StrInfoBody += "<td>" + data.powerstationName + "</td>"; StrInfoBody += "<td>" + data.powerstationName + "</td>";
StrInfoBody += "<td>" + data.kwh.toFixed(2) + "</td>"; // 發電量 StrInfoBody += "<td>" + toThousands(data.kwh.toFixed(2)) + "</td>"; // 發電量
StrInfoBody += "<td>" + data.avgKWHKWP.toFixed(2) + "</td>"; // 有效發電小時 StrInfoBody += "<td>" + toThousands(data.avgKWHKWP.toFixed(2)) + "</td>"; // 有效發電小時
StrInfoBody += "<td>" + data.avgIrradiance.toFixed(2) + "</td>"; // 平均日照 StrInfoBody += "<td>" + toThousands(data.avgIrradiance.toFixed(2)) + "</td>"; // 平均日照
StrInfoBody += "<td>" + data.avgPR.toFixed(2) + "</td>"; StrInfoBody += "<td>" + toThousands(data.avgPR.toFixed(2)) + "</td>";
if (showmoney == 1) { if (showmoney == 1) {
StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney)) + "</td>"; StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney)) + "</td>";
StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney * hirerate * 0.01))+ "</td>"; StrInfoBody += "<td>" + Math.round(data.todayMoney * hirerate * 0.01)+ "</td>";
StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney)) + "</td>"; StrInfoBody += "<td>" + toThousands(Math.round(data.todayMoney)) + "</td>";
} }
@ -1387,8 +1393,8 @@
$.each(CityArray, function (index, data) { $.each(CityArray, function (index, data) {
CityInfoBody += "<tr>"; CityInfoBody += "<tr>";
CityInfoBody += "<td>" + data.city + "</td>"; CityInfoBody += "<td>" + data.city + "</td>";
CityInfoBody += "<td>" + (data.kwp / data.count).toFixed(2) + "</td>"; CityInfoBody += "<td>" + toThousands((data.kwp / data.count).toFixed(2)) + "</td>";
CityInfoBody += "<td>" + (data.kwhkwp / data.count).toFixed(2) + "</td>"; CityInfoBody += "<td>" + toThousands((data.kwhkwp / data.count).toFixed(2)) + "</td>";
CityInfoBody += "</tr>"; CityInfoBody += "</tr>";
}) })
//上面 //上面
@ -1410,8 +1416,8 @@
TotalBody += "<th>" + kwp.toFixed(2) + "</th>"; TotalBody += "<th>" + toThousands(kwp.toFixed(2)) + "</th>";
TotalBody += "<th>" + (kwhkwp / rel.data.length).toFixed(2) + "</th>"; TotalBody += "<th>" + toThousands((kwhkwp / rel.data.length).toFixed(2)) + "</th>";
TotalBody += "</tr>"; TotalBody += "</tr>";
//#endregion //#endregion

View File

@ -171,7 +171,8 @@
}, { }, {
"data": "phone" "data": "phone"
}, { }, {
"data": "spStationAmount" "data": "spStationAmount",
"render": $.fn.DataTable.render.number(",")
}, { }, {
"data": "createdAt" "data": "createdAt"
}, { }, {