Browse Source

统一代码中的导出下载功能

link: 587116b1dba887511abe587cb6dcf5c78fa99be2
cc12458 1 year ago
parent
commit
84f514affe
84 changed files with 606 additions and 687 deletions
  1. 3 1
      src/api/drugs/alias.js
  2. 5 3
      src/api/drugs/drugs.js
  3. 3 1
      src/api/drugs/modifyPrice.js
  4. 3 1
      src/api/drugs/place.js
  5. 3 1
      src/api/drugs/price.js
  6. 3 1
      src/api/drugs/specs.js
  7. 3 1
      src/api/inventory/SystemWin.js
  8. 3 1
      src/api/inventory/forward.js
  9. 13 5
      src/api/inventory/inventory.js
  10. 3 1
      src/api/inventory/modifyPrice.js
  11. 3 1
      src/api/inventory/reporting.js
  12. 3 1
      src/api/inventory/takeInventory.js
  13. 3 1
      src/api/inventory/warehouse.js
  14. 3 1
      src/api/inventory/warehousing.js
  15. 3 1
      src/api/medical/community.js
  16. 3 1
      src/api/medical/dept.js
  17. 3 1
      src/api/medical/log.js
  18. 3 1
      src/api/monitor/job.js
  19. 3 1
      src/api/monitor/jobLog.js
  20. 3 1
      src/api/monitor/logininfor.js
  21. 3 1
      src/api/monitor/operlog.js
  22. 1 1
      src/api/pda/index.js
  23. 3 1
      src/api/pharmacy/mechanism.js
  24. 3 1
      src/api/pharmacy/prescription.js
  25. 3 1
      src/api/pharmacy/storage.js
  26. 3 1
      src/api/pharmacy/supplier.js
  27. 3 1
      src/api/prescription/prescriptionCore.js
  28. 3 1
      src/api/system/config.js
  29. 3 1
      src/api/system/dict/data.js
  30. 3 1
      src/api/system/dict/type.js
  31. 3 1
      src/api/system/post.js
  32. 3 1
      src/api/system/role.js
  33. 4 2
      src/api/system/supplier.js
  34. 6 2
      src/api/system/user.js
  35. 4 0
      src/main.js
  36. 6 0
      src/utils/request.js
  37. 4 1
      src/utils/ruoyi.js
  38. 1 1
      src/utils/zipdownload.js
  39. 12 16
      src/views/drugs/alias/index.vue
  40. 12 16
      src/views/drugs/drugs/index.vue
  41. 0 19
      src/views/drugs/map/index.vue
  42. 12 16
      src/views/drugs/modifyPrice/index.vue
  43. 12 16
      src/views/drugs/place/index.vue
  44. 10 11
      src/views/drugs/price/index.vue
  45. 10 11
      src/views/drugs/specs/index.vue
  46. 12 16
      src/views/inventory/SystemWin/index.vue
  47. 12 16
      src/views/inventory/drugDirectory/index.vue
  48. 12 16
      src/views/inventory/forward/index.vue
  49. 12 17
      src/views/inventory/inventory/index.vue
  50. 12 16
      src/views/inventory/inventoryWarning/index.vue
  51. 12 16
      src/views/inventory/modifyPrice/index.vue
  52. 12 16
      src/views/inventory/reporting/index.vue
  53. 12 16
      src/views/inventory/takeInventory/index.vue
  54. 12 15
      src/views/inventory/warehouse/index.vue
  55. 12 16
      src/views/inventory/warehousing/index.vue
  56. 12 16
      src/views/medical/community/index.vue
  57. 13 17
      src/views/medical/dept/index.vue
  58. 12 16
      src/views/medical/log/index.vue
  59. 10 11
      src/views/monitor/job/index.vue
  60. 10 11
      src/views/monitor/job/log.vue
  61. 10 11
      src/views/monitor/logininfor/index.vue
  62. 12 16
      src/views/monitor/operlog/index.vue
  63. 0 2
      src/views/pda/dispatch/index.vue
  64. 12 16
      src/views/pharmacy/mechanism/index.vue
  65. 12 16
      src/views/pharmacy/prescription/index.vue
  66. 13 17
      src/views/pharmacy/storage/index.vue
  67. 13 17
      src/views/pharmacy/supplier/index.vue
  68. 12 16
      src/views/pharmacyManagement/business/deploy/index.vue
  69. 12 16
      src/views/pharmacyManagement/business/drugDirectory/index.vue
  70. 13 17
      src/views/pharmacyManagement/business/expiryDateEnquiry/index.vue
  71. 12 16
      src/views/pharmacyManagement/business/putPosition/index.vue
  72. 1 3
      src/views/reportManagement/dispensing/index.vue
  73. 1 3
      src/views/reportManagement/expenditure/index.vue
  74. 1 3
      src/views/reportManagement/put-in-stock/index.vue
  75. 0 2
      src/views/reportManagement/transport/index.vue
  76. 12 16
      src/views/rescription/Dispensing/index.vue
  77. 12 16
      src/views/rescription/prescriptionCore/index.vue
  78. 12 16
      src/views/system/config/index.vue
  79. 12 16
      src/views/system/dict/data.vue
  80. 12 16
      src/views/system/dict/index.vue
  81. 10 11
      src/views/system/post/index.vue
  82. 13 17
      src/views/system/role/index.vue
  83. 10 11
      src/views/system/supplier/index.vue
  84. 13 17
      src/views/system/user/index.vue

