新增歷史資料查詢btn

This commit is contained in:
b110212000 2022-05-19 15:42:51 +08:00
parent ac0585055c
commit 702bed99c4
2 changed files with 28 additions and 16 deletions

View File

@ -2300,6 +2300,7 @@
document.getElementById("Group" + i).setAttribute("class", "btn btn-secondary waves-effect waves-themed"); document.getElementById("Group" + i).setAttribute("class", "btn btn-secondary waves-effect waves-themed");
} }
document.getElementById("Group" + type).setAttribute("class", "btn btn-success waves-effect waves-themed"); document.getElementById("Group" + type).setAttribute("class", "btn btn-success waves-effect waves-themed");
document.getElementById("Historybtn").style.display = "";//隱藏
switch (type) switch (type)
{ {
case 0: case 0:
@ -2355,6 +2356,8 @@
document.getElementById("DateGet").style.display = "none";//隱藏 document.getElementById("DateGet").style.display = "none";//隱藏
document.getElementById("MonthGet").style.display = "none";//隱藏 document.getElementById("MonthGet").style.display = "none";//隱藏
document.getElementById("YearGet").style.display = "none";//隱藏 document.getElementById("YearGet").style.display = "none";//隱藏
document.getElementById("Historybtn").style.display = "none";//隱藏
groupType = type; groupType = type;
historyRange = ''; historyRange = '';
getTable(); getTable();
@ -2421,22 +2424,31 @@
} }
//#endregion //#endregion
function Historyclick() {
switch (groupType) {
case 0: historyRange = $('#DateGet').val(); break;
case 1: historyRange = $('#MonthGet').val(); break;
case 2: historyRange = $('#YearGet').val(); break;
}
getTable();
}
console.log(" before onChange event"); console.log(" before onChange event");
$('#DateGet').on('change', function () { //$('#DateGet').on('change', function () {
console.log(" in onChange event"); // console.log(" in onChange event");
historyRange = $('#DateGet').val(); // historyRange = $('#DateGet').val();
getTable(); // getTable();
}); //});
$('#MonthGet').on('change', function () { //$('#MonthGet').on('change', function () {
historyRange = $('#MonthGet').val(); // historyRange = $('#MonthGet').val();
getTable(); // getTable();
}); //});
$('#YearGet').on('change', function () { //$('#YearGet').on('change', function () {
historyRange = $('#YearGet').val(); // historyRange = $('#YearGet').val();
getTable(); // getTable();
}); //});
function getTable() function getTable()
{ {

View File

@ -44,9 +44,9 @@
</div> </div>
@*<div class="pr-3"> <div class="pr-3">
<button type="button" class="btn btn-secondary waves-effect waves-themed">列印報告</button> <button type="button" class="btn btn-secondary waves-effect waves-themed" id="Historybtn" onclick="Historyclick()">查詢</button>
</div>*@ </div>
</div> </div>