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

/**
 * 获取供应商列表
 * @returns
 */
export function getVendorPage(data, urlType = 'product') {
	return request({
		url: `${urlType}/admin/product/vendor/page`,
		method: "GET",
		data: {
			...data
		}
	})
}


/**
 * 获取供应商列表/无分页
 * @returns
 */
export function getVendorList(urlType = 'product') {
	return request({
		url: `${urlType}/admin/product/vendor/list`,
		method: "GET"
	})
}

/**
 * 添加供应商
 * @returns
 */
export function addVendor(data, urlType = 'product') {
	return request({
		url: `${urlType}/admin/product/vendor`,
		method: "POST",
		data: {
			...data
		}
	})
}

/**
 * 编辑供应商
 * @returns
 */
export function editVendor(data, urlType = 'product') {
	return request({
		url: `${urlType}/admin/product/vendor`,
		method: "PUT",
		data: {
			...data
		}
	})
}

/**
 * 删除供应商
 * @returns
 */
export function delVendor(id, urlType = 'product') {
	return request({
		url: `${urlType}/admin/product/vendor/${id}`,
		method: "DELETE",
	})
}