|
|
@@ -117,14 +117,10 @@
|
|
|
font-size: 15px;
|
|
|
}
|
|
|
|
|
|
- .select-cell {
|
|
|
- width: 100%;
|
|
|
- min-width: 0;
|
|
|
- }
|
|
|
-
|
|
|
- .select-cell > .ss-select-container {
|
|
|
- width: 100%;
|
|
|
- min-width: 0;
|
|
|
+ .info-text {
|
|
|
+ align-items: flex-start;
|
|
|
+ line-height: 1.55;
|
|
|
+ overflow-wrap: anywhere;
|
|
|
}
|
|
|
|
|
|
.clickable {
|
|
|
@@ -282,6 +278,13 @@
|
|
|
font-size: 18px;
|
|
|
}
|
|
|
|
|
|
+ .formula-note {
|
|
|
+ padding: 4px 4px 0;
|
|
|
+ color: var(--muted);
|
|
|
+ text-align: right;
|
|
|
+ font-size: 13px;
|
|
|
+ }
|
|
|
+
|
|
|
.empty-tip {
|
|
|
padding: 16px 12px;
|
|
|
color: var(--muted);
|
|
|
@@ -289,71 +292,6 @@
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
|
|
|
- .sheet {
|
|
|
- max-height: 72vh;
|
|
|
- padding: 18px 16px 24px;
|
|
|
- background: #fff;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-mask {
|
|
|
- position: fixed;
|
|
|
- z-index: 9999;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- display: flex;
|
|
|
- align-items: flex-end;
|
|
|
- background: rgba(0, 0, 0, 0.35);
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-mask .sheet {
|
|
|
- width: 100%;
|
|
|
- border-radius: 8px 8px 0 0;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-title {
|
|
|
- margin: 0 0 14px;
|
|
|
- font-size: 17px;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-list {
|
|
|
- overflow-y: auto;
|
|
|
- max-height: 58vh;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-item {
|
|
|
- padding: 13px 0;
|
|
|
- border-bottom: 1px solid #eef0f3;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-item:last-child {
|
|
|
- border-bottom: none;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-main {
|
|
|
- font-size: 15px;
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
-
|
|
|
- .sheet-sub {
|
|
|
- margin-top: 4px;
|
|
|
- color: var(--muted);
|
|
|
- font-size: 13px;
|
|
|
- }
|
|
|
-
|
|
|
- .class-option {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- cursor: pointer;
|
|
|
- }
|
|
|
-
|
|
|
- .class-option.selected {
|
|
|
- color: var(--green);
|
|
|
- }
|
|
|
-
|
|
|
.warning-bar {
|
|
|
margin: 12px 14px 0;
|
|
|
padding: 11px 12px;
|
|
|
@@ -409,39 +347,24 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="info-row">
|
|
|
- <div class="info-label">检查时间</div>
|
|
|
- <div class="info-value">{{ todayText }}</div>
|
|
|
+ <div class="info-label">检查日期</div>
|
|
|
+ <div class="info-value">{{ inspectionDate }}</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="info-row">
|
|
|
- <div class="info-label">入学年度</div>
|
|
|
- <div class="info-value">
|
|
|
- <div class="select-cell">
|
|
|
- <ss-select
|
|
|
- v-model="form.rxnd"
|
|
|
- cb="rxnd"
|
|
|
- placeholder="入学年度"
|
|
|
- @change="onRxndChange"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="info-label">学员总人数</div>
|
|
|
+ <div class="info-value">{{ totalStudents }}</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="info-row">
|
|
|
- <div class="info-label">班级</div>
|
|
|
- <div class="info-value">
|
|
|
- <div class="select-cell">
|
|
|
- <ss-select
|
|
|
- :key="'bj-' + form.rxnd"
|
|
|
- v-model="form.bjid"
|
|
|
- :cb="form.rxnd ? 'bjByRxnd' : ''"
|
|
|
- :url="bjUrl"
|
|
|
- :filter="{cascadingLevel: 'rxnd,bjid'}"
|
|
|
- :disabled="!form.rxnd"
|
|
|
- :placeholder="form.rxnd ? '班级' : '请先选择入学年度'"
|
|
|
- @change="onBjChange"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <div class="info-label">有效应到人数</div>
|
|
|
+ <div class="info-value">{{ expectedStudents }}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="info-row">
|
|
|
+ <div class="info-label">同步班级</div>
|
|
|
+ <div class="info-value info-text">
|
|
|
+ {{ classNamesText || '当前部门暂无有效班级' }}
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -497,9 +420,10 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="score-total">
|
|
|
- <span>总分数(打分项合计)</span>
|
|
|
- <strong>{{ totalFs }}<span v-if="maxFs"> / {{ maxFs }}</span></strong>
|
|
|
+ <span>升旗礼总分</span>
|
|
|
+ <strong>{{ totalFs }}</strong>
|
|
|
</div>
|
|
|
+ <div class="formula-note">{{ formulaNote }}</div>
|
|
|
<div class="bottom-spacer"></div>
|
|
|
</div>
|
|
|
|
|
|
@@ -524,14 +448,16 @@
|
|
|
errorMsg: "",
|
|
|
warnMsg: "",
|
|
|
submitHint: "",
|
|
|
- recordsToday: 0,
|
|
|
bmmc: "",
|
|
|
jcryxm: "",
|
|
|
- todayText: "",
|
|
|
+ inspectionDate: "",
|
|
|
+ totalStudents: 0,
|
|
|
+ leaveStudents: 0,
|
|
|
+ classCount: 0,
|
|
|
+ classes: [],
|
|
|
+ formulaNote: "出勤率×25% + 队列分×20% + 风貌分×40% + 纪律分×15%",
|
|
|
jcxmList: [],
|
|
|
form: {
|
|
|
- rxnd: "",
|
|
|
- bjid: "",
|
|
|
ms: ""
|
|
|
},
|
|
|
bottomButtons: [
|
|
|
@@ -541,40 +467,34 @@
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- /**
|
|
|
- * 2026-09-29 修复「选完入学年度班级不出来」。
|
|
|
- *
|
|
|
- * 原因:码本 bjByRxnd 的 SQL 是
|
|
|
- * select BJID,MC from BJ where BJZTM!=81 and trunc(RXND,'YYYY')=trunc(:rxnd,'YYYY')
|
|
|
- * <parm name="rxnd" type="date"/>
|
|
|
- * 而平台 loadObjpOpt 在【非级联】方式下会把 objectpickerparam 里的筛选值按字符串
|
|
|
- * 绑到 SQL 参数上(ss.objp.ObjpServ.loadOptByA → ss.db.Db.doSelMapByC),
|
|
|
- * 字符串绑到 DATE 参数上 → Oracle 报
|
|
|
- * ORA-00932: expression (TRUNC(TO_NUMBER(:1),TO_NUMBER('YYYY'))) is of type NUMBER,
|
|
|
- * incompatible with expected type DATE
|
|
|
- * → 码本查询失败 → loadObjpOpt 返回「*** 页面执行时错误 ***」→ 班级下拉为空。
|
|
|
- * 入学年度能用,是因为它的码本 rxnd 是"服务型码本"(DwServ.rxnd),不走 SQL 参数绑定。
|
|
|
- *
|
|
|
- * 解法:改用平台的【级联】方式取班级 —— 带上 cascadingLevel,
|
|
|
- * 并把上级值通过 URL 的 upperValue 传给后端(PC 的 入学年度>班级 就是这么走的,
|
|
|
- * 后端在级联分支里会按参数声明的类型正确绑定日期)。只改前端,不动平台与码本。
|
|
|
- */
|
|
|
- bjUrl() {
|
|
|
- const base = "/service?ssServ=loadObjpOpt&objectpickerdropdown1=1";
|
|
|
- const y = String(this.form.rxnd || "").trim();
|
|
|
- return y ? base + "&upperValue=" + encodeURIComponent(y) : base;
|
|
|
+ expectedStudents() {
|
|
|
+ const countCodes = [3, 4, 5, 6, 7, 8];
|
|
|
+ const exempt = countCodes.reduce(
|
|
|
+ (sum, code) => sum + this.valueOfCode(code), 0);
|
|
|
+ return Math.max(0, this.valueOfCode(1) - exempt);
|
|
|
+ },
|
|
|
+ attendanceRate() {
|
|
|
+ if (this.expectedStudents <= 0)
|
|
|
+ return 0;
|
|
|
+ return Math.min(100, this.round2(
|
|
|
+ this.valueOfCode(2) * 100 / this.expectedStudents));
|
|
|
},
|
|
|
totalFs() {
|
|
|
- return this.jcxmList.reduce(
|
|
|
- (sum, item) => sum + (this.isScoreItem(item) ? Number(item.value || 0) : 0), 0);
|
|
|
+ const queueScore = this.valueOfCode(11);
|
|
|
+ const demeanorScore = this.valueOfCode(21) + this.valueOfCode(22);
|
|
|
+ const disciplineScore = this.valueOfCode(31);
|
|
|
+ return this.round2(
|
|
|
+ this.attendanceRate * 0.25
|
|
|
+ + queueScore * 0.20
|
|
|
+ + demeanorScore * 0.40
|
|
|
+ + disciplineScore * 0.15);
|
|
|
},
|
|
|
- maxFs() {
|
|
|
- return this.jcxmList.reduce(
|
|
|
- (sum, item) => sum + (this.isScoreItem(item) ? Number(item.mfz || 0) : 0), 0);
|
|
|
+ classNamesText() {
|
|
|
+ return this.classes.map((item) => item.bjmc).filter(Boolean).join("、");
|
|
|
}
|
|
|
},
|
|
|
async mounted() {
|
|
|
- this.todayText = this.formatNow();
|
|
|
+ this.inspectionDate = this.formatLocalDate(new Date());
|
|
|
// 从列表页「新增」进来时带 ?from=list:提交后直接回列表。Lin
|
|
|
try {
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
|
@@ -627,9 +547,16 @@
|
|
|
|
|
|
async loadInit() {
|
|
|
const data = await this.postService(
|
|
|
- "/service?ssServ=sqljc_mpInit&ssDest=data", {});
|
|
|
+ "/service?ssServ=sqljc_mpInit&ssDest=data",
|
|
|
+ { jcsjDate: this.inspectionDate });
|
|
|
this.bmmc = (data && data.bmmc) || "";
|
|
|
this.jcryxm = (data && data.jcryxm) || "";
|
|
|
+ this.inspectionDate = (data && data.jcsjDate) || this.inspectionDate;
|
|
|
+ this.totalStudents = Number(data && data.totalStudents || 0);
|
|
|
+ this.leaveStudents = Number(data && data.leaveStudents || 0);
|
|
|
+ this.classCount = Number(data && data.classCount || 0);
|
|
|
+ this.classes = (data && data.classes) || [];
|
|
|
+ this.formulaNote = (data && data.formulaNote) || this.formulaNote;
|
|
|
this.jcxmList = ((data && data.jcxmList) || []).map((item) => {
|
|
|
const mfz = item.mfz === null || item.mfz === undefined || item.mfz === ""
|
|
|
? null : Number(item.mfz);
|
|
|
@@ -649,6 +576,17 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ valueOfCode(code) {
|
|
|
+ const item = this.jcxmList.find(
|
|
|
+ (row) => Number(row.sqljcxmm) === Number(code));
|
|
|
+ return item ? Number(item.value || 0) : 0;
|
|
|
+ },
|
|
|
+
|
|
|
+ round2(value) {
|
|
|
+ const number = Number(value || 0);
|
|
|
+ return Math.round(number * 100) / 100;
|
|
|
+ },
|
|
|
+
|
|
|
isScoreItem(item) {
|
|
|
return item.mfz !== null && item.mfz !== undefined;
|
|
|
},
|
|
|
@@ -667,15 +605,6 @@
|
|
|
return raw && raw.ssData !== undefined ? raw.ssData : raw;
|
|
|
},
|
|
|
|
|
|
- onRxndChange(value) {
|
|
|
- this.form.rxnd = value || "";
|
|
|
- this.form.bjid = ""; // 换入学年度后清空班级,避免串档。Lin
|
|
|
- },
|
|
|
-
|
|
|
- onBjChange(value) {
|
|
|
- this.form.bjid = value || "";
|
|
|
- },
|
|
|
-
|
|
|
// 打分项显示累计扣分;人数项没有满分,不显示扣分。Lin
|
|
|
deductedFs(item) {
|
|
|
if (!this.isScoreItem(item))
|
|
|
@@ -709,12 +638,16 @@
|
|
|
},
|
|
|
|
|
|
validateForm() {
|
|
|
- if (!this.form.rxnd)
|
|
|
- return "请选择入学年度";
|
|
|
- if (!this.form.bjid)
|
|
|
- return "请选择班级";
|
|
|
+ if (!this.classCount)
|
|
|
+ return "当前部门没有有效班级";
|
|
|
if (!this.jcxmList.length)
|
|
|
return "检查项目未配置";
|
|
|
+ if (this.valueOfCode(1) <= 0)
|
|
|
+ return "学员总人数必须大于0";
|
|
|
+ if (this.expectedStudents <= 0)
|
|
|
+ return "有效应到人数必须大于0";
|
|
|
+ if (this.valueOfCode(2) > this.expectedStudents)
|
|
|
+ return "队列人数不能大于有效应到人数";
|
|
|
for (const item of this.jcxmList) {
|
|
|
const value = Number(item.value || 0);
|
|
|
if (value < 0)
|
|
|
@@ -741,7 +674,7 @@
|
|
|
this.warnMsg = "";
|
|
|
this.submitHint = "";
|
|
|
const payload = {
|
|
|
- bjid: this.form.bjid,
|
|
|
+ jcsjDate: this.inspectionDate,
|
|
|
ms: this.form.ms
|
|
|
};
|
|
|
this.jcxmList.forEach((item) => {
|
|
|
@@ -750,21 +683,20 @@
|
|
|
});
|
|
|
const result = await this.postService(
|
|
|
"/service?ssServ=sqljc_mpSubm&ssDest=data", payload);
|
|
|
- this.recordsToday = (result && result.recordsToday) || this.recordsToday + 1;
|
|
|
this.markListRefresh();
|
|
|
+ const savedCount = Number(result && result.classCount || this.classCount);
|
|
|
+ const savedScore = this.round2(result && result.zfs);
|
|
|
if (this.fromList) {
|
|
|
- // 从列表页进来的:提交完直接回列表(列表会自动刷新),与宿舍内务检查一致。Lin
|
|
|
- this.resetAfterSubmit();
|
|
|
this.warnMsg = "";
|
|
|
- this.showToast("提交成功", "success");
|
|
|
+ this.showToast("已同步" + savedCount + "个班级", "success");
|
|
|
setTimeout(() => this.goBack(), 900);
|
|
|
return;
|
|
|
}
|
|
|
- // 直接入口进来的:保留连续录入(今天已录入 N 条)。Lin
|
|
|
- this.resetAfterSubmit();
|
|
|
- this.warnMsg = "已提交,可继续录入下一个班级(今天已录入 "
|
|
|
- + this.recordsToday + " 条)";
|
|
|
- this.showToast("提交成功", "success");
|
|
|
+ this.form.ms = "";
|
|
|
+ await this.loadInit();
|
|
|
+ this.warnMsg = "保存成功:已同步" + savedCount
|
|
|
+ + "个班级,升旗礼总分" + savedScore;
|
|
|
+ this.showToast("已同步" + savedCount + "个班级", "success");
|
|
|
} catch (error) {
|
|
|
console.error("[mp_sqljc_inp] 提交失败", error);
|
|
|
this.submitHint = error && error.message ? error.message : "提交失败";
|
|
|
@@ -774,15 +706,6 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // 连续录入:保留入学年度,清空班级与说明,评分恢复默认(打分项满分、人数 0)。Lin
|
|
|
- resetAfterSubmit() {
|
|
|
- this.form.bjid = "";
|
|
|
- this.form.ms = "";
|
|
|
- this.jcxmList.forEach((item) => {
|
|
|
- item.value = Number(item.defaultValue || 0);
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
// 通知列表页刷新(回到列表时由 mp_sqljc_list.html 的 pageshow 处理读取)。Lin
|
|
|
markListRefresh() {
|
|
|
try {
|
|
|
@@ -813,13 +736,6 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- formatNow() {
|
|
|
- const now = new Date();
|
|
|
- const pad = (v) => String(v).padStart(2, "0");
|
|
|
- return now.getFullYear() + "-" + pad(now.getMonth() + 1) + "-" + pad(now.getDate())
|
|
|
- + " " + pad(now.getHours()) + ":" + pad(now.getMinutes());
|
|
|
- },
|
|
|
-
|
|
|
showToast(message, type) {
|
|
|
const toastType = type === "success" ? "success" : "error";
|
|
|
if (window.wx && window.wx.miniProgram && window.wx.miniProgram.showToast) {
|