浏览代码

后缀格式

11wqe1 4 月之前
父节点
当前提交
364b0dd12e
共有 3 个文件被更改,包括 81 次插入158 次删除
  1. 4 0
      src/common/apiConfig.js
  2. 8 57
      src/components/examine.vue
  3. 69 101
      src/components/list.vue

+ 4 - 0
src/common/apiConfig.js

@@ -46,6 +46,10 @@ export const API_CONFIG = {
   ajax_confirm: {
     functionName: "updata_user_o_s",
   },
+  //查询后缀
+  ajax_Suffix: {
+    functionName: "select_Suffix",
+  },
   ////////////// 以下是账号审核的数据接口
 
   moveUser: {

+ 8 - 57
src/components/examine.vue

@@ -270,7 +270,7 @@
               <div class="checkbox-container">
                 <!-- 循环渲染每个学校 -->
                 <div
-                  v-for="(school, index) in schoolList"
+                  v-for="(school, index) in cn_school"
                   :key="index"
                   class="checkbox_comment"
                 >
@@ -629,56 +629,7 @@ export default {
       sortO: "DESC",
     };
   },
-  watch: {
-    // school:{
-    //   deep:true,
-    //   handler:function(newVal){
-    //     this.schoolList = []
-    //     if (newVal.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == newVal.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //     }else if (this.searchQuery) {
-    //         this.schoolList = this.cn_school.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    //   },
-    //   immediate:true
-    // },
-    // searchQuery(newVal){  
-    //   this.schoolList = []
-    //     if (this.school.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == this.school.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //       console.log('111');
-          
-    //     } else if (newVal) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.name.includes(newVal)
-    //       })
-    //       console.log('222');
-
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    // },
-  },
+  watch: {},
   computed: {
     ...mapGetters(["userid"]),
   },
@@ -734,12 +685,12 @@ export default {
             org: item.org,
             area:item.area
           }));
-          this.schoolList = res.data[0].map((item) => ({
-            name: item.name,
-            id: item.id,
-            org: item.org,
-            area:item.area
-          }));
+          // this.schoolList = res.data[0].map((item) => ({
+          //   name: item.name,
+          //   id: item.id,
+          //   org: item.org,
+          //   area:item.area
+          // }));
           console.log(this.cn_school);
         }
       })

+ 69 - 101
src/components/list.vue

@@ -137,7 +137,7 @@
           <div class="checkbox-container">
             <!-- 循环渲染每个学校 -->
             <div
-              v-for="(school, index) in schoolList"
+              v-for="(school, index) in cn_school"
               :key="index"
               class="checkbox_comment"
             >
@@ -202,6 +202,7 @@
                 class="add_input"
               ></el-input>
             </div>
+            <!-- <span style="margin-left: 5px;">{{ this.SuffixData }}</span> -->
           </div>
           <!-- <div class="el-form-item">
             <label class="el-form-item__label">选择身份</label>
@@ -565,6 +566,18 @@
             header-align="center"
             align="center"
           />
+          <el-table-column
+            show-overflow-tooltip
+            prop="company_number"
+            label="组织编号"
+            min-width="32"
+            header-align="center"
+            align="center"
+          >
+          <template slot-scope="{ row }">
+              <div>{{ row.orgCode ? row.orgCode : row.schoolCode ? row.schoolCode : '暂无' }}</div>
+            </template>
+          </el-table-column>
           <el-table-column
             show-overflow-tooltip
             prop="name"
@@ -581,6 +594,14 @@
             header-align="center"
             align="center"
           />
+          <el-table-column
+            show-overflow-tooltip
+            prop="Ctime"
+            label="账户开通时间"
+            min-width="40"
+            header-align="center"
+            align="center"
+          />
           <el-table-column
             show-overflow-tooltip
             label="身份"
