zhangjie 8 сар өмнө
parent
commit
8f6ed15966

+ 41 - 0
src/assets/styles/pages.scss

@@ -1645,3 +1645,44 @@
     color: $--color-text-dark;
   }
 }
+
+// audit-course-outline-dialog
+.audit-course-outline-dialog {
+  .report-page {
+    padding: 50px 40px;
+    background-color: #fff;
+    height: auto;
+    color: $--color-text-dark;
+    font-size: 14px;
+
+    > h1 {
+      font-size: 20px;
+      margin-bottom: 20px;
+      text-align: center;
+      font-weight: 600;
+    }
+    .page-part {
+      margin-bottom: 30px;
+
+      > h3 {
+        font-size: 16px;
+        font-weight: 600;
+        margin-bottom: 20px;
+      }
+    }
+
+    .el-input-number .el-input__inner {
+      text-align: left;
+    }
+  }
+  .report-footer {
+    text-align: center;
+    margin-top: 20px;
+  }
+  .info-label {
+    display: inline-block;
+    vertical-align: middle;
+    width: 100px;
+    text-align: right;
+  }
+}

+ 166 - 47
src/modules/target/components/course-outline/AuditCourseOutlineDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    class="page-dialog"
+    class="page-dialog audit-course-outline-dialog"
     :visible.sync="modalIsShow"
     :title="title"
     fullscreen
@@ -10,7 +10,7 @@
     @open="visibleChange"
     @close="dialogClose"
   >
-    <div class="part-page">
+    <div class="report-page">
       <h1>{{ reportTitle }}</h1>
       <!-- 课程基本信息 -->
       <div v-if="courseBasicInfo" class="page-part">
@@ -65,6 +65,7 @@
                   :min="0"
                   :max="999"
                   :controls="false"
+                  class="width-full"
                 ></el-input-number>
               </el-form-item>
             </el-col>
@@ -77,6 +78,7 @@
                   :min="0"
                   :max="999"
                   :controls="false"
+                  class="width-full"
                 ></el-input-number>
               </el-form-item>
             </el-col>
@@ -105,7 +107,10 @@
       </div>
 
       <!-- 课程目标情况 -->
-      <div v-if="courseTargetInfo" class="page-part">
+      <div
+        v-if="courseTargetInfo && courseTargetInfo.courseEvaluateList"
+        class="page-part"
+      >
         <h3>课程目标情况</h3>
         <table class="table">
           <tr>
@@ -121,28 +126,27 @@
             <th>观测点</th>
             <th>分值</th>
           </tr>
-          <template v-for="(item, index) in courseEvaluateList">
+          <template
+            v-for="(item, index) in courseTargetInfo.courseEvaluateList"
+          >
             <tr
               v-for="(evaluate, eindex) in item.procedureEvaluateList"
               :key="`${index}-${eindex}`"
             >
-              <td
-                v-if="eindex === 0"
-                :rowspan="item.procedureEvaluateList.length"
-              >
+              <td v-if="eindex === 0" :rowspan="item.colspan">
                 {{ item.name }}
               </td>
               <td>{{ evaluate.content }}</td>
               <td>{{ evaluate.point }}</td>
               <td>{{ evaluate.score }}</td>
               <template v-if="eindex === 0">
-                <td :rowspan="item.procedureEvaluateList.length">
+                <td :rowspan="item.colspan">
                   {{ item.finalityEvaluateList[0]?.content }}
                 </td>
-                <td :rowspan="item.procedureEvaluateList.length">
+                <td :rowspan="item.colspan">
                   {{ item.finalityEvaluateList[0]?.point }}
                 </td>
-                <td :rowspan="item.procedureEvaluateList.length">
+                <td :rowspan="item.colspan">
                   {{ item.finalityEvaluateList[0]?.score }}
                 </td>
               </template>
@@ -157,19 +161,21 @@
             <td colspan="7">
               <el-row>
                 <el-col :span="12">
-                  <span>课程负责人:</span>
+                  <span class="info-label">课程负责人:</span>
                   <el-input
                     v-model="courseTargetInfo.courseManager"
                     placeholder="请输入"
                     clearable
+                    style="width: 200px"
                   ></el-input>
                 </el-col>
                 <el-col :span="12">
-                  <span>填写日期:</span>
+                  <span class="info-label">填写日期:</span>
                   <el-date-picker
                     v-model="courseTargetInfo.date"
                     type="date"
                     value-format="timestamp"
+                    style="width: 200px"
                   >
                   </el-date-picker>
                 </el-col>
@@ -198,22 +204,22 @@
           >
             <td>{{ item.index || "" }}</td>
             <td>{{ item.content }}</td>
-            <td>
+            <td style="text-align: center">
               <el-checkbox
                 v-model="item.reasonable"
                 @change="() => evaluationChange(item, 'reasonable')"
               ></el-checkbox>
             </td>
-            <td>
+            <td style="text-align: center">
               <el-checkbox
                 v-model="item.middle"
