yubo
2026-03-12 d62d67dc663b2b45411e11da11357419926cc76f
src/views/dashboard/zzUser.vue
@@ -10,12 +10,8 @@
  >
    <div class="app-container">
      <div class="filter-container" style="margin-left: -340px;">
        <el-input v-model="queryParams.name" placeholder="姓名/身份证号/护卫点/员工编号" class="filter-item search-item" />
        <el-button class="filter-item" type="primary" @click="search">
          {{ $t('table.search') }}
        </el-button>
        <el-button class="filter-item" type="success" @click="reset">
          {{ $t('table.reset') }}
        <el-button class="filter-item" type="warning" @click="handleExport">
          导出
        </el-button>
      </div>
      <el-table
@@ -91,7 +87,7 @@
      }, // 查询参数
      sort: {}, // 排序
      pagination: { // 分页参数
        size: 5,
        size: 15,
        num: 1
      },
      probationStatusOptions: [],
@@ -99,7 +95,26 @@
      defaultProps: {
        children: 'children',
        label: 'label'
      }
      },
      // 导出配置
      exportConfig: {
        selectedFields: [
          'empNumb', // 员工编号
          'allDeptName', // 部门(护卫点)
          'jobName', // 岗位
          'empName', // 姓名
          'certificateNumb', // 身份证号码
          'birthdate', // 出生日期
          'insuranceTypeName', // 社保档位
          'socialNumb', // 社保电脑号
          'entryDate', // 入职日期
          'probationDate', // 转正日期
          'probationStatusName' // 转正状态
        ],
        exportUrl: 'hr/empBaseInfo/export/probation',
        fileName: '员工转正提醒.xls'
      },
      selectIndex: 0 // 存储传入的时间筛选索引
    }
  },
  computed: {
@@ -139,6 +154,8 @@
      this.queryParams.index = index
      this.queryParams.number = number
      this.queryParams.name = null
      this.selectIndex = index !== null ? index : 0 // 保存传入的 index
      this.pagination.num = 1
      this.search()
    },
    fetch(params = {}) {
@@ -147,6 +164,12 @@
      params.pageNum = this.pagination.num
      params.delFlag = 0
      params.empStatus = 0
      // 添加 index 参数
      if (params.timeRange === undefined || params.timeRange === null) {
        params.timeRange = this.selectIndex
      }
      this.$get('hr/empBaseInfo/probation/alert', {
        ...params
      }).then((r) => {
@@ -157,6 +180,27 @@
    },
    cancleChoose() {
      this.$emit('cancleChooseUser')
    },
    // 导出方法
    handleExport() {
      const params = {
        ...this.queryParams,
        index: this.selectIndex, // 使用当前查询的 index
        delFlag: 0,
        empStatus: 0,
        exportField: this.exportConfig.selectedFields.join(',')
      }
      this.$download(
        this.exportConfig.exportUrl,
        params,
        this.exportConfig.fileName
      ).then(() => {
        this.$message({
          message: '下载成功!',
          type: 'success'
        })
      })
    }
  }
}