import request from '@/utils/request'
import Qs from 'qs';

/**
 * 请假相关页面
 * @param params
 */



//获取请假列表（个人）
export function pageList(params) {
    return request({
        url: '/mobile/requestForLeave/pageList',
        data: Qs.stringify(params),
        method: 'post',
    })
}

//请假类型列表
export function leaveTypeList(params) {
    return request({
        url: '/mobile/requestForLeave/leaveTypeList',
        data: Qs.stringify(params),
        method: 'post',
    })
}
//审批人列表
export function approvedList(params) {
    return request({
        url: '/mobile/workAttendance/approvalList',
        data: Qs.stringify(params),
        method: 'post',
    })
}
//获取请假详情
export function detail(params) {
    return request({
        url: '/mobile/requestForLeave/detail',
        data: Qs.stringify(params),
        method: 'post',
    })
}

//提交请假
export function save(params) {

    return request.post('/mobile/requestForLeave/save', params,{
        headers: {
            "Content-Type": "application/json"
        }

    });
}

//获取请假列表（管理）
export function approvedPageList(params) {
    return request({
        url: '/mobile/requestForLeave/approvedPageList',
        data: Qs.stringify(params),
        method: 'post',
    })
}

//请假   审批
export function approved(params) {
    return request({
        url: '/mobile/requestForLeave/approved',
        data: Qs.stringify(params),
        method: 'post',
    })
}

