/*
 * @Author: zc
 * @description 系统管理- 班次管理
 */
import request from '@/utils/request';
/**
 * @description 获取排班人员列表
 * @param {object} params
 * @return {*}
 */
export const getWorkforceList = (params?: object) => {
	return request({
		url: '/api/v1/Scheduling/user_list',
		method: 'get',
		params,
	});
};
/**
 * @description 新增排班人员
 * @return {*}
 * @param data
 */
export const addWorkforce = (data: object) => {
	return request({
		url: '/api/v1/Scheduling/user',
		method: 'post',
		data,
	});
};
/**
 * @description 删除排版人员
 * @return {*}
 * @param data
 */
export const deleteWorkforce = (data: object) => {
	return request({
		url: '/api/v1/Scheduling/user',
		method: 'delete',
		data,
	});
};
/**
 * @description 获取班次列表
 * @param {object} params
 * @return {*}
 */
export const getWorkforceClassList = (params?: object) => {
	return request({
		url: '/api/v1/Scheduling/shift_list',
		method: 'get',
		params,
	});
};
/**
 * @description 新增班次
 * @return {*}
 * @param data
 */
export const addWorkforceClass = (data: object) => {
	return request({
		url: '/api/v1/Scheduling/shift',
		method: 'post',
		data,
	});
};
/**
 * @description 获取班次详情
 * @return {*}
 * @param id
 */
export const getWorkforceClassDetail = (id: string) => {
	return request({
		url: `/api/v1/Scheduling/shift/${id}`,
		method: 'get',
	});
};
/**
 * @description 编辑班次
 * @return {*}
 * @param data
 */
export const updateWorkforceClass = (data: object) => {
	return request({
		url: '/api/v1/Scheduling/shift',
		method: 'put',
		data,
	});
};
/**
 * @description 删除班次
 * @return {*}
 * @param data
 */
export const deleteWorkforceClass = (data: object) => {
	return request({
		url: '/api/v1/Scheduling/shift',
		method: 'delete',
		data,
	});
};
/**
 * @description 获取班次人员列表
 * @return {*}
 * @param params
 */
export const getWorkforceClassUserList = (params: object) => {
	return request({
		url: '/api/v1/Scheduling/data',
		method: 'get',
		params,
	});
}
/**
 * @description 批量排班
 * @return {*}
 * @param data
 */
export const batchScheduling = (data: object) => {
	return request({
		url: '/api/v1/Scheduling',
		method: 'post',
		data,
	});
}
/**
 * @description 排班修改
 * @return {*}
 * @param data
 */
export const updateScheduling = (data: object) => {
	return request({
		url: '/api/v1/Scheduling',
		method: 'put',
		data,
	});
}
/**
 * @description 排班详情
 * @return {*}
 * @param id
 */
export const getSchedulingDetail = (id: string) => {
	return request({
		url: `/api/v1/Scheduling/${id}`,
		method: 'get',
	});
}
/**
 * @description 批量删除排班
 * @param {object} data
 * @return {*}
 */
export const deleteScheduling = (data:object) => {
	return request({
		url: `/api/v1/Scheduling`,
		method: 'delete',
		data
	});
}