zjf
2023-03-03 26e972196ed6046bcb7fb341be86241c8300fd2b
src/api/common.js
@@ -287,9 +287,33 @@
    responseType: 'blob'
  })
}
export function DownloadSubscriptions (data) {
export function ExportSubscriptionsExcel (data) {
  // let params = ''
  // for (const key in data) {
  //   console.log(key + ':' + data[key])
  //   params = params + (data[key] ? `&${key}=${data[key]}` : '')
  // }
  // console.log(params)
  return request({
    url: '/AutoDesk/download/subscriptions/' + data.taskId,
    url: '/AutoDesk/subscriptions/ExportExcel?AutoRenewingSubscriptionText=' + (data.AutoRenewingSubscriptionText === 'AutoRenewing Subscription' ? data.AutoRenewingSubscriptionText : '') +
    (data.ContractNumber
      ? '&ContractNumber=' + encodeURIComponent(data.ContractNumber) : '') +
    (data.EndCustomerAccountName
      ? '&EndCustomerAccountName=' + encodeURIComponent(data.EndCustomerAccountName) : '') +
    (data.EndCustomerStateProvince
      ? '&EndCustomerStateProvince=' + encodeURIComponent(data.EndCustomerStateProvince) : '') +
    (data.ProductLine
      ? '&ProductLine=' + encodeURIComponent(data.ProductLine) : '') +
    (data.Term
      ? '&Term=' + data.Term : '') +
    (data.StartEndDate
      ? '&StartEndDate=' + data.StartEndDate : '') +
    (data.EndEndDate
      ? '&EndEndDate=' + data.EndEndDate : '') +
    (data.StartLastPurchaseDate
      ? '&StartLastPurchaseDate=' + data.StartLastPurchaseDate : '') +
    (data.EndLastPurchaseDate
      ? '&EndLastPurchaseDate=' + data.EndLastPurchaseDate : ''),
    method: 'get',
    responseType: 'blob'
  })