import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 礼品申领表分页查询
 * @param {查询条件} data
 */
export function listGiftClaim(query) {
  return request({
    url: 'business/GiftClaim/list',
    method: 'get',
    params: query,
  })
}
export function getGiftClaimSatistics() {
  return request({
    url: 'business/GiftClaim/statistics',
    method: 'get',
  })
}
/**
 * 新增礼品申领表
 * @param data
 */
export function addGiftClaim(data) {
  return request({
    url: 'business/GiftClaim',
    method: 'post',
    data: data,
  })
}
/**
 * 修改礼品申领表
 * @param data
 */
export function updateGiftClaim(data) {
  return request({
    url: 'business/GiftClaim',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取礼品申领表详情
 * @param {Id}
 */
export function getGiftClaim(id) {
  return request({
    url: 'business/GiftClaim/' + id,
    method: 'get'
  })
}

/**
 * 删除礼品申领表
 * @param {主键} pid
 */
export function delGiftClaim(pid) {
  return request({
    url: 'business/GiftClaim/delete/' + pid,
    method: 'POST'
  })
}
// 导出礼品申领表
export async function exportGiftClaim(query) {
  await downFile('business/GiftClaim/export', { ...query })
}


/**
 * 新增礼品申领表
 * @param data
 */
export function updateGiftClaimStatus(id, status) {
  return request({
    url: 'business/GiftClaim/editStatus?id=' + id + "&status=" + status,
    method: 'post',
  })
}