diff --git a/SolarPower/Controllers/PowerStationController.cs b/SolarPower/Controllers/PowerStationController.cs index b4563b5..3f5a87f 100644 --- a/SolarPower/Controllers/PowerStationController.cs +++ b/SolarPower/Controllers/PowerStationController.cs @@ -606,6 +606,8 @@ namespace SolarPower.Controllers } #endregion + await StationUnStatus(post.Id); + apiResult.Code = "0000"; apiResult.Msg = "儲存成功"; apiResult.Data = await powerStationRepository.GetOneAsync(powerStation.Id); diff --git a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml index a7f3b3d..09d0aed 100644 --- a/SolarPower/Views/PowerStation/PowerStationEdit.cshtml +++ b/SolarPower/Views/PowerStation/PowerStationEdit.cshtml @@ -104,6 +104,7 @@ var station_infocreate = false; $(function () { $('#power_station_operation_personnel-error').hide(); + $('#coordinate_text-error').hide(); var url = new URL(location.href); stationId = url.searchParams.get('stationId'); @@ -1034,9 +1035,9 @@ //#region 儲存電站基本資料資訊 function SaveStationInfo() { + var a = $('#coordinate').val().split(','); - - if ($("#station-created-form").valid() && $('#power_station_operation_personnel').val().length != 0) { + if ($("#station-created-form").valid() && $('#power_station_operation_personnel').val().length != 0 && a.length == 2) { station_infocreate = false; $(".select2-selection__choice").each(function () { @@ -1231,7 +1232,7 @@ if (mode === "view") { //觀看 $('#power_station_operation_personnel-error').hide(); - + $('#coordinate_text-error').hide(); //#region 電站基本資料 文字 $("#address_detail_text").show(); @@ -1652,6 +1653,9 @@ }); }); + + + //#region 設定電站基本資料 function SetStationInfo() { @@ -3038,6 +3042,19 @@ } }); + $('#coordinate').change(function () { + var a = $('#coordinate').val().split(','); + if (stationId == 'new' || station_infocreate) { + if (a.length != 2) { + $('#coordinate_text-error').show(); + } else { + $('#coordinate_text-error').hide(); + } + } + }); + + + $("#Inverter-form").validate({ rules: { Inverter_ControllerId_modal: { diff --git a/SolarPower/Views/PowerStation/_StationInfo.cshtml b/SolarPower/Views/PowerStation/_StationInfo.cshtml index cb0cb4e..e77332e 100644 --- a/SolarPower/Views/PowerStation/_StationInfo.cshtml +++ b/SolarPower/Views/PowerStation/_StationInfo.cshtml @@ -138,10 +138,14 @@
- +
+ + +
+
diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index dc388c1..475c909 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -338,7 +338,7 @@ case 0: $('#DateGet').prop({ 'type': 'date' }); $(".btn-change-quickSearch1").html("昨天"); $(".btn-change-quickSearch2").html("前天"); - var today = new Date().toISOString().substring(0, 10); + var today = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().substring(0, 10); $('#DateGet').val(today); document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定