import service from '@/utils/request'

/*
* 工单核验单维护
*/

// 侧边栏
export const getSide = (data) => {
  return service({
    url: '/mes_server/work_order_verification/getTab',
    method: 'get',
    data
  })
}

// 列表、定位
export const getTable = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getList',
    method: 'get',
    params
  })
}

// 2.1获取单个工单核检单信息
export const getOneWorkOrder = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getOneWorkOrder',
    method: 'get',
    params
  })
}

// 2.2获取工单基本信息
export const getOrderInfo = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getOrderInfo',
    method: 'get',
    params
  })
}

// 2.3获取印件名称及工序
export const getYjInfo = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getYjInfo',
    method: 'get',
    params
  })
}

// 2.4获取废品类别
export const getWastInfo = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getWastInfo',
    method: 'get',
    params
  })
}

// 2.5获取工序及责任组长
export const getGxAndLeader = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getGxAndLeader',
    method: 'get',
    params
  })
}

// 2.6修改工单核检单
export const updateData = (data) => {
  return service({
    url: '/mes_server/work_order_verification/edit',
    method: 'post',
    data
  })
}

// 3.1工单核检废品分布
export const getWasteDistribution = (params) => {
  return service({
    url: '/mes_server/work_order_verification/wasteDistribution',
    method: 'get',
    params
  })
}

// 4.1获取工单工序状态
export const getOrderDate = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getOrderDate',
    method: 'get',
    params
  })
}

// 4.2工单工序状态修正
export const updateOrderData = (data) => {
  return service({
    url: '/mes_server/work_order_verification/editOrderFinishDate',
    method: 'post',
    data
  })
}

// 5.1工单工序生产进程菜单栏
export const getOrderProcessLeft = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getOrderProcessLeft',
    method: 'get',
    params
  })
}

// 5.2获取工单工序生产进程右侧
export const getOrderProcessRight = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getOrderProcessRight',
    method: 'get',
    params
  })
}

// 6核检废品日统计
export const getDaysWast = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getDaysWast',
    method: 'get',
    params
  })
}

// 8工单质检废品统计
export const getOrderWasteTotal = (params) => {
  return service({
    url: '/mes_server/work_order_verification/getOrderWasteTotal',
    method: 'get',
    params
  })
}
// 9新增
export const add = (data) => {
  return service({
    url: '/mes_server/work_order_verification/add',
    method: 'post',
    data
  })
}
