@@ -86,7 +91,7 @@
-
+
@@ -94,29 +99,26 @@
圖資上傳
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Frontend/_historyData.html b/Frontend/_historyData.html
index f89f042..bd3b25c 100644
--- a/Frontend/_historyData.html
+++ b/Frontend/_historyData.html
@@ -31,13 +31,13 @@
@@ -71,7 +71,7 @@
var historyTable = null;
$(function () {
initList();
-
+ $(loadEle).Loading("close");
// default list filter
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
// custom response message
@@ -90,9 +90,34 @@
onEvent('change', '#startdate', 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('/', '-');
- console.log(today);
- console.log(ytd);
- if ($(this).val() == today) {
+
+ if (pageAct.dateType == 'range') {
+ 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)"]`).addClass('btn-dark');
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
@@ -104,13 +129,37 @@
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-dark');
}
- else {
- $(`[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)"]`).removClass('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 {
+ $('#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');
+ }
+ }
+ }
+ });
});
function initList() {
@@ -283,7 +332,9 @@
$('#enddate').css('display', 'block');
$('#getmonth').css('display', 'none');
$('#startdate').val(now);
+ $('#startdate').data('val', now);
$('#enddate input').val(tmr);
+ $('#enddate input').data('val', tmr);
}
else if (type == "month") {
$(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-dark');
diff --git a/Frontend/_operation.html b/Frontend/_operation.html
index 3cbc47e..49f2fb7 100644
--- a/Frontend/_operation.html
+++ b/Frontend/_operation.html
@@ -19,12 +19,12 @@
@@ -572,23 +572,50 @@
pageAct.startdate = startdate;
pageAct.enddate = enddate;
- if (dateType == 'tdy') {
- pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date'));
- }
- else if (dateType == 'ytd') {
- pageAct.startdate = new Date(displayDate(new Date(new Date().setDate(new Date().getDate() - 1)), 'date'));
+ if ($('#startdate').val() > $('#enddate').val()) {
+ $('#startdate').val($('#startdate').data('val'));
+ $('#enddate').val($('#enddate').data('val'));
+ toast_error('不可選擇大於結束時間');
}
else {
- $(`[onclick^=setDate]`).removeClass('btn-dark');
- $(`[onclick^=setDate]`).addClass('btn-secondary');
- }
+ 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('/', '-')
- refTable();
+ if (dateType == 'tdy') {
+ 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') {
+ 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 {
+ $(`[onclick^=setDate]`).removeClass('btn-dark');
+ $(`[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();
+ }
}
function initDate() {
- $('#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('/', '-'));
+ //$('#startdate').val(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date').replaceAll('/', '-'));
+ //$('#enddate').val(displayDate(new Date(new Date().setDate(new Date().getDate())), 'date').replaceAll('/', '-'));
+ $(`[onclick="setDate('tdy')"]`).click();
}
function clearPageAct() {
diff --git a/Frontend/index.html b/Frontend/index.html
index d12ee73..0a9a25b 100644
--- a/Frontend/index.html
+++ b/Frontend/index.html
@@ -2084,6 +2084,9 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
"n4js/historybaja",
"lib/statistics/flot/flot.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);
}
/**
diff --git a/FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-03.xlsx b/FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-03.xlsx
new file mode 100644
index 0000000..d3f2789
Binary files /dev/null and b/FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-03.xlsx differ
diff --git a/FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-22_2022-12-05.xlsx b/FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-22_2022-12-05.xlsx
new file mode 100644
index 0000000..a611faa
Binary files /dev/null and b/FrontendWebApi/wwwroot/excel/operation/廠商資料_2022-12-22_2022-12-05.xlsx differ