-                @change="() => evaluationChange(item, 'reasonable')"
+                @change="() => evaluationChange(item, 'middle')"
               ></el-checkbox>
             </td>
-            <td>
+            <td style="text-align: center">
               <el-checkbox
                 v-model="item.unreasonable"
-                @change="() => evaluationChange(item, 'reasonable')"
+                @change="() => evaluationChange(item, 'unreasonable')"
               ></el-checkbox>
             </td>
           </tr>
@@ -221,25 +227,36 @@
             <td colspan="5">存在的问题及建议:</td>
           </tr>
           <tr>
-            <td colspan="5"></td>
+            <td colspan="5">
+              <el-input
+                v-model.trim="rationalityEvaluation.questionAndAdvice"
+                type="textarea"
+                :autosize="{ minRows: 3, maxRows: 5 }"
+                placeholder="请输入存在的问题及建议"
+                maxlength="999"
+                show-word-limit
+              ></el-input>
+            </td>
           </tr>
           <tr>
             <td colspan="5">
               <el-row>
                 <el-col :span="12">
-                  <span>课程负责人:</span>
+                  <span class="info-label">专业负责人:</span>
                   <el-input
-                    v-model="courseTargetInfo.courseManager"
+                    v-model="rationalityEvaluation.professionalManager"
                     placeholder="请输入"
                     clearable
+                    style="width: 200px"
                   ></el-input>
                 </el-col>
                 <el-col :span="12">
-                  <span>填写日期:</span>
+                  <span class="info-label">评价日期:</span>
                   <el-date-picker
-                    v-model="courseTargetInfo.date"
+                    v-model="rationalityEvaluation.evaluateDate"
                     type="date"
                     value-format="timestamp"
+                    style="width: 200px"
                   >
                   </el-date-picker>
                 </el-col>
@@ -248,31 +265,41 @@
           </tr>
           <tr>
             <td colspan="5">
-              <el-row>
-                <el-col :span="12">
-                  <span>课程负责人:</span>
-                  <el-input
-                    v-model="courseTargetInfo.courseManager"
-                    placeholder="请输入"
-                    clearable
-                  ></el-input>
-                </el-col>
-                <el-col :span="12">
-                  <span>填写日期:</span>
-                  <el-date-picker
-                    v-model="courseTargetInfo.date"
-                    type="date"
-                    value-format="timestamp"
-                  >
-                  </el-date-picker>
-                </el-col>
-              </el-row>
+              <el-form label-width="100px">
+                <el-row>
+                  <el-col :span="12">
+                    <span class="info-label">审核人:</span>
+                    <el-input
+                      v-model="rationalityEvaluation.auditor"
+                      placeholder="请输入"
+                      clearable
+                      style="width: 200px"
+                    ></el-input>
+                  </el-col>
+                  <el-col :span="12">
+                    <span class="info-label">审核日期:</span>
+                    <el-date-picker
+                      v-model="rationalityEvaluation.auditDate"
+                      type="date"
+                      value-format="timestamp"
+                      style="width: 200px"
+                    >
+                    </el-date-picker>
+                  </el-col>
+                </el-row>
+              </el-form>
             </td>
           </tr>
         </table>
       </div>
     </div>
 
+    <div class="report-footer">
+      <el-button type="primary" :loading="loading" @click="toSubmit"
+        >提交</el-button
+      >
+    </div>
+
     <div slot="footer"></div>
   </el-dialog>
 </template>
