import request from '@/utils/request'

export function addApply(data) { 
	return request({
	  'url': '/routine/leaveApplication/add', 
	  'method': 'post',
	  'data': data
	})
}

// leaveApplication
export function getStuInfo(data) { 
	return request({
	  'url': '/routine/leaveApplication/getStuInfo',
	  'method': 'get',
	  data
	})
}
export function commonUpload() {
	uni.uploadFile({
		url: '/common/upload', //仅为示例，非真实的接口地址
		filePath: e.tempFilePaths[0],
		name: 'file',
		success: (uploadFileRes) => {
			console.log(uploadFileRes.data);
		}
	});
}
//保存
export function leaveSave(data) { 
	return request({
	  'url': '/routine/leaveApplication/save', 
	  'method': 'post',
	  'data': data
	})
}
//请假列表  新建请假列表，在列表里面新增假条、删除
//list?pageNum=1&pageSize=10   leaveStatus 状态  （0、保存；1、提交）
export function leaveList(data) { 
	return request({
	  'url': '/routine/leaveApplication/list',
	  'method': 'get',
	  'data':data
	})
}

//删除
export function leaveDel(id) { 
	return request({
	  'url': '/routine/leaveApplication/'+id, 
	  'method': 'post',
	})
}
// 详情
export function leaveDetail(id) { 
	return request({
	  'url': '/routine/leaveApplication/'+id,
	  'method': 'get'
	})
}
//修改
export function editApply(data) { 
	return request({
	  'url': '/routine/leaveApplication/update', 
	  'method': 'post',
	  'data': data
	})
}
