import service from '@/utils/request'

export const getMachineInfo = (params) => {
  return service({
    url: '/mes_server/Machine/getMachineInfo',
    method: 'get',
    params
  })
}
export const getDepartment = (data) => {
  return service({
    url: '/mes_server/Machine/getDepartment',
    method: 'get',
    data
  })
}

export const getProcessLoss = (params) => {
  return service({
    url: '/mes_server/Process/getProcessLoss',
    method: 'get',
    params
  })
}
export const getProcess = (data) => {
  return service({
    url: '/mes_server/Process/getProcess',
    method: 'get',
    data
  })
}

export const getOnePieceWork = (params) => {
  return service({
    url: '/mes_server/piece_work/getOnePieceWork',
    method: 'get',
    params
  })
}
export const getPieceWork = (data) => {
  return service({
    url: '/mes_server/piece_work/getPieceWork',
    method: 'get',
    data
  })
}

export const getSpotTab = (data) => {
  return service({
    url: '/mes_server/work_order_spot_check/getTab',
    method: 'get',
    data
  })
}

// 工单抽检记录列表
export const getSpotList = (params) => {
  return service({
    url: '/mes_server/work_order_spot_check/getList',
    method: 'get',
    params
  })
}

// 工单抽检记录定位
export const getSpotLocal = (params) => {
  return service({
    url: '/mes_server/work_order_spot_check/search',
    method: 'get',
    params
  })
}

// 工单抽检记录修改
export const updateSpotData = (data) => {
  return service({
    url: '/mes_server/work_order_spot_check/edit',
    method: 'post',
    data
  })
}
// 工单抽检记录新增
export const add = (data) => {
  return service({
    url: '/mes_server/work_order_spot_check/add',
    method: 'post',
    data
  })
}

// 工单抽检记录获取工单抽检记录信息
export const getSpotInfo = (params) => {
  return service({
    url: '/mes_server/work_order_spot_check/getInfo',
    method: 'get',
    params
  })
}

export const getRewardTab = (data) => {
  return service({
    url: '/mes_server/large_waste_reward_punish/getTab',
    method: 'get',
    data
  })
}
export const getRewardList = (params) => {
  return service({
    url: '/mes_server/large_waste_reward_punish/getList',
    method: 'get',
    params
  })
}

// 获取工序大废品惩奖信息
export const getRewardDetail = (params) => {
  return service({
    url: '/mes_server/large_waste_reward_punish/getInfo',
    method: 'get',
    params
  })
}

// 大废品奖惩侧边栏根据工单
export const getRewardTabByGd = (params) => {
  return service({
    url: '/mes_server/large_waste_reward_punish/getTabByGd',
    method: 'get',
    params
  })
}


export const getDocumentData = (params) => {
  return service({
    url: '/mes_server/process_document/getData',
    method: 'get',
    params
  })
}
export const getDocumentHistory = (params) => {
  return service({
    url: '/mes_server/process_document/getHistory',
    method: 'get',
    params
  })
}
export const saveDocumentData = (data) => {
  return service({
    url: '/mes_server/process_document/saveData',
    method: 'post',
    data
  })
}
export const getDocumentInfo = (data) => {
  return service({
    url: '/mes_server/process_document/getInfo',
    method: 'post',
    data
  })
}

export const getProcessCode = (params) => {
  return service({
    url: '/mes_server/process/getProcessCode',
    method: 'get',
    params
  })
}
export const getProcessAdd = (data) => {
  return service({
    url: '/mes_server/process/add',
    method: 'post',
    data
  })
}

export const getProcessEdit = (data) => {
  return service({
    url: '/mes_server/process/edit',
    method: 'post',
    data
  })
}
export const getProcessDel = (data) => {
  return service({
    url: '/mes_server/process/delete',
    method: 'post',
    data
  })
}

export const getPieceParams = (params) => {
  return service({
    url: '/mes_server/piece_work/getPieceParams',
    method: 'get',
    params
  })
}
export const editAllParams = (data) => {
  return service({
    url: '/mes_server/piece_work/editAllParams',
    method: 'post',
    data
  })
}

export const dictionaryTab = (params) => {
  return service({
    url: '/mes_server/dictionary/getTab',
    method: 'get',
    params
  })
}
export const dictionaryList = (params) => {
  return service({
    url: '/mes_server/dictionary/getEditList',
    method: 'get',
    params
  })
}
export const dictionaryEdit = (data) => {
  return service({
    url: '/mes_server/dictionary/edit',
    method: 'post',
    data
  })
}
export const FieldInspectionRecord = (params) => {
  return service({
    url: '/mes_server/facility/FieldInspectionRecord',
    method: 'get',
    params
  })
}
