From 51468f93275c2bcfcc7ad25bf05f3d6a079ff764 Mon Sep 17 00:00:00 2001 From: zjf <zhangjf@probim.com.cn> Date: Wed, 08 Mar 2023 11:40:01 +0800 Subject: [PATCH] 订阅 最终决定 --- src/views/clients/components/CRMExport.vue | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/views/clients/components/CRMExport.vue b/src/views/clients/components/CRMExport.vue index add542a..ecdbcf5 100644 --- a/src/views/clients/components/CRMExport.vue +++ b/src/views/clients/components/CRMExport.vue @@ -43,7 +43,7 @@ OutputContacterToExcel, OutputSalesChanceToExcel, OutputOtherSalesChanceToExcel, - DownloadSubscriptions + ExportSubscriptionsExcel } from '@/api/common' export default { @@ -234,7 +234,7 @@ } } else if (this.crmType === 'subscriptions') { params = { - 'taskId': this.headObj ? this.headObj.taskId : '' + ...this.headObj } } let month = new Date().getMonth() + 1 @@ -245,11 +245,24 @@ contacts: OutputContacterToExcel, business: OutputSalesChanceToExcel, businessChances: OutputOtherSalesChanceToExcel, - subscriptions: DownloadSubscriptions + subscriptions: ExportSubscriptionsExcel }[this.crmType] console.log(request) request(params) .then(res => { + if (this.crmType === 'subscriptions') { + if (res.data.type === 'application/json') { + // this.show = false + this.closeView() + let reader = new FileReader() + reader.readAsText(res.data, 'utf-8') + reader.onload = (e) => { + let resData = JSON.parse(reader.result) + this.$message.error(resData.Message) + } + return + } + } this.exportQueueIndex = '' this.done = true var blob @@ -279,7 +292,7 @@ } else if (this.crmType === 'contacts') { downloadElement.download = `客户联系人列表` + timer + `.xlsx` } else if (this.crmType === 'subscriptions') { - downloadElement.download = `订阅列表` + timer + `.zip` + downloadElement.download = `订阅列表` + timer + `.xlsx` } else { downloadElement.download = `列表` + timer + `.xlsx` } -- Gitblit v1.9.3