gaoluyang
5 天以前 af4f913751c08fd6ef70cb183de2fb3c604bab38
人力资源-添加导出功能
已修改2个文件
39 ■■■■■ 文件已修改
src/views/personnelManagement/payrollManagement/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/scheduling/index.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/payrollManagement/index.vue
@@ -27,8 +27,8 @@
                >
            </div>
            <div>
                <el-button @click="handleExport" style="margin-right: 10px">导出</el-button>
                <el-button type="primary" @click="openForm('add')">新增薪资</el-button>
<!--                <el-button @click="handleOut">导出</el-button>-->
                <el-button type="danger" plain @click="handleDelete">删除</el-button>
            </div>
        </div>
@@ -51,7 +51,7 @@
<script setup>
import { Search } from "@element-plus/icons-vue";
import {onMounted, ref} from "vue";
import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
import FormDia from "@/views/personnelManagement/payrollManagement/components/formDia.vue";
import {staffJoinDel} from "@/api/personnelManagement/onboarding.js";
import {ElMessageBox} from "element-plus";
@@ -283,6 +283,22 @@
            proxy.$modal.msg("已取消");
        });
};
// 导出薪资管理
const handleExport = () => {
    ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
    })
        .then(() => {
            proxy.download("/compensationPerformance/export", { ...searchForm.value, ...page }, "薪资管理.xlsx");
        })
        .catch(() => {
            proxy.$modal.msg("已取消");
        });
};
onMounted(() => {
    getList();
});
src/views/personnelManagement/scheduling/index.vue
@@ -37,6 +37,10 @@
            <el-icon><Refresh/></el-icon>
            重置
          </el-button>
          <el-button @click="handleExport">
            <el-icon><Download/></el-icon>
            导出
          </el-button>
          <el-button type="primary" @click="openScheduleDialog('add')">
          <el-icon><Plus/></el-icon>
          新增排班
@@ -244,7 +248,7 @@
</template>
<script setup>
import {ref, reactive, computed, onMounted} from 'vue'
import {ref, reactive, computed, onMounted, getCurrentInstance} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import {useDict} from "@/utils/dict.js"
import {Plus, Download, Search, Refresh} from '@element-plus/icons-vue'
@@ -252,6 +256,8 @@
import {getStaffOnJob} from "@/api/personnelManagement/onboarding.js";
import dayjs from "dayjs";
import pagination from "@/components/PIMTable/Pagination.vue";
const { proxy } = getCurrentInstance();
const tableCount = ref(0)
// 响应式数据
@@ -482,6 +488,17 @@
  selectedRows.value = selection
}
// 导出
const handleExport = () => {
  let searchForm = {
    ...filterForm,
    ...(filterForm.dateRange.length > 0 && {
      startDate: filterForm.dateRange[0],
      endDate: filterForm.dateRange[1],
    })
  }
  proxy.download('/staff/staffScheduling/export', {}, '人员排班.xlsx')
}
// 生命周期
onMounted(() => {