Эх сурвалжийг харах

1.考试安排(新增批量修改人数功能弹窗)2.fix:修复模考试卷总分问题

xiexaing 1 жил өмнө
parent
commit
dab5c5c424

+ 9 - 1
src/newApi/examapply.js

@@ -174,4 +174,12 @@ export default {
             data
         })
     },
-}
+    // 考试安排(修改考场人数)
+    editPeopleNum(data) {
+        return request({
+            url: '/system/apply/update/applyNum',
+            method: 'post',
+            data
+        })
+    },
+}

+ 75 - 4
src/views/education/examManagement/examArrangement/index.vue

@@ -1,6 +1,7 @@
 <template>
   <div id="examArrangement">
     <table-list
+      ref="tableList"
       :tableSets="tableSet"
       :tableData="tableData"
       :navText="navText"
@@ -12,11 +13,14 @@
         <el-button size="medium" type="warning" @click="setExamAdress"
           >配置考试地点</el-button
         >
+        <el-button size="medium" type="primary" @click="openPeopleNumDialog"
+          >批量修改人数</el-button
+        >
       </template>
       <template slot="btn" slot-scope="props">
-        <el-button type="text" @click="beforeFunc(props.scope.row)"
+        <!-- <el-button type="text" @click="beforeFunc(props.scope.row)"
           >前培设置</el-button
-        >
+        > -->
         <el-button
           type="text"
           @click="addClick(props.scope.row, 0)"
@@ -29,12 +33,12 @@
           :disabled="props.scope.row.status === 1"
           >考点设置</el-button
         >
-        <el-button
+        <!-- <el-button
           type="text"
           @click="setExams(props.scope.row, 2)"
           :disabled="props.scope.row.status === 1"
           >考培设置</el-button
-        >
+        > -->
         <el-button
           type="text"
           @click="editGoods(props.scope.row)"
@@ -680,6 +684,44 @@
         <el-button @click="dialogExamSync = false">取 消</el-button>
       </span>
     </el-dialog>
+    <!-- 修改人数弹窗 -->
+    <el-dialog
+      @closed="loadingClose"
+      :visible.sync="isPeopleNumDialog"
+      width="500px"
+      :show-close="false"
+      :close-on-click-modal="false"
+    >
+      <div slot="title" class="hearders">
+          <div class="leftTitle">修改人数</div>
+      </div>
+      <div>
+        <el-form
+          label-position="right"
+          label-width="150px"
+          :model="peopleNumDate"
+          :rules="peopleRules"
+          ref="peopleNum"
+        >
+          <el-form-item label="人数" prop="num">
+            <el-input-number
+                  v-model="peopleNumDate.num"
+                  :min="0"
+                  :controls="false"
+            ></el-input-number>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="isPeopleNumDialog = false">取 消</el-button>
+        <el-button
+          type="primary"
+          :loading="disabledBtn"
+          @click="handlePeopleNum"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
     <before-page ref="beforePage" />
     <applicable-products ref="applicableProducts" />
     <downMaterial ref="downMaterial" />
@@ -718,6 +760,9 @@ export default {
       pageSize2: 10,
       currentPage2: 1,
       loading: false, //当前表单加载是否加载动画
+      isPeopleNumDialog: false,
+      peopleRules: { num: [{ required: true, message: "请输入", trigger: "blur" }]},
+      peopleNumDate: {},
       navText: {
         title: "考试安排",
         index: 0,
@@ -902,6 +947,32 @@ export default {
       link.click();
       link.remove();
     },
+    // 打开修改人数弹窗
+    openPeopleNumDialog() {
+      if (!this.$refs.tableList.allCheckData.length) {
+        this.$message.warning("请选中选项!")
+        return
+      }
+      this.isPeopleNumDialog = true
+      this.peopleNumDate.num = 0
+      this.peopleNumDate.applyIds = this.$refs.tableList.allCheckData.map(item => item.applyId)
+    },
+    // 保存修改人数
+    handlePeopleNum() {
+      this.isPeopleNumDialog = false
+      this.$refs['peopleNum'].validate((valid) => {
+        if (valid) {
+          this.$api.editPeopleNum(this.peopleNumDate).then(res => {
+            this.$message.success("修改人数成功");
+            this.search();
+          }).finally(() => {
+            console.log('error submit!')
+          })
+        } else {
+          return false;
+        }
+      });
+    },
     //下载资料
     downMaterial(row) {
       this.$refs.downMaterial.openBox(row);

+ 2 - 2
src/views/education/mockTestManagement/mockTestData/recordQusetion/index.vue

@@ -328,7 +328,7 @@ export default {
           this.$set(
             this.getInfoRecord.historyExamJson[index],
             "scoreResult",
-            value
+            Number(value)
           );
         })
         .catch(() => {});
@@ -374,7 +374,7 @@ export default {
             data.historyExamJson[i].type === 5) &&
           data.historyExamJson[i].scoreResult
         ) {
-          data.score += data.historyExamJson[i].scoreResult;
+          data.score += Number(data.historyExamJson[i].scoreResult);
         }
       }
       data.historyExamJson = JSON.stringify(data.historyExamJson);