yubo
2026-03-11 09d00cd810cebc2b78c3928a8673f569cbffe165
feat(dashboard): 添加四险提醒统计功能和导出功能

- 在dashboard页面添加四险提醒统计注释
- 为sfzUser组件新增导出按钮功能
- 扩展查询参数添加timeRange字段
- 配置导出功能的字段选择和接口设置
- 实现导出方法并处理时间筛选索引逻辑
- 添加下载成功消息提示功能
2个文件已修改
46 ■■■■■ 已修改文件
src/views/dashboard/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/sfzUser.vue 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dashboard/index.vue
@@ -257,6 +257,7 @@
    <sfz-user ref="sfzUser" :dialog-visible="dialog.dialogShowSfz" :title="title" @cancleChooseUser="cancleSfzUser" />
    <ct-user ref="ctUser" :dialog-visible="dialog.dialogShowct" :title="title" @cancleChooseUser="canclectUser" />
    <zz-user ref="zzUser" :dialog-visible="dialog.dialogShowProbation" :title="title" @cancleChooseUser="cancleZzUser" />
    <!--    四险提醒统计-->
    <insurance-user ref="insuranceUser" :dialog-visible="dialog.dialogShowInsurance" :title="title" @cancleChooseUser="cancleInsuranceUser" />
  </div>
</template>
src/views/dashboard/sfzUser.vue
@@ -17,6 +17,10 @@
        <el-button class="filter-item" type="success" @click="reset">
          {{ $t('table.reset') }}
        </el-button>
        <!-- 新增导出按钮 -->
        <el-button class="filter-item" type="warning" @click="handleExport">
          导出
        </el-button>
      </div>
      <el-table
        ref="multipleTable"
@@ -91,7 +95,8 @@
        btime: null,
        etime: null,
        index: null,
        number: null
        number: null,
        timeRange: null
      }, // 查询参数
      sort: {}, // 排序
      pagination: { // 分页参数
@@ -102,7 +107,22 @@
      defaultProps: {
        children: 'children',
        label: 'label'
      }
      },
      // 导出配置
      exportConfig: {
        selectedFields: [
          'empNumb', // 编号
          'allDeptName', // 部门(护卫点)
          'jobName', // 岗位
          'empName', // 姓名
          'certificateNumb', // 身份证号码
          'certificateValidity', // 身份证有效期
          'empStatus' // 员工状态
        ],
        exportUrl: 'hr/empBaseInfo/export/sfz', // 需要后端提供对应接口
        fileName: '身份证到期员工列表.xls'
      },
      selectIndex: 0 // 存储传入的时间筛选索引
    }
  },
  computed: {
@@ -131,6 +151,7 @@
      this.queryParams.etime = etime
      this.queryParams.index = index
      this.queryParams.number = number
      this.selectIndex = index !== null ? index : 0 // 保存传入的 index
      this.queryParams.name = null
      this.search()
    },
@@ -148,6 +169,26 @@
    },
    cancleChoose() {
      this.$emit('cancleChooseUser')
    },
    // 导出方法
    handleExport() {
      const params = {
        ...this.queryParams,
        index: this.queryParams.index !== null ? this.queryParams.index : this.selectIndex,
        timeRange: this.queryParams.index !== null ? this.queryParams.index : this.selectIndex,
        exportField: this.exportConfig.selectedFields.join(',')
      }
      this.$download(
        this.exportConfig.exportUrl,
        params,
        this.exportConfig.fileName
      ).then(() => {
        this.$message({
          message: '下载成功!',
          type: 'success'
        })
      })
    }
  }
}