import { request } from '@/api/_service'

const BASE = 'quality_control/xqc/inspection_order_manage/'

function apiParams (data = {}, method = 'xqc.inspection_order_manage.list', platform = 'api') {
  return { method, platform, ...data }
}
export function fetchInspectionOrdersList (data = {}) {
  return request({
    url: BASE + 'list',
    method: 'post',
    data: apiParams(data, 'xqc.inspection_order_manage.list', 'api')
  })
}

export function createInspectionOrders (data = {}) {
  return request({
    url: BASE + 'save',
    method: 'post',
    data: apiParams(data, 'xqc.inspection_order_manage.save', 'api')
  })
}

export function editInspectionOrders (data = {}) {
  return request({
    url: BASE + 'save',
    method: 'post',
    data: apiParams(data, 'xqc.inspection_order_manage.save', 'api')
  })
}

export function deleteInspectionOrders (data = {}) {
  return request({
    url: BASE + 'revoke',
    method: 'post',
    data: apiParams(data, 'xqc.inspection_order_manage.revoke', 'api')
  })
}

