import request from '@/utils/new-request'
import { exportExcel } from '@/utils/filedown'
export function _getQtys(billName) {
  return request({
    url: '/FinanceServiceDeliveyBill/getQtys',
    method: 'get',
    params: { billName },
    timeout: 20 * 1000
  })
}

export function _getData(status, billName) {
  return request({
    url: '/FinanceServiceDeliveyBill/GetData',
    method: 'get',
    params: { status, billName },
    timeout: 20 * 1000
  })
}

export function _getConfirmeds(billId) {
  exportExcel('/FinanceServiceDeliveyBill/GetConfirmeds?billId=' + billId)
}

export function _getNotConfirmeds(billId) {
  exportExcel('/FinanceServiceDeliveyBill/GetNotConfirmeds?billId=' + billId)
}

export function _getOriginals(billId) {
  exportExcel('/FinanceServiceDeliveyBill/GetOriginals?billId=' + billId)
}

export function _getSupplements(billId) {
  exportExcel('/FinanceServiceDeliveyBill/GetSupplements?billId=' + billId)
}

export function _getDeductions(billId) {
  exportExcel('/FinanceServiceDeliveyBill/GetDeductions?billId=' + billId)
}

export function _addDeliveryBill(data) {
  return request({
    timeout: 60000,
    url: '/FinanceServiceDeliveyBill/AddDeliveryBill',
    method: 'post',
    data
  })
}

export function _inputSupplementOrDeduction(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/InputSupplementOrDeduction',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _Pass(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/Pass',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}
export function _Rereject(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/Rereject',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _updateConfirmed(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/UpdateConfirmed',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _postPayment(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/postPayment',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}
export function _changeBillName(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/changeBillName ',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}
export function _getPaymentLog(billId) {
  return request({
    url: '/FinanceServiceDeliveyBill/GetPaymentLog',
    method: 'get',
    params: { billId }
  })
}

export function _deleteBill(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/deleteBill',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _getDeliveryBillTypes() {
  return request({
    url: '/FinanceServiceDeliveyBill/getDeliveryBillTypes',
    method: 'get',
    timeout: 20 * 1000
  })
}

export function _freightRecalculation(data) {
  return request({
    url: '/FinanceServiceDeliveyBill/FreightRecalculation',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}
