Commit 00b2260a authored by 饶来安's avatar 饶来安

调整

parent e7d0a00d
...@@ -505,6 +505,14 @@ ...@@ -505,6 +505,14 @@
'input[name="quickDate"]:checked', 'input[name="quickDate"]:checked',
); );
checkedQuickDate && (checkedQuickDate.checked = false); checkedQuickDate && (checkedQuickDate.checked = false);
return;
}
if (dateId === "dateFrom") {
startDate = startDate;
document.getElementById(dateId).value = startDate;
} else {
endDate = endDate;
document.getElementById(dateId).value = endDate;
} }
}; };
......
...@@ -541,6 +541,14 @@ ...@@ -541,6 +541,14 @@
'input[name="quickDate"]:checked', 'input[name="quickDate"]:checked',
); );
checkedQuickDate && (checkedQuickDate.checked = false); checkedQuickDate && (checkedQuickDate.checked = false);
return;
}
if (dateId === "dateFrom") {
startDate = startDate;
document.getElementById(dateId).value = startDate;
} else {
endDate = endDate;
document.getElementById(dateId).value = endDate;
} }
}; };
......
...@@ -756,7 +756,7 @@ ...@@ -756,7 +756,7 @@
</div> </div>
</div> </div>
</th> </th>
<th style="width: 95px;"> <th style="width: 81px;">
<div class="xflex"> <div class="xflex">
<span>备注 </span> <span>备注 </span>
<div class="jiantou"> <div class="jiantou">
...@@ -837,7 +837,7 @@ ...@@ -837,7 +837,7 @@
<!-- 工具栏 --> <!-- 工具栏 -->
<div class="toolbar2"> <div class="toolbar2">
<div class="toolbar-left"> <div class="toolbar-left">
<label><input type="checkbox"> 全选</label> <label><input type="checkbox" id="all_1" onclick="selectAll(1);">全选</label>
<span>本次查询时间:20250901-20260428</span> <span>本次查询时间:20250901-20260428</span>
</div> </div>
<div id="rightType"> <div id="rightType">
...@@ -985,7 +985,7 @@ ...@@ -985,7 +985,7 @@
const moreTds = more ? `<td>222</td><td>222</td><td>222</td><td>222</td><td>222</td>` : ''; const moreTds = more ? `<td>222</td><td>222</td><td>222</td><td>222</td><td>222</td>` : '';
tr.innerHTML = ` tr.innerHTML = `
<td class="center col-select"><input type="checkbox"></td> <td class="center col-select"><input type="checkbox" class="row-checkbox"></td>
<td class="center">${r.tradeTime?.replaceAll('-', '')}</td> <td class="center">${r.tradeTime?.replaceAll('-', '')}</td>
<td class="num">${fmtAmt(r.debit)}</td> <td class="num">${fmtAmt(r.debit)}</td>
<td class="num">${fmtAmt(r.credit)}</td> <td class="num">${fmtAmt(r.credit)}</td>
...@@ -1014,10 +1014,55 @@ ...@@ -1014,10 +1014,55 @@
CURRENT_RANGE.from = v.dateFrom; CURRENT_RANGE.from = v.dateFrom;
CURRENT_RANGE.to = v.dateTo; CURRENT_RANGE.to = v.dateTo;
// document.getElementById('resultArea').style.display = ''; // document.getElementById('resultArea').style.display = '';
console.log('查询结果:', rows);
render(rows); render(rows);
// document.getElementById('resultArea').scrollIntoView({ behavior: 'smooth', block: 'start' }); // document.getElementById('resultArea').scrollIntoView({ behavior: 'smooth', block: 'start' });
} }
// 获取所有行 checkbox
function getRowCheckboxes() {
return document.querySelectorAll('.row-checkbox');
}
// 全选 / 取消全选
function selectAll() {
var isChecked = document.getElementById('all_1').checked;
document.getElementById('all_1').checked = isChecked;
var checkboxes = getRowCheckboxes();
checkboxes.forEach(function(item) {
item.checked = isChecked;
});
}
// 反选
function invertSelection() {
var checkboxes = getRowCheckboxes();
checkboxes.forEach(function(item) {
item.checked = !item.checked;
});
updateSelectAllStatus();
}
// 单个点击时,联动“全选”
function updateSelectAllStatus() {
var checkboxes = getRowCheckboxes();
var allCheckboxs = document.getElementById('all_1');
var allChecked = true;
checkboxes.forEach(function(item) {
if (!item.checked) {
allChecked = false;
}
});
allCheckboxs.checked = allChecked;
}
// 给每个子 checkbox 绑定事件(页面加载后执行)
document.addEventListener('DOMContentLoaded', function() {
var checkboxes = getRowCheckboxes();
checkboxes.forEach(function(item) {
item.addEventListener('change', updateSelectAllStatus);
});
});
function lookmore() { function lookmore() {
const ths = document.querySelectorAll('.thmore'); const ths = document.querySelectorAll('.thmore');
ths.forEach(th => { ths.forEach(th => {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box; box-sizing: border-box;
font-family: "Microsoft Yahei", sans-serif; font-family: \5b8b\4f53, arial, georgia, verdana, helvetica, sans-serif;
font-size: 14px; font-size: 14px;
} }
...@@ -278,12 +278,12 @@ ...@@ -278,12 +278,12 @@
align-items: center; align-items: center;
} }
.flex { /* .flex {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 10px; margin-top: 10px;
width: 100%; width: 100%;
} } */
.empty { .empty {
padding: 30px; padding: 30px;
...@@ -425,6 +425,159 @@ ...@@ -425,6 +425,159 @@
z-index: 2; z-index: 2;
} }
</style> </style>
<style>
input[type="text"],
select,
textarea {
outline: none;
}
/* css 复选框美化 -s- */
input[type="checkbox"] {
cursor: pointer;
position: relative;
}
input[type="checkbox"]::after {
position: absolute;
top: 0;
background-color: #fff;
color: #fff;
width: 14px;
height: 14px;
display: inline-block;
visibility: visible;
padding-left: 0px;
text-align: center;
content: " ";
border-radius: 2px;
box-sizing: border-box;
border: 1px solid black;
}
input[type="checkbox"]:checked::after {
content: "";
background-color: #fff;
border-color: black;
background-color: #fff;
}
input[type="checkbox"]:checked::before {
content: "";
position: absolute;
top: 1px;
left: 5px;
width: 3px;
height: 8px;
border: solid black;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
z-index: 1;
}
/* css 复选框 -e- */
</style>
<style>
.tableHide {
background: #f7fafd;
width: 100%;
margin-bottom: 15px;
}
.tableHide tr td {
height: 42px;
padding-left: 10px;
}
.hideTitle {
width: 210px;
text-align: right;
padding-right: 5px;
}
.hideInfo {
width: 350px;
}
.formTitle {
width: 210px;
text-align: right;
padding-right: 5px;
}
.label_standard {
display: inline-block;
text-align: right;
width: 100%;
}
/*s 5.4 选择组件 */
/**s 5.4.1 时间日期选择组件 */
.inDate {
border: 1px solid #c5c5c5;
height: 25px;
line-height: 25px;
/*margin-left:5px;*/
padding-left: 10px;
width: 193px;
vertical-align: middle;
font-size: 1em;
}
.inDate:hover {
border: 1px solid #62a7e3;
}
.inDate:focus {
border: 1px solid #62a7e3;
}
.dSty1 {
width: 71px;
}
.dSty2 {
width: 71px;
margin-left: 2px;
}
.dateBtn {
margin-left: -1px;
margin-right: 3px;
border: 0px;
}
.dateImg {
vertical-align: middle;
border: 0px;
}
/**e 5.4.1 */
/*s 5.2 输入组件 */
/**s 5.2.1 标准输入框组件 5.2.2 通栏输入框组件 5.2.5 交易密码输入组件 5.2.6 双项输入组件 */
.inTxt {
border: 1px solid #c5c5c5;
height: 25px;
line-height: 25px;
/*margin-left:5px;*/
margin-right: 10px;
padding-left: 10px;
width: 220px;
vertical-align: middle;
font-size: 1em;
}
.inTxt:hover {
border: 1px solid #62a7e3;
}
.inTxt:focus {
border: 1px solid #62a7e3;
}
/**e 5.2.1 标准输入框组件 */
.iBtn {
margin-right: 10px;
display: inline-block;
color: #0066b3;
cursor: pointer;
line-height: 24px;
vertical-align: middle;
text-decoration: none;
}
.iBtn:hover {
text-decoration: underline;
}
.icon5 {
padding-left: 16px;
background: url(https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/filter.png)
left no-repeat;
}
</style>
<link rel="stylesheet" href="calendar-plugin/calendar.css" />
<script src="calendar-plugin/calendar.js"></script>
</head> </head>
<body> <body>
...@@ -455,7 +608,88 @@ ...@@ -455,7 +608,88 @@
</span> </span>
</div> </div>
</div> </div>
<table
id="conditionTB"
class="tableHide"
cellpadding="0"
cellspacing="0"
border="0"
width="100%"
style="display: none"
>
<!--是否有他行账号,有则可以选择行别
-->
<!--是否有海外账号,有则可以选择账户归属地-->
<tbody>
<tr>
<td class="formTitle" width="5%">
<label class="label_standard">任务设定日期:</label>
</td>
<td>
<input
class="inDate dSty1"
id="dateFrom"
name="dateFrom"
type="text"
size="10"
maxlength="10"
oninput="startDate = this.value"
onblur="handleBlur('dateFrom')"
value="20260505"
/><a class="dateBtn date-picker" id="sDate"
><img
class="dateImg"
src="https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/date.png"
id="img1" /></a
>-
<input
class="inDate dSty2"
id="dateTo"
name="dateTo"
type="text"
size="10"
maxlength="10"
oninput="endDate = this.value"
onblur="handleBlur('dateTo')"
value="20260414"
/><a class="dateBtn date-picker" id="eDate"
><img
class="dateImg"
src="https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/date.png"
id="img2" /></a
>(标准输入格式20130101,表示2013年1月1日)
</td>
<input type="hidden" id="now_DATE" name="now_DATE" value="20260505" />
</tr>
<tr>
<td class="formTitle">
<label class="label_standard">批次号:</label>
</td>
<td>
<input
class="inTxt"
name="Asyn_Tsk_No"
type="text"
size="30"
maxlength="30"
/>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="3">
<a
class="iBtn icon5"
href="javascript:void(0);"
onclick="searchOne(document.getElementById('filterCheckbox'))"
>过滤筛选</a
>
</td>
</tr>
<tr></tr>
</tbody>
</table>
<!-- 交易明细表格 --> <!-- 交易明细表格 -->
<div class="tablebox"> <div class="tablebox">
<table class="detail-table grid" id="resultTable"> <table class="detail-table grid" id="resultTable">
...@@ -555,22 +789,98 @@ ...@@ -555,22 +789,98 @@
function openFilter(element) { function openFilter(element) {
var isChecked = element.checked; var isChecked = element.checked;
var rightType = document.getElementById("rightType");
var rightTypes = document.getElementById("rightTypes");
var conditionTB = document.getElementById("conditionTB"); var conditionTB = document.getElementById("conditionTB");
console.log("复选框当前状态:", isChecked); console.log("复选框当前状态:", isChecked);
if (isChecked) { if (isChecked) {
rightType.style.display = "none";
rightTypes.style.display = "inline-block";
conditionTB.style.display = "inline-block"; conditionTB.style.display = "inline-block";
} else { } else {
rightType.style.display = "inline-block";
rightTypes.style.display = "none";
conditionTB.style.display = "none"; conditionTB.style.display = "none";
} }
} }
function searchOne(checkboxElement) {
if (checkboxElement) {
checkboxElement.checked = false;
}
var conditionTB = document.getElementById("conditionTB");
conditionTB.style.display = "none";
}
function onBack() { function onBack() {
window.history.back(); window.history.back();
} }
/**
* 解析 YYYYMMDD 格式为 Date 对象
* @param {string} dateStr - 8位数字字符串,如 20250101
* @returns {Date}
*/
function parseYYYYMMDD(dateStr) {
const year = parseInt(dateStr.substring(0, 4));
const month = parseInt(dateStr.substring(4, 6)) - 1;
const day = parseInt(dateStr.substring(6, 8));
return new Date(year, month, day);
}
/**
* 检测 YYYYMMDD 格式的日期间隔是否大于365天
* @param {string} startStr - 开始日期,如 20250101
* @param {string} endStr - 结束日期,如 20260101
* @returns {boolean}
*/
function isOver365DaysYYYYMMDD(startStr, endStr) {
const start = parseYYYYMMDD(startStr);
const end = parseYYYYMMDD(endStr);
const diffDays = (end - start) / (1000 * 60 * 60 * 24);
return Math.abs(diffDays) > 365;
}
let startDate = "";
let endDate = "";
const handleBlur = (dateId) => {
console.log(
"handleBlur",
startDate,
endDate,
isOver365DaysYYYYMMDD(startDate, endDate),
);
if (startDate && endDate && isOver365DaysYYYYMMDD(startDate, endDate)) {
alert("起止日期间隔不能超过365天");
if (dateId === "dateFrom") {
startDate = "";
document.getElementById(dateId).value = "";
} else {
endDate = "";
document.getElementById(dateId).value = "";
}
const checkedQuickDate = document.querySelector(
'input[name="quickDate"]:checked',
);
checkedQuickDate && (checkedQuickDate.checked = false);
return;
}
if (dateId === "dateFrom") {
startDate = startDate;
document.getElementById(dateId).value = startDate;
} else {
endDate = endDate;
document.getElementById(dateId).value = endDate;
}
};
const pickerStart = new CalendarPlugin({
trigger: "#sDate",
onSelect: function (date) {
startDate = date.replaceAll("-", "");
handleBlur("dateFrom");
},
});
const pickerEnd = new CalendarPlugin({
trigger: "#eDate",
onSelect: function (date) {
endDate = date.replaceAll("-", "");
handleBlur("dateTo");
},
});
</script> </script>
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