zhengnaiwen_citu il y a 9 mois
Parent
commit
ded0241db4
3 fichiers modifiés avec 20 ajouts et 3 suppressions
  1. 1 0
      .env.development
  2. 7 2
      src/api/system.js
  3. 12 1
      src/views/system/organizationStructure/index.vue

+ 1 - 0
.env.development

@@ -3,4 +3,5 @@ NODE_ENV = 'development'
 
 VUE_APP_MODE = 'development'
 
+# VUE_APP_BASE_API = 'http://192.168.3.149:7654'
 VUE_APP_BASE_API = 'http://192.168.3.86:7654'

+ 7 - 2
src/api/system.js

@@ -139,12 +139,17 @@ export function uploadRoster (params) {
   return http.upload('/digitizationData/employee/upload', params)
 }
 
-// 花名册上传
+// 花名册导出
 export function exportRoster (params) {
   return http.download('/digitizationData/employee/download/export', params)
 }
 
-// 花名册上传
+// 花名册模板下载
 export function downloadRosterTemplate (params) {
   return http.download('/digitizationData/employee/download/template', params)
 }
+
+// 花名册钻取员工
+export function drillEmployee (params) {
+  return http.post('/digitizationData/employee/organization/tree/subordinates', params)
+}

+ 12 - 1
src/views/system/organizationStructure/index.vue

@@ -8,6 +8,8 @@
     :page-current="1"
     :total="total"
     :expand-row-keys="expandRowKeys"
+    lazy
+    :load="load"
     :tree-props="{children: 'child'}"
     :default-sort="{ prop: 'sort', order: 'ascending' }"
   ></m-table>
@@ -15,7 +17,8 @@
 
 <script>
 import {
-  getOrganizationTree
+  getOrganizationTree,
+  drillEmployee
 } from '@/api/system'
 export default {
   name: 'organization-structure',
@@ -45,6 +48,14 @@ export default {
       } catch (error) {
         this.$message.error(error)
       }
+    },
+    async load (tree, treeNode, resolve) {
+      try {
+        const { data } = await drillEmployee({ deptName: tree.organizationName })
+        resolve(data)
+      } catch (error) {
+        this.$message.error(error)
+      }
     }
   }
 }