/*
 * 企业信息
 *
 * @Author:    开云
 * @Date:      2022-09-03 21:47:28
 * @Wechat:    zhuda1024
 * @Email:     lab1024@163.com
 * @Copyright  1024创新实验室 （ https://1024lab.net ），Since 2012
 */
import {postRequest, getRequest, postDownload} from '/@/lib/axios';

export const enterpriseApi = {
    // 新建企业 @author 开云
    create: (param: any) => {
        return postRequest('/oa/enterprise/create', param);
    },

    // 删除企业 @author 开云
    delete: (enterpriseId: number) => {
        return getRequest(`/oa/enterprise/delete/${enterpriseId}`, {});
    },

    // 查询企业详情 @author 开云
    detail: (enterpriseId: number) => {
        return getRequest(`/oa/enterprise/get/${enterpriseId}`, {});
    },

    // 分页查询企业模块 @author 开云
    pageQuery: (param: any) => {
        return postRequest('/oa/enterprise/page/query', param);
    },

    // 导出企业数据excel @author 卓大
    exportExcel: (param: any) => {
        return postDownload('/oa/enterprise/exportExcel', param);
    },

    //企业列表查询 含数据范围 @author 开云
    queryList: (type: string) => {
        let query = '';
        if (type) {
            query = `?type=${type}`;
        }
        return getRequest(`/oa/enterprise/query/list${query}`, {});
    },

    // 编辑企业 @author 开云
    update: (param: any) => {
        return postRequest('/oa/enterprise/update', param);
    },
    // 企业全部员工List @author yandy
    employeeList: (param: any) => {
        return postRequest('/oa/enterprise/employee/list', param);
    },
    // 分页查询企业员工List @author 卓大
    queryPageEmployeeList: (param: any) => {
        return postRequest('/oa/enterprise/employee/queryPage', param);
    },
    // 添加员工 @author yandy
    addEmployee: (param: any) => {
        return postRequest('/oa/enterprise/employee/add', param);
    },

    // 删除员工 @author yandy
    deleteEmployee: (param: any) => {
        return postRequest('/oa/enterprise/employee/delete', param);
    },

};
