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

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

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