import request from '@/utils/request'

// 查询核销码列表
export function listScrm(query) {
  return request({
    url: '/shop/scrm/list',
    method: 'get',
    params: query
  })
}

// 查询核销码详细
export function getScrm(id) {
  return request({
    url: '/shop/scrm/' + id,
    method: 'get'
  })
}

// 新增核销码
export function addScrm(data) {
  return request({
    url: '/shop/scrm',
    method: 'post',
    data: data
  })
}

// 修改核销码
export function updateScrm(data) {
  return request({
    url: '/shop/scrm',
    method: 'put',
    data: data
  })
}

// 删除核销码
export function delScrm(id) {
  return request({
    url: '/shop/scrm/' + id,
    method: 'delete'
  })
}

// 导出核销码
export function exportScrm(query) {
  return request({
    url: '/shop/scrm/export',
    method: 'get',
    params: query
  })
}

export function importVerifyNoteTemplate() {
  return request({
    url: '/shop/scrm/downloadTemplate',
    method: 'get'
  })
}

// 核销核销码
export function writeOff(data) {
  return request({
    url: '/shop/scrm/writeOff',
    method: 'post',
    data: data
  })
}
