import request from '@/utils/wms-request'


// 查询仓库列表
export function listWarehouse(query) {
	return request({
		url: '/basic/warehouse/list',
		method: 'get',
		params: query
	})
}

export function getReceiveDetails(data) {
	return request({
		url: '/produce/product/receive/getDetails',
		method: 'post',
		data: data
	})
}

// export function getDetails(data) {
// 	return request({
// 		url: '/produce/product/receive/getDetails',
// 		method: 'post',
// 		data: data
// 	})
// }

// 查询生产入库任务单列表
export function listTask(query) {
	return request({
		url: '/produce/product/task/list',
		method: 'get',
		params: query
	})
}

// 查询生产入库任务单详细
export function getTask(id) {
	return request({
		url: '/produce/product/task/' + id,
		method: 'get'
	})
}

// 新增生产入库任务单
export function addTask(data) {
	return request({
		url: '/produce/product/task',
		method: 'post',
		data: data
	})
}

// 修改生产入库任务单
export function updateTask(data) {
	return request({
		url: '/produce/product/task',
		method: 'put',
		data: data
	})
}

// 删除生产入库任务单
export function delTask(id) {
	return request({
		url: '/produce/product/task/' + id,
		method: 'delete'
	})
}


// 查询产品收货单列表
export function listReceive(query) {
	return request({
		url: '/produce/product/receive/list',
		method: 'get',
		params: query
	})
}

// 查询产品收货单详细
export function getReceive(id) {
	return request({
		url: '/produce/product/receive/' + id,
		method: 'get'
	})
}

export function getDetails(data) {
	return request({
		url: '/produce/product/in/getDetails',
		method: 'post',
		data: data
	})
}

// 新增产品收货单
export function addReceive(data) {
	return request({
		url: '/produce/product/receive',
		method: 'post',
		data: data
	})
}

// 修改产品收货单
export function updateReceive(data) {
	return request({
		url: '/produce/product/receive',
		method: 'put',
		data: data
	})
}

// 删除产品收货单
export function delReveive(id) {
	return request({
		url: '/produce/product/reveive/' + id,
		method: 'delete'
	})
}


// 查询产品质检单列表
export function listQuality(query) {
	return request({
		url: '/produce/product/quality/list',
		method: 'get',
		params: query
	})
}

// 查询产品质检单详细
export function getQuality(id) {
	return request({
		url: '/produce/product/quality/' + id,
		method: 'get'
	})
}

// 新增产品质检单
export function addQuality(data) {
	return request({
		url: '/produce/product/quality',
		method: 'post',
		data: data
	})
}

// 修改产品质检单
export function updateQuality(data) {
	return request({
		url: '/produce/product/quality',
		method: 'put',
		data: data
	})
}

// 删除产品质检单
export function delQuality(id) {
	return request({
		url: '/produce/product/quality/' + id,
		method: 'delete'
	})
}


// 查询产品入库单列表
export function listIn(query) {
	return request({
		url: '/produce/product/in/list',
		method: 'get',
		params: query
	})
}

// 查询产品入库单详细
export function getIn(id) {
	return request({
		url: '/produce/product/in/' + id,
		method: 'get'
	})
}

// 新增产品入库单
export function addIn(data) {
	return request({
		url: '/produce/product/in',
		method: 'post',
		data: data
	})
}

// 修改产品入库单
export function updateIn(data) {
	return request({
		url: '/produce/product/in',
		method: 'put',
		data: data
	})
}

// 删除产品入库单
export function delIn(id) {
	return request({
		url: '/produce/product/in/' + id,
		method: 'delete'
	})
}

// 修改产品入库单
export function updateInDetail(data) {
	return request({
		url: '/product/productIndetail',
		method: 'put',
		data: data
	})
}

// 查询收货单明细信息
export function listReceiveDetail(data) {
	return request({
		url: '/produce/product/receive/getProductReceiveDetail',
		method: 'get',
		params: data
	})
}

// 修改产品收货单明细
export function updateReceiveDetail(data) {
	return request({
		url: '/produce/product/receive/updateReceiveDetail',
		method: 'put',
		data: data
	})
}

// 查询产品入库明细单列表
export function listProductIndetail(query) {
	return request({
		url: '/product/productIndetail/list',
		method: 'get',
		params: query
	})
}

// 修改产品入库明细单
export function updateProductIndetail(data) {
	return request({
		url: '/product/productIndetail',
		method: 'put',
		data: data
	})
}

// 查询入库任务明细单详细
export function getDetail(id) {
	return request({
		url: '/produce/product/taskDetail/' + id,
		method: 'get'
	})
}

/**根据任务明细扫码直接产品入库单，id为任务单明细id
 * data示例:{"id": 864,"whCode": "02001","areaCode": "B2B201"}
 * */
export function directProductInByTaskDetail(data) {
	return request({
		url: '/produce/product/in/directProductInByTaskDetail',
		method: 'post',
		data: data
	})
}