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

const BASE = 'quality_control/first_inspection/first_inspection/'

function apiParams (data = {}, method = 'get.setting.item.list', platform = 'api') {
  return { method, platform, ...data }
}
export function fetchFirstArticleInspectionRecordsList (data = {}) {
  return request({
    url: BASE + 'item/list',
    method: 'post',
    data: apiParams(data, 'get.setting.item.list', 'api')
  })
}

export function createFirstArticleInspectionRecords (data = {}) {
  return request({
    url: BASE + 'item/add',
    method: 'post',
    data: apiParams(data, 'add.setting.item', 'admin')
  })
}

export function editFirstArticleInspectionRecords (data = {}) {
  return request({
    url: BASE + 'item/update',
    method: 'post',
    data: apiParams(data, 'set.setting.item', 'admin')
  })
}

export function deleteFirstArticleInspectionRecords (data = {}) {
  return request({
    url: BASE + 'item/delete',
    method: 'post',
    data: apiParams(data, 'del.setting.item', 'admin')
  })
}

