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

/**
 * 考勤相关
 * @param params
 */

//获取考勤记录
export function pageList(params) {
	return request({
		url: '/mobile/workAttendance/pageList',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//获取申请补卡详情
export function getApplyInfo(params) {
	return request({
		url: '/mobile/workAttendance/detailPatchCard',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//申请补卡提交
export function postPatchCard(params) {
	return request({
		url: '/mobile/workAttendance/postPatchCard',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//获取时间段
export function patchCard(params) {
	return request({
		url: '/mobile/workAttendance/patchCard',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//获取审核人列表
export function getApprovalList(params) {
	return request({
		url: '/mobile/workAttendance/approvalList',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//获取补卡审批列表
export function getVerifyList(params) {
	return request({
		url: '/mobile/workAttendance/adminListPatchCard',
		data: Qs.stringify(params),
		method: 'post',
	})
}

//补卡审批
export function doVerify(params) {
	return request({
		url: '/mobile/workAttendance/approvalPatchCard',
		data: Qs.stringify(params),
		method: 'post',
	})
}


//获取考勤统计时段列表
export function getAttednanceTimeList(params) {
	return request({
		url: '/mobile/workAttendance/findAttendancePeriod',
		params: params,
		method: 'get',
	})
}

//获取考勤列表数据
export function getAttednance(params) {
	return request({
		url: '/mobile/workAttendance/workAttendanceStat',
		params: params,
		method: 'get',
	})
}

//获取考勤统计人员更多
export function getPersonList(params) {
	return request({
		url: '/mobile/workAttendance/workAttendanceStatByCompanyId',
		params: params,
		method: 'get',
	})
}

//获取考勤统计公司列表
export function getCompanyList(params) {
	return request({
		url: '/mobile/workAttendance/workAttendanceStatCompanyList',
		params: params,
		method: 'get',
	})
}

//获取考勤人员列表
export function getNewPrsonList(params) {
	return request({
		url: '/mobile/workAttendance/workAttendanceStatByCompanyIdAndDate',
		params: params,
		method: 'get',
	})
}

//获取考勤具体详情id
export function getBusinessId(id) {
	return request({
		url: '/mobile/workAttendance/getBusinessId',
		params: {
			id: id
		},
		method: 'get',
	})
}

//添加备注
export function addRemark(params) {
	return request({
		url: '/mobile/workAttendance/addRemarkForAttendance',
		data: Qs.stringify(params),
		method: 'post',
	})
}