import request from '@/utils/request'

// 查询报工报表列表
export function listReportWork(query) {
	return request({
		url: '/mes/reportWork/list',
		method: 'get',
		params: query
	});
}

// 查询报工报表详细
export function getReportWork(id) {
	return request({
		url: '/mes/reportWork/' + id,
		method: 'get'
		});
}

// 新增报工报表
export function addReportWork(data) {
	return request({
		url: '/mes/reportWork',
		method: 'post',
		data: data
	});
}

// 修改报工报表
export function updateReportWork(data) {
	return request({
		url: '/mes/reportWork',
		method: 'put',
		data: data
	});
}

// 删除报工报表
export function delReportWork(id) {
	return request({
		url: '/mes/reportWork/' + id,
		method: 'delete'
	});
}

// 查询工单的工序完成列表
export function getProcessFinishList(query) {
	return request({
		url: '/mes/reportWork/getProcessFinishList',
		method: 'get',
		params: query
	});
}
//成品产量报表
export function getProductionList(query) {
	return request({
		url: '/mes/reportWork/getProductionList',
		method: 'get',
		params: query
	});
}
//成品产量报表
export function getDailyReport(query) {
	return request({
		url: '/mes/reportWork/getDailyReport',
		method: 'get',
		params: query
	});
}

export function getWorkcenterList() {
	return request({
		url: '/mes/reportWork/getWorkcenterList',
		method: 'get'
	});
}

export function getLineChartData() {
	return request({
		url: '/mes/reportWork/getLineChartData',
		method: 'get'
	});
}
//查询设备小时表头
export function getHourProductionTitle(query) {
	return request({
		url: '/mes/reportWork/getHourProductionTitle',
		method: 'get',
		params: query
	});
}

// 查询设备小时产量
export function getHourProductionList(query) {
	return request({
		url: '/mes/reportWork/getHourProductionList',
		method: 'get',
		params: query
	});
}

// 获取班次信息
export function getProShifts() {
	return request({
	  url: '/mes/reportWork/getProShifts/',
	  method: 'get'
	})
  }


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

//查询工单列表
export function getMesListWorkOrder(query) {
	return request({
		url: '/mes/reportWork/getMesListWorkOrder',
		method: 'get',
		params: query
	});
}  

//查询线体列表
export function getMesListEquip(query) {
	return request({
		url: '/mes/reportWork/getMesListEquip',
		method: 'get',
		params: query
	});
}  
//报工按钮
export function reportSap(reportCode) {
	const data = {
		reportCode
	}
	return request({
		url: '/mes/reportWork/reportSap',
		method: 'put',
		data: data
	});
}


// 查询物料管理列表
export function getMesListBom(query) {
	return request({
	  url: '/mes/reportWorkConsume/getMesListBom',
	  method: 'get',
	  params: query
	});
  }

  // 查询物料管理列表
// export function getTeamList() {
// 	return request({
// 		url: '/mes/reportWorkConsume/getTeamList',
// 		method: 'get'
// 	});
// }
//获取批次
export function getBatchList(workorderCode) {
	const data = {
		workorderCode
	}
	return request({
		url: '/mes/reportWork/getBatchList',
		method: 'put',
		data: data
	});
}
