lrf402788946 4 роки тому
батько
коміт
4aeacb77cc
1 змінених файлів з 11 додано та 1 видалено
  1. 11 1
      parts/print/certCard.vue

+ 11 - 1
parts/print/certCard.vue

@@ -5,7 +5,7 @@
         <el-col :span="24">
           <el-col :span="24" style="margin:15px 0;">
             <el-button type="primary" size="mini" @click="clickView()"> 打印预览</el-button>
-            <el-button type="primary" size="mini" @click="toComputIsFine()" :disabled="this.defaultOption.classid ? false : true">设置优秀学员</el-button>
+            <el-button type="primary" size="mini" @click="toComputIsFine()" :disabled="canSetFine()">设置优秀学员</el-button>
           </el-col>
           <el-col :span="24">
             <data-table :fields="fields" :select="true" @handleSelect="handleSelect" :data="list" :opera="opera" :usePage="false"></data-table>
@@ -74,6 +74,7 @@ export default {
     enddate: { type: String },
     classname: { type: String },
     term: { type: String },
+    classid: { type: String },
   },
   components: { dataTable },
   data: function() {
@@ -157,6 +158,15 @@ export default {
     //   if (num < 10) return '0' + num;
     //   else return index;
     // },
+    // 判断是否可以设置优秀学员
+    canSetFine() {
+      let classid = _.get(this.defaultOption, 'classid');
+      if (!classid) {
+        classid = this.classid;
+        if (!classid) return true;
+      }
+      return false;
+    },
   },
   computed: {
     ...mapState(['user', 'defaultOption']),