import request from '@/utils/new-request'
import wmsRequest from '@/utils/request'
import { exportExcelNew } from '@/utils/filedown'
import { exportExcel } from '@/utils/filedown'
import requestMessage from '@/utils/request_message'

export function _getQtys() {
  return request({
    url: '/Finance/getQtys',
    method: 'get',
    timeout: 20 * 1000
  })
}

export function _getData(data) {
  return request({
    url: '/Finance/GetData',
    method: 'post',
    timeout: 20 * 1000,
    data
  })
}

export function _getBillInfo(billNumber) {
  return request({
    url: '/Finance/getBillInfo',
    method: 'get',
    params: { billNumber },
    timeout: 20 * 1000
  })
}

export function _postStart(data) {
  return request({
    url: '/Finance/postStart',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _postEditBill(data) {
  return request({
    url: '/Finance/postEditBill',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _postPass(billNumber) {
  return request({
    url: '/Finance/postPass?billNumber=' + billNumber,
    method: 'post',
    timeout: 20 * 1000
  })
}

export function _postPayment(data) {
  return request({
    url: '/Finance/postPayment',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _getLadingBillLogs(params) {
  return request({
    url: '/Finance/getLadingBillLogs',
    method: 'get',
    params: params,
    timeout: 20 * 1000
  })
}

export function _postReject(billId) {
  return request({
    url: '/Finance/PostReject?billId=' + billId,
    method: 'post',
    timeout: 20 * 1000
  })
}

export function _postStart2(data) {
  return request({
    url: '/Finance/postStart2',
    method: 'post',
    data,
    timeout: 20 * 1000
  })
}

export function _getIncidentals(billId, type) {
  return request({
    url: '/Finance/GetIncidentals',
    method: 'get',
    params: { billId: billId, type: type }
  })
}

export function _downloadLadingbillData(ladingNumbers, type) {
  return request({
    url: '/Finance/GetFee',
    method: 'post',
    data: { LaddingBills: ladingNumbers, Type: type }
  })
}

export function _getFeeAsFile(data) {
  exportExcel('/Finance/GetFeeAsFile', data, 'post')
}

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

export function _postInputFile(data) {
  return request({
    url: '/Finance/PostInputFile',
    method: 'post',
    data,
    timeout: 1200 * 1000
  })
}

export function AddZZEUBOrder(ladingNumber) {
  return request({
    url: '/order/AddZZEUBOrder',
    method: 'post',
    params: { ladingNumber }
  })
}

export function GetZZEUBOrder(ladingNumber) {
  return request({
    url: '/order/GetZZEUBOrder',
    method: 'get',
    params: { ladingNumber }
  })
}

export function _batchUpdateFeeBase(data) {
  return wmsRequest({
    url: '/Finance/BatchUpdateFeeBase',
    method: 'post',
    data,
    timeout: 60 * 60 * 60
  })
}

export function _batchSendFeeBase(data) {
  return wmsRequest({
    url: '/Finance/BatchSendFeeBase',
    method: 'post',
    data,
    timeout: 60 * 60 * 60
  })
}

export function _downloadLadingbillDataByCustomer(data) {
  return exportExcelNew('/Finance/ExportCustomerMonitoring',data,'post')
}

export function ReCustomerComputeNew(data) {
  return requestMessage({
    url: '/Finance/ReCustomerComputeNew?systemno='+data.systemNo+'&reCustomerCompute='+data.reCustomerComputeType+'&reComputeVerType='+data.reComputeVerType,
    method: 'get',
    data,
    timeout: 60 * 60 * 60
  })
}
