import request from '@/utils/request'

// 查询会员组列表
export function listMemberGroup(query) {
    return request({
        url: '/member/memberGroup/list',
        method: 'get',
        params: query
    })
}

// 查询会员组详细
export function getMemberGroup(id) {
    return request({
        url: '/member/memberGroup/' + id,
        method: 'get'
    })
}

// 新增会员组
export function addMemberGroup(data) {
    return request({
        url: '/member/memberGroup',
        method: 'post',
        data: data
    })
}

// 修改会员组
export function updateMemberGroup(data) {
    return request({
        url: '/member/memberGroup',
        method: 'put',
        data: data
    })
}

// 删除会员组
export function delMemberGroup(id) {
    return request({
        url: '/member/memberGroup/' + id,
        method: 'delete'
    })
}

// 添加会员
export function addMember(data) {
    return request({
        url: '/member/memberGroup/addMember',
        method: 'post',
        data: data
    })
}

// 查询会员组中的会员列表
export function queryMemberList(query) {
    return request({
        url: '/member/memberGroup/queryMemberList',
        method: 'get',
        params: query
    })
}
//  创建优惠计费模板
export function preferentialTemplates(data) {
    console.log("创建优惠计费模板", JSON.stringify(data));
    return request({
        method: "post",
        url: "/billing/template/createPreferentialBillingTemplate",
        data,
    });
}

// 查询会员组中的站点列表
export function queryStationList(query) {
    return request({
        url: '/member/memberGroup/queryStationList',
        method: 'get',
        params: query
    })
}

//删除会员组中的站点列表
export function removeStationFromMemberGroup(data) {
    return request({
        url: '/member/memberGroup/removeStationFromMemberGroup',
        method: 'post',
        data: data
    })
}

//删除会员组中的会员
export function removeMemberFromMemberGroup(data) {
    return request({
        url: '/member/memberGroup/removeMemberFromMemberGroup',
        method: 'post',
        data: data
    })
}

// 查询会员组中车辆消费记录
export function queryMemberGroupConsumptionList(data) {
    return request({
        url: '/member/memberGroup/queryMemberGroupConsumptionList',
        method: 'post',
        data: data
    })
}
// 查询会员组中车辆消费明细
export function queryConsumptionDetailListByVinCode(data) {
    return request({
        url: '/member/memberGroup/queryConsumptionDetailListByVinCode',
        method: 'post',
        data: data
    })
}
