import request from '@/utils/request'
import Qs from 'qs'

export function listCustomerBillingInfo(query) {
    return request({
        method: 'post',
        params: {
            _gp: 'admin.customerbilling',
            _mt: 'list',
            page: query.page,
            limit: query.limit,
            CustomerBillingInfoDTO: JSON.stringify(query.type)
        }
    })
}
export function getCusDate(query) {
    return request({
        method: 'post',
        params: {
            _gp: 'admin.customerbilling',
            _mt: 'cusDate',
            ...query

        }
    })
}
export function listCustomer() {
    return request({
        method: 'post',
        params: {
            _gp: 'admin.customerbilling',
            _mt: 'customerList'
        }
    })
}
export function createCustomerBillingInfo(data) {
    return request({
        method: 'post',
        data: Qs.stringify({
            _gp: 'admin.customerbilling',
            _mt: 'create',
            CustomerBillingInfoDTO: JSON.stringify(data)
        })
    })
}
export function editCustomerBillingInfo(data) {
    return request({
        method: 'post',
        data: Qs.stringify({
            _gp: 'admin.customerbilling',
            _mt: 'edit',
            CustomerBillingInfoDTO: JSON.stringify(data)
        })
    })
}

export function updateCustomerBillingInfo(data) {
    return request({
        method: 'post',
        data: Qs.stringify({
            _gp: 'admin.customerbilling',
            _mt: 'edit',
            CustomerBillingInfoDTO: JSON.stringify(data)
        })
    })
}

export function deleteCustomerBillingInfo(id) {
    return request({
        method: 'post',
        params: {
            _gp: 'admin.customerbilling',
            _mt: 'delete',
            id: id
        }
    })
}

export function exportXlsx(data) {
    return request({
        method: 'post',
        data: Qs.stringify({
            _gp: 'admin.customerbilling',
            _mt: 'export',
            CustomerBillingInfoDTO: JSON.stringify(data),
            response: 'blob'
        })
    })
}

export function importWord(data) {
    return request({
        method: 'post',
        data: Qs.stringify({
            _gp: 'admin.customerbilling',
            _mt: 'createAll',
            CustomerBillingInfoDTO: JSON.stringify(data)
        })
    })
}