import request from '@/utils/request'

// 查询密码充值卡管理列表
export function listCard(query) {
  return request({
    url: '/mapi/recharge/card/list',
    method: 'get',
    params: query
  })
}

// 查询密码充值卡管理详细
export function getCard(id) {
  return request({
    url: '/mapi/recharge/card/' + id,
    method: 'get'
  })
}

// 新增密码充值卡管理
export function addCard(data) {
  return request({
    url: '/mapi/recharge/card',
    method: 'post',
    data: data
  })
}

// 修改密码充值卡管理
export function updateCard(data) {
  return request({
    url: '/mapi/recharge/card',
    method: 'put',
    data: data
  })
}

// 删除密码充值卡管理
export function delCard(id) {
  return request({
    url: '/mapi/recharge/card/' + id,
    method: 'delete'
  })
}


// 修改密码充值卡管理状态
export function updateCardStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/recharge/card/updateStatus',
    method: 'post',
    data: data
  })
}

// 一键生成充值卡
export function multiInsertCard(data) {
  return request({
    url: '/mapi/recharge/card/multiInsert',
    method: 'post',
    data: data
  })
}

// 门店绑定客户余额统计
export function getUserBalanceCountList(query) {
  return request({
    url: '/mapi/recharge/card/getUserBalanceCountList',
    method: 'get',
    params: query
  })
}

// 充值卡查询消费明细
export function getCardBillMstrInfo(rechargeCardId) {
  return request({
    url: '/mapi/recharge/card/getCardBillMstrInfo',
    method: 'get',
    params: {
      "rechargeCardId" : rechargeCardId
    }
  })
}
// 查询收银流水
export function getBillMstrInfoList(data) {
  return request({
    url: '/mapi/recharge/card/getBillMstrInfoList',
    method: 'post',
    data: data
  })
}
