1. 修改電站基本資料

2. 加入電站Repository
This commit is contained in:
Kai 2021-06-15 20:37:09 +08:00
parent 6b1907ee74
commit 32973c35a1
11 changed files with 882 additions and 179 deletions

View File

@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using SolarPower.Models; using SolarPower.Models;
using SolarPower.Models.PowerStation;
using SolarPower.Models.User; using SolarPower.Models.User;
using SolarPower.Repository.Interface; using SolarPower.Repository.Interface;
@ -16,10 +17,14 @@ namespace SolarPower.Controllers
public class PowerStationController : MyBaseController<PowerStationController> public class PowerStationController : MyBaseController<PowerStationController>
{ {
private readonly IUserRepository userRepository; private readonly IUserRepository userRepository;
private readonly IPowerStationRepository powerStationRepository;
public PowerStationController(IUserRepository userRepository) : base() public PowerStationController(
IUserRepository userRepository,
IPowerStationRepository powerStationRepository) : base()
{ {
this.userRepository = userRepository; this.userRepository = userRepository;
this.powerStationRepository = powerStationRepository;
} }
public IActionResult Index() public IActionResult Index()
{ {
@ -46,7 +51,7 @@ namespace SolarPower.Controllers
ApiResult<List<UserSelectItemList>> apiResult = new ApiResult<List<UserSelectItemList>>(); ApiResult<List<UserSelectItemList>> apiResult = new ApiResult<List<UserSelectItemList>>();
try try
{ {
EDFunction edFunction = new EDFunction(); EDFunction edFunction = new EDFunction();
var companyId= Convert.ToInt32(edFunction.AESDecrypt(HttpContext.Session.GetString("CompanyId"))); //將公司id透過AES解密 var companyId= Convert.ToInt32(edFunction.AESDecrypt(HttpContext.Session.GetString("CompanyId"))); //將公司id透過AES解密
var userSelectItemLists = await userRepository.GetUserSelectOptionListAsync(companyId); var userSelectItemLists = await userRepository.GetUserSelectOptionListAsync(companyId);
@ -62,5 +67,154 @@ namespace SolarPower.Controllers
apiResult.Msg = errorCode.GetString(apiResult.Code); apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult; return apiResult;
} }
/// <summary>
/// 取得單一電站基本資料
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
public async Task<ApiResult<PowerStation>> GetOnePowerStation(int id)
{
ApiResult<PowerStation> apiResult = new ApiResult<PowerStation>();
PowerStation powerStation = null;
try
{
powerStation = await powerStationRepository.GetOneAsync(id);
if (powerStation == null)
{
apiResult.Code = "9992";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
else if (powerStation.Id != myUser.CompanyId)
{
apiResult.Code = "9993";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
apiResult.Code = "0000";
apiResult.Data = powerStation;
}
catch (Exception exception)
{
apiResult.Code = "9999";
Logger.LogError("【" + controllerName + "/" + actionName + "】" + "Id=" + id);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
/// <summary>
/// 新增 / 修改 電站基本資料
/// </summary>
/// <param name="post"></param>
/// <returns></returns>
public async Task<ApiResult<string>> SavePowerStationInfo(PostPowerStationInfo post)
{
ApiResult<string> apiResult = new ApiResult<string>();
PowerStation powerStation = null;
try
{
powerStation = await powerStationRepository.GetOneAsync(post.Id);
if(powerStation == null)
{
if (post.Id != 0)
{
apiResult.Code = "9992";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
#region
powerStation = new PowerStation() {
CompanyId = myUser.CompanyId,
CityId = post.CityId,
AreaId = post.AreaId,
Address = post.Address,
Name = post.Name,
IsEscrow = post.IsEscrow,
EscrowName = post.EscrowName,
ElectricityMeterAt = post.ElectricityMeterAt,
EstimatedRecoveryTime = post.EstimatedRecoveryTime,
GeneratingCapacity = post.GeneratingCapacity,
PowerRate = post.PowerRate,
Coordinate = post.Coordinate,
InverterBrand = post.InverterBrand,
InverterProductModel = post.InverterProductModel,
InverterAmount = post.InverterAmount,
PhotovoltaicPanelBrand = post.PhotovoltaicPanelBrand,
PhotovoltaicPanelProductModel = post.PhotovoltaicPanelProductModel,
PhotovoltaicPanelSpecification = post.PhotovoltaicPanelSpecification,
PhotovoltaicPanelAmount = post.PhotovoltaicPanelAmount,
CreatedBy = myUser.Id
};
List<string> properties = new List<string>()
{
"CompanyId",
"CityId",
"AreaId",
"Address",
"Name",
"IsEscrow",
"EscrowName",
"ElectricityMeterAt",
"EstimatedRecoveryTime",
"GeneratingCapacity",
"PowerRate",
"Coordinate",
"InverterBrand",
"InverterProductModel",
"InverterAmount",
"PhotovoltaicPanelBrand",
"PhotovoltaicPanelProductModel",
"PhotovoltaicPanelSpecification",
"PhotovoltaicPanelAmount",
"CreatedBy",
};
var id = await powerStationRepository.AddOneAsync(powerStation, properties);
apiResult.Data = id.ToString();
#endregion
}
else
{
if(powerStation.CompanyId != myUser.CompanyId)
{
apiResult.Code = "9993";
apiResult.Msg = errorCode.GetString(apiResult.Code);
return apiResult;
}
#region
#endregion
}
apiResult.Code = "0000";
apiResult.Msg = "修改成功";
}
catch (Exception exception)
{
apiResult.Code = "9999";
string json = System.Text.Json.JsonSerializer.Serialize(post);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + json);
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
}
return apiResult;
}
} }
} }

View File

@ -17,6 +17,7 @@ namespace SolarPower.Models
{ {
{ "0000", "OK" }, { "0000", "OK" },
{ "0001", "傳入參數錯誤。" }, { "0001", "傳入參數錯誤。" },
{ "9992", "查無該電站資訊"},
{ "9993", "無此權限操作"}, { "9993", "無此權限操作"},
{ "9994", "查無該公司角色"}, { "9994", "查無該公司角色"},
{ "9995", "該統一編號已被使用。" }, { "9995", "該統一編號已被使用。" },

View File

@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SolarPower.Models.PowerStation
{
public class PowerStation : Created
{
public int Id { get; set; }
public int CompanyId { get; set; }
public int CityId { get; set; } //縣市
public int AreaId { get; set; } //地區
public string Address { get; set; } //地址
public string Name { get; set; } //名稱
//public string Code { get; set; }
public byte IsEscrow { get; set; } //是否被代管
public string EscrowName { get; set; } //被代管公司
public string ElectricityMeterAt { get; set; } //台電掛錶日
public int EstimatedRecoveryTime { get; set; } //預計回收年限
public double GeneratingCapacity { get; set; } //發電容量
public double PowerRate { get; set; } //授電費率
public string Coordinate { get; set; } //座標
public string InverterBrand { get; set; } //逆變器廠牌
public string InverterProductModel { get; set; } //逆變器型號
public int InverterAmount { get; set; } //逆變器數量
public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
public string BoEFile { get; set; } //能源局檔案
public int BoEDiscountRate { get; set; } //能源局折扣率
public string BoEDeviceRegisterNumber { get; set; } //能源局設備登記編號
public int BoERentRatio { get; set; } //能源局租金比例
public string TPCContractNumber { get; set; } //台電契約編號
public string TPCContractAt { get; set; } //台電簽約日期
public int TPCSellDeadline { get; set; } //台電售電期限(年)
public string TPCPurchaseElectricityAt { get; set; } //台電正式購電日
public string TPCSellElectricityAt { get; set; } //台電正式售電日
public List<LandBuilding> LandBuildings { get; set; } //土地房屋資料
}
public class LandBuilding : Created
{
public int Id { get; set; }
public int PowerStationId { get; set; }
public string Address { get; set; }
public string LeaseNotarizationAt { get; set; } //租約公證日期
public string Landowner { get; set; } //地主姓名
public string Purpose { get; set; } //房屋用途
public int LeaseRate { get; set; } //租金比例
public string Coordinate { get; set; } //經緯度
public string Phone { get; set; } //電話
}
public class PostPowerStationInfo
{
public int Id { get; set; }
public int CityId { get; set; } //縣市
public int AreaId { get; set; } //地區
public string Address { get; set; } //地址
public string Name { get; set; } //名稱
//public string Code { get; set; }
public byte IsEscrow { get; set; } //是否被代管
public string EscrowName { get; set; } //被代管公司
public string ElectricityMeterAt { get; set; } //台電掛錶日
public int EstimatedRecoveryTime { get; set; } //預計回收年限
public double GeneratingCapacity { get; set; } //發電容量
public double PowerRate { get; set; } //授電費率
public string Coordinate { get; set; } //座標
public string InverterBrand { get; set; } //逆變器廠牌
public string InverterProductModel { get; set; } //逆變器型號
public int InverterAmount { get; set; } //逆變器數量
public string PhotovoltaicPanelBrand { get; set; } //光電板廠牌
public string PhotovoltaicPanelProductModel { get; set; } //光電板型號
public string PhotovoltaicPanelSpecification { get; set; } //光電板規格
public int PhotovoltaicPanelAmount { get; set; } //光電板規格
}
}

View File

@ -548,7 +548,7 @@ namespace SolarPower.Repository.Implement
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Deleted` tinyint(4) NOT NULL DEFAULT 0, `Deleted` tinyint(4) NOT NULL DEFAULT 0,
`PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '', `PowerStationId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '',
`UserId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '', `UserId` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '',
`CreatedBy` int(10) unsigned NOT NULL COMMENT '', `CreatedBy` int(10) unsigned NOT NULL COMMENT '',
`CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '', `CreatedAt` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '',
PRIMARY KEY (`Id`), PRIMARY KEY (`Id`),

View File

@ -0,0 +1,52 @@
using Dapper;
using SolarPower.Helper;
using SolarPower.Models.PowerStation;
using SolarPower.Repository.Interface;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
namespace SolarPower.Repository.Implement
{
public class PowerStationRepository : RepositoryBase<PowerStation>, IPowerStationRepository
{
public PowerStationRepository(IDatabaseHelper databaseHelper) : base(databaseHelper)
{
tableName = "power_station";
}
public override async Task<PowerStation> GetOneAsync(int id)
{
//base.GetOneAsync(id);
PowerStation result;
using (IDbConnection conn = this._databaseHelper.GetConnection())
{
conn.Open();
try
{
var sql = $"SELECT * FROM {tableName} WHERE Deleted = 0 AND Id = @Id";
result = await conn.QueryFirstOrDefaultAsync<PowerStation>(sql, new { Id = id});
if(result!= null)
{
var sql_land_building = @"SELECT * FROM land_building WHERE Deleted = 0 AND PowerStationId = @PowerStationId";
result.LandBuildings = (await conn.QueryAsync<LandBuilding>(sql_land_building, new { PowerStationId = result.Id })).ToList();
}
}
catch (Exception exception)
{
throw exception;
}
finally
{
conn.Close();
}
return result;
}
}
}
}

View File

@ -0,0 +1,12 @@
using SolarPower.Models.PowerStation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SolarPower.Repository.Interface
{
public interface IPowerStationRepository : IRepositoryBase<PowerStation>
{
}
}

View File

@ -64,6 +64,7 @@ namespace SolarPower
services.AddScoped<IUserRepository, UserRepository>(); services.AddScoped<IUserRepository, UserRepository>();
services.AddScoped<ICompanyRepository, CompanyRepository>(); services.AddScoped<ICompanyRepository, CompanyRepository>();
services.AddScoped<IRoleRepository, RoleRepository>(); services.AddScoped<IRoleRepository, RoleRepository>();
services.AddScoped<IPowerStationRepository, PowerStationRepository>();
services.AddScoped<IOperatorLogRepository, OperatorLogRepository>(); services.AddScoped<IOperatorLogRepository, OperatorLogRepository>();
#endregion #endregion

View File

@ -50,7 +50,7 @@
<div class="tab-pane fade show active" id="tab-newtaipei" role="tabpanel" aria-labelledby="tab-newtaipei"> <div class="tab-pane fade show active" id="tab-newtaipei" role="tabpanel" aria-labelledby="tab-newtaipei">
<div class="row mb-5 d-flex justify-content-between"> <div class="row mb-5 d-flex justify-content-between">
<div class="col-6"> <div class="col-6">
<a asp-controller="PowerStation" asp-action="Edit" asp-route-solarid="new" class="btn btn-success waves-effect waves-themed mb-3"> <a asp-controller="PowerStation" asp-action="Edit" asp-route-stationId="new" class="btn btn-success waves-effect waves-themed mb-3">
<span class="fal fa-plus mr-1"></span> <span class="fal fa-plus mr-1"></span>
新增電站 新增電站
</a> </a>

View File

@ -29,22 +29,22 @@
</div> </div>
<ul class="nav nav-tabs mb-5" role="tablist" id="tablist"> <ul class="nav nav-tabs mb-5" role="tablist" id="tablist">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link fs-lg px-4 active" data-toggle="tab" href="#tab-001" role="tab"> <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> <i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">電站資料</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-002" role="tab"> <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> <i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">裝置列表</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-003" role="tab"> <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> <i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">維運廠商</span>
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link fs-lg px-4" data-toggle="tab" href="#tab-004" role="tab"> <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> <i class="fal fa-home text-success"></i> <span class="hidden-sm-down ml-1">資料上傳</span>
</a> </a>
</li> </li>
@ -55,19 +55,19 @@
</li> </li>
</ul> </ul>
<div class="tab-content p-3"> <div class="tab-content p-3">
<div class="tab-pane fade show active" id="tab-001" role="tabpanel" aria-labelledby="tab-001"> <div class="tab-pane fade show active" id="tab-station-info" role="tabpanel" aria-labelledby="tab-station-info">
@Html.Partial("_StationInfo") @Html.Partial("_StationInfo")
</div> </div>
<div class="tab-pane fade" id="tab-002" role="tabpanel" aria-labelledby="tab-002"> <div class="tab-pane fade" id="tab-device-setting" role="tabpanel" aria-labelledby="tab-device-setting">
@Html.Partial("_DeviceSetting") @Html.Partial("_DeviceSetting")
</div> </div>
<div class="tab-pane fade" id="tab-003" role="tabpanel" aria-labelledby="tab-003"> <div class="tab-pane fade" id="tab-operation-firm" role="tabpanel" aria-labelledby="tab-operation-firm">
@Html.Partial("_Operation") @Html.Partial("_Operation")
</div> </div>
<div class="tab-pane fade" id="tab-004" role="tabpanel" aria-labelledby="tab-004"> <div class="tab-pane fade" id="tab-upload-image" role="tabpanel" aria-labelledby="tab-upload-image">
@Html.Partial("_UploadImage") @Html.Partial("_UploadImage")
</div> </div>
@ -84,36 +84,76 @@
</div> </div>
@section Scripts{ @section Scripts{
<script> <script>
var stationId;
$(function () { $(function () {
var getUrlString = location.href;
var url = new URL(getUrlString); var url = new URL(location.href);
var solarid=url.searchParams.get('solarid'); stationId = url.searchParams.get('stationId');
if (solarid = 'new') {
$("#power_station_id_text").hide(); //#region 電站資料 view 控制
if (stationId == 'new') {
//#region 電站基本資料
$("#power_station_code_text").hide();
$("#power_station_name_text").hide(); $("#power_station_name_text").hide();
$("#ElectricityMeterAt_text").hide(); $("#electricity_meter_at_text").hide();
$("#EstimatedRecoveryTime_text").hide(); $("#estimated_recovery_time_text").hide();
$("#CreatedBy_text").hide(); $("#created_by_text").hide();
$("#GeneratingCapacity_text").hide();
$("#EscrowName_text").hide(); $("#generating_capacity_text").hide();
$("#PowerRate_text").hide(); $("#escrow_name_text").hide();
$("#Coordinate_Text").hide(); $("#power_rate_text").hide();
$("#InverterBrand_text").hide(); $("#coordinate_text").hide();
$("#InverterProductModel_text").hide(); $("#created_at_text").hide();
$("#InverterAmount_text").hide();
$("#PhotovoltaicPanelBrand_text").hide(); //逆變器
$("#PhotovoltaicPanelSpecification_text").hide(); $("#inverter_brand_text").hide();
$("#PhotovoltaicPanelAmount_text").hide(); $("#inverter_product_model_text").hide();
$("#PhotovoltaicPanelProductModel_text").hide(); $("#inverter_amount_text").hide();
$("#CreatedAt_Text").hide();
$("#IsEscrow").attr('disabled', false) //光電板
$("#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(); $("#BoEPart").hide();
$("#land_buildingPart").hide(); $("#land_buildingPart").hide();
$("#tablist").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 //#region 預先載入公司下拉式選單select_option
@ -137,15 +177,308 @@
$('.js-example-basic-multiple').select2(); $('.js-example-basic-multiple').select2();
}); });
//#region 代管切換
$("#IsEscrow").click(function () { $("#check_escrow").click(function () {
if ($(this).prop("checked")) { if ($(this).prop("checked")) {
$('#IsEscrowLabel').html("Yes"); $('#check_escrow_label').html("Yes");
$("#EscrowName").attr('disabled', false) $("#escrow_name").attr('disabled', false)
} else { } else {
$('#IsEscrowLabel').html("No"); $('#check_escrow_label').html("No");
$("#EscrowName").attr('disabled', true) $("#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> </script>
} }

View File

@ -5,98 +5,133 @@
<!-- we wrap header title inside a div tag with utility padding --> <!-- we wrap header title inside a div tag with utility padding -->
<div class="card-title font-weight-bold">電站基本資料</div> <div class="card-title font-weight-bold">電站基本資料</div>
<div class="text-right"> <div class="text-right">
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed"> <a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed" id="add-station-info-btn" onclick="SaveStationInfo()">
<span class="fal fa-plus mr-1"></span> 新增 <span class="fal fa-plus mr-1"></span> 儲存
</a> </a>
<a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed"> <a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed" id="edit-station-info-btn" onclick="ChangeMode('station_info', 'edit')">
<span class="fal fa-cog mr-1"></span> 修改 <span class="fal fa-cog mr-1"></span> 修改
</a> </a>
<a href="javascript:;" class="btn btn-sm btn-primary ml-auto waves-effect waves-themed" id="canecl-station-info-btn" onclick="ChangeMode('station_info', 'view')">
<span class="fal fa-cog mr-1"></span> 取消
</a>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row d-flex justify-content-between"> <div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="addressLabel">地址: </p> <label class="col-xl-4 form-label" id="city_label">縣市:</label>
<select class="form-control" id="company_select"> <div class="col-xl-8">
<option value="0" selected>全部</option> <select class="form-control" id="select_city">
</select> <option value="0" selected>全部</option>
</select>
</div>
</div> </div>
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="power_station_name_text">電站名稱:</p> <label class="col-xl-4 form-label" id="area_label">地區:</label>
<select class="form-control" id="company_select"> <div class="col-xl-8">
<option value="0" selected>全部</option> <select class="form-control" id="select_area">
</select> <option value="0" selected>全部</option>
</select>
</div>
</div> </div>
<div class="col-xl-6 row">
<div class="col-xl-2 justify-content-center"> <div class="col-12">
<input type="text" id="addressDetail" name="addressDetail" class="form-control"> <input type="text" id="address_detail" name="address_detail" class="form-control">
</div> </div>
</div>
<div class="row d-flex justify-content-between">
<div class="col-xl-2 justify-content-center">
<p id="power_station_id_text">電站代碼: </p>
<label class="form-label" id="power_station_id_label" for="power_station_id">電站編號</label>
<input type="text" id="power_station_id" name="power_station_id" disabled="disabled" class="form-control">
</div>
<div class="col-xl-2 justify-content-center">
<p id="power_station_name_text">電站名稱:</p>
<label class="form-label" id="power_station_name_label" for="power_station_name">電站名稱</label>
<input type="text" id="power_station_name" name="power_station_name" class="form-control">
</div>
<div class="col-xl-2 justify-content-center">
<p>是否為代管 </p>
<p class="color-info-600">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="IsEscrow" name="IsEscrow" disabled="disabled">
<label class="custom-control-label" for="IsEscrow" id="IsEscrowLabel">No</label>
</div>
</p>
</div>
<div class="col-xl-2 justify-content-center">
<p id="ElectricityMeterAt_text">台電掛錶日 </p>
<label class="form-label" id="ElectricityMeterAt_Label" for="ElectricityMeterAt">台電掛錶日</label>
<input type="date" id="ElectricityMeterAt" name="ElectricityMeterAt" class="form-control">
</div>
<div class="col-xl-2 justify-content-center">
<p id="EstimatedRecoveryTime_text">預計回收年限:</p>
<label class="form-label" id="EstimatedRecoveryTime_Label" for="EstimatedRecoveryTime">預計回收年限</label>
<input type="text" id="EstimatedRecoveryTime" name="EstimatedRecoveryTime" class="form-control">
</div>
<div class="col-xl-2 justify-content-center">
<p id="CreatedBy_text">資料建立:</p>
</div> </div>
</div> </div>
<div class="row d-flex justify-content-between mb-5"> <div class="row mb-3 d-flex justify-content-between">
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="GeneratingCapacity_text">電廠發電容量 <br>(kW)</p> <label class="col-xl-4 form-label" id="power_station_code_label" for="power_station_code">電站編號:</label>
<label class="form-label" id="GeneratingCapacity_Label" for="GeneratingCapacity">電廠發電容量</label> <div class="col-xl-8">
<input type="text" id="GeneratingCapacity" name="GeneratingCapacity" class="form-control"> <p id="power_station_code_text">PEP-NTP001</p>
@*<input type="text" id="power_station_code" name="power_station_code" disabled="disabled" class="form-control">*@
</div>
</div> </div>
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="power_station_operation_personnel_text">運維人員:</p> <label class="col-xl-4 form-label" id="power_station_name_label" for="power_station_name">電站名稱:</label>
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple"> <div class="col-xl-8">
</select> <p id="power_station_name_text">薪族鋸成</p>
<input type="text" id="power_station_name" name="power_station_name" class="form-control">
</div>
</div> </div>
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="EscrowName_text">被代管公司 </p> <label class="col-xl-4 form-label">是否為代管:</label>
<label class="form-label" id="EscrowName_Lable" for="EscrowName">被代管公司</label> <div class="col-xl-8">
<input type="text" id="EscrowName" name="EscrowName" class="form-control" disabled="disabled"> <p class="color-info-600">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="check_escrow" name="check_escrow" disabled="disabled">
<label class="custom-control-label" for="check_escrow" id="check_escrow_label">No</label>
</div>
</p>
</div>
</div> </div>
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="PowerRate_text">授電費率:</p> <label class="col-xl-4 form-label" id="electricity_meter_at_label" for="electricity_meter_at">台電掛錶日:</label>
<label class="form-label" id="PowerRate_Label" for="PowerRate">授電費率</label> <div class="col-xl-8">
<input type="text" id="PowerRate" name="PowerRate" class="form-control"> <p id="electricity_meter_at_text">2021-02-29</p>
<input type="date" id="electricity_meter_at" name="electricity_meter_at" class="form-control">
</div>
</div> </div>
<div class="col-xl-2 justify-content-center"> </div>
<p id="Coordinate_Text">座標:</p>
<label class="form-label" id="Coordinate_Label" for="Coordinate">座標</label> <div class="row mb-3 d-flex justify-content-between">
<input type="text" id="Coordinate" name="Coordinate" class="form-control"> <div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="estimated_recovery_time_label" for="estimated_recovery_time">預計回收年限:</label>
<div class="col-xl-8">
<p id="estimated_recovery_time_text">20</p>
<input type="text" id="estimated_recovery_time" name="estimated_recovery_time" class="form-control">
</div>
</div> </div>
<div class="col-xl-2 justify-content-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<p id="CreatedAt_Text">建立時間:</p> <label class="col-xl-4 form-label" id="generating_capacity_label" for="generating_capacity">電廠發電容量(kW)</label>
<div class="col-xl-8">
<p id="generating_capacity_text">123123</p>
<input type="number" step="0.1" id="generating_capacity" name="generating_capacity" class="form-control">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="escrow_name_lable" for="escrow_name">被代管公司:</label>
<div class="col-xl-8">
<p id="escrow_name_text">台電電</p>
<input type="text" id="escrow_name" name="escrow_name" class="form-control" disabled="disabled">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="power_station_operation_personnel_label">運維人員:</label>
<div class="col-xl-8">
<select class="js-example-basic-multiple form-control" id="power_station_operation_personnel" multiple="multiple">
</select>
</div>
</div>
</div>
<div class="row mb-5 d-flex justify-content-between ">
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="power_rate_label" for="power_rate">授電費率</label>
<div class="col-xl-8">
<p id="power_rate_text">123123</p>
<input type="number" step="0.001" id="power_rate" name="power_rate" class="form-control">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate">座標</label>
<div class="col-xl-8">
<p id="coordinate_text">座標:</p>
<input type="text" id="coordinate" name="coordinate" class="form-control">
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label">資料建立:</label>
<div class="col-xl-8">
<p id="created_by_text">野員新之助</p>
</div>
</div>
<div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label">建立時間:</label>
<div class="col-xl-8">
<p id="created_at_text">YYYY-MM-DD</p>
</div>
</div> </div>
</div> </div>
@ -105,19 +140,19 @@
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">逆變器</h5> <h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">逆變器</h5>
<div class="row d-flex justify-content-between px-5"> <div class="row d-flex justify-content-between px-5">
<div class="col-xl-4"> <div class="col-xl-4">
<p id="InverterBrand_text">廠牌:<span class="color-info-600">AUO</span></p> <label class="form-label" id="inverter_brand_label" for="inverter_brand">廠牌</label>
<label class="form-label" id="InverterBrand_Label" for="InverterBrand">廠牌</label> <p id="inverter_brand_text" class="color-info-600">AUO</p>
<input type="text" id="InverterBrand" name="InverterBrand" class="form-control"> <input type="text" id="inverter_brand" name="inverter_brand" class="form-control">
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">
<p id="InverterProductModel_text">型號 <span class="color-info-600">PM060MW2_305</span></p> <label class="form-label" id="inverter_product_model_label" for="inverter_product_model">型號</label>
<label class="form-label" id="InverterProductModel_Label" for="InverterProductModel">型號</label> <p id="inverter_product_model_text" class="color-info-600">PM060MW2_305</p>
<input type="text" id="InverterProductModel" name="InverterProductModel" class="form-control"> <input type="text" id="inverter_product_model" name="inverter_product_model" class="form-control">
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">
<p id="InverterAmount_text">數量:<span class="color-info-600">400</span></p> <label class="form-label" id="inverter_amount_label" for="inverter_amount">數量</label>
<label class="form-label" id="InverterAmount_Label" for="InverterAmount">數量</label> <p id="inverter_amount_text" class="color-info-600">400</p>
<input type="text" id="InverterAmount" name="InverterAmount" class="form-control"> <input type="text" id="inverter_amount" name="inverter_amount" class="form-control">
</div> </div>
</div> </div>
</div> </div>
@ -125,24 +160,24 @@
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">光電板</h5> <h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">光電板</h5>
<div class="row d-flex justify-content-between px-5"> <div class="row d-flex justify-content-between px-5">
<div class="col-xl-4"> <div class="col-xl-4">
<p id="PhotovoltaicPanelBrand_text">廠牌:<span class="color-info-600">ABLYTEK</span></p> <label class="form-label" id="photovoltaic_panel_brand_label" for="photovoltaic_panel_brand">廠牌</label>
<label class="form-label" id="PhotovoltaicPanelBrand_Label" for="PhotovoltaicPanelBrand">廠牌</label> <p id="photovoltaic_panel_brand_text" class="color-info-600">ABLYTEK</p>
<input type="text" id="PhotovoltaicPanelBrand" name="PhotovoltaicPanelBrand" class="form-control"> <input type="text" id="photovoltaic_panel_brand" name="photovoltaic_panel_brand" class="form-control">
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">
<p id="PhotovoltaicPanelSpecification_text">規格 <span class="color-info-600">1640×992×40</span></p> <label class="form-label" id="photovoltaic_panel_specification_label" for="photovoltaic_panel_specification">規格</label>
<label class="form-label" id="PhotovoltaicPanelSpecification_Label" for="PhotovoltaicPanelSpecification">規格</label> <p id="photovoltaic_panel_specification_text" class="color-info-600">1640×992×40</p>
<input type="text" id="PhotovoltaicPanelSpecification" name="PhotovoltaicPanelSpecification" class="form-control"> <input type="text" id="photovoltaic_panel_specification" name="photovoltaic_panel_specification" class="form-control">
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">
<p id="PhotovoltaicPanelAmount_text">數量:<span class="color-info-600">1116</span></p> <label class="form-label" id="photovoltaic_panel_amount_label" for="photovoltaic_panel_amount">數量</label>
<label class="form-label" id="PhotovoltaicPanelAmount_Label" for="PhotovoltaicPanelAmount">數量</label> <p id="photovoltaic_panel_amount_text" class="color-info-600">1116</p>
<input type="text" id="PhotovoltaicPanelAmount" name="PhotovoltaicPanelAmount" class="form-control"> <input type="text" id="photovoltaic_panel_amount" name="photovoltaic_panel_amount" class="form-control">
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">
<p id="PhotovoltaicPanelProductModel_text">型號 <span class="color-info-600">6MN6A295</span></p> <label class="form-label" id="photovoltaic_panel_product_model_label" for="photovoltaic_panel_product_model">型號</label>
<label class="form-label" id="PhotovoltaicPanelProductModel_Label" for="PhotovoltaicPanelProductModel">型號</label> <p id="photovoltaic_panel_product_model_text" class="color-info-600">6MN6A295</p>
<input type="text" id="PhotovoltaicPanelProductModel" name="PhotovoltaicPanelProductModel" class="form-control"> <input type="text" id="photovoltaic_panel_product_model" name="photovoltaic_panel_product_model" class="form-control">
</div> </div>
</div> </div>
</div> </div>
@ -160,12 +195,15 @@
<!-- we wrap header title inside a div tag with utility padding --> <!-- we wrap header title inside a div tag with utility padding -->
<div class="card-title font-weight-bold">經濟部能源局與台電資訊</div> <div class="card-title font-weight-bold">經濟部能源局與台電資訊</div>
<div class="text-right"> <div class="text-right">
<a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed"> <a href="javascript:;" class="btn btn-sm btn-success ml-auto waves-effect waves-themed" id="add-boe-tpc-btn" onclick="SaveBoETPCInfo()">
<span class="fal fa-plus mr-1"></span> 新增 <span class="fal fa-plus mr-1"></span> 儲存
</a> </a>
<a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed"> <a href="javascript:;" class="btn btn-sm btn-info ml-auto waves-effect waves-themed" id="edit-boe-tpc-btn" onclick="ChangeMode('BOE_TPC', 'edit')">
<span class="fal fa-cog mr-1"></span> 修改 <span class="fal fa-cog mr-1"></span> 修改
</a> </a>
<a href="javascript:;" class="btn btn-sm btn-primary ml-auto waves-effect waves-themed" id="canecl-boe-tpc-btn" onclick="ChangeMode('BOE_TPC', 'view')">
<span class="fal fa-cog mr-1"></span> 取消
</a>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -173,42 +211,90 @@
<div class="col-xl-6"> <div class="col-xl-6">
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">經濟部能源局</h5> <h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">經濟部能源局</h5>
<div class="row d-flex justify-content-between px-5"> <div class="row d-flex justify-content-between px-5">
<div class="col-xl-6"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>能源局同意檔案:<span class="color-info-600">台北市內湖區中山路一段1001號</span></p> <label class="col-xl-4 form-label">能源局同意檔案:</label>
<div class="col-xl-8">
<a id="link-boe-file" class="color-info-600" href="link/to/your/download/file" download>Download link</a>
<input type="file" id="BoE_file" name="BoE_file" class="form-control">
</div>
</div> </div>
<div class="col-xl-6"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>折扣率 <span class="color-info-600">2018-01-01</span></p> <label class="col-xl-4 form-label">折扣率:</label>
<div class="col-xl-8">
<p id="BoE_discount_rate_text" class="color-info-600">123123</p>
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control">
</div>
</div> </div>
<div class="col-xl-6"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>能源局設備登記編號:<span class="color-info-600">25.0726625,121.5725953</span></p> <label class="col-xl-4 form-label" for="BoE_device_register_number">能源局設備登記編號:</label>
<div class="col-xl-8">
<p id="BoE_device_register_number_text" class="color-info-600">123123</p>
<input type="text" id="BoE_device_register_number" name="BoE_device_register_number" class="form-control">
</div>
</div> </div>
<div class="col-xl-6"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>租金比例 (%) <span class="color-info-600">10</span></p> <label class="col-xl-4 form-label">租金比例 (%)</label>
<div class="col-xl-8">
<p id="BoE_discount_rate_text" class="color-info-600">123123</p>
<input type="number" step="1" id="BoE_discount_rate" name="BoE_discount_rate" class="form-control">
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-xl-6"> <div class="col-xl-6">
<h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">台電資訊</h5> <h5 class="border-bottom font-weight-bold mb-3 pl-5 pb-3">台電資訊</h5>
<div class="row d-flex justify-content-between px-5"> <div class="row d-flex justify-content-between px-5">
<div class="col-xl-4"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>契約編號 <span class="color-info-600">鋼鐵人</span></p> <label class="col-xl-4 form-label" for="TPC_contract_number">契約編號:</label>
<div class="col-xl-8">
<p id="TPC_contract_number_text" class="color-info-600">123123</p>
<input type="text" id="TPC_contract_number" name="TPC_contract_number" class="form-control">
</div>
</div> </div>
<div class="col-xl-4"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>售電期限(年) <span class="color-info-600">20</span></p> <label class="col-xl-4 form-label" for="TPC_contract_at">簽約日期:</label>
<div class="col-xl-8">
<p id="TPC_contract_at_text" class="color-info-600">123123</p>
<input type="date" id="TPC_contract_at" name="TPC_contract_at" class="form-control">
</div>
</div> </div>
<div class="col-xl-4 text-right"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>正式購電日 <span class="color-info-600">2018-10-01</span></p> <label class="col-xl-4 form-label" for="TPC_sell_deadline">售電期限(年)</label>
<div class="col-xl-8">
<p id="TPC_sell_deadline_text" class="color-info-600">123123</p>
<input type="text" id="TPC_sell_deadline" name="TPC_sell_deadline" class="form-control">
</div>
</div> </div>
<div class="col-xl-4"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>簽約日期 <span class="color-info-600">0828-123456</span></p> <label class="col-xl-4 form-label" for="TPC_meter_reading">每期抄錶日:</label>
<div class="col-xl-8">
<p id="TPC_meter_reading_text" class="color-info-600">123123</p>
<input type="text" id="TPC_meter_reading" name="TPC_meter_reading" class="form-control">
</div>
</div> </div>
<div class="col-xl-4"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>每期抄錶日 <span class="color-info-600">10日</span></p> <label class="col-xl-4 form-label" for="TPC_purchase_electricity_at">正式購電日:</label>
<div class="col-xl-8">
<p id="TPC_purchase_electricity_at_text" class="color-info-600">123123</p>
<input type="date" id="TPC_purchase_electricity_at" name="TPC_purchase_electricity_at" class="form-control">
</div>
</div> </div>
<div class="col-xl-4 text-right"> <div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<p>正式售電日 <span class="color-info-600">2018-10-01</span></p><br><br> <label class="col-xl-4 form-label" for="TPC_sell_electricity_at">正式售電日:</label>
<p>資料建立:<span class="color-info-600">蜘蛛人</span></p> <div class="col-xl-8">
<p>建立時間:<span class="color-info-600">2018-10-01 12:00</span></p> <p id="TPC_sell_electricity_at_text" class="color-info-600">123123</p>
<input type="date" id="TPC_sell_electricity_at" name="TPC_sell_electricity_at" class="form-control">
</div>
</div>
</div>
<div class="row d-flex justify-content-end px-5">
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-12 text-right">資料建立:<span id="BOE_TPC_created_by_text" class="color-info-600">123123</span></label>
</div>
</div>
<div class="row d-flex justify-content-end px-5">
<div class="col-xl-6 mb-3 row justify-content-center align-items-center">
<label class="col-xl-12 text-right">建立時間:<span id="BOE_TPC_created_at_text" class="color-info-600">123123</span></label>
</div> </div>
</div> </div>
</div> </div>

View File

@ -470,23 +470,6 @@
} }
} }
}); });
@*roleAuthTable.on('order.dt search.dt', function () {
roleAuthTable.column(0, {
search: 'applied',
order: 'applied'
}).nodes().each(function (cell, i) {
i = i + 1;
var page = roleAuthTable.page.info();
var pageno = page.page;
var length = page.length;
var columnIndex = (i + pageno * length);
cell.innerHTML = columnIndex;
})
});*@
//#endregion //#endregion
//#region 角色未加入權限列表 DataTable //#region 角色未加入權限列表 DataTable