diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index f58d198..2e6d489 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -346,9 +346,9 @@ $('#monthbtn').hide(); $('#yearbtn').show(); $('#daybtn').show(); - document.getElementById("monthbtn").disabled = true;//月報表鎖定 + @*document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 - document.getElementById("daybtn").disabled = false;//日報表鎖定 + document.getElementById("daybtn").disabled = false;//日報表鎖定*@ break; case 1: @@ -386,9 +386,9 @@ $('#daybtn').hide(); $('#monthbtn').show(); $('#yearbtn').show(); - document.getElementById("daybtn").disabled = true;//日報表鎖定 + @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定 - document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 + document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ break; case 2: $('#DateGet').prop({ 'type': 'month' }); $(".btn-change-quickSearch1").html("本月"); @@ -398,9 +398,9 @@ $('#daybtn').hide(); $('#monthbtn').show(); $('#yearbtn').show(); - document.getElementById("daybtn").disabled = true;//日報表鎖定 + @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定 - document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 + document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ break; case 3: $(".btn-change-quickSearch1").html("今年"); @@ -411,9 +411,9 @@ $('#daybtn').hide(); $('#monthbtn').hide(); $('#yearbtn').show(); - document.getElementById("daybtn").disabled = true;//日報表鎖定 + @*document.getElementById("daybtn").disabled = true;//日報表鎖定 document.getElementById("monthbtn").disabled = true;//月報表鎖定 - document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 + document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@ break; } if (type == 1) { @@ -674,12 +674,81 @@ FormType: form, PowerStation: nowpowerstation } + + switch (form) { + case 0: + $("#daybtn").html('').attr("disabled", true); + $("#monthbtn").attr("disabled", true); + $("#yearbtn").attr("disabled", true); + $("#year2btn").attr("disabled", true); + $(".btn-station").attr("disabled", true); + break; + case 1: + $("#daybtn").attr("disabled", true); + $("#monthbtn").html('').attr("disabled", true); + $("#yearbtn").attr("disabled", true); + $("#year2btn").attr("disabled", true); + $(".btn-station").attr("disabled", true); + break; + case 2: + $("#daybtn").attr("disabled", true); + $("#monthbtn").attr("disabled", true); + $("#yearbtn").html('').attr("disabled", true); + $("#year2btn").attr("disabled", true); + $(".btn-station").attr("disabled", true); + break; + case 3: + $("#daybtn").attr("disabled", true); + $("#monthbtn").attr("disabled", true); + $("#yearbtn").attr("disabled", true); + $("#year2btn").attr('', true); + $(".btn-station").attr("disabled", true); + break; + } + var url = "/StationReport/GetTableHead"; $.post(url, send_data, function (rel) { if (rel.code != "0000") { toast_warning(rel.msg); + + switch (form) { + case 0: + $("#daybtn").html('日報表').attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 1: + $("#daybtn").attr("disabled", false); + $("#monthbtn").html('月報表').attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 2: + $("#daybtn").attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").html('綜合報表').attr("disabled", false); + $("#year2btn").attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + case 3: + $("#daybtn").attr("disabled", false); + $("#monthbtn").attr("disabled", false); + $("#yearbtn").attr("disabled", false); + $("#year2btn").html('年報表').attr("disabled", false); + $(".btn-station").attr("disabled", false); + break; + } + + return; } + + + + $('#TableHead').empty(); var str = "