zhangjie преди 3 години
родител
ревизия
f30f60b0aa

+ 11 - 1
src/components/base/ClazzSelect.vue

@@ -40,6 +40,7 @@ export default {
     styles: { type: String, default: "" },
     clearable: { type: Boolean, default: true },
     multiple: { type: Boolean, default: false },
+    campusId: { type: String, default: "" },
     datas: {
       type: Array
     }
@@ -68,6 +69,13 @@ export default {
         });
         this.labelChange();
       }
+    },
+    campusId(val, oldval) {
+      if (val !== oldval) {
+        this.search();
+        this.$emit("input", "");
+        this.$emit("change", null);
+      }
     }
   },
   created() {
@@ -75,7 +83,9 @@ export default {
   },
   methods: {
     async search() {
-      const res = await clazzQuery();
+      const res = await clazzQuery({
+        campusId: this.campusId
+      });
       this.optionList = res || [];
       this.labelChange();
     },

+ 11 - 2
src/components/base/CourseSelect.vue

@@ -31,7 +31,8 @@ export default {
     value: { type: [Number, String], default: "" },
     styles: { type: String, default: "" },
     clearable: { type: Boolean, default: true },
-    printPlanId: { type: [String, Array], default: "" }
+    printPlanId: { type: [String, Array], default: "" },
+    teachingRoomId: { type: [String, Array], default: "" }
   },
   data() {
     return {
@@ -52,6 +53,13 @@ export default {
         this.$emit("input", "");
         this.$emit("change", {});
       }
+    },
+    teachingRoomId(val, oldval) {
+      if (val !== oldval) {
+        this.search("");
+        this.$emit("input", "");
+        this.$emit("change", {});
+      }
     }
   },
   async created() {
@@ -61,7 +69,8 @@ export default {
     async search(query) {
       const res = await courseQuery({
         param: query,
-        printPlanId: this.printPlanId
+        printPlanId: this.printPlanId,
+        teachingRoomId: this.teachingRoomId
       });
       this.optionList = res;
     },

+ 0 - 4
src/components/base/TeachingRoomSelect.vue

@@ -47,7 +47,6 @@ export default {
   },
   created() {
     this.search();
-    console.log("create");
   },
   methods: {
     async search() {
@@ -61,9 +60,6 @@ export default {
         this.optionList.find(item => item.id === this.selected)
       );
     }
-  },
-  beforeDestroy() {
-    console.log("before destory");
   }
 };
 </script>

+ 0 - 9
src/mixins/common.js

@@ -1,5 +1,3 @@
-import { pickByNotNull } from "@/plugins/utils";
-
 export default {
   methods: {
     deletePageLastItem() {
@@ -20,13 +18,6 @@ export default {
       const current = this.current || 1;
       const size = this.size || 10;
       return (current - 1) * size + index + 1;
-    },
-    getHeadIds() {
-      return pickByNotNull({
-        orgId: this.$ls.get("orgId"),
-        schoolId: this.$ls.get("schoolId"),
-        userId: this.$ls.get("user", { id: "" }).id
-      });
     }
   }
 };

+ 2 - 2
src/modules/base/api.js

@@ -181,8 +181,8 @@ export const deleteClazz = idList => {
 export const updateClazz = datas => {
   return $post("/api/admin/basic/clazz/save", datas);
 };
-export const clazzQuery = () => {
-  return $post("/api/admin/basic/clazz/datasource", {});
+export const clazzQuery = datas => {
+  return $postParam("/api/admin/basic/clazz/datasource", datas);
 };
 
 // print-plan-push-manage

+ 22 - 1
src/modules/base/views/StudentManage.vue

@@ -10,6 +10,22 @@
             clearable
           ></el-input>
         </el-form-item>
+        <el-form-item label="校区:">
+          <campus-select
+            v-model="filter.campusId"
+            placeholder="校区"
+            clearable
+            @change="campusChange"
+          ></campus-select>
+        </el-form-item>
+        <el-form-item label="班级:">
+          <clazz-select
+            v-model="filter.clazzId"
+            :campus-id="filter.campusId"
+            placeholder="班级"
+            clearable
+          ></clazz-select>
+        </el-form-item>
         <el-form-item>
           <el-button
             v-if="checkPrivilege('button', 'select')"
@@ -119,7 +135,9 @@ export default {
   data() {
     return {
       filter: {
-        queryParams: ""
+        queryParams: "",
+        campusId: "",
+        clazzId: ""
       },
       current: 1,
       size: this.GLOBAL.pageSize,
@@ -152,6 +170,9 @@ export default {
       this.current = page;
       this.getList();
     },
+    campusChange() {
+      this.filter.clazzId = "";
+    },
     toAdd() {
       this.curRow = {};
       this.$refs.ModifyStudent.open();

+ 12 - 1
src/modules/exam/components/CreateTaskApply.vue

@@ -23,7 +23,7 @@
             <el-form-item prop="teachingRoomId" label="教研室:">
               <teaching-room-select
                 v-model="examTask.teachingRoomId"
-                @change="clearCard"
+                @change="teachingRoomChange"
               ></teaching-room-select>
             </el-form-item>
           </el-col>
@@ -31,6 +31,7 @@
             <el-form-item prop="courseCode" label="课程(代码):">
               <course-select
                 v-model="examTask.courseCode"
+                :teaching-room-id="examTask.teachingRoomId"
                 @change="courseChange"
               ></course-select>
             </el-form-item>
@@ -601,7 +602,17 @@ export default {
       this.examTaskDetail.makeMethod = "";
       this.examTaskDetail.cardId = "";
     },
+    teachingRoomChange() {
+      this.examTask.courseCode = "";
+      this.examTask.courseName = "";
+      this.clearCard();
+    },
     courseChange(val) {
+      if (!val || !val.code) {
+        this.examTask.courseCode = "";
+        this.examTask.courseName = "";
+        return;
+      }
       this.examTask.courseName = val.name;
       this.clearCard();
       this.updateApproverPeople();