@@ -281,7 +308,7 @@
 import {
   courseOutlineAuditReport,
   courseOutlineAuditRationalityReport,
-  // courseOutlineAuditSave,
+  courseOutlineAuditSave,
 } from "../../api";
 
 export default {
@@ -301,8 +328,9 @@ export default {
       courseBasicInfo: null,
       courseTargetInfo: null,
       rationalityEvaluation: null,
+      evaluationKeys: ["reasonable", "middle", "unreasonable"],
       audit: this.checkPrivilege("link", "audit"),
-      auditRationality: this.checkPrivilege("link", "auditRationality"),
+      auditRationality: this.checkPrivilege("link", "AuditAndRationality"),
     };
   },
   computed: {
@@ -328,15 +356,43 @@ export default {
       const { courseBasicInfo, courseTargetInfo, rationalityEvaluation } =
         res || {};
 
+      if (courseBasicInfo) {
+        courseBasicInfo.credit = courseBasicInfo.credit || undefined;
+        courseBasicInfo.period = courseBasicInfo.period || undefined;
+      }
+
       this.courseBasicInfo = courseBasicInfo;
-      this.courseTargetInfo = courseTargetInfo;
+
       this.rationalityEvaluation = rationalityEvaluation;
+
+      if (courseTargetInfo && courseTargetInfo.courseEvaluateList) {
+        courseTargetInfo.courseEvaluateList =
+          courseTargetInfo.courseEvaluateList.filter(
+            (item) =>
+              item.procedureEvaluateList.length ||
+              item.finalityEvaluateList.length
+          );
+        courseTargetInfo.courseEvaluateList.forEach((item) => {
+          if (item.procedureEvaluateList.length === 0) {
+            item.procedureEvaluateList = [
+              { content: "", point: null, score: null },
+            ];
+          }
+
+          item.colspan = Math.max(
+            item.procedureEvaluateList.length,
+            item.finalityEvaluateList.length
+          );
+        });
+      }
+      // console.log(courseTargetInfo);
+
+      this.courseTargetInfo = courseTargetInfo;
     },
     evaluationChange(evaluate, type) {
       if (!evaluate[type]) return;
 
-      const keys = ["reasonable", "middle", "unreasonable"];
-      keys
+      this.evaluationKeys
         .filter((k) => k !== type)
         .forEach((k) => {
           evaluate[k] = false;
@@ -353,6 +409,69 @@ export default {
       this.courseTargetInfo = null;
       this.rationalityEvaluation = null;
     },
+    checkData() {
+      let valid = true;
+      if (this.courseBasicInfo) {
+        valid = Object.keys(this.courseBasicInfo).every(
+          (k) => this.courseBasicInfo[k]
+        );
+
+        if (!valid) {
+          this.$message.error("请完成课程基本信息");
+          return valid;
+        }
+      }
+
+      if (this.courseTargetInfo) {
+        valid =
+          this.courseTargetInfo.courseManager && this.courseTargetInfo.date;
+        if (!valid) {
+          this.$message.error("课程目标情况");
+          return valid;
+        }
+      }
+
+      if (this.rationalityEvaluation) {
+        valid =
+          this.rationalityEvaluation.rationalityEvaluationDetailList.every(
+            (item) => {
+              return this.evaluationKeys.some((k) => item[k]);
+            }
+          );
+
+        const keys = [
+          "professionalManager",
+          "evaluateDate",
+          "auditor",
+          "auditDate",
+        ];
+        valid = valid && keys.every((k) => this.rationalityEvaluation[k]);
+
+        if (!valid) {
+          this.$message.error("合理性评价");
+          return valid;
+        }
+      }
+
+      return valid;
+    },
+    async toSubmit() {
+      if (!this.checkData()) return;
+
+      if (this.loading) return;
+      this.loading = true;
+
+      const res = await courseOutlineAuditSave({
+        courseOutlineId: this.rowData.id,
+        courseBasicInfo: this.courseBasicInfo,
+        courseTargetInfo: this.courseTargetInfo,
+        rationalityEvaluation: this.rationalityEvaluation,
+      }).catch(() => {});
+      this.loading = false;
+      if (!res) return;
+      this.$message.success("提交成功!");
+      this.cancel();
+    },
   },
 };
 </script>

+ 30 - 2
src/modules/target/views/CourseOutlineManage.vue

@@ -108,7 +108,7 @@
         <el-table-column
           class-name="action-column"
           label="操作"
-          width="180"
+          width="200"
           fixed="right"
         >
           <template slot-scope="scope">
@@ -119,6 +119,16 @@
               @click="toEdit(scope.row)"
               >编辑</el-button
             >
+            <el-button
+              v-if="
+                checkPrivilege('link', 'audit') ||
+                checkPrivilege('link', 'AuditAndRationality')
+              "
+              class="btn-primary"
+              type="text"
+              @click="toAudit(scope.row)"
+              >审核</el-button
+            >
             <el-button
               v-if="checkPrivilege('link', 'delete')"
               class="btn-danger"
@@ -164,6 +174,15 @@
       :row-data="curRow"
       @modified="getList"
     ></detail-course-outline>
+    <!-- AuditCourseOutlineDialog -->
+    <audit-course-outline-dialog
+      v-if="
+        checkPrivilege('link', 'audit') ||
+        checkPrivilege('link', 'AuditAndRationality')
+      "
+      ref="AuditCourseOutlineDialog"
+      :row-data="curRow"
+    ></audit-course-outline-dialog>
   </div>
 </template>
 
@@ -171,10 +190,15 @@
 import { courseOutlineListPage, deleteCourseOutline } from "../api";
 import ModifyCourseOutline from "../components/course-outline/ModifyCourseOutline.vue";
 import DetailCourseOutline from "../components/course-outline/DetailCourseOutline.vue";
+import AuditCourseOutlineDialog from "../components/course-outline/AuditCourseOutlineDialog.vue";
 
 export default {
   name: "course-outline-manage",
-  components: { ModifyCourseOutline, DetailCourseOutline },
+  components: {
+    ModifyCourseOutline,
+    DetailCourseOutline,
+    AuditCourseOutlineDialog,
+  },
   data() {
     return {
       filter: {
@@ -221,6 +245,10 @@ export default {
       this.curRow = row;
       this.$refs.ModifyCourseOutline.open();
     },
+    toAudit(row) {
+      this.curRow = row;
+      this.$refs.AuditCourseOutlineDialog.open();
+    },
     async toDelete(row) {
       const confirm = await this.$confirm(
         `确定要删除课程大纲【${row.outlineName}】吗?`,