zhangjie преди 2 години
родител
ревизия
0edc8fc3a2
променени са 1 файла, в които са добавени 9 реда и са изтрити 0 реда
  1. 9 0
      src/modules/card/components/ModifyCard.vue

+ 9 - 0
src/modules/card/components/ModifyCard.vue

@@ -97,6 +97,15 @@ export default {
     },
     visibleChange() {
       this.modalForm = this.$objAssign(initModalForm, this.instance);
+      const hasTeacher = this.teachers.find(
+        (item) => item.id === this.instance.teacherId
+      );
+      if (!hasTeacher) {
+        this.modalForm.teacherId = null;
+        this.$nextTick(() => {
+          this.$refs.modalFormComp.validateField("teacherId");
+        });
+      }
       this.isSubmit = false;
     },
     cancel() {