import request from '@/utils/request'

const baseUrl = import.meta.env.VITE_APP_BASE_API
// 查询工艺从表列表
export function listTechnologicalProcessDetail(query) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/list',
		method: 'get',
		params: query
	})
}

// 查询工艺从表下拉框
export function getTechnologicalProcessDetails(query) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/getTechnologicalProcessDetails',
		method: 'get',
		params: query
	})
}
// 查询工艺从表详细
export function getTechnologicalProcessDetail(id) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/' + id,
		method: 'get'
	})
}
// 新增工序(单条保存)
export function saveSingleTechnologicalProcessDetail(data) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/singleSave',
		method: 'post',
		data: data
	})
}
// 新增工艺从表
export function saveTechnologicalProcessDetail(data) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/save',
		method: 'post',
		data: data
	})
}

// 删除工艺从表
export function delTechnologicalProcessDetail(id) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/' + id,
		method: 'delete'
	})
}

// 获取工序，用于供应商管理中的相关工序的配置
export function getProcessesForSupplier(data) {
	return request({
		url: baseUrl + '/base/technologicalProcessDetail/getProcessesForSupplier',
		method: 'post',
		data: data
	})
}
