Ver Fonte

fix(员工选择组件): 修复分页和树形选择问题

liujt há 6 meses atrás
pai
commit
0897de557a

+ 6 - 1
src/views/documentManagement/certificateManagement/components/staffSelection.vue

@@ -161,6 +161,7 @@
     methods: {
       open(selectedList) {
         this.dialogVisible = true;
+        this.pageNum = 1;
         this.selectStafflist = selectedList;
         this.getInfo();
       },
@@ -172,6 +173,10 @@
           idField: 'id',
           parentIdField: 'parentId'
         });
+        this.$nextTick(()=>{
+          this.handleNodeClick(this.treeList[0])
+          this.$refs.tree.setCurrentKey(this.treeList[0].id)
+        })
         //this.treeList = res.data;
       },
       //选择分类
@@ -190,7 +195,7 @@
       async getStaffList(params) {
         let res = await getUserPage(params);
         let list = res.list;
-        if (list.length < res.count) {
+        if (this.staffList.length < res.count) {
           this.isMore = true;
         } else {
           this.isMore = false;

+ 6 - 1
src/views/enterpriseModel/dept/components/staffSelection.vue

@@ -161,6 +161,7 @@
     methods: {
       open(selectedList) {
         this.dialogVisible = true;
+        this.pageNum = 1;
         // this.selectStafflist = selectedList;
         this.selectStafflist = selectedList.map((item) => {
           item.name = item.name ? item.name : item.recipientName;
@@ -180,6 +181,10 @@
           idField: 'id',
           parentIdField: 'parentId'
         });
+        this.$nextTick(()=>{
+          this.handleNodeClick(this.treeList[0])
+          this.$refs.tree.setCurrentKey(this.treeList[0].id)
+        })
         //this.treeList = res.data;
       },
       //选择分类
@@ -198,7 +203,7 @@
       async getStaffList(params) {
         let res = await getUserPage(params);
         let list = res.list;
-        if (list.length < res.count) {
+        if (this.staffList.length < res.count) {
           this.isMore = true;
         } else {
           this.isMore = false;

+ 2 - 1
src/views/workforceManagement/team/components/staffSelection.vue

@@ -201,6 +201,7 @@
     methods: {
       open(selectedList) {
         this.dialogVisible = true;
+        this.pageNum = 1;
         this.selectStafflist = selectedList;
         this.getInfo();
       },
@@ -254,7 +255,7 @@
         }
       let res = await getUserPage(params);
       let list = res.list;
-      if (list.length < res.count) {
+      if (this.staffList.length < res.count) {
         this.isMore = true;
       } else {
         this.isMore = false;