Showing
2 changed files
with
22 additions
and
11 deletions
@@ -123,14 +123,15 @@ service.interceptors.response.use(res => { | @@ -123,14 +123,15 @@ service.interceptors.response.use(res => { | ||
123 | ) | 123 | ) |
124 | 124 | ||
125 | // 通用下载方法 | 125 | // 通用下载方法 |
126 | -export function download(url, params = {}, filename, config) { | ||
127 | - downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", }) | ||
128 | - return service.post(url, params, { | ||
129 | - transformRequest: [(params) => { return tansParams(params) }], | 126 | +export function download(url, params = {}, filename, config,isTransFormParams = true) { |
127 | + downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", backgviround: "rgba(0, 0, 0, 0.7)", }) | ||
128 | + const serviceConfig = { | ||
130 | headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, | 129 | headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, |
131 | responseType: 'blob', | 130 | responseType: 'blob', |
132 | ...config | 131 | ...config |
133 | - }).then(async (data) => { | 132 | + } |
133 | + isTransFormParams && (serviceConfig.transformRequest = [(params) => { return tansParams(params) }]) | ||
134 | + return service.post(url, params, serviceConfig).then(async (data) => { | ||
134 | const isBlob = blobValidate(data) | 135 | const isBlob = blobValidate(data) |
135 | if (isBlob) { | 136 | if (isBlob) { |
136 | const blob = new Blob([data]) | 137 | const blob = new Blob([data]) |
@@ -395,21 +395,31 @@ function submitForm() { | @@ -395,21 +395,31 @@ function submitForm() { | ||
395 | 395 | ||
396 | const handleExportDiff = () => { | 396 | const handleExportDiff = () => { |
397 | proxy.download( | 397 | proxy.download( |
398 | - "monitor/jobLog/export", | 398 | + "/scanSpec/difference/export", |
399 | { | 399 | { |
400 | - ...queryParams.value, | 400 | + scanTaskId:route.query.scanTaskId, |
401 | + status:'COMPLETED' | ||
401 | }, | 402 | }, |
402 | - `回收差异表.xlsx` | 403 | + `回收差异表.xlsx`, |
404 | + { | ||
405 | + headers: {} | ||
406 | + }, | ||
407 | + false | ||
403 | ); | 408 | ); |
404 | }; | 409 | }; |
405 | 410 | ||
406 | const handleExportResult = () => { | 411 | const handleExportResult = () => { |
407 | proxy.download( | 412 | proxy.download( |
408 | - "monitor/jobLog/export", | 413 | + "/scanItem/result/export", |
414 | + { | ||
415 | + scanTaskId:route.query.scanTaskId, | ||
416 | + status:'COMPLETED' | ||
417 | + }, | ||
418 | + `分拣结果表.xlsx`, | ||
409 | { | 419 | { |
410 | - ...queryParams.value, | 420 | + headers: {} |
411 | }, | 421 | }, |
412 | - `分拣结果表.xlsx` | 422 | + false |
413 | ); | 423 | ); |
414 | }; | 424 | }; |
415 | // Reset operation form | 425 | // Reset operation form |
Please
register
or
login
to post a comment