| | |
| | | OutputContacterToExcel, |
| | | OutputSalesChanceToExcel, |
| | | OutputOtherSalesChanceToExcel, |
| | | DownloadSubscriptions |
| | | ExportSubscriptionsExcel |
| | | } from '@/api/common' |
| | | |
| | | export default { |
| | |
| | | } |
| | | } else if (this.crmType === 'subscriptions') { |
| | | params = { |
| | | 'taskId': this.headObj ? this.headObj.taskId : '' |
| | | ...this.headObj |
| | | } |
| | | } |
| | | let month = new Date().getMonth() + 1 |
| | |
| | | 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 |
| | |
| | | } 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` |
| | | } |