Преглед на файлове

:bug:修复企业部门联动不清楚旧数据的问题,修复选择企业部门之后无法选择人员的问题

Twelve615 преди 1 година
родител
ревизия
0a2c1016b8
променени са 3 файла, в които са добавени 16 реда и са изтрити 4 реда
  1. 1 0
      package.json
  2. 1 0
      src/views/user/enterprise/index.vue
  3. 14 4
      src/views/user/list/index.vue

+ 1 - 0
package.json

@@ -8,6 +8,7 @@
     "dev": "vue-cli-service serve --open",
     "build:prod": "vue-cli-service build",
     "build:stage": "vue-cli-service build --mode staging",
+    "build:dev": "vue-cli-service build --mode development",
     "preview": "node build/index.js --preview",
     "prettier:comment": "自动格式化当前目录下的所有文件",
     "prettier": "prettier --write .",

+ 1 - 0
src/views/user/enterprise/index.vue

@@ -866,6 +866,7 @@
         }
         otganizatonDepartmentUserList(data).then((res) => {
           this.userList = res
+          this.associationForm.realName = '';
         })
       },
       // 设置信用额度

+ 14 - 4
src/views/user/list/index.vue

@@ -489,7 +489,7 @@
         <el-form-item label="填写部门" required>
           <!-- <el-input v-model.trim="associationForm.department" class="selWidth"></el-input> -->
           <el-select v-model="authForm.department" placeholder="填写部门" @change="getNameList">
-            <el-option v-for="item in bmList" :key="item.name" :label="item.name" :value="item.name" ></el-option>
+            <el-option v-for="item in bmList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="真实姓名" required>
@@ -507,7 +507,7 @@
 </template>
 
 <script>
- 
+
 import {
   userListApi,
   tagAllListApi,
@@ -719,12 +719,21 @@ export default {
       })
     },
     getNameList() {
+      // 处理部门
+      this.bmList.forEach(res =>{
+        if (res.id === this.authForm.department) {
+          console.log(res)
+          this.authForm.departId = res.id
+          this.authForm.departName = res.name
+        }
+      })
       let data = {
         id: this.authForm.department,
         organizationId: this.authForm.name
       }
       otganizatonDepartmentUserList(data).then((res) => {
         this.userList = res
+        this.authForm.realName = '';
       })
     },
     // 认证
@@ -749,7 +758,8 @@ export default {
         phone: that.userInfo.phone,
         realName: that.authForm.realName,
         userId: that.userInfo.id,
-        department: that.authForm.department
+        department: that.authForm.departName,
+        departId: that.authForm.departId,
       }
       authentication(data).then((res) => {
         this.$message.success('认证成功')
@@ -759,7 +769,7 @@ export default {
         that.authForm.department = ''
         that.authVisible = false
       })
-      
+
     },
     getTemplateRow(row) {
       this.formExtension.spreadUid = row.id;