lrf402788946 4 years ago
parent
commit
b2ed581551
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/views/student/index.vue

+ 9 - 1
src/views/student/index.vue

@@ -20,6 +20,9 @@
         <el-col :span="2">
           <el-button type="danger" size="mini" :disabled="batchdet.length <= 0" @click="batchdelete">批量删除</el-button>
         </el-col>
+        <el-col :span="2">
+          <el-button type="primary" size="mini" :disabled="form.classid ? false : true" @click="toComputIsFine">设置本班优秀学员</el-button>
+        </el-col>
       </el-row>
       <data-table :fields="fields" @handleSelect="handleSelect" :select="true" :data="list" :opera="opera" @turnClass="toTurnClass" @edit="toEdit"></data-table>
     </list-frame>
@@ -109,7 +112,7 @@ export default {
   computed: { ...mapState(['user', 'defaultOption']) },
   methods: {
     ...trainplan({ planfetch: 'fetch' }),
-    ...mapActions(['query', 'delete', 'update', 'removeAll']),
+    ...mapActions(['query', 'delete', 'update', 'removeAll', 'computedIsFine']),
     ...classes({ classesquery: 'query' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
       const res = await this.query({ skip, limit, termid: this.form.termid, classid: this.form.classid });
@@ -171,6 +174,11 @@ export default {
         this.toClose();
       }
     },
+    // 计算优秀学员
+    async toComputIsFine() {
+      const res = await this.computedIsFine(this.defaultOption.classid);
+      if (this.$checkRes(res, '优秀学员设置成功', res.errmsg || '优秀学员设置失败')) this.search();
+    },
     toClose() {
       this.dialog = false;
       this.form = {};