ソースを参照

fix: 修改参数问题

xiaweibo 1 ヶ月 前
コミット
4d7a4a96e7

+ 13 - 1
src/api/production-safety/personal-protective-equipment-purchase-apply.ts

@@ -227,4 +227,16 @@ export function saveThePurchaseRequest(data: SavePpePurchaseApplyReq) {
     method: 'post',
     data,
   });
-}
+}
+
+/** 导出劳防用品采购申请管理 */
+export function exportSafetyEquipmentProcurementRequest (queryParams) {
+  return http.request({
+    url: '/ppePurchaseApply/exportPpePurchaseApplyList',
+    method: 'post',
+    responseType: 'blob',
+    data: queryParams,
+  }, {
+    isTransformResponse: false,
+  });
+}

+ 1 - 1
src/api/safety-organization-management/index.ts

@@ -107,7 +107,7 @@ export const delEmployee = (id) => {
 export const exportSafetyOrganizationSystemManagement = (params)=>{
   return http.request({
     url: `/safetyorguser/exportSafetyOrgUser`,
-    method: 'get',
+    method: 'post',
     params,
     responseType: 'blob',
   }, {

+ 3 - 2
src/views/production-safety/productionSafetySystem/doubleSystemManagement/components/doubleSystemManagementDetail.vue

@@ -29,9 +29,9 @@
               <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
                 >预览</el-button
               >
-              <!-- <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
+              <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
                 >下载</el-button
-              > -->
+              >
             </div>
           </div>
         </div>
@@ -89,6 +89,7 @@
   import type { FileItem } from '@/components/UploadFiles/types';
   import { formatAttachmentList } from '@/components/UploadFiles/utils';
   import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
+  import { downloadFile } from '@/views/disaster/utils';
 
   const router = useRouter();
   const route = useRoute();

+ 1 - 1
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/configs/tables.ts

@@ -16,7 +16,7 @@ const PURCHASE_APPLY_TABLE_COLUMNS: TableColumnProps[] = [
   },
   {
     label: '申请单号',
-    prop: 'applyCode',
+    prop: 'applyCodeDesc',
     align: 'left',
     minWidth: '140px',
   },

+ 20 - 1
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/list.vue

@@ -43,12 +43,15 @@
                   placeholder="请输入申请部门名称"
                   class="act-search-input"
                   clearable
-                />
+                /> 
               </div>
             </section>
             <section class="search-btn">
               <el-button type="primary" @click="handleSearch">查询</el-button>
               <el-button @click="handleReset">重置</el-button>
+              <el-button plain  @click="handleDownload">
+                导出
+              </el-button>
             </section>
           </div>
         </header>
@@ -110,10 +113,12 @@
   import {
     queryPurchaseApplyList,
     deletePurchaseApply,
+    exportSafetyEquipmentProcurementRequest,
     type PpePurchaseApply,
     type QueryPurchaseApplyPageReq,
   } from '@/api/production-safety/personal-protective-equipment-purchase-apply';
   import { template } from 'lodash-es';
+  import { downloadByData } from '@/utils/file/download';
 
   const router = useRouter();
   const basicTableRef = ref<InstanceType<typeof BasicTable>>();
@@ -269,6 +274,20 @@
     });
   };
 
+  const handleDownload = async () => {
+    try {
+      const response = await exportSafetyEquipmentProcurementRequest(tableQuery.queryParam);
+      if (response) {
+        const fileName = `劳防用品采购申请管理_${new Date().toISOString().split('T')[0]}.xlsx`;
+        downloadByData(response, fileName);
+        ElMessage.success('导出成功');
+      }
+    } catch (e) {
+      console.error('导出劳防用品采购申请管理失败:', e);
+      ElMessage.error('导出失败,请重试');
+    }
+  };
+
   onMounted(() => {
     getTableData();
   });