From 51bfe4a889a45a1733cc6542f3bc624ad1675f33 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 31 五月 2024 09:27:04 +0800
Subject: [PATCH] 完善工时管理

---
 src/components/view/person-manage.vue |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/src/components/view/person-manage.vue b/src/components/view/person-manage.vue
index acac893..1467cdb 100644
--- a/src/components/view/person-manage.vue
+++ b/src/components/view/person-manage.vue
@@ -252,9 +252,6 @@
 </template>
 
 <script>
-  import {
-    compileToFunctions
-  } from 'vue-template-compiler'
   import ValueTable from '../tool/value-table.vue'
   export default {
     components: {
@@ -438,6 +435,7 @@
         })
       },
       opeaAdd() {
+        console.log(this.addOb.fatherId,this.selectTree)
         if (!this.addOb.fatherId || this.selectTree == '' || this.selectTree == '鍏ㄩ儴') {
           this.$message.error('璇烽�夋嫨涓�涓粍缁�')
           return
@@ -524,7 +522,7 @@
         }
         this.selectTree = data2.replace(' - ', '')
         this.addOb.fatherId = val.id;
-        this.componentData.entity.departId = val.id;
+        this.componentData.entity.departId = val.id + ',';
         this.refreshTable()
       },
       nodeOpen(data, node, el) {
@@ -538,7 +536,7 @@
       },
       getNodeParent(val) {
         if (val.parent != null) {
-          this.selectTree += ' - ' + val.label
+          this.selectTree += ' - ' + val.data.name
           this.getNodeParent(val.parent)
         }
       },
@@ -600,7 +598,7 @@
         })
       },
       nodeClick2(ob, node, el) {
-        this.currentCompaniesList[node.level-1] = ob.id
+        this.getNodeParent0(node)
         if (ob.id !== 'SC21') {
           this.personLoad = true
           this.$axios.post(this.$api.companies.selectSimpleList, {
@@ -613,6 +611,12 @@
           })
         }
       },
+      getNodeParent0(val){
+        this.currentCompaniesList[val.level-1] = val.data.id
+        if(val.parent!=null){
+          this.getNodeParent0(val.parent)
+        }
+      },
       handleSelectionChange(val) {
         this.multipleSelection = val;
       },
@@ -623,24 +627,17 @@
         if(this.currentCompaniesList.length === 0){
           return this.$message.error('璇烽�夋嫨缁勭粐')
         }
-        for (let index = this.currentCompaniesList.length-1; index >1; index--) {
+        /* for (let index = this.currentCompaniesList.length-1; index >1; index--) {
           let obj = this.multipleSelection.find(a=>a.companyId==this.currentCompaniesList[index])
           if(!obj){
             this.currentCompaniesList.splice(index,1)
-          }else{
-            return
           }
-        }
+        } */
         let arr = []
         this.currentCompaniesList.forEach(b=>{
-          /* this.companiesList.forEach(a=>{
-            if(a.companyId===b){
-              console.log(a)
-            }
-          }) */
           let obj = this.companiesList.find(a=>a.companyId==b)
           arr.push(obj)
-          })
+        })
         this.addLoad = true
         this.$axios.post(this.$api.companies.addPersonUser, {
           company: arr,
@@ -661,7 +658,7 @@
           this.addLoad = false
           this.personList = []
           this.userSearch2 = ''
-          this.refresh()
+          this.selectTreeList()
         }).catch(e => {
           this.addthirdParty = false
           this.addLoad = false

--
Gitblit v1.9.3