diff --git a/src/api/cost/cost.js b/src/api/cost/cost.js index 3faeb50b..ec0e9331 100644 --- a/src/api/cost/cost.js +++ b/src/api/cost/cost.js @@ -358,7 +358,7 @@ export function getExportZipUnsettled(data) { // 导出zip获取进度 export function getExportZipProgress(data) { return request({ - url: '/material/slt_agreement_info/exportProgress', + url: '/material/slt_agreement_info/exZipProgress', method: 'post', data: data, }) diff --git a/src/views/material/cost/component/unreportHome.vue b/src/views/material/cost/component/unreportHome.vue index 455bded2..d9f55140 100644 --- a/src/views/material/cost/component/unreportHome.vue +++ b/src/views/material/cost/component/unreportHome.vue @@ -569,14 +569,17 @@ import { getUnitList, getAgreementInfoById, getUnitListFilterTeam, } from '@/api/back/index.js' -import {getSltList, costExamine, getSltReportedList, getSltReportList, getHistoryReportList, getHistoryLeaseCostDetails, getHistoryRepairCostDetails, getHistoryLoseCostDetails, getHistoryScrapCostDetails} from '@/api/cost/cost' +import {getSltList, costExamine, getSltReportedList, getSltReportList, getHistoryReportList, + getHistoryLeaseCostDetails, getHistoryRepairCostDetails, getHistoryLoseCostDetails, getHistoryScrapCostDetails, + getExportZipUnsettled,getExportZipProgress +} from '@/api/cost/cost' import { toChineseAmount } from '@/utils/bonus.js' import vueEasyPrint from "vue-easy-print"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import * as XLSX from 'xlsx'; import request from '@/utils/request' - +import { download,downloadJson,downloadZip } from '@/utils/request' export default { name: 'UnreportHome', @@ -879,12 +882,7 @@ export default { this.statusText = '开始导出...' - const response = await request({ - url: '/material/slt_agreement_info/exportUnsettled', - method: 'post', - data: JSON.stringify(param), - timeout: 60000 // 设置10分钟超时 - }) + const response = await getExportZipUnsettled(param) const result = response this.taskId = result.taskId this.totalZip = result.total @@ -903,12 +901,9 @@ export default { startPolling() { this.pollInterval = setInterval(async () => { try { - const response = await request({ - url: `/material/slt_agreement_info/exportProgress/${this.taskId}`, - method: 'get' - }) + const param = { taskId: this.taskId } + const response = await getExportZipProgress(param) const progress = response - this.progress = progress.percentage this.current = progress.current @@ -930,7 +925,7 @@ export default { this.statusText = '查询进度失败' this.exportFlag = false } - }, 1000) + }, 5000) }, downloadFile() { @@ -940,7 +935,7 @@ export default { this.downloadZip( 'material/slt_agreement_info/downloadExport', JSON.stringify(param), - `未结算报表批量明细导出_${new Date().getTime()}.zip`, + `未结算批量明细导出_${new Date().getTime()}.zip`, ) }