Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/Foshan4A4.0

zhongxiaoyu 3 years ago
parent
commit
161e8351e1

+ 33 - 6
src/components/organization/index.vue

@@ -4,7 +4,7 @@
     <div class="left">
       <div class="paren_header">
         <p>{{ title }}</p>
-        <template v-if="doesJobShow">
+        <template>
           <div class="column" v-show="vice">
             <div :class="active == index ? 'column_childs' : 'column_child'" v-for="(item, index) in colType" :key="index" @click="upStart(index)">
               {{ item.name }}
@@ -25,8 +25,20 @@
             </el-tree>
           </el-scrollbar>
         </div>
-        <div class="dptBox" v-if="doesJobShow" v-show="active == 1">
+        <!-- <div class="dptBox" v-if="doesJobShow" v-show="active == 1">
           <Rolelist :type="true" @radioChange="radioChange" :radioCheck="radioCheck" :number="8" :active="true" class="lessData" :mainData="mainData" />
+        </div> -->
+        <div v-show="active == 1" class="dptBox duoBox">
+          <el-scrollbar style="height: 100%">
+            <el-tree :data="data" show-checkbox @check-change="currentChangeDuo" :default-expanded-keys="defaultExpandedKeys" :props="defaultProps" :default-checked-keys="checkedKeysDuo" :node-key="nodekey" ref="treeDuo" highlight-current>
+              <span v-if="orgType == 'org'" slot-scope="{ data }" :title="data.OrganName" class="org-data-tree-node">
+                {{ data.OrganName }}
+              </span>
+              <span v-else slot-scope="{ data }" :title="data.AuthName" class="org-data-tree-node">
+                {{ data.AuthName }}
+              </span>
+            </el-tree>
+          </el-scrollbar>
         </div>
       </div>
     </div>
@@ -61,6 +73,11 @@ export default {
       type: Array,
       default: () => [],
     },
