Merge branch 'master' of https://gitea.mjm-staging.developers-homelab.net/BIMS/BIMS
This commit is contained in:
commit
5c0907c8fc
@ -31,13 +31,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="form-control" id="startdate" type="date" name="date" value="">
|
<input class="form-control" id="startdate" data-val="" type="date" name="date" value="">
|
||||||
<input class="form-control" id="getmonth" type="month" style="display: none"/>
|
<input class="form-control" id="getmonth" type="month" style="display: none"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" id="enddate" style="display: none">
|
<div class="col-auto" id="enddate" style="display: none">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="form-control" type="date" name="date" value="">
|
<input class="form-control" type="date" data-val="" name="date" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
@ -71,7 +71,7 @@
|
|||||||
var historyTable = null;
|
var historyTable = null;
|
||||||
$(function () {
|
$(function () {
|
||||||
initList();
|
initList();
|
||||||
|
$(loadEle).Loading("close");
|
||||||
// default list filter
|
// default list filter
|
||||||
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
|
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
|
||||||
// custom response message
|
// custom response message
|
||||||
@ -90,9 +90,34 @@
|
|||||||
onEvent('change', '#startdate', function () {
|
onEvent('change', '#startdate', function () {
|
||||||
let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-');
|
let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-');
|
||||||
let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
|
let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
|
||||||
console.log(today);
|
|
||||||
console.log(ytd);
|
if (pageAct.dateType == 'range') {
|
||||||
if ($(this).val() == today) {
|
if ($('#startdate').val() > $('#enddate input').val() && ($('#startdate').val() != "" && $('#enddate input').val() != "")) {
|
||||||
|
$('#startdate').val($('#startdate').data('val'));
|
||||||
|
toast_error('不可選擇大於結束時間');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#startdate').data('val', $('#startdate').val());
|
||||||
|
$('#enddate input').data('val', $('#enddate input').val());
|
||||||
|
|
||||||
|
$(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
|
||||||
|
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-dark');
|
||||||
|
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
|
||||||
|
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-dark');
|
||||||
|
|
||||||
|
if ($('#startdate').val() == $('#enddate input').val()) {
|
||||||
|
if ($('#startdate').val() == today) {
|
||||||
|
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
|
||||||
|
$(`[onclick="setDateType('today', this)"]`).addClass('btn-dark');
|
||||||
|
}
|
||||||
|
else if ($('#startdate').val() == ytd) {
|
||||||
|
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
|
||||||
|
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-dark');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($(this).val() == today) {
|
||||||
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
|
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
|
||||||
$(`[onclick="setDateType('today', this)"]`).addClass('btn-dark');
|
$(`[onclick="setDateType('today', this)"]`).addClass('btn-dark');
|
||||||
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
|
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
|
||||||
@ -104,11 +129,35 @@
|
|||||||
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
|
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
|
||||||
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-dark');
|
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-dark');
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onEvent('change', '#enddate input', function () {
|
||||||
|
let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-');
|
||||||
|
let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
|
||||||
|
|
||||||
|
if ($('#startdate').val() > $('#enddate input').val() && ($('#startdate').val() != "" && $('#enddate input').val() != "")) {
|
||||||
|
$('#enddate input').val($('#enddate input').data('val'));
|
||||||
|
toast_error('不可選擇大於結束時間');
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
$('#startdate').data('val', $('#startdate').val());
|
||||||
|
$('#enddate input').data('val', $('#enddate input').val());
|
||||||
|
|
||||||
$(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
|
$(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
|
||||||
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-dark');
|
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-dark');
|
||||||
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
|
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
|
||||||
$(`[onclick="setDateType('ytd', this)"]`).removClass('btn-dark');
|
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-dark');
|
||||||
|
|
||||||
|
if ($('#startdate').val() == $('#enddate input').val()) {
|
||||||
|
if ($('#startdate').val() == today) {
|
||||||
|
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
|
||||||
|
$(`[onclick="setDateType('today', this)"]`).addClass('btn-dark');
|
||||||
|
}
|
||||||
|
else if ($('#startdate').val() == ytd) {
|
||||||
|
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
|
||||||
|
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-dark');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -283,7 +332,9 @@
|
|||||||
$('#enddate').css('display', 'block');
|
$('#enddate').css('display', 'block');
|
||||||
$('#getmonth').css('display', 'none');
|
$('#getmonth').css('display', 'none');
|
||||||
$('#startdate').val(now);
|
$('#startdate').val(now);
|
||||||
|
$('#startdate').data('val', now);
|
||||||
$('#enddate input').val(tmr);
|
$('#enddate input').val(tmr);
|
||||||
|
$('#enddate input').data('val', tmr);
|
||||||
}
|
}
|
||||||
else if (type == "month") {
|
else if (type == "month") {
|
||||||
$(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-dark');
|
$(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-dark');
|
||||||
|
@ -19,12 +19,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="form-control" id="startdate" type="date" name="date" value="">
|
<input class="form-control" id="startdate" data-val="" type="date" name="date" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="form-control" id="enddate" type="date" name="date" value="">
|
<input class="form-control" id="enddate" type="date" data-val="" name="date" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto" style="display: none">
|
<div class="col-auto" style="display: none">
|
||||||
@ -572,23 +572,50 @@
|
|||||||
pageAct.startdate = startdate;
|
pageAct.startdate = startdate;
|
||||||
pageAct.enddate = enddate;
|
pageAct.enddate = enddate;
|
||||||
|
|
||||||
|
if ($('#startdate').val() > $('#enddate').val()) {
|
||||||
|
$('#startdate').val($('#startdate').data('val'));
|
||||||
|
$('#enddate').val($('#enddate').data('val'));
|
||||||
|
toast_error('不可選擇大於結束時間');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let today = displayDate(new Date(new Date().setDate(new Date().getDate())), 'date').replaceAll('/', '-');
|
||||||
|
let ytd = displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'date').replaceAll('/', '-')
|
||||||
|
|
||||||
if (dateType == 'tdy') {
|
if (dateType == 'tdy') {
|
||||||
pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date'));
|
pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date'));
|
||||||
|
$('#startdate').val(today);
|
||||||
|
$('#startdate').data('val', today);
|
||||||
|
$('#enddate').val(today);
|
||||||
|
$('#enddate').data('val', today);
|
||||||
}
|
}
|
||||||
else if (dateType == 'ytd') {
|
else if (dateType == 'ytd') {
|
||||||
pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'date'));
|
pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'date'));
|
||||||
|
$('#startdate').val(ytd);
|
||||||
|
$('#startdate').data('val', ytd);
|
||||||
|
$('#enddate').val(ytd);
|
||||||
|
$('#enddate').data('val', ytd);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(`[onclick^=setDate]`).removeClass('btn-dark');
|
$(`[onclick^=setDate]`).removeClass('btn-dark');
|
||||||
$(`[onclick^=setDate]`).addClass('btn-secondary');
|
$(`[onclick^=setDate]`).addClass('btn-secondary');
|
||||||
|
if ($('#startdate').val() == $('#enddate').val()) {
|
||||||
|
if ($('#startdate').val() == today)
|
||||||
|
$(`[onclick="setDate('tdy')"]`).click();
|
||||||
|
else if ($('#startdate').val() == ytd)
|
||||||
|
$(`[onclick="setDate('ytd')"]`).click();
|
||||||
|
}
|
||||||
|
$('#startdate').data('val', $('#startdate').val());
|
||||||
|
$('#enddate').data('val', $('#enddate').val());
|
||||||
}
|
}
|
||||||
|
|
||||||
refTable();
|
refTable();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initDate() {
|
function initDate() {
|
||||||
$('#startdate').val(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date').replaceAll('/', '-'));
|
//$('#startdate').val(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date').replaceAll('/', '-'));
|
||||||
$('#enddate').val(displayDate(new Date(new Date().setDate(new Date().getDate() + 1)), 'date').replaceAll('/', '-'));
|
//$('#enddate').val(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date').replaceAll('/', '-'));
|
||||||
|
$(`[onclick="setDate('tdy')"]`).click();
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearPageAct() {
|
function clearPageAct() {
|
||||||
|
@ -2129,6 +2129,9 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
|
|||||||
"n4js/historybaja",
|
"n4js/historybaja",
|
||||||
"lib/statistics/flot/flot.bundle",
|
"lib/statistics/flot/flot.bundle",
|
||||||
"lib/statistics/peity/peity.bundle",
|
"lib/statistics/peity/peity.bundle",
|
||||||
|
"lib/jquery-validation/dist/jquery.validate",
|
||||||
|
"lib/jquery-validation/dist/additional-methods.min",
|
||||||
|
"lib/jquery-validation/dist/localization/messages_zh_TW",
|
||||||
], loadedMasterPack);
|
], loadedMasterPack);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
BIN
FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-03.xlsx
Normal file
BIN
FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-03.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user