From b22ca897c863fc34f6f8f9a13c3e303f9f34c180 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 28 五月 2024 15:19:23 +0800
Subject: [PATCH] 光纤配置对接检验项目信息部分字段

---
 src/components/view/person-manage.vue |   55 +++++++++++++++++++++++++++++++++----------------------
 1 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/src/components/view/person-manage.vue b/src/components/view/person-manage.vue
index 2859d05..5938846 100644
--- a/src/components/view/person-manage.vue
+++ b/src/components/view/person-manage.vue
@@ -174,8 +174,8 @@
           <el-button size="small" @click="refresh()">閲� 缃�</el-button>
           <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
         </div>
-        <div class="search_thing">
-          <el-button size="small" type="primary" @click="openthirdParty">鑾峰彇涓夋柟浜哄憳</el-button>
+        <div class="search_thing" style="display: flex;justify-content: right;margin-right: 10px;">
+          <el-button size="small" type="primary" @click="openthirdParty" v-if="addUserPower">鑾峰彇涓夋柟浜哄憳</el-button>
           <el-button size="small" type="primary" @click="opeaAdd" v-if="addPower">鏂板鐢ㄦ埛</el-button>
         </div>
       </div>
@@ -184,7 +184,7 @@
           :componentData="componentData" :key="upIndex" />
       </div>
     </div>
-    <el-dialog title="鏋舵瀯鏂板" :visible.sync="addDia0" width="400px">
+    <el-dialog title="鏋舵瀯鏂板" :visible.sync="addDia" width="400px">
       <div class="body">
         <el-row style="line-height: 50px;">
           <el-col :span="6" style="text-align: right;">
@@ -196,7 +196,7 @@
         </el-row>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="addDia0 = false">鍙� 娑�</el-button>
+        <el-button @click="addDia = false">鍙� 娑�</el-button>
         <el-button type="primary" @click="addStandardTree" :loading="addLoad">纭� 瀹�</el-button>
       </span>
     </el-dialog>
@@ -204,7 +204,7 @@
       <div class="body">
         <el-row>
           <el-col :span="9" style="height: 70vh;overflow: hidden;">
-            <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="search2" size="small" style="width: 90%;padding: 0 5% 10px 5%;"
+            <el-input placeholder="杈撳叆鍏抽敭瀛楁悳绱�" v-model="search2" size="small" style="width: 90%;padding: 0 5% 10px 5%;"
               clearable @blur="searchFilter2" @clear="searchFilter2" @keyup.enter.native="searchFilter2()">
             </el-input>
             <el-tree :data="datathirdParty" node-key="id" :props="defaultProps" @node-click="nodeClick2"
@@ -289,7 +289,8 @@
             font: '缂栬緫',
             type: 'text',
             method: 'doDiy',
-            field: ['createUserName', 'updateUserName', 'roleName', '瑙掕壊=roleId', '瀵嗙爜=password']
+            field: ['roleName', '瑙掕壊=roleId', '瀵嗙爜=password',
+            '濮撳悕EN=nameEn','骞撮緞=age','閭=email','鍗曚綅=company','绛惧悕=pictureUrl','鏈汉鐓�=signatureUrl']
           }],
           tagField: {
             state: {
@@ -344,6 +345,7 @@
         upIndex: 0,
         addDia: false,
         addPower: true,
+        addUserPower: true,
         delStandardTree: true,
         addDia0: false,
         addOb: {
@@ -464,6 +466,7 @@
         let power = JSON.parse(sessionStorage.getItem('power'))
         let up = false
         let add = false
+        let addUserPower = false
         let delStandardTree = false
         for (var i = 0; i < power.length; i++) {
           if (power[i].menuMethod == 'updateUser') {
@@ -475,16 +478,22 @@
           if (power[i].menuMethod == 'delDepartment') {
             delStandardTree = true
           }
+          if (power[i].menuMethod == 'selectCompaniesList') {
+            addUserPower = true
+          }
         }
         if (!up) {
           this.componentData.do.splice(0, 1)
         }
         this.delStandardTree = delStandardTree
         this.addPower = add
+        this.addUserPower = addUserPower
       },
       handleAdd() {
+        console.log(`output->this.addOb.fatherId`,this.addOb.fatherId)
+        console.log(`output->this.addOb.name`,this.addOb.name)
         if (this.addOb.fatherId||this.addOb.name=='鍏ㄩ儴') {
-          this.addDia0 = true;
+          this.addDia = true;
         } else {
           this.$message.error('璇烽�夋嫨涓�涓灦鏋勫眰绾�')
         }
@@ -515,7 +524,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) {
@@ -580,18 +589,18 @@
             return
           }
           this.$message.success('娣诲姞鎴愬姛')
-          this.addDia0 = false
+          this.addDia = false
           this.selectTreeList()
           this.addLoad = false
           this.addOb.name = ''
           this.addOb.fatherId = ''
         }).catch(e => {
-          this.addDia0 = false
+          this.addDia = false
           this.addLoad = false
         })
       },
       nodeClick2(ob, node, el) {
-        this.currentCompaniesList[node.level-1] = ob.id
+        this.getNodeParent(node)
         if (ob.id !== 'SC21') {
           this.personLoad = true
           this.$axios.post(this.$api.companies.selectSimpleList, {
@@ -604,6 +613,12 @@
           })
         }
       },
+      getNodeParent(val){
+        this.currentCompaniesList[val.level-1] = val.data.id
+        if(val.parent!=null){
+          this.getNodeParent(val.parent)
+        }
+      },
       handleSelectionChange(val) {
         this.multipleSelection = val;
       },
@@ -614,24 +629,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,
@@ -646,10 +654,13 @@
             return
           }
           this.$message.success('鎿嶄綔鎴愬姛')
-          this.refresh()
           this.multipleSelection = []
           this.$refs.personTable.clearSelection()
           this.addthirdParty = false
+          this.addLoad = false
+          this.personList = []
+          this.userSearch2 = ''
+          this.selectTreeList()
         }).catch(e => {
           this.addthirdParty = false
           this.addLoad = false

--
Gitblit v1.9.3