11wqe1 6 bulan lalu
induk
melakukan
203138b77c
1 mengubah file dengan 11 tambahan dan 2 penghapusan
  1. 11 2
      src/components/list.vue

+ 11 - 2
src/components/list.vue

@@ -1092,6 +1092,7 @@ export default {
               type: "success",
               message: "操作成功",
             });
+            this.SuffixData = '';
             this.isTableUseVisible = false;
             this.getData(); // 例如刷新表格数据
           }
@@ -1350,6 +1351,7 @@ export default {
     orgChange() {
       this.SuffixData = ''
       this.person.selectedSchool = "";
+      this.getSuffix()
       this.$forceUpdate()
     },
     getSuffix(){
@@ -1367,10 +1369,15 @@ export default {
         .then((res) => {
           console.log('getSuffix',res)
           let data = res.data[0]
+          let orgData = res.data[1]
+
           if(data.length > 0){
             let ap = data[0].username
             this.SuffixData =  this.getEmailWithAt(ap)[0]
-          } 
+          } else if (orgData.length > 0) {
+            let ap = orgData[0].username
+            this.SuffixData =  this.getEmailWithAt(ap)[0]
+          }
         
         })
         .catch((err) => {
@@ -1392,7 +1399,9 @@ export default {
         }
       }
       this.SuffixData = ''
-      this.getSuffix()
+      if (this.person.selectedSchool != '') {
+        this.getSuffix()
+      }
 
       this.$forceUpdate()
     },