import { http } from '@/utils/http';

/*根据username获取职位名称和审批领导列表*/
export function queryZwmcAndExaApi(username : string) {
	return http({
		url: '/CxcQxj/cxcQxj/queryZwmcByUsername',
		method: 'GET',
		data: {
			username
		}
	})
}

/*新增请假申请*/
export function addApi(config : Object) {
	return http({
		url: '/CxcQxj/cxcQxj/add',
		method: 'POST',
		data: config
	})
}

/*根据username获取最新请假结束日期*/
export function queryHisDateApi(username : string) {
	return http({
		url: '/CxcQxj/cxcQxj/queryHisDate',
		method: 'GET',
		data: {
			username
		}
	})
}

/*获取请假列表*/
export function listApi(params : object) {
	return http({
		url: '/CxcQxj/cxcQxj/list',
		method: 'GET',
		data: params
	})
}

/*获取请假数据分析*/
export function countByOrgApi(params : object) {
	return http({
		url: '/CxcQxj/cxcQxj/countByOrg',
		method: 'GET',
		data: params
	})
}

/*通过id查询数据*/
export function queryByIdApi(id : string) {
	return http({
		url: '/CxcQxj/cxcQxj/queryById',
		method: 'GET',
		data: { id }
	})
}

/*销假*/
export function editApi(config : object ) {
	return http({
		url: '/CxcQxj/cxcQxj/edit',
		method: 'PUT',
		data: config
	})
}