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 => {
......
This diff is collapsed.
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