import request from '@/utils/request'
//质量巡查----子任务

export function getsubinspecttasklist(query) {
  return request({
    url: '/quality/subinspecttask/',
    method: 'get',
    params: query
  })
}
export function getsubinspecttaskselflist(query) {
  return request({
    url: '/quality/subinspecttask/self/',
    method: 'get',
    params: query
  })
}

export function getsubinspecttask(id) {
  return request({
    url: `/quality/subinspecttask/${id}/`,
    method: 'get'
  })
}
export function updateinspectrecord(id,data) {
  return request({
    url: `/quality/inspectrecord/${id}/check/`,
    method: 'put',
    data
  })
}


export function getinspectrecord(id) {
  return request({
    url: `/quality/inspectrecord/${id}/`,
    method: 'get'
  })
}
export function starttask(id) {
  return request({
    url: `/quality/inspecttask/${id}/start/`,
    method: 'put'
  })
}
export function updatesubinspecttask(id) {
  return request({
    url: `/quality/subinspecttask/${id}/`,
    method: 'put',
  })
}
export function upinspectdept(id) {
  return request({
    url: `/quality/inspectdept/${id}/up/`,
    method: 'put',
  })
}

export function createsubinspecttask(data) {
  return request({
    url: '/quality/subinspecttask/',
    method: 'post',
    data
  })
}
export function getsubinspecttaskdep(id) {
  return request({
    url: `/quality/subinspecttask/${id}/depts/`,
    method: 'get'
  })
}

export function gettaskdepstart(id) {
  return request({
    url: `/quality/inspectdept/${id}/start/`,
    method: 'put'
  })
}
export function getinspectrecordlist(query) {
  return request({
    url: '/quality/inspectrecord/',
    method: 'get',
    params: query
  })
}

export function deletesubinspecttask(id, data) {
  return request({
    url: `/quality/subinspecttask/${id}/`,
    method: 'delete',
    data
  })
}
export function addappoint(data) {
  return request({
    url: '/quality/inspectrecord/appoint/ ',
    method: 'post',
    data
  })
}


