484 lines
21 KiB
Plaintext
484 lines
21 KiB
Plaintext
@{
|
|
ViewData["MainNum"] = "6";
|
|
ViewData["SubNum"] = "1";
|
|
ViewData["Title"] = "電站資料管理";
|
|
}
|
|
|
|
<ol class="breadcrumb page-breadcrumb">
|
|
<li class="breadcrumb-item"><a href="javascript:void(0);">總覽</a></li>
|
|
<li class="breadcrumb-item">@ViewData["Title"]</li>
|
|
<li class="breadcrumb-item">新竹市</li>
|
|
<li class="breadcrumb-item active">新竹巨城站</li>
|
|
<li class="position-absolute pos-top pos-right d-none d-sm-block"><span class="js-get-date"></span></li>
|
|
</ol>
|
|
|
|
<!-- Your main content goes below here: -->
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div id="panel-5" class="panel">
|
|
<div class="panel-container show">
|
|
<div class="panel-content">
|
|
<div class="subheader">
|
|
<h1 class="subheader-title">
|
|
<span class="icon-stack fa-1x">
|
|
<i class="base-7 icon-stack-3x color-info-500"></i>
|
|
<i class="base-7 icon-stack-2x color-info-700"></i>
|
|
<i class="ni ni-graph icon-stack-1x text-white"></i>
|
|
</span> 新竹巨城站
|
|
</h1>
|
|
</div>
|
|
<ul class="nav nav-tabs mb-5" role="tablist" id="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link fs-lg px-4 active" data-toggle="tab" href="#tab-station-info" role="tab">
|
|
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">電站資料</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-device-setting" role="tab">
|
|
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">裝置列表</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-operation-firm" role="tab">
|
|
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">維運廠商</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-upload-image" role="tab">
|
|
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">資料上傳</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link fs-lg px-4 disabled" data-toggle="tab" href="#tab-005" role="tab">
|
|
<i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">異常設定</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content p-3">
|
|
<div class="tab-pane fade show active" id="tab-station-info" role="tabpanel" aria-labelledby="tab-station-info">
|
|
@Html.Partial("_StationInfo")
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="tab-device-setting" role="tabpanel" aria-labelledby="tab-device-setting">
|
|
@Html.Partial("_DeviceSetting")
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="tab-operation-firm" role="tabpanel" aria-labelledby="tab-operation-firm">
|
|
@Html.Partial("_Operation")
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="tab-upload-image" role="tabpanel" aria-labelledby="tab-upload-image">
|
|
@Html.Partial("_UploadImage")
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="tab-005" role="tabpanel" aria-labelledby="tab-005">
|
|
<div class="row mb-5">
|
|
此處放異常設定數據
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts{
|
|
<script>
|
|
var stationId;
|
|
$(function () {
|
|
|
|
var url = new URL(location.href);
|
|
stationId = url.searchParams.get('stationId');
|
|
|
|
//#region 電站資料 view 控制
|
|
if (stationId == 'new') {
|
|
//#region 電站基本資料
|
|
$("#power_station_code_text").hide();
|
|
$("#power_station_name_text").hide();
|
|
$("#electricity_meter_at_text").hide();
|
|
$("#estimated_recovery_time_text").hide();
|
|
$("#created_by_text").hide();
|
|
|
|
$("#generating_capacity_text").hide();
|
|
$("#escrow_name_text").hide();
|
|
$("#power_rate_text").hide();
|
|
$("#coordinate_text").hide();
|
|
$("#created_at_text").hide();
|
|
|
|
//逆變器
|
|
$("#inverter_brand_text").hide();
|
|
$("#inverter_product_model_text").hide();
|
|
$("#inverter_amount_text").hide();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand_text").hide();
|
|
$("#photovoltaic_panel_specification_text").hide();
|
|
$("#photovoltaic_panel_amount_text").hide();
|
|
$("#photovoltaic_panel_product_model_text").hide();
|
|
//#endregion
|
|
|
|
$("#edit-station-info-btn").hide();
|
|
$("#canecl-station-info-btn").hide();
|
|
$("#check_escrow").attr('disabled', false);
|
|
|
|
$("#BoEPart").hide();
|
|
$("#land_buildingPart").hide();
|
|
|
|
$("#tablist").hide();
|
|
} else {
|
|
var url = "/PowerStation/GetOnePowerStation"
|
|
|
|
var send_data = {
|
|
id: stationId
|
|
}
|
|
|
|
$.post(url, send_data, function (rel) {
|
|
if (rel.code != "0000") {
|
|
toast_error(rel.msg);
|
|
return;
|
|
}
|
|
|
|
//#region 電站基本資料
|
|
$("#add-station-info-btn").hide()
|
|
$("#canecl-station-info-btn").hide()
|
|
SetStationInfo(rel.data);
|
|
ChangeMode("station_info", "view");
|
|
//#endregion
|
|
|
|
//#region 能源局與台電資料
|
|
$("#add-station-info-btn").hide()
|
|
$("#canecl-station-info-btn").hide()
|
|
SetStationInfo(rel.data);
|
|
ChangeMode("BOE_TPC", "view");
|
|
//#endregion
|
|
|
|
}, 'json');
|
|
}
|
|
|
|
//#region 預先載入公司下拉式選單select_option
|
|
var url_user_select_option = "/PowerStation/GetUserSelectOptionList";
|
|
$.get(url_user_select_option, function (rel) {
|
|
if (rel.code != "0000") {
|
|
toast_error(rel.msg);
|
|
return;
|
|
}
|
|
|
|
$("#power_station_operation_personnel").empty();
|
|
|
|
$.each(rel.data, function (index, val) {
|
|
$("#power_station_operation_personnel").append($("<option />").val(val.value).text(val.text));
|
|
});
|
|
|
|
//預設查詢第一個
|
|
$("#power_station_operation_personnel").val($("#power_station_operation_personnel option:first").val());
|
|
});
|
|
//#endregion
|
|
$('.js-example-basic-multiple').select2();
|
|
});
|
|
|
|
//#region 代管切換
|
|
$("#check_escrow").click(function () {
|
|
if ($(this).prop("checked")) {
|
|
$('#check_escrow_label').html("Yes");
|
|
$("#escrow_name").attr('disabled', false)
|
|
} else {
|
|
$('#check_escrow_label').html("No");
|
|
$("#escrow_name").attr('disabled', true)
|
|
}
|
|
});
|
|
//#endregion
|
|
|
|
function SaveStationInfo() {
|
|
|
|
var url = "/PowerStation/SavePowerStationInfo";
|
|
|
|
var send_data = {
|
|
Id: stationId,
|
|
CityId: $("#select_city").val(),
|
|
AreaId: $("#select_area").val(),
|
|
AddressDetail: $("#address_detail").val(),
|
|
Name: $("#power_station_name").val(),
|
|
IsEscrow: $("#check_escrow").val() == true ? 1 : 0,
|
|
ElectricityMeterAt: $("electricity_meter_at").val(),
|
|
EstimatedRecoveryTime: $("estimated_recovery_time").val(),
|
|
GeneratingCapacity: $("generating_capacity").val(),
|
|
EscrowName: $("#check_escrow").val() == true? $("escrow_name").val() : "",
|
|
PowerRate: $("#power_rate").val(),
|
|
Coordinate: $("#coordinate").val(),
|
|
InverterBrand: $("#inverter_brand").val(),
|
|
InverterProductModel: $("#inverter_product_model").val(),
|
|
InverterAmount: $("#inverter_amount").val(),
|
|
PhotovoltaicPanelBrand: $("#photovoltaic_panel_brand").val(),
|
|
PhotovoltaicPanelSpecification: $("#photovoltaic_panel_specification").val(),
|
|
PhotovoltaicPanelAmount: $("#photovoltaic_panel_amount").val(),
|
|
PhotovoltaicProductModel: $("#photovoltaic_panel_product_model").val()
|
|
}
|
|
|
|
$.post(url, send_data, function (rel) {
|
|
if (rel.code != "0000") {
|
|
toast_error(rel.msg);
|
|
return;
|
|
}
|
|
|
|
if (stationId == "new") {
|
|
window.location = "/PowerStation/Edit?stationId=" + rel.data
|
|
} else {
|
|
//回填資料
|
|
SetStationInfo(rel.data);
|
|
}
|
|
}, 'json');
|
|
}
|
|
|
|
//#region 切換【電站基本資料】、【能源局與台電】等檢視或修改模式
|
|
function ChangeMode(type, mode) {
|
|
switch (type) {
|
|
case "station_info": //【電站基本資料】
|
|
if (mode === "view") {
|
|
//觀看
|
|
//#region 電站基本資料 文字
|
|
$("#power_station_code_text").show();
|
|
$("#power_station_name_text").show();
|
|
$("#electricity_meter_at_text").show();
|
|
$("#estimated_recovery_time_text").show();
|
|
$("#created_by_text").show();
|
|
|
|
$("#generating_capacity_text").show();
|
|
$("#escrow_name_text").show();
|
|
$("#power_rate_text").show();
|
|
$("#coordinate_text").show();
|
|
$("#created_at_text").show();
|
|
|
|
//逆變器
|
|
$("#inverter_brand_text").show();
|
|
$("#inverter_product_model_text").show();
|
|
$("#inverter_amount_text").show();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand_text").show();
|
|
$("#photovoltaic_panel_specification_text").show();
|
|
$("#photovoltaic_panel_amount_text").show();
|
|
$("#photovoltaic_panel_product_model_text").show();
|
|
//#endregion
|
|
|
|
//#region 電站基本資料 input
|
|
$("#power_station_name").hide();
|
|
$("#check_escrow").attr("disabled", true);
|
|
$("#electricity_meter_at").hide();
|
|
$("#estimated_recovery_time").hide();
|
|
|
|
$("#generating_capacity").hide();
|
|
$("#escrow_name").hide();
|
|
$("#power_rate").hide();
|
|
$("#coordinate").hide();
|
|
|
|
//逆變器
|
|
$("#inverter_brand").hide();
|
|
$("#inverter_product_model").hide();
|
|
$("#inverter_amount").hide();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand").hide();
|
|
$("#photovoltaic_panel_specification").hide();
|
|
$("#photovoltaic_panel_amount").hide();
|
|
$("#photovoltaic_panel_product_model").hide();
|
|
//#endregion
|
|
|
|
//電站基本資料btn
|
|
$("#add-station-info-btn").hide();
|
|
$("#edit-station-info-btn").show();
|
|
$("#canecl-station-info-btn").hide();
|
|
} else {
|
|
//修改
|
|
//#region 電站基本資料 文字
|
|
$("#power_station_code_text").hide();
|
|
$("#power_station_name_text").hide();
|
|
$("#electricity_meter_at_text").hide();
|
|
$("#estimated_recovery_time_text").hide();
|
|
$("#created_by_text").hide();
|
|
|
|
$("#generating_capacity_text").hide();
|
|
$("#escrow_name_text").hide();
|
|
$("#power_rate_text").hide();
|
|
$("#coordinate_text").hide();
|
|
$("#created_at_text").hide();
|
|
|
|
//逆變器
|
|
$("#inverter_brand_text").hide();
|
|
$("#inverter_product_model_text").hide();
|
|
$("#inverter_amount_text").hide();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand_text").hide();
|
|
$("#photovoltaic_panel_specification_text").hide();
|
|
$("#photovoltaic_panel_amount_text").hide();
|
|
$("#photovoltaic_panel_product_model_text").hide();
|
|
//#endregion
|
|
|
|
//#region 電站基本資料 input
|
|
$("#power_station_name").show();
|
|
$("#check_escrow").attr("disabled", false);
|
|
$("#electricity_meter_at").show();
|
|
$("#estimated_recovery_time").show();
|
|
|
|
$("#generating_capacity").show();
|
|
$("#escrow_name").show();
|
|
$("#power_rate").show();
|
|
$("#coordinate").show();
|
|
|
|
//逆變器
|
|
$("#inverter_brand").show();
|
|
$("#inverter_product_model").show();
|
|
$("#inverter_amount").show();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand").show();
|
|
$("#photovoltaic_panel_specification").show();
|
|
$("#photovoltaic_panel_amount").show();
|
|
$("#photovoltaic_panel_product_model").show();
|
|
//#endregion
|
|
|
|
//電站基本資料btn
|
|
$("#add-station-info-btn").show();
|
|
$("#edit-station-info-btn").hide();
|
|
$("#canecl-station-info-btn").show();
|
|
}
|
|
break;
|
|
case "BOE_TPC": //【能源局與台電】
|
|
if (mode === "view") {
|
|
//觀看
|
|
//#region 能源局與台電資料 文字
|
|
$("#link-boe-file").show();
|
|
$("#BoE_discount_rate_text").show();
|
|
$("#BoE_device_register_number_text").show();
|
|
$("#BoE_discount_rate_text").show();
|
|
|
|
$("#TPC_contract_number_text").show();
|
|
$("#TPC_contract_at_text").show();
|
|
$("#TPC_sell_deadline_text").show();
|
|
$("#TPC_meter_reading_text").show();
|
|
$("#TPC_purchase_electricity_at_text").show();
|
|
$("#TPC_sell_electricity_at_text").show();
|
|
//#endregion
|
|
|
|
//#region 能源局與台電資料 input
|
|
$("#BoE_file").hide();
|
|
$("#BoE_discount_rate").hide();
|
|
$("#BoE_device_register_number").hide();
|
|
$("#BoE_discount_rate").hide();
|
|
|
|
$("#TPC_contract_number").hide();
|
|
$("#TPC_contract_at").hide();
|
|
$("#TPC_sell_deadline").hide();
|
|
$("#TPC_meter_reading").hide();
|
|
$("#TPC_purchase_electricity_at").hide();
|
|
$("#TPC_sell_electricity_at").hide();
|
|
//#endregion
|
|
|
|
//能源局與台電btn
|
|
$("#add-boe-tpc-btn").hide();
|
|
$("#edit-boe-tpc-btn").show();
|
|
$("#canecl-boe-tpc-btn").hide();
|
|
} else {
|
|
//修改
|
|
//#region 能源局與台電資料 文字
|
|
$("#link-boe-file").hide();
|
|
$("#BoE_discount_rate_text").hide();
|
|
$("#BoE_device_register_number_text").hide();
|
|
$("#BoE_discount_rate_text").hide();
|
|
|
|
$("#TPC_contract_number_text").hide();
|
|
$("#TPC_contract_at_text").hide();
|
|
$("#TPC_sell_deadline_text").hide();
|
|
$("#TPC_meter_reading_text").hide();
|
|
$("#TPC_purchase_electricity_at_text").hide();
|
|
$("#TPC_sell_electricity_at_text").hide();
|
|
//#endregion
|
|
|
|
//#region 能源局與台電資料 input
|
|
$("#BoE_file").show();
|
|
$("#BoE_discount_rate").show();
|
|
$("#BoE_device_register_number").show();
|
|
$("#BoE_discount_rate").show();
|
|
|
|
$("#TPC_contract_number").show();
|
|
$("#TPC_contract_at").show();
|
|
$("#TPC_sell_deadline").show();
|
|
$("#TPC_meter_reading").show();
|
|
$("#TPC_purchase_electricity_at").show();
|
|
$("#TPC_sell_electricity_at").show();
|
|
//#endregion
|
|
|
|
//能源局與台電btn
|
|
$("#add-boe-tpc-btn").show();
|
|
$("#edit-boe-tpc-btn").hide();
|
|
$("#canecl-boe-tpc-btn").show();
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
//#endregion
|
|
|
|
//#region 設定電站基本資料
|
|
function SetStationInfo(data) {
|
|
//#region 顯示的部分
|
|
$("#power_station_code_text").html(station);
|
|
$("#power_station_name_text").hide();
|
|
$("#electricity_meter_at_text").hide();
|
|
$("#estimated_recovery_time_text").hide();
|
|
$("#created_by_text").hide();
|
|
|
|
$("#generating_capacity_text").hide();
|
|
$("#escrow_name_text").hide();
|
|
$("#power_rate_text").hide();
|
|
$("#coordinate_text").hide();
|
|
$("#created_at_text").hide();
|
|
|
|
//逆變器
|
|
$("#inverter_brand_text").hide();
|
|
$("#inverter_product_model_text").hide();
|
|
$("#inverter_amount_text").hide();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand_text").hide();
|
|
$("#photovoltaic_panel_specification_text").hide();
|
|
$("#photovoltaic_panel_amount_text").hide();
|
|
$("#photovoltaic_panel_product_model_text").hide();
|
|
//#endregion
|
|
|
|
}
|
|
//#endregion
|
|
|
|
//#region 設定能源局與台電資料
|
|
function SetBoETPCInfo(data) {
|
|
//#region 顯示的部分
|
|
$("#BoE_file").html(data.boeFileName).attr("href", data.boeFile);
|
|
$("#BoE_discount_rate_text").hide();
|
|
$("#electricity_meter_at_text").hide();
|
|
$("#estimated_recovery_time_text").hide();
|
|
$("#created_by_text").hide();
|
|
|
|
$("#generating_capacity_text").hide();
|
|
$("#escrow_name_text").hide();
|
|
$("#power_rate_text").hide();
|
|
$("#coordinate_text").hide();
|
|
$("#created_at_text").hide();
|
|
|
|
//逆變器
|
|
$("#inverter_brand_text").hide();
|
|
$("#inverter_product_model_text").hide();
|
|
$("#inverter_amount_text").hide();
|
|
|
|
//光電板
|
|
$("#photovoltaic_panel_brand_text").hide();
|
|
$("#photovoltaic_panel_specification_text").hide();
|
|
$("#photovoltaic_panel_amount_text").hide();
|
|
$("#photovoltaic_panel_product_model_text").hide();
|
|
//#endregion
|
|
|
|
}
|
|
//#endregion
|
|
|
|
|
|
</script>
|
|
} |