licp
2024-12-23 0e5763b1b39de488adb3bcc856a2201f87597a08
src/components/view/person-manage.vue
@@ -130,7 +130,7 @@
        @node-collapse="nodeClose" v-loading="treeLoad" :expand-on-click-node="false" default-expand-all>
        <div class="custom-tree-node" slot-scope="{ node, data }">
          <el-row style="width: 100%;">
            <el-col :span="21" :class="{sort:node.level>3}">
            <el-col :span="21" :class="{sort:node.level>3}" style="text-align: left;">
              <span><i
                  :class="`node_i ${data.children != undefined&&data.children.length>0 ? 'el-icon-folder-opened' : 'el-icon-tickets'}`"></i>
                {{ data.name }}</span>
@@ -178,7 +178,7 @@
        </div>
      </div>
      <div class="table">
        <ValueTable ref="ValueTable" :url="$api.user.selectUserList" :upUrl="$api.user.updateUser"
        <ValueTable ref="ValueTable" :url="$api.user.selectUserList2" :upUrl="$api.user.updateUser"
          :componentData="componentData" :key="upIndex" />
      </div>
    </div>
@@ -199,9 +199,9 @@
      </span>
    </el-dialog>
    <el-dialog title="获取人事系统人员信息" :visible.sync="addthirdParty" width="70%">
      <div class="body">
      <div class="body" v-loading="thirdPartyLoading">
        <el-row>
          <el-col :span="8" style="height: 70vh;overflow: hidden;">
          <el-col :span="8" style="height: 70vh;overflow: hidden;" v-if="companiesList.length!=1">
            <el-input placeholder="输入关键字搜索" v-model="search2" size="small" style="width: 90%;padding: 0 5% 10px 5%;"
              clearable @clear="searchFilter2" @keyup.enter.native="searchFilter2()">
            </el-input>
@@ -210,7 +210,7 @@
              highlight-current>
            </el-tree>
          </el-col>
          <el-col :span="16" style="height: 70vh;padding-left: 8px;">
          <el-col :span="companiesList.length==1?24:16" style="height: 70vh;padding-left: 8px;">
            <div class="search_thing" style="width: 100%;margin-bottom: 10px;justify-content: right;">
              <div class="search_label" style="width: 200px;">员工号/员工姓名:</div>
              <div class="search_input" style="width: 250px;">
@@ -289,7 +289,7 @@
            type: 'text',
            method: 'doDiy',
            field: ['roleName', '角色=roleId', '密码=password',
              '姓名EN=nameEn', '年龄=age', '邮箱=email', '单位=company', '签名=pictureUrl', '个人照片=signatureUrl'
              '姓名EN=nameEn', '年龄=age', '邮箱=email', '单位=company', '签名=signatureUrl', '个人照片=pictureUrl'
            ]
          }],
          tagField: {
@@ -329,6 +329,7 @@
            accept: '.png, .jpg, .jpeg, .gif',
            url: this.$api.deviceScope.uploadFile
          },
          needSort: ['name', 'state'],
        },
        entityCopy: {},
        upIndex: 0,
@@ -354,7 +355,8 @@
        companiesList: [],
        currentCompaniesList: [],
        userSearch2: '',
        searchEmployeeID: null
        searchEmployeeID: null,
        thirdPartyLoading:false
      }
    },
    // watch: {
@@ -370,8 +372,21 @@
    methods: {
      openthirdParty() {
        this.addthirdParty = true;
        this.thirdPartyLoading = true;
        this.$axios.get(this.$api.companies.selectCompaniesList).then(res => {
          this.companiesList = this.HaveJson(res.data);
          if(this.companiesList.length ==1){
            this.$axios.post(this.$api.companies.selectSimpleList, {
              companyId: this.companiesList[0].companyId
            }).then(res => {
              this.thirdPartyLoading = false;
              this.personListCopy = JSON.parse(JSON.stringify(res.data))
              this.personList = res.data
              this.$refs.personTable.doLayout()
            })
          }else{
            this.thirdPartyLoading = false;
          }
          this.datathirdParty = this.tranListToTreeData(res.data, "ROOT");
        })
        if(this.componentData.entity.roleId > 10000)this.$message.warning('由于未选中具体角色,新增用户将成为默认角色')
@@ -504,12 +519,14 @@
          })
        }).catch(e => {})
      },
      selectTreeList() {
      selectTreeList(e) {
        this.treeLoad = true
        this.$axios.get(this.$api.department.selectDepartment).then(res => {
          this.list = res.data
          this.treeLoad = false
          this.componentData.entity.roleId = this.list[0].id;
          if(!e){
            this.componentData.entity.roleId = this.list[0].id;
          }
          this.refreshTable()
        })
      },
@@ -530,7 +547,7 @@
          }
          this.$message.success('添加成功')
          this.addDia = false
          this.selectTreeList()
          this.selectTreeList(true)
          this.addLoad = false
          this.addOb.name = ''
        }).catch(e => {
@@ -598,7 +615,7 @@
          this.$refs.personTable.clearSelection()
          this.addLoad = false
          this.userSearch2 = ''
          this.selectTreeList()
          this.selectTreeList(true)
        }).catch(e => {
          this.addLoad = false
        })