lrf402788946 4 年之前
父節點
當前提交
8e917f5f89
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/views/train-plan/bedroom.vue

+ 9 - 1
src/views/train-plan/bedroom.vue

@@ -38,7 +38,7 @@
             <template v-slot="{ row }">
               <el-row>
                 <el-col v-for="(i, index) in row.list" :key="index" :span="6">
-                  <el-checkbox :label="i.id">
+                  <el-checkbox :label="i.id" :disabled="checkSelect(i)">
                     <el-link :type="i.gender.includes('男') ? 'primary' : 'success'">{{ i.name }}({{ i.gender }})</el-link>
                   </el-checkbox>
                 </el-col>
@@ -222,6 +222,14 @@ export default {
       const r = this.ostuList.filter(f => f.gender.includes(gender));
       return r.length;
     },
+    // 性别多选过滤
+    checkSelect(i) {
+      if (this.stuList.length > 0) {
+        const h = _.head(this.stuList);
+        const stu = this.ostuList.find(f => f._id === h);
+        if (stu) return !i.gender.includes(stu.gender);
+      } else return false;
+    },
   },
   watch: {
     defaultOption: {