import request from '@/utils/request'

// 查询来料检验列表
export function listIncome(query) {
	return request({
		url: '/quality/qcIncome/list',
		method: 'get',
		params: query
	});
}

// 查询来料检验详细
export function getIncome(recordId) {
	return request({
		url: '/quality/qcIncome/' + recordId,
		method: 'get'
		});
}

// 新增来料检验
export function addIncome(data) {
	return request({
		url: '/quality/qcIncome',
		method: 'post',
		data: data
	});
}

// 修改来料检验
export function updateIncome(data) {
	return request({
		url: '/quality/qcIncome',
		method: 'put',
		data: data
	});
}

// 删除来料检验
export function delIncome(recordId) {
	return request({
		url: '/quality/qcIncome/' + recordId,
		method: 'delete'
	});
}

// 查询BOM物料管理列表
export function getQcListBom(query) {
	return request({
	  url: '/quality/qcIncome/getQcListBom',
	  method: 'get',
	  params: query
	});
  }

// 查询供应商管理列表
export function getQcListSupplier(query) {
	return request({
	  url: '/quality/qcIncome/getQcListSupplier',
	  method: 'get',
	  params: query
	});
  }

// 查询人员列表
export function getQcListUser(query) {
	return request({
	  url: '/quality/qcIncome/getQcListUser',
	  method: 'get',
	  params: query
	});
  }

//状态修改
export function changeIncomeStatus(recordId, status) {
	const data = {
		recordId,
	    status
	}
	return request({
	  url: '/quality/qcIncome/changeIncomeStatus',
	  method: 'put',
	  data: data
	})
  }

// 查询检测项列表
export function getCkeckProjectList(query) {
	return request({
	  url: '/quality/qcIncome/getCkeckProjectList',
	  method: 'get',
	  params: query
	});
  }

//合格不合格 
export function changeCheckDetailStatus(recordId, status) {
	const data = {
		recordId,
		status
	}
	return request({
		url: '/quality/qcIncome/changeCheckDetailStatus',
		method: 'put',
		data: data
	})
} 

//测量值提交
export function commitActualValue(recordId, actualValues) {
	const data = {
		recordId,
		actualValues
	}
	return request({
		url: '/quality/qcIncome/commitActualValue',
		method: 'put',
		data: data
	})
} 

//审核结果提交
export function commitCheckResult(recordId,typeCode,checkType) {
	const data = {
		recordId,
		typeCode,
		checkType
	}
	return request({
		url: '/quality/qcIncome/commitCheckResult',
		method: 'put',
		data: data
	})
} 
