晏有为
2024-05-27 1344317356b0407f4aff867865ba72248871ac1f
src/components/view/person-manage.vue
@@ -289,7 +289,7 @@
            font: '编辑',
            type: 'text',
            method: 'doDiy',
            field: ['createUserName', 'updateUserName', 'roleName', '角色=roleId', '密码=password',
            field: ['roleName', '角色=roleId', '密码=password',
            '姓名EN=nameEn','年龄=age','邮箱=email','单位=company','签名=pictureUrl','本人照=signatureUrl']
          }],
          tagField: {
@@ -490,8 +490,10 @@
        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('请选择一个架构层级')
        }
@@ -522,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) {
@@ -587,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, {
@@ -611,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;
      },
@@ -621,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,
@@ -659,7 +660,7 @@
          this.addLoad = false
          this.personList = []
          this.userSearch2 = ''
          this.refresh()
          this.selectTreeList()
        }).catch(e => {
          this.addthirdParty = false
          this.addLoad = false