@@ -666,6 +687,8 @@ export default {
   components: {},
   data() {
     return {
+      // 新增账户默认后缀
+      SuffixData:'',
       // 储存筛选完后的学校
       schoolList:[],
       // 控制下拉菜单的显示与隐藏
@@ -797,99 +820,7 @@ export default {
         : this.cn_school;
     },
   },
-  watch: {
-    // school:{
-    //   deep:true,
-    //   handler:function(newVal){
-    //     this.schoolList = []
-    //     if (newVal.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == newVal.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //         if (this.selReg) {
-    //           this.schoolList = this.cn_school.filter((e) => {
-    //             return e.area == this.selReg
-    //           })
-    //         }
-    //       }
-    //       if (this.selReg) {
-    //           this.schoolList = this.cn_school.filter((e) => {
-    //             return e.area == this.selReg
-    //           })
-    //         }
-    //     }else if (this.searchQuery) {
-    //         this.schoolList = this.cn_school.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //         if (this.selReg) {
-    //           this.schoolList = this.cn_school.filter((e) => {
-    //             return e.area == this.selReg
-    //           })
-    //         }
-    //     } else if(this.selReg){
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.area == this.selReg
-    //       })
-    //     }else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    //   },
-    //   immediate:true
-    // },
-    // searchQuery(newVal){  
-    //   this.schoolList = []
-    //     if (this.school.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == this.school.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //       console.log('111');
-          
-    //     } else if (newVal) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.name.includes(newVal)
-    //       })
-    //       console.log('222');
-
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    // },
-    // selReg(newVal){  
-    //   this.schoolList = []
-    //     if (this.school.OrgId) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.org == this.school.OrgId
-    //       })
-    //       if (this.searchQuery) {
-    //         this.schoolList = this.schoolList.filter((e) => {
-    //           return e.name.includes(this.searchQuery)
-    //         })
-    //       }
-    //       console.log('111');
-          
-    //     } else if (newVal) {
-    //       this.schoolList = this.cn_school.filter((e) => {
-    //         return e.name.includes(newVal)
-    //       })
-    //       console.log('222');
-
-    //     } else{
-    //       this.schoolList = this.cn_school
-    //     }
-    //     console.log('value is change',newVal)
-    // },
-  },
+  watch: {},
   methods: {
     handleSelectionChange(selectedRows) {
       this.checkArray = selectedRows.map((row) => row.userid);
@@ -910,7 +841,7 @@ export default {
       this.selReg = '';
       this.ajax_school()
 
-
+      this.SuffixData = ''
       this.isOrgFormVisible = false;
       this.isTableUseVisible = false;
       this.selectedSchool = ''
@@ -987,6 +918,9 @@ export default {
             org: user.org,
             type: user.usertype,
             state: user.user_state,
+            orgCode: user.org_code,
+            schoolCode: user.school_code,
+            Ctime: user.Ctime,
           }));
 
           // this.tableData = Array(this.pageSize * (this.currentPage - 1)).fill(null).concat(users);
@@ -1127,6 +1061,7 @@ export default {
         });
         return; // 终止函数执行
       }
+      this.person.account = this.person.account + this.SuffixData
       if (!/\S+@\S+\.\S+/.test(this.person.account)) {
         this.$message.error("账号要填写邮箱格式");
         return;
@@ -1192,12 +1127,12 @@ export default {
               org: item.org,
               area:item.area
             }));
-            this.schoolList= res.data[0].map((item) => ({
-              name: item.name,
-              id: item.id,
-              org: item.org,
-              area:item.area
-            }));
+            // this.schoolList= res.data[0].map((item) => ({
+            //   name: item.name,
+            //   id: item.id,
+            //   org: item.org,
+            //   area:item.area
+            // }));
             console.log(this.cn_school);
           }
         })
@@ -1415,6 +1350,36 @@ export default {
       this.person.selectedSchool = "";
       this.$forceUpdate()
     },
+    getSuffix(){
+      let params = [
+        {
+          functionName: API_CONFIG.ajax_Suffix.functionName, // 调用存储过程的名称
+          org: this.person.selectedOrg, //组织id
+          oid: this.person.selectedSchool, //学校id
+        },
+      ];
+
+      // 发起请求
+      this.$ajax
+        .post(API_CONFIG.baseUrl, params)
+        .then((res) => {
+          console.log('getSuffix',res)
+          let data = res.data[0]
+          if(data.length > 0){
+            let ap = data[0].username
+            this.SuffixData =  this.getEmailWithAt(ap)[0]
+          } 
+        
+        })
+        .catch((err) => {
+          console.error("请求失败,错误信息:", err);
+        });
+    },
+    getEmailWithAt(email) {
+      const regex = /@[^@]+$/;  // 匹配最后一个 @ 及其后的内容
+      const match = email.match(regex);
+      return match ? match : '';
+    },
     schoolChange() {
       for (var i = 0; i < this.cn_school.length; i++) {
         if (
@@ -1424,6 +1389,9 @@ export default {
           this.person.selectedOrg = this.cn_school[i].org;
         }
       }
+      
+      this.getSuffix()
+
       this.$forceUpdate()
     },
   },