Commit 6587d82f authored by 秦垚玲's avatar 秦垚玲

fix:电子回单查询内页、空页、单位结算卡回单查询等

parent 2658fd9a
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
margin: 15px 0; margin: 15px 0;
font-size: 14px; font-size: 14px;
color: #2C2C2C; color: #2C2C2C;
font-family: \5b8b\4f53, arial, georgia, verdana, helvetica, sans-serif !important;
} }
.breadcrumb_item{ .breadcrumb_item{
font-weight: bold; font-weight: bold;
...@@ -125,6 +126,7 @@ ...@@ -125,6 +126,7 @@
display: inline; display: inline;
line-height: 20px; line-height: 20px;
float: left; float: left;
} }
.tabMenuBox .tabMenu span{ .tabMenuBox .tabMenu span{
display: block; display: block;
...@@ -132,6 +134,12 @@ ...@@ -132,6 +134,12 @@
width: 5px; width: 5px;
float: left; float: left;
} }
.tabMenuBox .tabMenu a{
font-family: \5b8b\4f53, arial, georgia, verdana, helvetica, sans-serif !important;
}
.tabMenuBox li span { .tabMenuBox li span {
display: block; display: block;
height: 40px; height: 40px;
...@@ -693,13 +701,13 @@ ...@@ -693,13 +701,13 @@
> >
<input <input
type="text" type="text"
id="dateFrom" id="dateFroms"
class="form-input" class="form-input"
name="dateFrom" name="dateFroms"
oninput="startDate = this.value" oninput="transactionDate = this.value"
onblur="handleBlur('dateFrom')" onblur="handleBlurs('dateFroms')"
/> />
<div class="date-picker" id="sDate"> <div class="date-picker" id="tradeDate">
<img class="dateimg" src="./images/date.png" alt="" /> <img class="dateimg" src="./images/date.png" alt="" />
</div> </div>
</div> </div>
...@@ -746,7 +754,7 @@ ...@@ -746,7 +754,7 @@
<!-- 按钮组 --> <!-- 按钮组 -->
<button class="buttonx xx" onclick="onHandle(1)" type="submit">确定</button> <button class="buttonx xx" onclick="onHandle(1)" type="submit">确定</button>
<button type="button" class="buttonx yy showForm1" id="amendBtn" <button type="button" class="buttonx yy showForm1" id="amendBtn"
onclick="onHandle(2)">更正回查询</button> onclick="onHandle(2)">更正回查询</button>
</form> </form>
</div> </div>
...@@ -780,14 +788,10 @@ ...@@ -780,14 +788,10 @@
function sendHeight() { function sendHeight() {
const pageHeight = Math.ceil(Math.max( const pageHeight = document.body.scrollHeight;
document.body.scrollHeight,
document.documentElement.scrollHeight
));
window.parent.postMessage({ window.parent.postMessage({
type: 'STATUS_HEIGHT', type: 'STATUS_HEIGHT',
value: pageHeight value: pageHeight + 50
}, '*'); }, '*');
} }
window.addEventListener('load', sendHeight); window.addEventListener('load', sendHeight);
...@@ -803,6 +807,10 @@ function getTodayYYYYMMDD() { ...@@ -803,6 +807,10 @@ function getTodayYYYYMMDD() {
return `${y}${m}${d}`; return `${y}${m}${d}`;
} }
// 声明
let startDate = "";
let endDate = "";
let transactionDate = '';
// 页面加载默认赋值 // 页面加载默认赋值
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
const today = getTodayYYYYMMDD(); const today = getTodayYYYYMMDD();
...@@ -813,16 +821,13 @@ window.addEventListener("DOMContentLoaded", () => { ...@@ -813,16 +821,13 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("dateFrom").value = startDate; document.getElementById("dateFrom").value = startDate;
document.getElementById("dateTo").value = endDate; document.getElementById("dateTo").value = endDate;
});
});
// 类型选择 // 类型选择
document.getElementById('typeSelect').addEventListener('change', function(e) { document.getElementById('typeSelect').addEventListener('change', function(e) {
var selectedValue = this.value; var selectedValue = this.value;
console.log(selectedValue,"选择类型==========",selectedValue); // 输出选中的值
if(selectedValue == 1){ if(selectedValue == 1){
document.querySelectorAll(".showForm1").forEach(item => { document.querySelectorAll(".showForm1").forEach(item => {
...@@ -886,37 +891,40 @@ document.getElementById('typeSelect').addEventListener('change', function(e) { ...@@ -886,37 +891,40 @@ document.getElementById('typeSelect').addEventListener('change', function(e) {
const diffDays = (end - start) / (1000 * 60 * 60 * 24); const diffDays = (end - start) / (1000 * 60 * 60 * 24);
return Math.abs(diffDays) > 365; return Math.abs(diffDays) > 365;
} }
/**
* 检测 YYYYMMDD 格式的日期间隔是否大于三个月
* @param {string} startStr - 开始日期,如 20250101
* @param {string} endStr - 结束日期,如 20260101
* @returns {boolean}
*/
function isOver90DaysYYYYMMDD(startStr, endStr) {
const start = parseYYYYMMDD(startStr);
const end = parseYYYYMMDD(endStr);
const diffDays = (end - start) / (1000 * 60 * 60 * 24);
return Math.abs(diffDays) > 90;
}
let startDate = "";
let endDate = "";
const handleBlur = (dateId) => { const handleBlur = (dateId) => {
console.log( console.log(
"handleBlur", "handleBlur",
startDate, startDate,
endDate, endDate,
isOver365DaysYYYYMMDD(startDate, endDate), isOver90DaysYYYYMMDD(startDate, endDate),
); );
if (startDate && endDate && isOver365DaysYYYYMMDD(startDate, endDate)) { if (startDate && endDate && isOver90DaysYYYYMMDD(startDate, endDate)) {
alert("起止日期间隔不能超过365天"); alert("预约时间段不能超过3个月!");
if (dateId === "dateFrom") { if (dateId === "dateFrom") {
startDate = ""; startDate = "";
document.getElementById(dateId).value = "";
} else { } else {
endDate = ""; endDate = "";
document.getElementById(dateId).value = "";
} }
const checkedQuickDate = document.querySelector( document.getElementById(dateId).value = "";
'input[name="quickDate"]:checked',
);
checkedQuickDate && (checkedQuickDate.checked = false);
return; return;
} }
if (dateId === "dateFrom") { if (dateId === "dateFrom") {
startDate = startDate;
document.getElementById(dateId).value = startDate; document.getElementById(dateId).value = startDate;
} else { } else {
endDate = endDate;
document.getElementById(dateId).value = endDate; document.getElementById(dateId).value = endDate;
} }
}; };
...@@ -937,6 +945,22 @@ document.getElementById('typeSelect').addEventListener('change', function(e) { ...@@ -937,6 +945,22 @@ document.getElementById('typeSelect').addEventListener('change', function(e) {
}, },
}); });
const handleBlurs = (dateId) => {
if (dateId === "dateFroms") {
document.getElementById(dateId).value = transactionDate;
}
};
// 筛选日期选择器
new CalendarPlugin({
trigger: '#tradeDate',
onSelect(date) {
transactionDate = date.replaceAll('-', '');
handleBlurs('dateFroms');
}
});
// 快速日期 // 快速日期
document.querySelectorAll("input[name=quickDate]").forEach((el) => { document.querySelectorAll("input[name=quickDate]").forEach((el) => {
el.addEventListener("change", () => { el.addEventListener("change", () => {
...@@ -975,10 +999,11 @@ document.getElementById('typeSelect').addEventListener('change', function(e) { ...@@ -975,10 +999,11 @@ document.getElementById('typeSelect').addEventListener('change', function(e) {
JSON.stringify(Object.fromEntries(formData.entries())), JSON.stringify(Object.fromEntries(formData.entries())),
); );
// setTimeout(() => { setTimeout(() => {
// window.localStorage.setItem("dateFrom", startDate); window.localStorage.setItem("dateFrom", startDate);
// window.location.href = "./account_list.html"; window.location.href = "./electronic_receipt_list.html";
// }, 500); }, 500);
}); });
} }
if(number == 2) { if(number == 2) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="calendar-plugin/calendar.css"> <link rel="stylesheet" href="calendar-plugin/calendar.css">
<title>更正回查询</title> <title>更正回查询</title>
<style> <style>
* { * {
margin: 0; margin: 0;
......
This diff is collapsed.
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
margin: 15px 0; margin: 15px 0;
font-size: 14px; font-size: 14px;
color: #2C2C2C; color: #2C2C2C;
font-family: \5b8b\4f53, arial, georgia, verdana, helvetica, sans-serif !important;
} }
.breadcrumb_item{ .breadcrumb_item{
font-weight: bold; font-weight: bold;
...@@ -131,6 +132,10 @@ ...@@ -131,6 +132,10 @@
width: 5px; width: 5px;
float: left; float: left;
} }
.tabMenuBox .tabMenu a{
font-family: \5b8b\4f53, arial, georgia, verdana, helvetica, sans-serif !important;
}
.tabMenuBox li span { .tabMenuBox li span {
display: block; display: block;
height: 40px; height: 40px;
...@@ -577,7 +582,7 @@ ...@@ -577,7 +582,7 @@
<div style="height: 90px"></div> <div style="height: 90px"></div>
<!-- 按钮组 --> <!-- 按钮组 -->
<button class="buttonx xx" onclick="onHandle(1)" type="submit"> <button class="buttonx xx" onclick="onHandle(2)" type="button">
查询 查询
</button> </button>
...@@ -598,14 +603,10 @@ ...@@ -598,14 +603,10 @@
</html> </html>
<script> <script>
function sendHeight() { function sendHeight() {
const pageHeight = Math.ceil(Math.max( const pageHeight = document.body.scrollHeight;
document.body.scrollHeight,
document.documentElement.scrollHeight
));
window.parent.postMessage({ window.parent.postMessage({
type: 'STATUS_HEIGHT', type: 'STATUS_HEIGHT',
value: pageHeight value: pageHeight + 50
}, '*'); }, '*');
} }
window.addEventListener('load', sendHeight); window.addEventListener('load', sendHeight);
...@@ -746,32 +747,27 @@ window.addEventListener("DOMContentLoaded", () => { ...@@ -746,32 +747,27 @@ window.addEventListener("DOMContentLoaded", () => {
e.preventDefault(); // 阻止页面刷新 e.preventDefault(); // 阻止页面刷新
// 方式1:使用 FormData 自动搜集 // 方式1:使用 FormData 自动搜集
const formData = new FormData(form); // const formData = new FormData(form);
localStorage.setItem( // localStorage.setItem(
"accountQueryParams", // "accountQueryParams",
JSON.stringify(Object.fromEntries(formData.entries())), // JSON.stringify(Object.fromEntries(formData.entries())),
); // );
// setTimeout(() => { // setTimeout(() => {
// window.localStorage.setItem("dateFrom", startDate); // window.localStorage.setItem("dateFrom", startDate);
// window.location.href = "./account_list.html"; // window.location.href = "./account_list.html";
// }, 500); // }, 500);
alert("请选择账号")
}); });
} }
if (number == 2) { if (number == 2) {
window.history.back(); alert("请选择账号")
return false;
} }
if (number == 3) { if (number == 3) {
console.log(33333);
window.location.href = "./account_detail-long.html";
return false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment