電站停用

This commit is contained in:
b110212000 2021-09-10 18:07:46 +08:00
parent 8d9687a8d2
commit 2d8494456c
4 changed files with 28 additions and 5 deletions

View File

@ -606,6 +606,8 @@ namespace SolarPower.Controllers
} }
#endregion #endregion
await StationUnStatus(post.Id);
apiResult.Code = "0000"; apiResult.Code = "0000";
apiResult.Msg = "儲存成功"; apiResult.Msg = "儲存成功";
apiResult.Data = await powerStationRepository.GetOneAsync(powerStation.Id); apiResult.Data = await powerStationRepository.GetOneAsync(powerStation.Id);

View File

@ -104,6 +104,7 @@
var station_infocreate = false; var station_infocreate = false;
$(function () { $(function () {
$('#power_station_operation_personnel-error').hide(); $('#power_station_operation_personnel-error').hide();
$('#coordinate_text-error').hide();
var url = new URL(location.href); var url = new URL(location.href);
stationId = url.searchParams.get('stationId'); stationId = url.searchParams.get('stationId');
@ -1034,9 +1035,9 @@
//#region 儲存電站基本資料資訊 //#region 儲存電站基本資料資訊
function SaveStationInfo() { function SaveStationInfo() {
var a = $('#coordinate').val().split(',');
if ($("#station-created-form").valid() && $('#power_station_operation_personnel').val().length != 0 && a.length == 2) {
if ($("#station-created-form").valid() && $('#power_station_operation_personnel').val().length != 0) {
station_infocreate = false; station_infocreate = false;
$(".select2-selection__choice").each(function () { $(".select2-selection__choice").each(function () {
@ -1231,7 +1232,7 @@
if (mode === "view") { if (mode === "view") {
//觀看 //觀看
$('#power_station_operation_personnel-error').hide(); $('#power_station_operation_personnel-error').hide();
$('#coordinate_text-error').hide();
//#region 電站基本資料 文字 //#region 電站基本資料 文字
$("#address_detail_text").show(); $("#address_detail_text").show();
@ -1652,6 +1653,9 @@
}); });
}); });
//#region 設定電站基本資料 //#region 設定電站基本資料
function SetStationInfo() { 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({ $("#Inverter-form").validate({
rules: { rules: {
Inverter_ControllerId_modal: { Inverter_ControllerId_modal: {

View File

@ -138,10 +138,14 @@
</div> </div>
</div> </div>
<div class="col-xl-3 row justify-content-center align-items-center"> <div class="col-xl-3 row justify-content-center align-items-center">
<label class="col-xl-4 form-label" id="coordinate_label" for="coordinate"><span class="text-danger">*</span>座標</label> <div class="col-xl-4">
<label class="col-xl-12 form-label" id="coordinate_label" for="coordinate"><span class="text-danger">*</span>座標</label>
<label class="col-xl-12">xxx,yyy</label>
</div>
<div class="col-xl-8"> <div class="col-xl-8">
<label id="coordinate_text" class="color-info-600"></label> <label id="coordinate_text" class="color-info-600"></label>
<input type="text" id="coordinate" name="coordinate" class="form-control"> <input type="text" id="coordinate" name="coordinate" class="form-control">
<label id="coordinate_text-error" class="" style="z-index:1;color:red;display:none">此欄位格式錯誤</label>
</div> </div>
</div> </div>
<div class="col-xl-3 row justify-content-center align-items-center"> <div class="col-xl-3 row justify-content-center align-items-center">

View File

@ -338,7 +338,7 @@
case 0: $('#DateGet').prop({ 'type': 'date' }); case 0: $('#DateGet').prop({ 'type': 'date' });
$(".btn-change-quickSearch1").html("昨天"); $(".btn-change-quickSearch1").html("昨天");
$(".btn-change-quickSearch2").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); $('#DateGet').val(today);
document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("monthbtn").disabled = true;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定