From bafa9dff4d9880c562f4d3a7b83bd4c1129240c5 Mon Sep 17 00:00:00 2001
From: zjf <zhangjf@probim.com.cn>
Date: Fri, 03 Mar 2023 15:20:22 +0800
Subject: [PATCH] Subscriptions 导出条件修改

---
 src/api/common.js |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/api/common.js b/src/api/common.js
index ed9309f..0e4d52c 100644
--- a/src/api/common.js
+++ b/src/api/common.js
@@ -287,9 +287,29 @@
     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.StartLastPurchaseDate
+      ? '&StartLastPurchaseDate=' + data.StartLastPurchaseDate : '') +
+    (data.EndLastPurchaseDate
+      ? '&EndLastPurchaseDate=' + data.EndLastPurchaseDate : ''),
     method: 'get',
     responseType: 'blob'
   })

--
Gitblit v1.9.3