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() {