import request from '@/utils/request'
//标准规范
export function getStandardList(query) {
  return request({
    url: '/qm/standard/',
    method: 'get',
    params: query
  })
}
export function createStandard(data) {
  return request({
    url: '/qm/standard/',
    method: 'post',
    data
  })
}
export function updateStandard(id, data) {
  return request({
    url: `/qm/standard/${id}/`,
    method: 'put',
    data
  })
}
export function deleteStandard(id, data) {
  return request({
    url: `/qm/standard/${id}/`,
    method: 'delete',
    data
  })
}
//检测项目
export function getTestitemList(query) {
  return request({
    url: '/qm/testitem/',
    method: 'get',
    params: query
  })
}
export function createTestitem(data) {
  return request({
    url: '/qm/testitem/',
    method: 'post',
    data
  })
}
export function updateTestitem(id, data) {
  return request({
    url: `/qm/testitem/${id}/`,
    method: 'put',
    data
  })
}
export function deleteTestitem(id, data) {
  return request({
    url: `/qm/testitem/${id}/`,
    method: 'delete',
    data
  })
}
//检测记录
export function getTestRecord(query) {
  return request({
    url: '/qm/testrecord/',
    method: 'get',
    params: query
  })
}
//检测记录
export function getTestRecordItem(id) {
  return request({
    url: `/qm/testrecord/${id}/`,
    method: 'get'
  })
}
//检测记录更改保存
export function putTestRecordItem(id,data) {
  return request({
    url: `/qm/testrecord/${id}/`,
    method: 'put',
    data
  })
}
//检测记录删除
export function delTestRecordItem(id) {
  return request({
    url: `/qm/testrecord/${id}/`,
    method: 'delete'
  })
}
//检测记录提交
export function subTestRecordItem(id,data) {
  return request({
    url: `/qm/testrecord/${id}/submit/`,
    method: 'post',
    data
  })
}
