sunlupeng 1 год назад
Родитель
Сommit
17603b7433

+ 18 - 0
src/api/PeopleSelect.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+// 获得可选择的员工信息列表用于选择业务人
+export function listForSelectEmployee() {
+  return request({
+    url: '/personnel/employee/listForSelectEmployee',
+    method: 'get',
+  })
+}
+
+// 获得员工信息列表用于选择审批人
+export function listForSelectAssigns() {
+    return request({
+      url: '/personnel/employee/listForSelectAssigns',
+      method: 'get',
+    })
+  }
+  

+ 7 - 0
src/api/system/user.js

@@ -96,6 +96,13 @@ export function getUserProfile() {
     method: 'get'
   })
 }
+//获得员工信息根据id
+export function getEmployeeInfo(id) {
+  return request({
+    url: '/personnel/employee/get?id=' + id,
+    method: 'get'
+  })
+}
 
 // 修改用户个人信息
 export function updateUserProfile(data) {

+ 12 - 6
src/components/PeopleSelect/index.vue

@@ -164,6 +164,7 @@
   <script>
   
     import { listUser } from '@/api/system/user';
+    import { listForSelectAssigns,listForSelectEmployee } from '@/api/PeopleSelect';
     import {listSimpleDepts} from "@/api/system/dept";
   
     export default {
@@ -217,12 +218,10 @@
   
           // 查询参数
           queryParams: {
-            pageNum: 1,
-            pageSize: 100,
             username: undefined,
             phonenumber: undefined,
-            status: '0',
-            deptId: undefined
+            deptId: undefined,
+            type: undefined
           },
   
           //已选择的用户信息
@@ -234,6 +233,11 @@
         }
       },
       created() {
+        if(this.type == 'multiple'){
+          this.queryParams.type = 1;
+        }else{
+          this.queryParams.type = 2;
+        }
         this.getDeptTree()
         this.getAllUserList()
       },
@@ -291,8 +295,10 @@
         },
         // 筛选节点
         filterNode(value, data) {
+          console.log(value, data)
+
           if (!value) return true
-          return data.label.indexOf(value) !== -1
+          return data.name.indexOf(value) !== -1
         },
         // 节点单击事件
         handleNodeClick(data) {
@@ -311,7 +317,7 @@
         //第一步要做的 checkedUsers 为数组如['admin','ry'] 在父组件调用此方法并传入要回显的数组可进行复选框回显操作
         getAllUserList(checkedUsers = []) {
           //查出所有的用户,用于根据不同情况筛选显示
-          listUser({ pageNum: 1, pageSize: 100, status: '0' }).then(response => {
+          listUser(this.queryParams).then(response => {
               this.allUserList = response.data.list
   
               this.allUserMap = new Map()

+ 11 - 9
src/views/oa/conversion/edit.vue

@@ -109,7 +109,7 @@
 <script>
 import { getDetail, create,reCommit, save, deleteById,closeById } from "@/api/oa/conversion"
 import {getDate} from "@/utils/dateUtils";
-import { getUserProfile } from "@/api/system/user";
+import { getEmployeeInfo } from "@/api/system/user";
 import { listDept } from "@/api/system/dept";
 import PeopleSelect from "@/components/PeopleSelect/index.vue";
 import Treeselect from "@riophae/vue-treeselect";
@@ -200,7 +200,7 @@ export default {
         if(val){
           this.getDetail(val);
         }else{
-          // this.getUser();
+          // this.getEmployee();
         }
       }
     }
@@ -209,13 +209,14 @@ export default {
     getDateStar(ms) {
       return getDate(ms);
     },
-    getUser() {
-      getUserProfile().then(response => {
-        let userInfo = response.data;
-        this.form.employeeName = userInfo.nickname;
-        this.form.deptName = userInfo.dept.name;
-        this.form.position = userInfo.posts[0].name;
-        this.form.employeePhone = userInfo.mobile;
+    getEmployee() {
+      getEmployeeInfo(this.form.employeeId).then(response => {
+        let employeeInfo = response.data;
+        this.form.deptName = employeeInfo.deptName;
+        this.form.position = employeeInfo.position;
+        this.form.employeePhone = employeeInfo.phone;
+        this.form.entryDate = employeeInfo.entryDate;
+        this.form.probationEndDate = employeeInfo.probationEndDate;
       });
     },
     handleRemove(file, fileList) {
@@ -425,6 +426,7 @@ export default {
       console.log(userNamelist);
       this.form.employeeName = nikeNamelist.join();
       this.form.employeeId = userIdList.join();
+      this.getEmployee();
       this.singlePeopleOpen = false;
     },
     getTimelineItemIcon(item) {