import request from '@/utils/new-request'
import { exportExcel, exportExcelNew } from '@/utils/filedown'
import { createService } from '../channelOrder'

export function _outFinanceReport(data) {
  return exportExcelNew('/Finance/DownFinanceReport', data, 'post')
}

export function _outFinanceBranchProfitReport(data) {
  return exportExcelNew('/Finance/DownFinanceBranchProfitReport', data, 'post')
}

export function _queryFinanceReport(data) {
  return request({
    url: '/Finance/GetFinanceReportDetails',
    method: 'post',
    timeout: 60 * 1000,
    data
  })
}

/**
 * 欠费提醒记录
 */
const request2 = createService(process.env.VUE_APP_BASE_API);
export function _queryFinanceGetArrears(data) {
  return request2({
    url: '/finance/GetArrears',
    method: 'post',
    timeout: 60 * 1000,
    data
  })
}
/**
 * 导出欠费提醒记录
 */
export function _outDownloadArrearsData(data) {
  exportExcel('/finance/DownloadArrearsData', data, 'post')
}


/**
 * 欠费提醒
 */

export function _sendArrearsFile(data){
  return request2({
    url: '/finance/SendArrearsFile',
    method: 'post',
    timeout: 60 * 1000,
    data
  })
}

export function _getTransferWarehouseLogs(data){
  return request2({
    url:'/finance/GetTransferWarehouseLogs',
    method:'post',
    timeout:60*1000,
    data
  })
}