import request from '@/utils/request'

// 查询sop模板列表
export function listSopTemp(query) {
  return request({
    url: '/app/sopTemp/list',
    method: 'get',
    params: query
  })
}

export function listMySopTemp(query) {
  return request({
    url: '/app/sopTemp/myList',
    method: 'get',
    params: query
  })
}

export function listDeptSopTemp(query) {
  return request({
    url: '/app/sopTemp/deptList',
    method: 'get',
    params: query
  })
}

// 查询sop模板详细
export function getSopTemp(id) {
  return request({
    url: '/app/sopTemp/' + id,
    method: 'get'
  })
}
export function dayListFun(id) {
  return request({
    url: '/app/sopTemp/dayList',
    method: 'get',
    params: {id}
  })
}
// 查询sop模板详细
export function sortDay(list) {
  return request({
    url: '/app/sopTemp/sortDay',
    method: 'post',
    data: list
  })
}
// 查询sop模板详细
export function selectRulesInfo(id, name, dayNum) {
  return request({
    url: '/app/sopTemp/selectRulesInfo',
    method: 'get',
    params: {id, name, dayNum}
  })
}
// 查询sop模板详细
export function delRules(id, name, dayNum) {
  return request({
    url: '/app/sopTemp/delRules',
    method: 'get',
    params: {id, name, dayNum}
  })
}

// 新增sop模板
export function addSopTemp(data) {
  return request({
    url: '/app/sopTemp/sopTemp',
    method: 'post',
    data: data
  })
}
// 新增sop模板
export function addTemp(data) {
  return request({
    url: '/app/sopTemp/add',
    method: 'post',
    data: data
  })
}

// 新增sop模板
export function copyTemplate(data) {
  return request({
    url: '/app/sopTemp/copy',
    method: 'post',
    data: data
  })
}

// 修改sop模板
export function updateTemp(data) {
  return request({
    url: '/app/sopTemp/edit',
    method: 'post',
    data: data
  })
}
// 修改sop模板
export function addOrUpdateSetting(data) {
  return request({
    url: '/app/sopTemp/addOrUpdateSetting',
    method: 'post',
    data: data
  })
}
// 修改sop模板
export function updateSopTemp(data) {
  return request({
    url: '/app/sopTemp/sopTemp',
    method: 'put',
    data: data
  })
}

// 删除sop模板
export function delSopTemp(id) {
  return request({
    url: '/app/sopTemp/' + id,
    method: 'delete'
  })
}
// 删除sop模板
export function updateImage(id) {
  return request({
    url: '/app/sopTemp/updateImage',
    method: 'get',
    params: {id}
  })
}


export function shareSopTemp(data) {
  return request({
    url: '/app/sopTemp/shareTemp',
    method: 'post',
    data: data
  })
}

// 导出sop模板
export function exportSopTemp(query) {
  return request({
    url: '/app/sopTemp/export',
    method: 'get',
    params: query
  })
}
