import { AxiosRequestData } from '@/data/axios_request'
import cache from '@/utils/cache'

/**
 * 开票页面开票概览
 */
function getStatToInvoice() {
    const url = '/sys/stat/toInvoice'
    let token = cache.getToken()
    let entTaxId = JSON.parse(cache.getSession('company')).entTaxId
    let args = {
        entTaxId: entTaxId,
    }
    console.log('开票页面开票概览 参数：')
    console.log(args)
    return new Promise(function (resolve, reject) {
        AxiosRequestData(url, token, args, false, 2)
            .then(val => {
                console.log('开票页面开票概览 结果：')
                console.log(val)
                if (val.code === 0) {
                    resolve(val)
                } else {
                    reject(val.msg)
                }
            })
    })
}

const INVOICE_OTHER = {
    getStatToInvoice
}

export default INVOICE_OTHER