import http from '@/http/yskApi/http.js'
const request = http.request

/**
 * 获取耗材分页
 * @returns
 */
export function getConsPage(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/cons/page`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 获取耗材列表
 * @returns
 */
export function getConsList(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/cons/list`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 耗材添加
 * @returns
 */
export function addCons(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/cons`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 耗材修改
 * @returns
 */
export function editCons(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/cons`,
		method: "PUT",
		data: {
			...data
		}
	})
}


/**
 * 获取耗材类别
 * @returns
 */
export function getConsGrpupPage(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/consGroup/page`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 获取耗材类别
 * @returns
 */
export function getConsGrpupList(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/consGroup/list`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 新增耗材类别
 * @returns
 */
export function addConsGrpup(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/consGroup`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 修改耗材类别
 * @returns
 */
export function editConsGrpup(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/consGroup`,
		method: "PUT",
		data: {
			...data
		}
	})
}

/**
 * 启用耗材类别
 * @returns
 */
export function consGrpupEnable(id, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/consGroup/enable/${id}`,
		method: "POST",
	})
}

/**
 * 禁用耗材类别
 * @returns
 */
export function consGrpupDisable(id, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/consGroup/disable/${id}`,
		method: "POST",
	})
}


/**
 * 耗材入库
 * @returns
 */
export function consStockIn(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/stock/in`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 耗材出库
 * @returns
 */
export function stockOut(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/stock/out`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 库存盘点
 * @returns
 */
export function stockCheck(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/stock/check`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 耗材报损
 * @returns
 */
export function stockReportDamage(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/stock/reportDamage`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 耗材库存变动记录
 * @returns
 */
export function stockFlow(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/stock/flow`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 耗材统计
 * @returns
 */
export function consStatistics(data, urlType = 'product') {
	return request({
		url: `/${urlType}/admin/product/cons/statistics`,
		method: "GET",
		data: {
			...data
		}
	})
}