Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
buildbank-replica
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚珂
buildbank-replica
Commits
8e14f9d6
Commit
8e14f9d6
authored
May 08, 2026
by
秦垚玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:单位结算查询调整
parent
6587d82f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
unit_receipt.html
unit_receipt.html
+21
-20
No files found.
unit_receipt.html
View file @
8e14f9d6
...
...
@@ -622,6 +622,9 @@ function getTodayYYYYMMDD() {
return
`
${
y
}${
m
}${
d
}
`
;
}
let
startDate
=
""
;
let
endDate
=
""
;
// 页面加载默认赋值
window
.
addEventListener
(
"DOMContentLoaded"
,
()
=>
{
const
today
=
getTodayYYYYMMDD
();
...
...
@@ -632,14 +635,8 @@ window.addEventListener("DOMContentLoaded", () => {
document
.
getElementById
(
"dateFrom"
).
value
=
startDate
;
document
.
getElementById
(
"dateTo"
).
value
=
endDate
;
});
/**
* 解析 YYYYMMDD 格式为 Date 对象
* @param {string} dateStr - 8位数字字符串,如 20250101
...
...
@@ -665,36 +662,40 @@ window.addEventListener("DOMContentLoaded", () => {
return
Math
.
abs
(
diffDays
)
>
365
;
}
let
startDate
=
""
;
let
endDate
=
""
;
/**
* 检测 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
;
}
const
handleBlur
=
(
dateId
)
=>
{
console
.
log
(
"handleBlur"
,
startDate
,
endDate
,
isOver
365
DaysYYYYMMDD
(
startDate
,
endDate
),
isOver
90
DaysYYYYMMDD
(
startDate
,
endDate
),
);
if
(
startDate
&&
endDate
&&
isOver
365
DaysYYYYMMDD
(
startDate
,
endDate
))
{
alert
(
"
起止日期间隔不能超过365天
"
);
if
(
startDate
&&
endDate
&&
isOver
90
DaysYYYYMMDD
(
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
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment