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: {
@@ -322,25 +322,14 @@
            },
            company: {select: []}
          },
          /* cascaderField:{
            departId:{
              tree:[]
            },
            // 字段配置
            props:{
              value:'id',
              label:'name',
              checkStrictly: true
            }
          }, */
          requiredAdd: ['account', 'name', 'state', 'roleId', 'password', 'nameEn', 'phone'],
          requiredUp: ['account', 'name', 'state', 'roleId', 'nameEn', 'phone'],
          // disabledUp:['departId'],
          addUpload: ['pictureUrl', 'signatureUrl'],
          addUploadConfig: {
            accept: '.png, .jpg, .jpeg, .gif',
            url: this.$api.deviceScope.uploadFile
          },
          needSort: ['name', 'state'],
        },
        entityCopy: {},
        upIndex: 0,
@@ -360,14 +349,14 @@
        addLoad: false,
        personList: [],
        personListCopy: [],
        treeLoad: false,
        personLoad: false,
        search2: '',
        multipleSelection: [],
        companiesList: [],
        currentCompaniesList: [],
        userSearch2: '',
        searchEmployeeID: null
        searchEmployeeID: null,
        thirdPartyLoading:false
      }
    },
    // watch: {
@@ -383,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('由于未选中具体角色,新增用户将成为默认角色')
@@ -425,12 +427,6 @@
      opeaAdd() {
        this.$refs.ValueTable.openAddDia(this.$api.user.addUser);
        this.$refs['ValueTable'].upData.departId = this.selectTree
      },
      selectTreeList() {
        /* this.$axios.get(this.$api.department.selectDepartment).then(res => {
          this.componentData.cascaderField.departId.tree = this.handleTree(res.data[0].children)
            }) */
        this.$refs.ValueTable.selectList()
      },
      handleTree(arr) {
        arr.forEach(a => {
@@ -509,12 +505,6 @@
      nodeClose(data, node, el) {
        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
      },
      getNodeParent(val) {
        if (val.parent != null) {
          this.selectTree += ' - ' + val.label
          this.getNodeParent(val.parent)
        }
      },
      remove(node, data) {
        this.$confirm("是否删除该层级", "提示", {
          type: "error"
@@ -529,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()
        })
      },
@@ -555,7 +547,7 @@
          }
          this.$message.success('添加成功')
          this.addDia = false
          this.selectTreeList()
          this.selectTreeList(true)
          this.addLoad = false
          this.addOb.name = ''
        }).catch(e => {
@@ -623,7 +615,7 @@
          this.$refs.personTable.clearSelection()
          this.addLoad = false
          this.userSearch2 = ''
          this.selectTreeList()
          this.selectTreeList(true)
        }).catch(e => {
          this.addLoad = false
        })