spring
2025-03-11 bdd5fd12d584a71b03d0f7a7a10f3364b8e5f0e1
src/views/CNAS/personnel/personnelInfo/Department/components/PersonnelList/index.vue
@@ -15,7 +15,8 @@
        <el-button :loading="synchronousLoading" size="small" type="primary" @click="synchronous"
          :v-show="departId">同步第三方人员信息</el-button>
        <el-button :loading="outLoading" size="small" type="primary" @click="handleDown">导出</el-button>
        <el-button size="small" type="primary" @click="selectUserDia = true">新建</el-button>
        <el-button size="small" type="primary"
          @click="selectUserDia = true, getList(), queryParams.name = '', multipleSelection = []">新建</el-button>
      </span>
    </div>
    <div class="search-table">
@@ -60,13 +61,15 @@
        <div class="search_thing">
          <div class="search_label">用户名:</div>
          <div class="search_input">
            <el-input v-model="addUserTableInfo.entity.name" clearable placeholder="请输入" size="small"
              @keyup.enter.native="$refs.ValueTable.selectList()"></el-input>
            <el-input v-model="queryParams.name" clearable placeholder="请输入" size="small"
              @keyup.enter.native="getList()" style="width: 200px;"></el-input>
          </div>
        </div>
      </div>
      <div v-if="selectUserDia" class="body" style="height: 60vh;">
        <ValueTable ref="ValueTable" :componentData="addUserTableInfo" :url="$api.user.selectUserList" />
        <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 290px)'"
          :page="personPage" @pagination="pagination" :isSelection="true"
          :handleSelectionChange="handleSelectionChange"></lims-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="selectUserDia = false">取 消</el-button>
@@ -77,7 +80,7 @@
</template>
<script>
import ValueTable from '@/components/Table/value-table.vue';
import limsTable from "@/components/Table/lims-table.vue";
import {
  getEmployees,
  basicInformationOfPersonnelSelectPage,
@@ -85,11 +88,12 @@
  upUserDepardLimsId,
  exportPersonBasicInfo,
  exportPersonBasicInfoById,
  selectUserList,
} from '@/api/cnas/personnel/personnelInfo.js'
export default {
  name: 'PersonnelList',
  // import 引入的组件需要注入到对象中才能使用
  components: { ValueTable },
  components: { limsTable },
  props: {
    departId: {
      type: Number,
@@ -109,6 +113,8 @@
  data() {
    // 这里存放数据
    return {
      entity: {},
      multipleSelection: [],
      synchronousLoading: false,
      page: {
        size: 20,
@@ -117,46 +123,61 @@
      outLoading: false,
      tableLoading: false,
      tableData: [], // 人员总列表数据
      selectUserDia: false, // 添加人员弹框
      entity: {
        name: '',
        orderBy: {
          field: 'id',
          order: 'asc'
      selectUserDia: false, // 添加人员弹框,
      stateList: [
        {
          value: 1,
          type: 'success',
          label: '启用'
        },
        {
          value: 0,
          type: 'danger',
          label: '停用'
        }
      ],
      queryParams: {
        name: ''
      },
      addUserTableInfo: {
        name: null,
        entity: {
          isCustom: 0,
          orderBy: {
            field: 'id',
            order: 'asc'
          }
      tableData: [],
      column: [
        { label: "姓名", prop: "name" },
        { label: "账号", prop: "account" },
        {
          label: "角色",
          prop: "roleName",
        },
        isIndex: true,
        showSelect: true,
        select: true,
        do: [],
        tagField: {
          state: {
            select: [
              {
                value: 1,
                type: 'success',
                label: '启用'
              },
              {
                value: 0,
                type: 'danger',
                label: '停用'
              }
            ]
          }
        {
          label: "状态", prop: "state", dataType: "tag",
          formatData: (params) => {
            let index = this.stateList.findIndex(
              (item) => item.value == params
            );
            if (index > -1) {
              return this.stateList[index].label;
            } else {
              return null;
            }
          },
          formatType: (params) => {
            let index = this.stateList.findIndex(
              (item) => item.value == params
            );
            if (index > -1) {
              return this.stateList[index].type;
            } else {
              return null;
            }
          },
        },
        selectField: {},
        upUserDepardLimsIdPower: true
        { label: "电话号码", prop: "phone" },
      ],
      personPage: {
        total: 0,
        size: 10,
        current: 0,
      },
      tableLoading: false,
    };
  },
  mounted() {
@@ -232,12 +253,15 @@
      this.page.current = val;
      this.refreshTable();
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    selectUser() {
      if (!this.currentCompaniesList.length > 0) {
        this.$message.warning("请选择部门!")
        return;
      }
      let selects = this.$refs.ValueTable.multipleSelection;
      let selects = this.multipleSelection;
      if (selects.length == 0) {
        this.$message.error('未选择数据');
        return;
@@ -265,6 +289,27 @@
      });
      this.$emit('refreshTree')
    },
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.personPage };
      delete param.total;
      selectUserList({ ...param })
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data.records;
            this.personPage.total = res.data.total;
          }
        })
        .catch((err) => {
          this.tableLoading = false;
        });
    },
    pagination({ page, limit }) {
      this.personPage.current = page;
      this.personPage.size = limit;
      this.getList();
    },
    handleDown() {
      this.outLoading = true;
      let entity = this.HaveJson(this.entity)