Przeglądaj źródła

调整组织架构

Lijy 3 lat temu
rodzic
commit
50c466a4e9

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -4,8 +4,8 @@ var path = require('path')
 // var ip = '192.168.2.36'
 
  
-var ip = '47.100.37.243'
-// var ip = '192.168.2.105'
+// var ip = '47.100.37.243'
+var ip = '192.168.2.105'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 

+ 111 - 5
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -10,7 +10,20 @@
             </div>
             <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
             <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
-                <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree>
+                <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
+                <el-tree :data="data" :props="defaultProps" node-key="id" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown">
+                    <span class="custom-tree-node" slot-scope="{ node }" @mouseleave= mouseleave(data,$event)>
+                        <span @mouseover= mouseover(data,$event) style="width: 100px;display: inline-block;">{{ node.label }}</span>
+                        <span v-if="node.label != '全部人员'" class="node none">
+                        <el-button type="text" size="mini" @click="createDepartment(-2)" >
+                            <i class="el-icon-circle-plus-outline"></i> <!-- 新增 -->
+                        </el-button>
+                        <el-button type="text" size="mini" @click="deleteDep(null)">
+                            <i class="el-icon-delete"></i> <!-- 删除 -->
+                        </el-button>
+                        </span>
+                    </span> 
+                </el-tree>
             </div>
         </el-col>
 
@@ -61,14 +74,36 @@
                     </el-form-item>
                     <el-form-item  v-if="depData != null && depData.id != -1 && depData.id != 0" style="float:right;border: 0.5px solid #20a0ff;height: 27px;margin-top: 6px;">
                     </el-form-item>
-                    <el-form-item style="float:right;">
+                    <!-- <el-form-item style="float:right;">
                         <el-link type="danger" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="deleteDep(null)">删除部门</el-link>
                     </el-form-item>
                     <el-form-item style="float:right;">
                         <el-link type="primary" v-if="depData != null && depData.id != -1 && depData.id != 0" :underline="false" @click="createDepartment(-2)">新增子部门</el-link>
+                    </el-form-item> -->
+                    <el-form-item style="float:right;">
+                        <span>角色</span>
+                        <el-select v-model="role" placeholder="请选择" @change="getUser()" style="width: 120px">
+                            <el-option
+                            v-for="item in rolesa"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                            </el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-form-item style="float:right;">
+                        <span>状态</span>
+                        <el-select v-model="status" placeholder="请选择" @change="getUser()" style="width: 120px">
+                            <el-option
+                            v-for="item in states"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value">
+                            </el-option>
+                        </el-select>
                     </el-form-item>
                     <el-form-item style="float:right;">
-                        <div style="width: 300px;display: inline-block;">
+                        <div style="width: 250px;display: inline-block;">
                             <el-input v-model="keyword" class="input-with-select" placeholder="请输入人员名字搜索" clearable="true">
                                 <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
                             </el-input>
@@ -411,10 +446,64 @@
                     name: [{ required: true, message: "请输入部门名称", trigger: "blur" }],
                 },
                 timeType:{},
-                keyword: ''
+                keyword: '',
+                rolesa: [{
+                    value: '',
+                    label: '全部'
+                }, {
+                    value: '6',
+                    label: '公司领导'
+                }, {
+                    value: '2',
+                    label: '系统管理员'
+                }, {
+                    value: '4',
+                    label: '财务管理员'
+                }, {
+                    value: '5',
+                    label: '项目管理员'
+                }, {
+                    value: '0',
+                    label: '普通员工'
+                }],
+                states: [{
+                    value: '',
+                    label: '全部'
+                }, {
+                    value: '1',
+                    label: '活跃'
+                }, {
+                    value: '0',
+                    label: '停用'
+                }],
+                status: '',
+                role: '',
+                jDarr: []
             };
         },
         methods: {
+            jieDian(a, b, c) {
+                var ids = a.id
+                var arrs = this.jDarr
+                arrs.push(ids)
+                this.jDarr = arrs
+            },
+            shutDown(a, b, c) {
+                var ids = a.id
+                var arrs = []
+                for (var i in this.jDarr) {
+                    if(this.jDarr[i] != ids) {
+                        arrs.push(this.jDarr[i])
+                    }
+                }
+                this.jDarr = arrs
+            },
+            mouseleave(data,$event){
+                $event.currentTarget.firstElementChild.nextElementSibling.setAttribute('class','node none')
+            },
+            mouseover(data,$event){
+                $event.currentTarget.nextElementSibling.setAttribute('class','node block');
+            },
             confirmDeactive() {
                 this.http.post('/user/deactiveUser', {
                         id: this.deactiveUser.id,
@@ -690,12 +779,15 @@
 
             //获取所有员工的列表
             getUser() {
+                console.log(12345)
                 this.listLoading = true;
                 this.http.post( this.port.manage.list, {
                     departmentId: this.depData.id,
                     pageIndex: this.page,
                     pageSize: this.size,
-                    keyword: this.keyword
+                    keyword: this.keyword,
+                    status: this.status,
+                    role: this.role
                 },
                 res => {
                     this.listLoading = false;
@@ -1239,6 +1331,14 @@
 </script>
 
 <style lang="scss" scoped>
+    .custom-tree-node {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        font-size: 14px;
+        padding-right: 8px;
+    }
     .left {
         
         border-right: 1px solid #f2f2f2;
@@ -1273,6 +1373,12 @@
             margin-right: 10px;
         }
     }
+    .none {
+        display: none;
+    }
+    .block {
+        display: block;
+    }
 </style>
 
 <style lang="scss">