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

// 查询生产领料单列表
export function listTask(query) {
	return request({
		url: '/produce/draw/task/list',
		method: 'get',
		params: query
	})
}

// 查询批号分批详细
export function getListDetail(data) {
	return request({
		url: '/produce/draw/out/detail',
		method: 'post',
		data: data
	})
}

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

//根据物料编码获取物料名称
export function listMaterial(query) {
	return request({
		url: '/mm/material/list',
		method: 'get',
		params: query
	})
}
// 新增领料拣货单
export function addPick(data) {
	return request({
		url: '/produce/draw/pick',
		method: 'post',
		data: data
	})
}

// 新增领料出库单
export function addOut(data) {
	return request({
		url: '/produce/draw/out',
		method: 'post',
		data: data
	})
}

// 查询生产领料单详细
export function getTask(id) {
	return request({
		url: '/produce/draw/task/' + id,
		method: 'get'
	})
}

export function updatePick(data) {
	return request({
		url: '/produce/draw/pick',
		method: 'put',
		data: data
	})
}

// 查询领料拣货单列表
export function listPick(query) {
	return request({
		url: '/produce/draw/pick/list',
		method: 'get',
		params: query
	})
}

export function listOut(query) {
	return request({
		url: '/produce/draw/out/list',
		method: 'get',
		params: query
	})
}

export function getOut(id) {
	return request({
		url: '/produce/draw/out/' + id,
		method: 'get'
	})
}

// 根据任务单获取直接出库信息
export function getDrawOutDirectlyByTaskCode(data) {
	return request({
		url: '/produce/draw/out/getDrawOutDirectlyByTaskCode',
		method: 'post',
		data: data
	})
}

// 修改领料出库单
export function updateOut(data) {
  return request({
    url: '/produce/draw/out',
    method: 'put',
    data: data
  })
}

// 撤销领料拣货单
export function revokeDrawPick(data) {
  return request({
    url: '/produce/draw/pick/revoke',
    method: 'post',
    data: data
  })
}

