Przeglądaj źródła

feat: 培养方案细节修改

zhangjie 1 rok temu
rodzic
commit
a2b6195c9c

+ 38 - 65
src/modules/target/components/course-examine/CourseExamineWeight.vue

@@ -8,41 +8,29 @@
           width="200"
           fixed="left"
         ></el-table-column>
-        <el-table-column
-          v-for="(column, cindex) in columns"
-          :key="cindex"
-          :label="column"
-        >
-          <template slot-scope="scope">
-            <el-input-number
-              v-model="scope.row.evaluationList[cindex].weight"
-              class="width-50"
-              size="small"
-              :min="0"
-              :max="100"
-              :step="1"
-              step-strictly
-              :controls="false"
-            >
-            </el-input-number>
-            <span style="margin-left: 5px">%</span>
-          </template>
+        <el-table-column label="考核项目及比例(%)">
+          <el-table-column
+            v-for="(column, cindex) in columns"
+            :key="cindex"
+            :label="column"
+          >
+            <template slot-scope="scope">
+              <el-input-number
+                v-model="scope.row.evaluationList[cindex].weight"
+                class="width-50"
+                size="small"
+                :min="0"
+                :max="100"
+                :step="1"
+                step-strictly
+                :controls="false"
+                @change="weightChange"
+              >
+              </el-input-number>
+            </template>
+          </el-table-column>
         </el-table-column>
-        <el-table-column label="目标整体权重" prop="totalWeight">
-          <template slot-scope="scope">
-            <el-input-number
-              v-model="scope.row.totalWeight"
-              class="width-50"
-              size="small"
-              :min="0"
-              :max="100"
-              :step="1"
-              step-strictly
-              :controls="false"
-            >
-            </el-input-number>
-            <span style="margin-left: 5px">%</span>
-          </template>
+        <el-table-column label="权重(%)" prop="totalWeight">
         </el-table-column>
       </el-table>
       <div class="text-center">
@@ -56,8 +44,7 @@
         <p>
           1.课程目标评价依据来源于平时成绩和期末考试成绩二部分,请录入平时成绩,期末成绩整体权重及各目标的权重;
         </p>
-        <p>2.各课程目标下选择评价方式总权重应等于100%;</p>
-        <p>3.目标整体权重应等于100%,用于计算课程整体达成度。</p>
+        <p>2.目标整体权重应等于100%,用于计算课程整体达成度。</p>
       </div>
     </div>
   </div>
@@ -109,14 +96,17 @@ export default {
         (item) => item.evaluationName
       );
     },
+    weightChange() {
+      this.dataList.forEach((item, tindex) => {
+        item.totalWeight = calcSum(
+          item.evaluationList.map((item) => item.weight || 0)
+        );
+      });
+    },
     checkDataList() {
       if (!this.dataList.length) return;
 
       // 目标整体权重
-      if (this.dataList.some((item) => !item.totalWeight)) {
-        this.$message.error("请设置所有目标的目标整体权重");
-        return;
-      }
       const totalWeight = calcSum(
         this.dataList.some((item) => item.totalWeight || 0)
       );
@@ -125,23 +115,6 @@ export default {
         return;
       }
 
-      // 目标权重统计
-      const unvalidTargets = [];
-      this.dataList.forEach((item, tindex) => {
-        const totalWeight = calcSum(
-          item.evaluationList.map((item) => item.weight || 0)
-        );
-        if (totalWeight !== 100) {
-          unvalidTargets.push(item.courseTargetName);
-        }
-      });
-      if (unvalidTargets.length) {
-        this.$message.error(
-          `${unvalidTargets.join()}评价方式权重合计不等于100%`
-        );
-        return;
-      }
-
       return true;
     },
     async submit() {
@@ -170,17 +143,17 @@ export default {
         }
 
         if (index === lastNo) {
-          sums[index] =
-            calcSum(this.dataList.map((item) => item.totalWeight || 0)) + "%";
+          sums[index] = calcSum(
+            this.dataList.map((item) => item.totalWeight || 0)
+          );
           return;
         }
 
-        sums[index] =
-          calcSum(
-            this.dataList.map(
-              (item) => item.evaluationList[index - 1].weight || 0
-            )
-          ) + "%";
+        sums[index] = calcSum(
+          this.dataList.map(
+            (item) => item.evaluationList[index - 1].weight || 0
+          )
+        );
       });
       return sums;
     },

+ 14 - 1
src/modules/target/components/training-plan/TrainingPlanCourseMatrix.vue

@@ -30,10 +30,23 @@
             <el-table-column
               v-for="subr in column.subRequirements"
               :key="subr.name"
-              :label="subr.name === 'null' ? '' : subr.name"
               align="center"
               :prop="`${column.name}_${subr.name}`"
             >
+              <template slot="header">
+                <span v-if="subr.name === 'null'"></span>
+                <template v-else>
+                  <span>{{ subr.name }}</span>
+                  <el-tooltip
+                    v-if="subr.content"
+                    :content="subr.content"
+                    effect="dark"
+                    placement="top"
+                  >
+                    <i class="el-icon-info ml-1"></i>
+                  </el-tooltip>
+                </template>
+              </template>
               <template slot-scope="scope">
                 <el-input-number
                   v-if="scope.row.canEdit"

+ 10 - 0
src/modules/target/components/training-plan/TrainingPlanRequirement.vue

@@ -132,6 +132,16 @@ export default {
       this.$emit("update-detail");
     },
     async toDeleteNode(row) {
+      if (row.parentId) {
+        const parentRow = this.dataList.find(
+          (item) => item.id === row.parentId
+        );
+        if (parentRow.children.length <= 1) {
+          this.$message.error("当前毕业要求必须有一个指标点!");
+          return;
+        }
+      }
+
       const confirm = await this.$confirm(
         `确定要删除 ${row.parentName} 【${row.label}】吗?`,
         "提示",