+ 3 - 1
src/api/drugs/alias.js

@@ -48,7 +48,9 @@ export function exportAlias(query) {
   return request({
     url: '/yfc-admin/drugs/alias/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 5 - 3
src/api/drugs/drugs.js

@@ -48,7 +48,9 @@ export function exportDrugs(query) {
   return request({
     url: '/yfc-admin/drugs/drugs/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 
@@ -103,7 +105,7 @@ export function drugsMapImportTemplate() {
     url: '/yfc-admin/medicalHerbsManage/downloadImportTemplate',
     method: 'post',
     responseType: 'blob',
-    fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
+    download: true,
   })
 }
 
@@ -113,7 +115,7 @@ export function drugsMapExport(query) {
     method: 'post',
     data: query,
     responseType: 'blob',
-    fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/drugs/modifyPrice.js

@@ -48,7 +48,9 @@ export function exportTrimPrice(query) {
   return request({
     url: '/yfc-admin/drugs/TrimPrice/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/drugs/place.js

@@ -48,6 +48,8 @@ export function exportPlace(query) {
   return request({
     url: '/yfc-admin/drugs/place/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/drugs/price.js

@@ -48,6 +48,8 @@ export function exportPrice(query) {
   return request({
     url: '/yfc-admin/drugs/price/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/drugs/specs.js

@@ -57,6 +57,8 @@ export function exportSpecs(query) {
   return request({
     url: '/yfc-admin/drugs/specs/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/inventory/SystemWin.js

@@ -48,7 +48,9 @@ export function exportSystemWin(query) {
   return request({
     url: '/yfc-admin/inventory/SystemWin/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/inventory/forward.js

@@ -64,7 +64,9 @@ export function exportForward(query) {
   return request({
     url: '/yfc-admin/inventory/forward/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 13 - 5
src/api/inventory/inventory.js

@@ -68,7 +68,9 @@ export function exportInventory(query) {
   return request({
     url: '/yfc-admin/inventory/inventory/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 
@@ -121,7 +123,9 @@ export function getWarehousingAndWarehouseExport(query) {
   return request({
     url: '/yfc-admin/inventory/inventory/getWarehousingAndWarehouseExport',
     method: "get",
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 // 药品账簿汇总
@@ -153,7 +157,9 @@ export function reportExport(query) {
   return request({
     url: '/yfc-admin/inventory/inventory/reportExport',
     method: "get",
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 // 收支月报导出
@@ -177,7 +183,9 @@ export function fySummaryExport(query) {
   return request({
     url: '/yfc-admin/prescription/prescriptionCore/fySummaryExport',
     method: "get",
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 // 运输明细报表
@@ -200,6 +208,6 @@ export function exportTransportReport(query) {
     method: 'post',
     data,
     responseType: 'blob',
-    fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
+    download: true,
   })
 }

+ 3 - 1
src/api/inventory/modifyPrice.js

@@ -48,7 +48,9 @@ export function exportModifyPrice(query) {
   return request({
     url: '/yfc-admin/inventory/modifyPrice/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/inventory/reporting.js

@@ -48,7 +48,9 @@ export function exportReporting(query) {
   return request({
     url: '/yfc-admin/inventory/reporting/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/inventory/takeInventory.js

@@ -48,7 +48,9 @@ export function exportTakeInventory(query) {
   return request({
     url: '/yfc-admin/inventory/takeInventory/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/inventory/warehouse.js

@@ -48,7 +48,9 @@ export function exportWarehouse(query) {
   return request({
     url: '/yfc-admin/inventory/warehouse/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/inventory/warehousing.js

@@ -48,7 +48,9 @@ export function exportWarehousing(query) {
   return request({
     url: '/yfc-admin/inventory/warehousing/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/medical/community.js

@@ -48,6 +48,8 @@ export function exportCommunity(query) {
   return request({
     url: '/yfc-admin/medical/community/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/medical/dept.js

@@ -56,6 +56,8 @@ export function exportDept(query) {
   return request({
     url: '/yfc-admin/medical/dept/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/medical/log.js

@@ -48,6 +48,8 @@ export function exportLog(query) {
   return request({
     url: '/yfc-admin/medical/log/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/monitor/job.js

@@ -48,7 +48,9 @@ export function exportJob(query) {
   return request({
     url: '/monitor/job/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/monitor/jobLog.js

@@ -30,6 +30,8 @@ export function exportJobLog(query) {
   return request({
     url: '/monitor/jobLog/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/monitor/logininfor.js

@@ -30,6 +30,8 @@ export function exportLogininfor(query) {
   return request({
     url: '/system/logininfor/export',
     method: 'post',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/monitor/operlog.js

@@ -30,6 +30,8 @@ export function exportOperlog(query) {
   return request({
     url: '/system/operlog/export',
     method: 'post',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 1 - 1
src/api/pda/index.js

@@ -29,6 +29,6 @@ export function exportDispatchReport(query) {
     method: 'post',
     data,
     responseType: 'blob',
-    fileType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8',
+    download: true,
   })
 }

+ 3 - 1
src/api/pharmacy/mechanism.js

@@ -48,6 +48,8 @@ export function exportMechanism(query) {
   return request({
     url: '/yfc-admin/pharmacy/mechanism/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/pharmacy/prescription.js

@@ -48,6 +48,8 @@ export function exportPrescription(query) {
   return request({
     url: '/yfc-admin/pharmacy/prescription/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/pharmacy/storage.js

@@ -48,7 +48,9 @@ export function exportStorage(query) {
   return request({
     url: '/yfc-admin/pharmacy/storage/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/pharmacy/supplier.js

@@ -48,6 +48,8 @@ export function exportSupplier(query) {
   return request({
     url: '/yfc-admin/pharmacy/supplier/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/prescription/prescriptionCore.js

@@ -349,7 +349,9 @@ export function exportPrescriptionCore(query) {
   return request({
     url: '/yfc-admin/prescription/prescriptionCore/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/system/config.js

@@ -64,6 +64,8 @@ export function exportConfig(query) {
   return request({
     url: '/system/config/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/system/dict/data.js

@@ -56,6 +56,8 @@ export function exportData(query) {
   return request({
     url: '/system/dict/data/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/system/dict/type.js

@@ -56,7 +56,9 @@ export function exportType(query) {
   return request({
     url: '/system/dict/type/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 3 - 1
src/api/system/post.js

@@ -48,6 +48,8 @@ export function exportPost(query) {
   return request({
     url: '/system/post/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }

+ 3 - 1
src/api/system/role.js

@@ -70,7 +70,9 @@ export function exportRole(query) {
   return request({
     url: '/system/role/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 4 - 2
src/api/system/supplier.js

@@ -48,6 +48,8 @@ export function exportSupplier(query) {
   return request({
     url: '/system/supplier/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
-}
+}

+ 6 - 2
src/api/system/user.js

@@ -49,7 +49,9 @@ export function exportUser(query) {
   return request({
     url: '/system/user/export',
     method: 'get',
-    params: query
+    params: query,
+    responseType: 'blob',
+    download: true,
   })
 }
 
@@ -122,7 +124,9 @@ export function uploadAvatar(data) {
 export function importTemplate() {
   return request({
     url: '/system/user/importTemplate',
-    method: 'get'
+    method: 'get',
+    responseType: 'blob',
+    download: true,
   })
 }
 

+ 4 - 0
src/main.js

@@ -45,6 +45,10 @@ Vue.prototype.resetForm = resetForm
 Vue.prototype.addDateRange = addDateRange
 Vue.prototype.selectDictLabel = selectDictLabel
 Vue.prototype.selectDictLabels = selectDictLabels
+/**
+ * @deprecated
+ * @type {download}
+ */
 Vue.prototype.download = download
 Vue.prototype.handleTree = handleTree
 

+ 6 - 0
src/utils/request.js

@@ -3,6 +3,7 @@ import { Notification, MessageBox, Message } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
+import { downloadBlob } from '@/utils/zipdownload';
 
 axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
@@ -59,6 +60,11 @@ service.interceptors.response.use(async res => {
       if (type === 'application/json') {
         const text = await res.data.text()
         res.data = JSON.parse(text);
+      } else if(res.config.download) {
+        return downloadBlob({
+          name: decodeURIComponent((value.match(/fileName=["']([^"']+)["']/i) || [])[1] || '') || (typeof res.config.download === 'string' ? res.config.download : ''),
+          blob: res.data
+        });
       } else {
         return {
           name: decodeURIComponent((value.match(/fileName=["']([^"']+)["']/i) || [])[1] || ''),

+ 4 - 1
src/utils/ruoyi.js

@@ -95,7 +95,10 @@ export function selectDictLabels(datas, value, separator) {
 	return actions.join('').substring(0, actions.join('').length - 1);
 }
 
-// 通用下载方法
+/**
+ * 通用下载方法
+ * @deprecated
+ */
 export function download(fileName) {
 	window.location.href = baseURL + "common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
 }

+ 1 - 1
src/utils/zipdownload.js

@@ -54,7 +54,7 @@ export function downloadBlob({blob, name}) {
     setTimeout(() => {
       document.body.removeChild(link);
       URL.revokeObjectURL(url);
-      resolve();
+      resolve({blob, name});
     }, 20)
   })
 }

+ 12 - 16
src/views/drugs/alias/index.vue

@@ -407,22 +407,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有别名维护数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportAlias(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有别名维护数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportAlias(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     //通过别名获取五笔、拼音
     handleChangeName(e) {

+ 12 - 16
src/views/drugs/drugs/index.vue

@@ -1627,22 +1627,18 @@ export default {
         });
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品信息数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportDrugs(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品信息数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportDrugs(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     handleChangeName(e, num, index) {
       getInfo(e).then((res) => {

+ 0 - 19
src/views/drugs/map/index.vue

@@ -272,7 +272,6 @@ export default {
       this.exporting = true;
       try {
         const {blob, name = ''} = await drugsMapExport(this.backupsParams);
-        await this.download(blob, name);
         this.msgSuccess(`${name} 下载成功`);
       } catch (error) {}
       this.exporting = false;
@@ -281,7 +280,6 @@ export default {
       this.downloading = true;
       try {
         const {blob, name = ''} = await drugsMapImportTemplate(this.backupsParams);
-        await this.download(blob, name);
         this.msgSuccess(`${name} 下载成功`);
       } catch (e) { }
       this.downloading = false;
@@ -296,23 +294,6 @@ export default {
       } catch (e) {}
       this.uploading = false;
     },
-    download(blob, filename = '') {
-      const link = document.createElement('a');
-      document.body.appendChild(link);
-
-      const url = URL.createObjectURL(blob);
-      link.href = url;
-      link.download = filename;
-      link.click();
-
-      return new Promise(resolve => {
-        setTimeout(() => {
-          document.body.removeChild(link);
-          URL.revokeObjectURL(url);
-          resolve();
-        }, 20)
-      })
-    }
   },
 };
 </script>

+ 12 - 16
src/views/drugs/modifyPrice/index.vue

@@ -1134,22 +1134,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有统一调价(整体)数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportTrimPrice(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有统一调价(整体)数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportTrimPrice(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/drugs/place/index.vue

@@ -375,22 +375,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品产地数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportPlace(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品产地数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportPlace(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     //通过产地名称获取五笔、拼音
     handleChangeName(e) {

+ 10 - 11
src/views/drugs/price/index.vue

@@ -358,19 +358,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有价格信息数据项?', "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有价格信息数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportPrice(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportPrice(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 10 - 11
src/views/drugs/specs/index.vue

@@ -436,19 +436,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有药品规格数据项?', "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品规格数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportSpecs(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportSpecs(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 12 - 16
src/views/inventory/SystemWin/index.vue

@@ -355,22 +355,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有窗口管理数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportSystemWin(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有窗口管理数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportSystemWin(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/inventory/drugDirectory/index.vue

@@ -375,22 +375,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportInventory(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/inventory/forward/index.vue

@@ -343,22 +343,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有库存结转数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportForward(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有库存结转数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportForward(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 17
src/views/inventory/inventory/index.vue

@@ -522,23 +522,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportInventory(queryParams);
-        })
-        .then((response) => {
-          //console.log(response)
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/inventory/inventoryWarning/index.vue

@@ -277,22 +277,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportInventory(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/inventory/modifyPrice/index.vue

@@ -1312,22 +1312,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有调价管理数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportModifyPrice(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有调价管理数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportModifyPrice(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/inventory/reporting/index.vue

@@ -982,22 +982,18 @@ export default {
       this.checkedReportingDetail = selection.map((item) => item.index);
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有报损单数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportReporting(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有报损单数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportReporting(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/inventory/takeInventory/index.vue

@@ -1332,22 +1332,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有盘存单数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportTakeInventory(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有盘存单数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportTakeInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 15
src/views/inventory/warehouse/index.vue

@@ -1022,22 +1022,19 @@ export default {
       this.checkedWarehouseDetail = selection.map((item) => item.index);
     },
     /** 导出按钮操作 */
-    handleExport() {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有出库单数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportWarehouse(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
       const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有出库单数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportWarehouse(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
     },
   },
 };

+ 12 - 16
src/views/inventory/warehousing/index.vue

@@ -1140,22 +1140,18 @@ export default {
       this.checkedWarehouseDetail = selection.map((item) => item.index);
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有入库单数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportWarehousing(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有入库单数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportWarehousing(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/medical/community/index.vue

@@ -361,22 +361,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有医共体数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportCommunity(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有医共体数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportCommunity(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     //启用 / 禁用
     handleState(row, num) {

+ 13 - 17
src/views/medical/dept/index.vue

@@ -294,7 +294,7 @@ export default {
       if(val){
         this.getMechanismListArr(val)
       }
-     
+
     }
   },
   methods: {
@@ -423,22 +423,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有科室病区数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportDept(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        this.$confirm("是否确认导出所有科室病区数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportDept(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/medical/log/index.vue

@@ -698,22 +698,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有会计期间数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportLog(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有会计期间数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportLog(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 10 - 11
src/views/monitor/job/index.vue

@@ -530,19 +530,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有定时任务数据项?", "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportJob(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportJob(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 10 - 11
src/views/monitor/job/log.vue

@@ -309,19 +309,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有调度日志数据项?", "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有调度日志数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportJobLog(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportJobLog(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 10 - 11
src/views/monitor/logininfor/index.vue

@@ -227,19 +227,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有操作日志数据项?', "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportLogininfor(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportLogininfor(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 12 - 16
src/views/monitor/operlog/index.vue

@@ -409,22 +409,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportOperlog(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportOperlog(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 0 - 2
src/views/pda/dispatch/index.vue

@@ -3,7 +3,6 @@ import {dispatchList, exportDispatchReport} from '@/api/pda';
 import dayjs from 'dayjs';
 import PrintContainer from './printContainer.vue';
 import ScanPanel from '@/views/pda/dispatch/scanPanel.vue';
-import {downloadBlob} from '@/utils/zipdownload';
 
 export default {
   name: 'pda-dispatch',
@@ -119,7 +118,6 @@ export default {
       this.exporting = true;
       try {
         const data = await exportDispatchReport(form);
-        await downloadBlob(data);
         this.$message.success(`导出 ${data.name} 成功`);
       } catch (error) {}
       this.exporting = false;

+ 12 - 16
src/views/pharmacy/mechanism/index.vue

@@ -574,22 +574,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有医疗机构与药房对照管理数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportMechanism(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有医疗机构与药房对照管理数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportMechanism(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/pharmacy/prescription/index.vue

@@ -815,22 +815,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有处方传输数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportPrescription(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有处方传输数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportPrescription(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 13 - 17
src/views/pharmacy/storage/index.vue

@@ -114,7 +114,7 @@
             node-key="id"
             @check="treeCheck"
             :default-checked-keys="pharmacyListArr"
-            ref="treeCheck" 
+            ref="treeCheck"
           >
           </el-tree>
         </el-form-item>
@@ -406,22 +406,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有出入库管理数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportStorage(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有出入库管理数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportStorage(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 13 - 17
src/views/pharmacy/supplier/index.vue

@@ -129,7 +129,7 @@
           :loading="exportLoading"
           @click="handleExport"
           v-hasPermi="['pharmacy:supplier:export']"
-        >导出</el-button> 
+        >导出</el-button>
       </el-col>-->
     <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
     <!-- </el-row> -->
@@ -454,22 +454,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有供货单位数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportSupplier(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有供货单位数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportSupplier(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     //通过医疗名称获取五笔、拼音
     handleChangeName(e) {

+ 12 - 16
src/views/pharmacyManagement/business/deploy/index.vue

@@ -1098,22 +1098,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportPrescriptionCore(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportPrescriptionCore(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     // 改变溯源记录的状态
     handleDeploy(item) {

+ 12 - 16
src/views/pharmacyManagement/business/drugDirectory/index.vue

@@ -362,22 +362,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportInventory(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 13 - 17
src/views/pharmacyManagement/business/expiryDateEnquiry/index.vue

@@ -381,7 +381,7 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
-  
+
       /*this.queryParams.startTime =
         this.time && this.formatTime(this.time[0], "yyyy-MM-dd");
       this.queryParams.endTime =
@@ -461,22 +461,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportInventory(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有药品库存数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/pharmacyManagement/business/putPosition/index.vue

@@ -380,22 +380,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有摆放位置数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportInventory(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有摆放位置数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportInventory(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 1 - 3
src/views/reportManagement/dispensing/index.vue

@@ -121,9 +121,7 @@ export default {
         form.endTime = this.date[1]
       }
       fySummaryExport(form).then(res => {
-        if (res.code == 200) {
-          this.download(res.msg)
-        }
+        this.$message.success(`导出 ${res.name} 成功`);
       })
     },
     print () {},

+ 1 - 3
src/views/reportManagement/expenditure/index.vue

@@ -106,9 +106,7 @@ export default {
         startTime: startTime,
         endTime : endTime
       }).then(res => {
-        if (res.code == 200) {
-          this.download(res.msg)
-        }
+        this.$message.success(`导出 ${res.name} 成功`);
       })
     },
     handleCurrentChange(val) {

+ 1 - 3
src/views/reportManagement/put-in-stock/index.vue

@@ -145,9 +145,7 @@ export default {
         form.endTime = this.date[1]
       }
       getWarehousingAndWarehouseExport(form).then(res => {
-        if (res.code == 200) {
-          this.download(res.msg)
-        }
+        this.$message.success(`导出 ${res.name} 成功`);
       })
     },
     print () {},

+ 0 - 2
src/views/reportManagement/transport/index.vue

@@ -3,7 +3,6 @@ import {listMedicalMechanism} from '@/api/medical/mechanism';
 import dayjs from 'dayjs';
 import {getByMechanismId, listDept} from '@/api/medical/dept';
 import {exportTransportReport, getTransportReport} from '@/api/inventory/inventory';
-import {downloadBlob} from '@/utils/zipdownload';
 
 export default {
   name: 'report-transport',
@@ -98,7 +97,6 @@ export default {
       this.exporting = true;
       try {
         const data = await exportTransportReport(form);
-        await downloadBlob(data);
         this.$message.success(`导出 ${data.name} 成功`);
       } catch (error) {}
       this.exporting = false;

+ 12 - 16
src/views/rescription/Dispensing/index.vue

@@ -838,22 +838,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportPrescriptionCore(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportPrescriptionCore(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };

+ 12 - 16
src/views/rescription/prescriptionCore/index.vue

@@ -2118,22 +2118,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportPrescriptionCore(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有处方审核数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportPrescriptionCore(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
   filters: {

+ 12 - 16
src/views/system/config/index.vue

@@ -436,22 +436,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有参数数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportConfig(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有参数数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportConfig(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     /** 刷新缓存按钮操作 */
     handleRefreshCache() {

+ 12 - 16
src/views/system/dict/data.vue

@@ -408,22 +408,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportData(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportData(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     goPage() {
       window.history.go(-1);

+ 12 - 16
src/views/system/dict/index.vue

@@ -335,22 +335,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有类型数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportType(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有类型数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportType(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     /** 刷新缓存按钮操作 */
     handleRefreshCache() {

+ 10 - 11
src/views/system/post/index.vue

@@ -312,19 +312,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有岗位数据项?', "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有岗位数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportPost(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportPost(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 13 - 17
src/views/system/role/index.vue

@@ -691,23 +691,19 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有角色数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportRole(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有角色数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportRole(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
   },
 };
-</script>
+</script>

+ 10 - 11
src/views/system/supplier/index.vue

@@ -283,19 +283,18 @@ export default {
         }).catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有供货单位数据项?', "警告", {
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有供货单位数据项?", "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportSupplier(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+          type: "warning",
+        });
+        const data = await exportSupplier(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     }
   }
 };

+ 13 - 17
src/views/system/user/index.vue

@@ -932,22 +932,18 @@ export default {
         .catch(() => {});
     },
     /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm("是否确认导出所有用户数据项?", "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.exportLoading = true;
-          return exportUser(queryParams);
-        })
-        .then((response) => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        })
-        .catch(() => {});
+    async handleExport() {
+      this.exportLoading = true;
+      try {
+        await this.$confirm("是否确认导出所有用户数据项?", "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        const data = await exportUser(this.queryParams)
+        this.$message.success(`导出 ${data.name} 成功`);
+      } catch (e) {}
+      this.exportLoading = false;
     },
     /** 导入按钮操作 */
     handleImport() {
@@ -957,7 +953,7 @@ export default {
     /** 下载模板操作 */
     importTemplate() {
       importTemplate().then((response) => {
-        this.download(response.msg);
+        this.$message.success(`下载模板 ${response.name} 成功`);
       });
     },
     // 文件上传中处理