guhongwei 5 лет назад
Родитель
Сommit
33c815dfbc
2 измененных файлов с 7 добавлено и 4 удалено
  1. 2 1
      src/views/pcenter/parts/personnelAdmin.vue
  2. 5 3
      src/views/pcenter/pinfo.vue

+ 2 - 1
src/views/pcenter/parts/personnelAdmin.vue

@@ -125,8 +125,9 @@ export default {
     },
     // 职务
     async selectChild(dept_id) {
-      let res = await this.levelQuery(dept_id);
+      let res = await this.levelQuery({ dept_id });
       if (this.$checkRes(res)) {
+        console.log(res.data);
         this.$set(this, `levelList`, res.data);
       }
     },

+ 5 - 3
src/views/pcenter/pinfo.vue

@@ -28,8 +28,8 @@
           <el-form-item v-if="this.user.type != '3'" label="家庭住址">
             <el-input v-model="form.address"></el-input>
           </el-form-item>
-          <el-form-item v-if="this.user.type === '0' || this.user.type === '1'" label="部门" @change="selectChild">
-            <el-select v-model="form.dept_id" filterable placeholder="请选择部门">
+          <el-form-item v-if="this.user.type === '0' || this.user.type === '1'" label="部门">
+            <el-select v-model="form.dept_id" filterable placeholder="请选择部门" @change="selectChild">
               <el-option v-for="(item, index) in deptList" :key="index" :label="item.name" :value="item._id"></el-option>
             </el-select>
           </el-form-item>
@@ -139,6 +139,7 @@ export default {
     ...login({ logout: 'logout' }),
     async search() {
       this.searchInfo();
+      this.selectChild();
       if (this.user.type === '3') {
         const user = await this.fetch(this.user.uid);
         this.$set(this, `form`, user.data);
@@ -159,7 +160,8 @@ export default {
     },
     // 职务
     async selectChild(dept_id) {
-      let res = await this.levelQuery(dept_id);
+      console.log(dept_id);
+      let res = await this.levelQuery({ dept_id });
       if (this.$checkRes(res)) {
         this.$set(this, `levelList`, res.data);
       }