+    checkedKeysDuo: {
+      //已选中
+      type: Array,
+      default: () => [],
+    },
     lessData: {
       //副岗
       type: Array,
@@ -94,10 +111,10 @@ export default {
       active: 0,
       colType: [
         {
-          name: "组织",
+          name: "所属组织",
         },
         {
-          name: "职务",
+          name: "组织授权",
         }
       ],
       checkedDatas: [],
@@ -117,14 +134,20 @@ export default {
       },
       deep: true,
     },
+    checkedKeysDuo: {
+      handler (val) {
+        this.$refs.tree.setCheckedKeys(val)
+      },
+      deep: true,
+    },
     orgList: {
-      handler(val) {
+      handler (val) {
         this.getExpandedKeysStep.splice(1, 1, true)
       },
       deep: true
     },
     getExpandedKeysStep: {
-      handler(val) {
+      handler (val) {
         if (val.every(v => v)) {
           this.defaultExpandedKeys = [-1]
           this.checkedKeys.forEach(key => {
@@ -179,6 +202,10 @@ export default {
         }
       }
     },
+    currentChangeDuo () {
+      const arr = this.$refs.treeDuo.getCheckedNodes()
+      this.$emit("getTreeDataDuo", arr)
+    },
     // 选中后设置初始数据
     setDataObj (arr) {
       arr.forEach((item) => {

+ 16 - 3
src/components/organization/organization.scss

@@ -59,7 +59,7 @@
     > .paren_content {
       width: 100%;
       height: 83%;
-      .dptBox{
+      .dptBox {
         > .el-scrollbar {
           > .el-scrollbar__wrap {
             overflow-x: hidden;
@@ -96,8 +96,21 @@
           border-radius: 0;
         }
       }
-
+      .duoBox {
+        .el-tree {
+          .el-checkbox__inner {
+            border-radius: 2px;
+          }
+          .el-checkbox__inner::after {
+            width: 3px;
+            height: 7px;
+            left: 4px;
+            top: 1px;
+            border-radius: 0;
+            background: #747ebb;
+          }
+        }
       }
-
+    }
   }
 }

+ 7 - 2
src/views/staffManagement/compontents/staffAdd.vue

@@ -41,7 +41,7 @@
     </div>
     <div class="power-content flex-wrap">
       <div class="r24 flex1 part">
-        <Organization ref="Organization" :defaultProps="defaultProps" :mainData="mainData" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :radioCheck="radioNum" nodekey="OrganId" title="选择组织" />
+        <Organization ref="Organization" :defaultProps="defaultProps" :vice="true" :data="data" @getTreeData="getOrgan" @getTreeDataDuo="getTreeDataDuo" :checkedKeys="orgCheckedKeys" nodekey="OrganId" title="选择组织" />
       </div>
       <!--开启多对多-->
       <template v-if="OpenAuthData">
@@ -282,12 +282,16 @@ export default {
     getTreeData (arr) {
       this.checkTrees = arr;
     },
-    //获取组织选中的数据
+    //获取组织选中的数据-单选
     getOrgan (arr) {
       const { OrganId } = arr[0];
       this.AppId = OrganId;
       this.getJobListByOrgan(OrganId);
     },
+    //获取组织选中的数据-多选
+    getTreeDataDuo (arr) {
+      this.lessData = arr;
+    },
     //获取指定数据
     decompose (data, id) {
       for (let i = 0; i < data.length; i++) {
@@ -436,6 +440,7 @@ export default {
           DepJobList: this.lessChecksData,
           GroupList: GroupIds.length ? GroupIds : [],
           JobId: this.JobId,
+          DepJobList: this.lessData,
           Status: 1,
           OrganId: this.AppId,
           OfficerId: this.OfficerId,

+ 15 - 3
src/views/staffManagement/compontents/staffEdit.vue

@@ -41,7 +41,7 @@
     </div>
     <div class="power-content flex-wrap">
       <div class="r24 flex1 part">
-        <Organization ref="Organization" :defaultProps="defaultProps" :mainData="mainData" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :orgList="orgList" :radioCheck="radioNum" nodekey="OrganId" title="选择组织" />
+        <Organization ref="Organization" :defaultProps="defaultProps" :vice="true" :data="data" @getTreeData="getOrgan" @radioChange="radioChange" :checkedKeys="orgCheckedKeys" :checkedKeysDuo="checkedKeysDuo" @getTreeDataDuo="getTreeDataDuo" :orgList="orgList" nodekey="OrganId" title="选择组织" />
       </div>
       <!--开启多对多-->
       <template v-if="OpenAuthData">
@@ -175,6 +175,7 @@ export default {
       checkedKeys: [], //上级组织选中
       RoleList: [],
       checkedBoxs: [],
+      checkedKeysDuo: [],
       arrs: [],
       authArrs: [],//
       OfficerId: null,
@@ -282,7 +283,7 @@ export default {
             RoleList,
             TacList,
             GroupList,
-            UserList
+            UserList,
           } = obj;
           this.form.name = OfficerName;
           this.form.loginName = OfficerLoginName;
@@ -293,7 +294,6 @@ export default {
           this.roleDatas = RoleList;
           this.radioCheck = JobId;
           this.JobId = JobId;
-          this.lessChecksData = DepJobList;
           this.isMainJob = false;
           this.AppId = OrganId;
           this.getJobListByOrgan(OrganId);
@@ -333,6 +333,13 @@ export default {
             })
             this.checkBoxList = datas;
           }
+          if (DepJobList && DepJobList.length) {
+            const datas = [];
+            DepJobList.forEach(item => {
+              datas.push(item.organId);
+            })
+            this.checkedKeysDuo = datas;
+          }
           this.checkedList = TacList;
           this.loginCheckBoxs = TacList;
         } else {
@@ -381,6 +388,10 @@ export default {
       this.AppId = OrganId;
       this.getJobListByOrgan(OrganId);
     },
+    //获取组织选中的数据-多选
+    getTreeDataDuo (arr) {
+      this.lessData = arr;
+    },
     //获取指定数据
     decompose (data, id) {
       for (let i = 0; i < data.length; i++) {
@@ -566,6 +577,7 @@ export default {
           GroupList: GroupIds.length ? GroupIds : [],
           JobId: this.JobId,
           Status: Number(this.Status),
+          DepJobList: this.lessData,
           OrganId: this.AppId,
           OfficerId: this.OfficerId,
           UserList: this.OpenAuthData ? this.checkBoxList : []