فهرست منبع

王子文 专项培养
1) 导师反馈每条培养计划时根据学员提供的学习反馈资料判断该条学习状态是否通过,反馈Comment 变富文本框,可插入图片

wangggziwen 3 سال پیش
والد
کامیت
f1979a75a5
2فایلهای تغییر یافته به همراه78 افزوده شده و 91 حذف شده
  1. 1 19
      ui/src/views/training/spec/myplan/index.vue
  2. 77 72
      ui/src/views/training/spec/plan/index.vue

+ 1 - 19
ui/src/views/training/spec/myplan/index.vue

@@ -26,7 +26,7 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-circle-check"
+            icon="el-icon-chat-dot-round"
             v-hasPermi="['spec:plan:edit']"
             @click="handleFeedback(scope.row)"
             v-if="scope.row.studyState == 0"
@@ -340,23 +340,18 @@ export default {
         return "background: #FFEEEE"
       }
     },
-
     /** 反馈按钮处理 */
     handleFeedback(row) {
       this.feedbackParams = {};
-
       let feedback1 = {};
       feedback1.planId = row.id;
       feedback1.questionId = 1;
-
       let feedback2 = {};
       feedback2.planId = row.id;
       feedback2.questionId = 2;
-
       let feedback3 = {};
       feedback3.planId = row.id;
       feedback3.questionId = 3;
-
       getAnswerByPlanIdAndQuestionId(feedback1).then(response => {
         let data = response.data;
         if (data != null) {
@@ -379,26 +374,20 @@ export default {
         this.feedbackDialog.open = true;
       });
     },
-
     /** 提交反馈处理 */
     handleSubmitFeedback() {
-      // 打包数据
       let feedback1 = {};
       feedback1.planId = this.planId;
       feedback1.questionId = 1;
       feedback1.answer = this.feedbackParams.answer1;
-
       let feedback2 = {};
       feedback2.planId = this.planId;
       feedback2.questionId = 2;
       feedback2.answer = this.feedbackParams.answer2;
-
       let feedback3 = {};
       feedback3.planId = this.planId;
       feedback3.questionId = 3;
       feedback3.answer = this.feedbackParams.answer3;
-
-      // 保存数据
       getAnswerByPlanIdAndQuestionId(feedback1).then(response => {
         let data = response.data;
         if (data != null) {
@@ -408,7 +397,6 @@ export default {
           addAnswer(feedback1);
         }
       });
-
       getAnswerByPlanIdAndQuestionId(feedback2).then(response => {
         let data = response.data;
         if (data != null) {
@@ -418,7 +406,6 @@ export default {
           addAnswer(feedback2);
         }
       });
-
       getAnswerByPlanIdAndQuestionId(feedback3).then(response => {
         let data = response.data;
         if (data != null) {
@@ -428,14 +415,9 @@ export default {
           addAnswer(feedback3);
         }
       });
-
-      // 隐藏对话框
       this.feedbackDialog.open = false;
-
-      // 提示
       this.msgSuccess("保存成功");
     },
-
     /** 文件下载处理 */
     handleDownload(row) {
       var name = row.fileName;

+ 77 - 72
ui/src/views/training/spec/plan/index.vue

@@ -239,10 +239,10 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleComment(scope.row)"
+            icon="el-icon-chat-dot-round"
+            @click="handleFeedback(scope.row)"
             v-hasPermi="['spec:plan:edit']"
-          >查看</el-button>
+          >反馈</el-button>
           <el-button
             size="mini"
             type="text"
@@ -425,10 +425,10 @@
         <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
       </div>
     </el-dialog>
-    <!-- 评价对话框 -->
-    <el-dialog v-dialogDrag :title="comment.title" :visible.sync="comment.open" width="800px" append-to-body>
+    <!-- 反馈对话框 -->
+    <el-dialog v-dialogDrag :title="feedbackDialog.title" :visible.sync="feedbackDialog.open" width="800px" append-to-body>
       <div style="width:700px; margin:0px auto;">
-        <h3 style="margin-bottom:20px;text-align:center;">学心得</h3>
+        <h3 style="margin-bottom:20px;text-align:center;">学心得</h3>
         <el-table :data="tableData" border style="width: 100%">
           <el-table-column prop="id" label="编号" width="50"></el-table-column>
           <el-table-column prop="question" label="问题" width="250"></el-table-column>
@@ -471,12 +471,12 @@
         <h3 style="margin-top:30px;margin-bottom:20px;text-align:center;">导师反馈</h3>
         <el-form>
           <el-form-item>
-            <editor :min-height="192"/>
+            <editor v-model="feedbackParams.mentorFeedback" :min-height="192"/>
           </el-form-item>
         </el-form>
         <div style="text-align:center;">
-          <el-button @click="handleAddComment()" type="success" size="medium" style="margin-right:25px;">{{ $t('通 过') }}</el-button>
-          <el-button @click="comment.open = false" type="danger" size="medium">{{ $t('驳 回') }}</el-button>
+          <el-button @click="handleApprove()" type="success" size="medium" style="margin-right:25px;">{{ $t('通 过') }}</el-button>
+          <el-button @click="handleReject()" type="danger" size="medium">{{ $t('驳 回') }}</el-button>
         </div>
       </div>
     </el-dialog>
@@ -485,9 +485,22 @@
 </template>
 
 <script>
-import { getFeedback} from "@/api/training/spec/planfeedback";
-import { getPlan,listPlanByYearId, delPlan, addPlan, updatePlan, updatePlan2, exportPlan, importTemplate, listSuccessorsByMentorId, listPlanByMentorId } from "@/api/training/spec/plan";
-import { allFileList, delCommonfile } from "@/api/common/commonfile";
+import { addFeedback } from "@/api/training/spec/feedback";
+import { getAnswerByPlanIdAndQuestionId } from "@/api/training/spec/answer";
+import { 
+  getPlan,
+  listPlanByYearId, 
+  delPlan, 
+  addPlan, 
+  updatePlan, 
+  updatePlan2, 
+  exportPlan, 
+  importTemplate, 
+} from "@/api/training/spec/plan";
+import { 
+  allFileList, 
+  delCommonfile 
+} from "@/api/common/commonfile";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import PlanApprove from "./plan-approve"
@@ -505,12 +518,10 @@ export default {
   },
   data() {
     return {
-      // 评论参数
-      commentParams: {
-        id: 0,
-        score: null,
-        overallComment: "",
-        studyState: 2
+      // 反馈参数
+      feedbackParams: {
+        id: null,
+        mentorFeedback: null
       },
       showMonths:[],
       minDay:"", // 最小日期
@@ -523,8 +534,8 @@ export default {
         // 弹出层标题(报告附件)
         title: ""
       },
-      // 评价参数
-      comment: {
+      // 反馈对话框参数
+      feedbackDialog: {
         id: 0,
         // 是否显示弹出层(报告附件)
         open: false,
@@ -716,14 +727,15 @@ export default {
     this.getDicts("spec_training_approve_status").then(response => {
       this.approveStatusOptions = response.data;
     });
-    this.getSuccessorOptions();
   },
   methods: {
-    // 单元格样式
+    /** 单元格样式 */
     tableCellStyle (row, column, rowIndex, columnIndex) {
+      // 超时学习突出显示
       if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
         return "background: #FFEEEE"
       }
+      // 修改过的计划突出显示
       if (row.column.label === "修改人" && row.row.updateBy!=null) {
         return "background: #FFFFDB"
       }
@@ -731,49 +743,54 @@ export default {
         return "background: #FFFFDB"
       }
     },
-    /** 评价提交处理 */
-    handleAddComment() {
-      this.commentParams.id = this.comment.id;
-      updatePlan2(this.commentParams).then(response => {
-        this.comment.open = false;
-        this.msgSuccess("已结束学习");
-        this.getList();
+    /** 通过处理 */
+    handleApprove() {
+      this.feedbackParams.planId = this.feedbackDialog.id;
+      addFeedback(this.feedbackParams).then(response => {
+        // 后期需要发邮件通知学员
+        this.feedbackDialog.open = false;
       });
     },
-    /** 查看培训详情处理 */
-    handleDetail(row) {
-      this.tableData = [];
-      this.detail.id = row.id;
-      this.detail.title = row.plantName + this.$t('详情');
-      this.detail.open = true;
-      getFeedback(row.id).then(response => {
-        let feedbackObject = response.data;
-        let data1 = { id: 1, question: feedbackObject.question1, answer: feedbackObject.answer1};
-        let data2 = { id: 2, question: feedbackObject.question2, answer: feedbackObject.answer2};
-        let data3 = { id: 3, question: feedbackObject.question3, answer: feedbackObject.answer3};
-        this.tableData.push(data1);
-        this.tableData.push(data2);
-        this.tableData.push(data3);
-      });
-      getPlan(row.id).then(response => {
-        this.commentParams.score = response.data.score;
-        this.commentParams.overallComment = response.data.overallComment;
+    /** 驳回处理 */
+    handleReject() {
+      this.feedbackParams.planId = this.feedbackDialog.id;
+      addFeedback(this.feedbackParams).then(response => {
+        // 后期需要发邮件通知学员
+        this.feedbackDialog.open = false;
       });
     },
-    /** 评价处理 */
-    handleComment(row) {
+    /** 反馈处理 */
+    handleFeedback(row) {
       this.tableData = [];
-      this.comment.id = row.id;
-      this.comment.title = row.staffName + " " + row.plantName + " " + this.$t('学习情况');
-      this.comment.open = true;
-      getFeedback(row.id).then(response => {
-        let feedbackObject = response.data;
-        let data1 = { id: 1, question: feedbackObject.question1, answer: feedbackObject.answer1};
-        let data2 = { id: 2, question: feedbackObject.question2, answer: feedbackObject.answer2};
-        let data3 = { id: 3, question: feedbackObject.question3, answer: feedbackObject.answer3};
-        this.tableData.push(data1);
-        this.tableData.push(data2);
-        this.tableData.push(data3);
+      let feedback1 = {};
+      feedback1.planId = row.id;
+      feedback1.questionId = 1;
+      let feedback2 = {};
+      feedback2.planId = row.id;
+      feedback2.questionId = 2;
+      let feedback3 = {};
+      feedback3.planId = row.id;
+      feedback3.questionId = 3;
+      let answerObj1 = {};
+      let answerObj2 = {};
+      let answerObj3 = {};
+      getAnswerByPlanIdAndQuestionId(feedback1).then(response => {
+        let data = response.data;
+        answerObj1 = { id: feedback1.questionId, question: data.question, answer: data.answer};
+        return getAnswerByPlanIdAndQuestionId(feedback2);
+      }).then(response => {
+        let data = response.data;
+        answerObj2 = { id: feedback2.questionId, question: data.question, answer: data.answer};
+        return getAnswerByPlanIdAndQuestionId(feedback3);
+      }).then(response => {
+        let data = response.data;
+        answerObj3 = { id: feedback3.questionId, question: data.question, answer: data.answer};
+        this.tableData.push(answerObj1);
+        this.tableData.push(answerObj2);
+        this.tableData.push(answerObj3);
+        this.feedbackDialog.id = row.id;
+        this.feedbackDialog.title = row.staffName + " " + row.plantName + " " + this.$t('学习情况');
+        this.feedbackDialog.open = true;
       });
     },
     /** 文件下载处理 */
@@ -837,18 +854,6 @@ export default {
         this.msgSuccess(this.$t('删除成功'));
       })
     },
-    /** 查询学员下拉列表 */
-    getSuccessorOptions() {
-      listSuccessorsByMentorId(this.queryObject).then(response => {
-        let successorList = response.data;
-        for (let i = 0; i < successorList.length; i++) {
-          let successor = {};
-          successor.key = successorList[i].staffId;
-          successor.value = successorList[i].staffName;
-          this.successorOptions.push(successor);
-        }
-      });
-    },
     /** 查询培训计划列表 */
     getList() {
       this.loading = true;