|
|
@@ -1,4 +1,4 @@
|
|
|
-<%-- 2026-11-26 风纪仪容检查批次录入页。具体违纪仍关联既有 WJJL。Lin --%>
|
|
|
+<%-- 2026-11-27 风纪仪容检查批次录入页。具体违纪仍关联既有 WJJL。Lin --%>
|
|
|
<html>
|
|
|
<head>
|
|
|
</head>
|
|
|
@@ -8,9 +8,9 @@
|
|
|
<div class="content-div" ssFith="true">
|
|
|
<table class="form">
|
|
|
<tr>
|
|
|
- <th>检查日期</th>
|
|
|
+ <th style="width:130px;">检查日期</th>
|
|
|
<td><input name="jcrq" type="date" onchange="loadBaseData()"/></td>
|
|
|
- <th>检查类型</th>
|
|
|
+ <th style="width:130px;">检查类型</th>
|
|
|
<td><select name="fjlx" id="fjlx"></select></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -20,7 +20,7 @@
|
|
|
width="220px" chg="loadBaseData"/>
|
|
|
</td>
|
|
|
<th>检查人员</th>
|
|
|
- <td class="plain-value">${sessionScope.ssUser.xm}</td>
|
|
|
+ <td><span class="plain-value">${sessionScope.ssUser.xm}</span></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th>检查说明</th>
|
|
|
@@ -28,47 +28,37 @@
|
|
|
<input name="ms" ssBtn="{desc:'附件',name:'fjid'}" ssRow="2"/>
|
|
|
</td>
|
|
|
</tr>
|
|
|
+ <tr>
|
|
|
+ <th>已检查班级</th>
|
|
|
+ <td><span id="classCount" class="plain-value">0</span></td>
|
|
|
+ <th>关联违纪</th>
|
|
|
+ <td><span id="violationCount" class="plain-value">0</span></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>扣分合计</th>
|
|
|
+ <td colspan="3"><span id="penaltyTotal" class="plain-value">0</span></td>
|
|
|
+ </tr>
|
|
|
</table>
|
|
|
|
|
|
- <div class="section-title">检查班级及结果</div>
|
|
|
- <div class="summary-line">
|
|
|
- 已选班级 <span id="classCount">0</span> 个,关联违纪 <span id="violationCount">0</span> 条,
|
|
|
- 扣分合计 <span id="penaltyTotal">0</span> 分
|
|
|
- </div>
|
|
|
- <div class="table-scroll">
|
|
|
- <table class="data-table" id="classTable">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th class="check-cell">本次检查</th>
|
|
|
- <th>班级</th>
|
|
|
- <th>检查结果</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr><td colspan="3" class="empty">加载中</td></tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <table class="form" id="classTable">
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th>检查班级</th>
|
|
|
+ <td colspan="3">正在加载</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="section-title">当天的风纪违纪记录</div>
|
|
|
- <div class="hint">勾选违纪记录后,将自动选中对应班级。未关联违纪的已检查班级按无违纪保存。</div>
|
|
|
- <div class="table-scroll">
|
|
|
- <table class="data-table" id="violationTable">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th class="check-cell">关联</th>
|
|
|
- <th>班级</th>
|
|
|
- <th>违纪类别</th>
|
|
|
- <th>学员</th>
|
|
|
- <th>时间</th>
|
|
|
- <th>扣分</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr><td colspan="6" class="empty">请选择日期和部门</td></tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <div class="content-div" ssFith="true">
|
|
|
+ <table class="form" id="violationTable">
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th>违纪记录</th>
|
|
|
+ <td colspan="3">请选择责任部门和检查日期</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bottom-div">
|
|
|
@@ -102,11 +92,31 @@
|
|
|
.replace(/'/g, "'");
|
|
|
}
|
|
|
|
|
|
+ function formVm() {
|
|
|
+ const app = document.getElementById("app");
|
|
|
+ return app && app.__vue_app__ && app.__vue_app__._instance
|
|
|
+ ? app.__vue_app__._instance.proxy : null;
|
|
|
+ }
|
|
|
+
|
|
|
function selectedBmid() {
|
|
|
+ const vm = formVm();
|
|
|
+ if (vm && vm.bmid != null && vm.bmid !== "")
|
|
|
+ return String(vm.bmid);
|
|
|
const input = document.querySelector("input[name='bmid']");
|
|
|
return input ? input.value : "";
|
|
|
}
|
|
|
|
|
|
+ function setSelectedBmid(value) {
|
|
|
+ if (value == null || value === "")
|
|
|
+ return;
|
|
|
+ const vm = formVm();
|
|
|
+ if (vm)
|
|
|
+ vm.bmid = value;
|
|
|
+ const input = document.querySelector("input[name='bmid']");
|
|
|
+ if (input)
|
|
|
+ input.value = String(value);
|
|
|
+ }
|
|
|
+
|
|
|
function selectedDate() {
|
|
|
const input = document.querySelector("input[name='jcrq']");
|
|
|
return input ? input.value : "";
|
|
|
@@ -152,6 +162,7 @@
|
|
|
return;
|
|
|
}
|
|
|
const data = res.ssData || {};
|
|
|
+ setSelectedBmid(data.bmid);
|
|
|
classRows = data.classes || [];
|
|
|
renderTypes(data.types || []);
|
|
|
renderClasses();
|
|
|
@@ -163,8 +174,7 @@
|
|
|
const select = document.getElementById("fjlx");
|
|
|
const current = select.value;
|
|
|
select.innerHTML = types.map((item) =>
|
|
|
- '<option value="' + esc(item.code) + '">' + esc(item.name) +
|
|
|
- '</option>'
|
|
|
+ '<option value="' + esc(item.code) + '">' + esc(item.name) + '</option>'
|
|
|
).join("");
|
|
|
if (current && types.some((item) => String(item.code) === String(current)))
|
|
|
select.value = current;
|
|
|
@@ -174,7 +184,7 @@
|
|
|
function renderClasses() {
|
|
|
const body = document.querySelector("#classTable tbody");
|
|
|
if (!classRows.length) {
|
|
|
- body.innerHTML = '<tr><td colspan="3" class="empty">当前部门没有可检查班级</td></tr>';
|
|
|
+ body.innerHTML = '<tr><th>检查班级</th><td colspan="3">当前部门没有可检查班级</td></tr>';
|
|
|
updateSummary();
|
|
|
return;
|
|
|
}
|
|
|
@@ -182,9 +192,10 @@
|
|
|
const id = String(item.bjid || item.BJID);
|
|
|
const name = item.bjmc || item.BJMC || "";
|
|
|
return '<tr>' +
|
|
|
- '<td class="check-cell"><input type="checkbox" class="class-check" data-bjid="' + esc(id) + '" onchange="toggleClass(\'' + esc(id) + '\', this.checked)"/></td>' +
|
|
|
+ '<th>班级</th>' +
|
|
|
'<td>' + esc(name) + '</td>' +
|
|
|
- '<td class="result-cell" data-class-result="' + esc(id) + '">未检查</td>' +
|
|
|
+ '<th>检查状态</th>' +
|
|
|
+ '<td>' + onoffArrayHtml("classCheck", "class-check", id, "已检查", false) + '</td>' +
|
|
|
'</tr>';
|
|
|
}).join("");
|
|
|
updateSummary();
|
|
|
@@ -213,25 +224,49 @@
|
|
|
function renderViolations() {
|
|
|
const body = document.querySelector("#violationTable tbody");
|
|
|
if (!violationRows.length) {
|
|
|
- body.innerHTML = '<tr><td colspan="6" class="empty">当天没有可关联的风纪违纪记录</td></tr>';
|
|
|
+ body.innerHTML = '<tr><th>违纪记录</th><td colspan="3">当天没有可关联的风纪违纪记录</td></tr>';
|
|
|
updateSummary();
|
|
|
return;
|
|
|
}
|
|
|
body.innerHTML = violationRows.map((item) => {
|
|
|
const id = String(item.wjjlid);
|
|
|
- const bjid = String(item.bjid);
|
|
|
return '<tr>' +
|
|
|
- '<td class="check-cell"><input type="checkbox" class="violation-check" data-wjjlid="' + esc(id) + '" onchange="toggleViolation(\'' + esc(id) + '\', this.checked)"/></td>' +
|
|
|
- '<td>' + esc(item.bjmc) + '</td>' +
|
|
|
- '<td>' + esc(item.wjlbmc) + '</td>' +
|
|
|
- '<td>' + esc(item.xm || "-") + '</td>' +
|
|
|
- '<td>' + esc(item.wjsj) + '</td>' +
|
|
|
- '<td>' + esc(item.bjfk) + '</td>' +
|
|
|
+ '<th>班级</th><td>' + esc(item.bjmc) + '</td>' +
|
|
|
+ '<th>违纪类别</th><td>' + esc(item.wjlbmc) + '</td>' +
|
|
|
+ '</tr>' +
|
|
|
+ '<tr>' +
|
|
|
+ '<th>学员</th><td>' + esc(item.xm || "-") + '</td>' +
|
|
|
+ '<th>违纪时间</th><td>' + esc(item.wjsj) + '</td>' +
|
|
|
+ '</tr>' +
|
|
|
+ '<tr>' +
|
|
|
+ '<th>扣分</th><td>' + esc(item.bjfk) + '</td>' +
|
|
|
+ '<th>本次检查</th><td>' +
|
|
|
+ onoffArrayHtml("violationCheck", "violation-check", id, "关联", false) +
|
|
|
+ '</td>' +
|
|
|
'</tr>';
|
|
|
}).join("");
|
|
|
updateSummary();
|
|
|
}
|
|
|
|
|
|
+ function onoffArrayHtml(inputName, className, id, label, checked) {
|
|
|
+ return '<div class="radio-container2">' +
|
|
|
+ '<input type="hidden" name="' + inputName + '" value="' + (checked ? esc(id) : "") + '"/>' +
|
|
|
+ '<div class="' + className + (checked ? ' checked' : '') + '" data-id="' + esc(id) + '"' +
|
|
|
+ ' onclick="toggleOnoff(\'' + className + '\',\'' + esc(id) + '\')">' +
|
|
|
+ '<span>' + esc(label) + '</span>' +
|
|
|
+ '<div class="mark"><i class="form-icon form-icon-onoff-' +
|
|
|
+ (checked ? 'checked' : 'unchecked') + '"></i></div>' +
|
|
|
+ '</div>' +
|
|
|
+ '</div>';
|
|
|
+ }
|
|
|
+
|
|
|
+ function toggleOnoff(className, id) {
|
|
|
+ if (className === "class-check")
|
|
|
+ toggleClass(id, !selectedClasses.has(String(id)));
|
|
|
+ else if (className === "violation-check")
|
|
|
+ toggleViolation(id, !selectedViolations.has(String(id)));
|
|
|
+ }
|
|
|
+
|
|
|
function toggleClass(bjid, checked) {
|
|
|
if (checked)
|
|
|
selectedClasses.add(String(bjid));
|
|
|
@@ -244,7 +279,6 @@
|
|
|
});
|
|
|
}
|
|
|
syncChecks();
|
|
|
- updateSummary();
|
|
|
}
|
|
|
|
|
|
function toggleViolation(wjjlid, checked) {
|
|
|
@@ -256,28 +290,28 @@
|
|
|
selectedViolations.delete(String(wjjlid));
|
|
|
}
|
|
|
syncChecks();
|
|
|
- updateSummary();
|
|
|
}
|
|
|
|
|
|
function syncChecks() {
|
|
|
- document.querySelectorAll(".class-check").forEach((input) => {
|
|
|
- input.checked = selectedClasses.has(String(input.dataset.bjid));
|
|
|
+ document.querySelectorAll(".class-check").forEach((button) => {
|
|
|
+ setOnoffState(button, selectedClasses.has(String(button.dataset.id)));
|
|
|
});
|
|
|
- document.querySelectorAll(".violation-check").forEach((input) => {
|
|
|
- input.checked = selectedViolations.has(String(input.dataset.wjjlid));
|
|
|
- });
|
|
|
- document.querySelectorAll("[data-class-result]").forEach((cell) => {
|
|
|
- const bjid = String(cell.dataset.classResult);
|
|
|
- if (!selectedClasses.has(bjid)) {
|
|
|
- cell.textContent = "未检查";
|
|
|
- return;
|
|
|
- }
|
|
|
- const hasViolation = Array.from(selectedViolations.keys()).some((id) => {
|
|
|
- const item = violationRows.find((row) => String(row.wjjlid) === id);
|
|
|
- return item && String(item.bjid) === bjid;
|
|
|
- });
|
|
|
- cell.textContent = hasViolation ? "已检查,有违纪" : "已检查,无违纪";
|
|
|
+ document.querySelectorAll(".violation-check").forEach((button) => {
|
|
|
+ setOnoffState(button, selectedViolations.has(String(button.dataset.id)));
|
|
|
});
|
|
|
+ updateSummary();
|
|
|
+ }
|
|
|
+
|
|
|
+ function setOnoffState(button, checked) {
|
|
|
+ button.classList.toggle("checked", checked);
|
|
|
+ const icon = button.querySelector(".form-icon");
|
|
|
+ if (icon) {
|
|
|
+ icon.classList.toggle("form-icon-onoff-checked", checked);
|
|
|
+ icon.classList.toggle("form-icon-onoff-unchecked", !checked);
|
|
|
+ }
|
|
|
+ const input = button.parentElement.querySelector("input[type='hidden']");
|
|
|
+ if (input)
|
|
|
+ input.value = checked ? button.dataset.id : "";
|
|
|
}
|
|
|
|
|
|
function updateSummary() {
|
|
|
@@ -286,7 +320,6 @@
|
|
|
document.getElementById("classCount").textContent = selectedClasses.size;
|
|
|
document.getElementById("violationCount").textContent = selectedViolations.size;
|
|
|
document.getElementById("penaltyTotal").textContent = Math.round(total * 100) / 100;
|
|
|
- syncChecks();
|
|
|
}
|
|
|
|
|
|
function submitInspection() {
|
|
|
@@ -301,11 +334,12 @@
|
|
|
return;
|
|
|
}
|
|
|
if (!selectedClasses.size) {
|
|
|
- alert("请至少选择一个检查班级");
|
|
|
+ alert("请至少标记一个已检查班级");
|
|
|
return;
|
|
|
}
|
|
|
submitting = true;
|
|
|
const formData = new FormData(document.getElementById("app"));
|
|
|
+ formData.set("bmid", selectedBmid());
|
|
|
formData.set("bjidStr", Array.from(selectedClasses).join(","));
|
|
|
formData.set("wjjlidStr", Array.from(selectedViolations.keys()).join(","));
|
|
|
$.ajax({
|
|
|
@@ -337,8 +371,13 @@
|
|
|
window.parent.location.reload();
|
|
|
} catch (_) {
|
|
|
}
|
|
|
- if (window.wd && window.wd.display)
|
|
|
- window.wd.display.closeDialog();
|
|
|
+ try {
|
|
|
+ if (window.ss && window.ss.display && window.ss.display.closeDialog)
|
|
|
+ window.ss.display.closeDialog();
|
|
|
+ else if (window.wd && window.wd.display)
|
|
|
+ window.wd.display.closeDialog();
|
|
|
+ } catch (_) {
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
window.onload = function () {
|
|
|
@@ -347,15 +386,5 @@
|
|
|
};
|
|
|
</script>
|
|
|
<style>
|
|
|
- .plain-value { padding-left: 12px; }
|
|
|
- .section-title { margin: 14px 12px 6px; color: #2f3f57; font-weight: 600; }
|
|
|
- .summary-line { margin: 0 12px 6px; color: #68778d; }
|
|
|
- .hint { margin: 0 12px 6px; color: #7c8798; font-size: 12px; }
|
|
|
- .table-scroll { margin: 0 12px 10px; max-height: 220px; overflow: auto; border: 1px solid #dfe5ed; }
|
|
|
- .data-table { width: 100%; border-collapse: collapse; background: #fff; }
|
|
|
- .data-table th, .data-table td { padding: 8px 10px; border-bottom: 1px solid #edf0f4; text-align: left; }
|
|
|
- .data-table th { position: sticky; top: 0; z-index: 1; background: #f5f7fa; color: #526078; font-weight: 500; }
|
|
|
- .data-table .check-cell { width: 74px; text-align: center; }
|
|
|
- .data-table .empty { color: #8d98a8; text-align: center; padding: 22px; }
|
|
|
- .result-cell { color: #3f5069; }
|
|
|
+ .plain-value { padding-left: 15px; }
|
|
|
</style>
|