1. 修改日期顯示

2. 電站報表 加入Loading
This commit is contained in:
Kai 2021-09-11 17:15:58 +08:00
parent 09f1634f75
commit 784f09b46a
2 changed files with 125 additions and 16 deletions

View File

@ -346,9 +346,9 @@
$('#monthbtn').hide(); $('#monthbtn').hide();
$('#yearbtn').show(); $('#yearbtn').show();
$('#daybtn').show(); $('#daybtn').show();
document.getElementById("monthbtn").disabled = true;//月報表鎖定 @*document.getElementById("monthbtn").disabled = true;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定
document.getElementById("daybtn").disabled = false;//日報表鎖定 document.getElementById("daybtn").disabled = false;//日報表鎖定*@
break; break;
case 1: case 1:
@ -386,9 +386,9 @@
$('#daybtn').hide(); $('#daybtn').hide();
$('#monthbtn').show(); $('#monthbtn').show();
$('#yearbtn').show(); $('#yearbtn').show();
document.getElementById("daybtn").disabled = true;//日報表鎖定 @*document.getElementById("daybtn").disabled = true;//日報表鎖定
document.getElementById("monthbtn").disabled = false;//月報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@
break; break;
case 2: $('#DateGet').prop({ 'type': 'month' }); case 2: $('#DateGet').prop({ 'type': 'month' });
$(".btn-change-quickSearch1").html("本月"); $(".btn-change-quickSearch1").html("本月");
@ -398,9 +398,9 @@
$('#daybtn').hide(); $('#daybtn').hide();
$('#monthbtn').show(); $('#monthbtn').show();
$('#yearbtn').show(); $('#yearbtn').show();
document.getElementById("daybtn").disabled = true;//日報表鎖定 @*document.getElementById("daybtn").disabled = true;//日報表鎖定
document.getElementById("monthbtn").disabled = false;//月報表鎖定 document.getElementById("monthbtn").disabled = false;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@
break; break;
case 3: case 3:
$(".btn-change-quickSearch1").html("今年"); $(".btn-change-quickSearch1").html("今年");
@ -411,9 +411,9 @@
$('#daybtn').hide(); $('#daybtn').hide();
$('#monthbtn').hide(); $('#monthbtn').hide();
$('#yearbtn').show(); $('#yearbtn').show();
document.getElementById("daybtn").disabled = true;//日報表鎖定 @*document.getElementById("daybtn").disabled = true;//日報表鎖定
document.getElementById("monthbtn").disabled = true;//月報表鎖定 document.getElementById("monthbtn").disabled = true;//月報表鎖定
document.getElementById("yearbtn").disabled = false;//綜合報表鎖定 document.getElementById("yearbtn").disabled = false;//綜合報表鎖定*@
break; break;
} }
if (type == 1) { if (type == 1) {
@ -674,12 +674,81 @@
FormType: form, FormType: form,
PowerStation: nowpowerstation PowerStation: nowpowerstation
} }
switch (form) {
case 0:
$("#daybtn").html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>').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('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>').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('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>').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('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>', true);
$(".btn-station").attr("disabled", true);
break;
}
var url = "/StationReport/GetTableHead"; var url = "/StationReport/GetTableHead";
$.post(url, send_data, function (rel) { $.post(url, send_data, function (rel) {
if (rel.code != "0000") { if (rel.code != "0000") {
toast_warning(rel.msg); 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; return;
} }
$('#TableHead').empty(); $('#TableHead').empty();
var str = "<tr>"; var str = "<tr>";
switch (form) switch (form)
@ -756,6 +825,38 @@
} }
var url = "/StationReport/GetForm"; var url = "/StationReport/GetForm";
$.post(url, send_data, function (rel) { $.post(url, send_data, function (rel) {
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;
}
if (rel.code != "0000") { if (rel.code != "0000") {
if (rel.code == "9985") { if (rel.code == "9985") {
toast_warning(rel.msg); toast_warning(rel.msg);
@ -766,6 +867,7 @@
$('#totbody').empty(); $('#totbody').empty();
return; return;
} }
var sta = ""; var sta = "";
$('#TableBody').empty(); $('#TableBody').empty();
$('#totbody').empty(); $('#totbody').empty();

View File

@ -1224,14 +1224,21 @@ var initApp = (function(app) {
/* Add app date to js-get-date */ /* Add app date to js-get-date */
if (myapp_config.appDateHook.length) { if (myapp_config.appDateHook.length) {
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], var months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], day = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
now = new Date(), now = new Date(),
formatted = day[now.getDay()] + ', ' + formatted = now.getFullYear() + '-' + months[now.getMonth()] + '-' + now.getDate();
months[now.getMonth()] + ' ' +
now.getDate() + ', ' +
now.getFullYear();
myapp_config.appDateHook.text(formatted); myapp_config.appDateHook.text(formatted);
//var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
// day = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
// now = new Date(),
// formatted = day[now.getDay()] + ', ' +
// months[now.getMonth()] + ' ' +
// now.getDate() + ', ' +
// now.getFullYear();
//myapp_config.appDateHook.text(formatted);
} }
/* Check conflicting classes to build/destroy slimscroll */ /* Check conflicting classes to build/destroy slimscroll */