Browse Source

fix(mp): restore class selection for flag ceremony check

apple 4 ngày trước cách đây
mục cha
commit
5fdbd7485f
2 tập tin đã thay đổi với 76 bổ sung và 44 xóa
  1. 3 3
      web/cfg/biz/bjpj/sqljc.serv.xml
  2. 73 41
      web/page/mp/mp_sqljc_inp.html

+ 3 - 3
web/cfg/biz/bjpj/sqljc.serv.xml

@@ -24,9 +24,9 @@
 			</serv>
 
 			<!-- 2026-09-24 小程序(移动端)专用服务,参照 宿舍内务检查 ssnwjc_mpXxx。Lin -->
-			<!-- 2026-11-25 移动端与 PC 端统一按登录人部门评分,并逐班生成记录。 -->
-			<serv name="sqljc_mpInit" desc="移动端初始化部门批量评分" clazz="biz.bjpj.SqljcServ" func="deptInitByA"/>
-			<serv name="sqljc_mpSubm" desc="移动端保存部门批量评分" clazz="biz.bjpj.SqljcServ" func="deptSaveByA"/>
+			<!-- 2026-11-27 小程序恢复为单班级录入;PC 端继续使用部门批量评分。 -->
+			<serv name="sqljc_mpInit" desc="移动端初始化升旗礼检查" clazz="biz.bjpj.SqljcMpServ" func="initByA"/>
+			<serv name="sqljc_mpSubm" desc="移动端提交升旗礼检查" clazz="biz.bjpj.SqljcMpServ" func="submAddByA"/>
 			<!-- 2026-09-29 移动端列表与详情,参照 ssnwjc_mpList / ssnwjc_mpPlay。Lin -->
 			<serv name="sqljc_mpList" desc="移动端升旗礼检查列表" clazz="biz.bjpj.SqljcMpServ" func="listByA"/>
 			<serv name="sqljc_mpPlay" desc="移动端升旗礼检查详情" clazz="biz.bjpj.SqljcMpServ" func="playByA"/>

+ 73 - 41
web/page/mp/mp_sqljc_inp.html

@@ -117,6 +117,16 @@
       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;
@@ -336,11 +346,6 @@
 
     <div class="page-content">
       <div class="info-table">
-        <div class="info-row">
-          <div class="info-label">部门</div>
-          <div class="info-value">{{ bmmc || '—' }}</div>
-        </div>
-
         <div class="info-row">
           <div class="info-label">检查人</div>
           <div class="info-value">{{ jcryxm || '—' }}</div>
@@ -352,19 +357,34 @@
         </div>
 
         <div class="info-row">
-          <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">{{ expectedStudents }}</div>
+          <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>
 
         <div class="info-row">
-          <div class="info-label">同步班级</div>
-          <div class="info-value info-text">
-            {{ classNamesText || '当前部门暂无有效班级' }}
+          <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=""
+                  @change="onBjChange"
+              />
+            </div>
           </div>
         </div>
 
@@ -448,16 +468,15 @@
           errorMsg: "",
           warnMsg: "",
           submitHint: "",
+          recordsToday: 0,
           bmmc: "",
           jcryxm: "",
           inspectionDate: "",
-          totalStudents: 0,
-          leaveStudents: 0,
-          classCount: 0,
-          classes: [],
           formulaNote: "出勤率×25% + 队列分×20% + 风貌分×40% + 纪律分×15%",
           jcxmList: [],
           form: {
+            rxnd: "",
+            bjid: "",
             ms: ""
           },
           bottomButtons: [
@@ -467,6 +486,11 @@
         };
       },
       computed: {
+        bjUrl() {
+          const base = "/service?ssServ=loadObjpOpt&objectpickerdropdown1=1";
+          const year = String(this.form.rxnd || "").trim();
+          return year ? base + "&upperValue=" + encodeURIComponent(year) : base;
+        },
         expectedStudents() {
           const countCodes = [3, 4, 5, 6, 7, 8];
           const exempt = countCodes.reduce(
@@ -489,9 +513,6 @@
               + demeanorScore * 0.40
               + disciplineScore * 0.15);
         },
-        classNamesText() {
-          return this.classes.map((item) => item.bjmc).filter(Boolean).join("、");
-        }
       },
       async mounted() {
         this.inspectionDate = this.formatLocalDate(new Date());
@@ -547,16 +568,9 @@
 
         async loadInit() {
           const data = await this.postService(
-              "/service?ssServ=sqljc_mpInit&ssDest=data",
-              { jcsjDate: this.inspectionDate });
+              "/service?ssServ=sqljc_mpInit&ssDest=data", {});
           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);
@@ -591,6 +605,15 @@
           return item.mfz !== null && item.mfz !== undefined;
         },
 
+        onRxndChange(value) {
+          this.form.rxnd = value || "";
+          this.form.bjid = "";
+        },
+
+        onBjChange(value) {
+          this.form.bjid = value || "";
+        },
+
         async postService(url, data) {
           const req = this.getRequest();
           if (!req || typeof req.post !== "function")
@@ -638,8 +661,10 @@
         },
 
         validateForm() {
-          if (!this.classCount)
-            return "当前部门没有有效班级";
+          if (!this.form.rxnd)
+            return "请选择入学年度";
+          if (!this.form.bjid)
+            return "请选择班级";
           if (!this.jcxmList.length)
             return "检查项目未配置";
           if (this.valueOfCode(1) <= 0)
@@ -674,7 +699,7 @@
             this.warnMsg = "";
             this.submitHint = "";
             const payload = {
-              jcsjDate: this.inspectionDate,
+              bjid: this.form.bjid,
               ms: this.form.ms
             };
             this.jcxmList.forEach((item) => {
@@ -683,20 +708,19 @@
             });
             const result = await this.postService(
                 "/service?ssServ=sqljc_mpSubm&ssDest=data", payload);
+            this.recordsToday = Number(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) {
+              this.resetAfterSubmit();
               this.warnMsg = "";
-              this.showToast("已同步" + savedCount + "个班级", "success");
+              this.showToast("提交成功", "success");
               setTimeout(() => this.goBack(), 900);
               return;
             }
-            this.form.ms = "";
-            await this.loadInit();
-            this.warnMsg = "保存成功:已同步" + savedCount
-                + "个班级,升旗礼总分" + savedScore;
-            this.showToast("已同步" + savedCount + "个班级", "success");
+            this.resetAfterSubmit();
+            this.warnMsg = "已提交,可继续录入下一个班级(今天已录入 "
+                + this.recordsToday + " 条)";
+            this.showToast("提交成功", "success");
           } catch (error) {
             console.error("[mp_sqljc_inp] 提交失败", error);
             this.submitHint = error && error.message ? error.message : "提交失败";
@@ -706,6 +730,14 @@
           }
         },
 
+        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 {