| 
					
				 | 
			
			
				@@ -1,4 +1,4 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { getDingTalkDepartmentList, queryDingTalkDeptUser } from '@/api/expenseManagement' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { getDingTalkAllDeptUser, refashDingTalkAllDeptUser } from '@/api/expenseManagement' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const DingDepartUser = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   template: ` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <a-tree-select 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -8,7 +8,6 @@ const DingDepartUser = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           :tree-data="treeData" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           :placeholder="placeholder" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          :load-data="onLoadData" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           multiple 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           treeCheckable 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           :treeCheckStrictly="true" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -39,7 +38,7 @@ const DingDepartUser = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   mounted() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    this.genTreeNode(1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.genTreeNode() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   watch: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     value(newValue, oldValue) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -63,7 +62,7 @@ const DingDepartUser = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       const ret = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       data.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(type == 'bm'){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          ret.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          const node = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             title: item.name, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             id:item.deptId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             value: item.deptId, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -72,7 +71,11 @@ const DingDepartUser = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             createDeptGroup: item.createDeptGroup, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             disableCheckbox: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             checkable: false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          if(item.deptUserList||item.deptList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            node.children = this.formatData(item.deptUserList||item.deptList,item.deptList?'bm':'yg') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          ret.push(node) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           ret.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             title: item.name, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -91,29 +94,22 @@ const DingDepartUser = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       return ret 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // 获取部门 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    genTreeNode(parentId, isLeaf = false) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-       Promise.all([ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         getDingTalkDepartmentList({deptId:parentId}), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         queryDingTalkDeptUser({deptId:parentId,pageNo:1,pageSize:10}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         ]).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          const res1 = res[0].data||[] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          const res2 = res[1].data||[] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.treeData = this.treeData.concat(this.formatData(res1,'bm')).concat(this.formatData(res2,'yg')); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          if(res1.length==0&&res2.length==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            this.$message.info("没有下一级了") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    onLoadData(treeNode) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      return new Promise(resolve => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        const { value } = treeNode.dataRef; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         this.genTreeNode(value) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         setTimeout(()=>{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-           resolve(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-         },1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 获取部门人员 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    async genTreeNode() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       let ret = await getDingTalkAllDeptUser().then(res => res.data) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       const res1 = ret.deptList||[] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       const res2 = ret.deptUserList||[] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       this.treeData = this.treeData.concat(this.formatData(res1,'bm')).concat(this.formatData(res2,'yg')); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 更新人员数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    updateDeptUser(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      refashDingTalkAllDeptUser().then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.$message.info(res.message) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(res.status == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.genTreeNode() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |