import request from '@/utils/request'

const baseUrl = import.meta.env.VITE_APP_PRODUCTION_API

//查询特殊报工列表
export function listSpecialDaywork(query) {
	return request({
		url: baseUrl + '/business/specialDaywork/list',
		method: 'get',
		params: query
	})
}

//特殊报工删除
export function delSpecialDaywork(data) {
	return request({
		url: baseUrl + '/business/specialDaywork/delSpecialDaywork',
		method: 'POST',
		data: data
	})
}



//查询工段可用计划单
export function selectProductList(query) {
	return request({
		url: baseUrl + '/business/specialDaywork/selectProductList',
		method: 'get',
		params: query
	})
}

//查询工段加工工序列表
export function getProcessList(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/selectDeptProcessList',
		method: 'POST',
		data: data
	})
}

//查询可用箱号
export function listCarriers(params) {
	return request({
		url:baseUrl + '/business/specialDaywork/specialCarriers',
		method: 'get',
    params
	})
}

//查询工段员工列表
export function getDeptUserList(params) {
	return request({
		url:baseUrl + '/business/specialDaywork/specialUserList',
		method: 'get',
    params
	})
}

//查询工段员工列表
export function getDeptEquipmentList(params) {
	return request({
		url:baseUrl + '/business/specialDaywork/specialEquipmentList',
		method: 'get',
    params
	})
}

//查询工段员工列表
export function certainLotInfo(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/certainLotInfo',
		method: 'POST',
		data: data
	})
}

//非首序查询批次信息
export function getNoFirstLotList(params) {
	return request({
		url:baseUrl + '/business/specialDaywork/getNoFirstLotList',
		method: 'get',
		params: params
	})
}

export function specialGetDeptList() {
  return request({
    url: baseUrl + '/business/specialDaywork/specialGetDeptList',
    method: 'get'
  })
}

//非首序查询批次炉号和报工信息
export function getDayworkItemAndFurnace(params) {
	return request({
		url:baseUrl + '/business/specialDaywork/getDayworkItemAndFurnace',
		method: 'get',
		params: params
	})
}

//特殊报工修改
export function specialUpdateDaywork(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/specialUpdateDaywork',
		method: 'POST',
		data: data
	})
}

//特殊报工车间内周转查询周转区
export function getTurnoverListByDeptId(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/getTurnoverListByDeptId',
		method: 'POST',
		data: data
	})
}

/**
 * 获取字典信息
 */
export function getDictInfoByType(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/getDictInfoByType/' + data,
		method: 'GET',
	})
}

/**
 * 获取报工记录
 * @param {Object} data
 */
export function getDayWorkItemList(data) {
	return request({
		url:baseUrl +  '/business/specialDaywork/getDayWorkItemList',
		method: 'POST',
		data: data
	})
}

export function getDeptList(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/listByPlanDetailsId',
		method: 'GET',
		params: data
	})
}

//特殊报工周转申请
export function turnover(data) {
	return request({
		url: baseUrl + '/business/specialDaywork/turnover',
		method: 'POST',
		data: data
	})
}

export function getDeptDetails(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/getDeptDetails',
		method: 'GET',
		params: data
	})
}


/**
 * 检查序检是否完成、一箱多批是否全部完成
 */
export function carrierFinishedCheck(data) {
	return request({
		url: baseUrl + '/business/specialDaywork/carrierFinishedCheck',
		method: 'POST',
		data: data
	})
}

/** 
 * 取消周转
 */
export function cancelSpecialDaywork(data) {
	return request({
		url:baseUrl +'/business/specialDaywork/cancelSpecialDaywork',
		method: 'POST',
		data: data
	})
}

/** 外协周转 */
export function turnoverOutsource(data) {
	return request({
		url:baseUrl +'/business/specialDaywork/turnoverOutsource',
		method: 'POST',
		data: data
	})
}

/**
 * 车间外周转区
 * @param {Object} data
 */
export function getTurnoverByWorkshop(data) {
	return request({
		url:baseUrl +'/business/specialDaywork/getTurnover',
		method: 'POST',
		data: data
	})
}


//非首序查询批次炉号和报工信息
export function specialSaveDaywork(data) {
	return request({
		url:baseUrl + '/business/specialDaywork/specialSaveDaywork',
		method: 'POST',
		data: data
	})
}



/**
 * 查询当前批号绑定的工序
 * @param {Object} data
 */
export function getProcessListByLot(data) {
	return request({
		url: baseUrl + '/business/specialDaywork/getProcessListByLot',
		method: 'get',
		params: data
	})
}

//根据计划单查询可用批次
export function getLotList(query) {
	return request({
		url: baseUrl + '/business/specialDaywork/lotList',
		method: 'get',
		params: query
	})
}




