Browse Source

导出修改

yusm 5 months ago
parent
commit
b0ada8b505

+ 3 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ExpenseSheetController.java

@@ -107,6 +107,9 @@ public class ExpenseSheetController {
         }
         }
         sheet.setCompanyId(user.getCompanyId());
         sheet.setCompanyId(user.getCompanyId());
         List<String> fileNames= expenseSheetService.queryExportFileZipList(sheet,projectId, startDate, endDate);
         List<String> fileNames= expenseSheetService.queryExportFileZipList(sheet,projectId, startDate, endDate);
+        /*List<String> fileNames=new ArrayList<>();
+        fileNames.add("头像.png");
+        fileNames.add("日报统计表_.xlsx");*/
         if (!fileNames.isEmpty()){
         if (!fileNames.isEmpty()){
             FileZipUtil.exportZip(response,uploadPath ,fileNames, "报销凭证压缩包", ".zip");
             FileZipUtil.exportZip(response,uploadPath ,fileNames, "报销凭证压缩包", ".zip");
         }else return;
         }else return;

+ 2 - 0
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -1683,6 +1683,8 @@
   "weiFaFang": "未发放",
   "weiFaFang": "未发放",
   "yiFaFang": "已发放",
   "yiFaFang": "已发放",
   "danJuDaoChu": "单据导出",
   "danJuDaoChu": "单据导出",
+  "baoXiaoPingZhengDaoChu": "报销凭证导出",
+  "baoXiaoPingZhengYaSuoBao": "报销凭证导出压缩包",
   "faFang": "发放",
   "faFang": "发放",
   "quXiaoFaFang": "取消发放",
   "quXiaoFaFang": "取消发放",
   "daiDiYiShenHeRenShenHe": "待第一审核人审核",
   "daiDiYiShenHeRenShenHe": "待第一审核人审核",

+ 21 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -342,6 +342,9 @@
                 <el-form-item v-if="currentClick == '2-1'">
                 <el-form-item v-if="currentClick == '2-1'">
                   <el-button @click="exportDocument()" size="small">{{ $t('danJuDaoChu') }}</el-button>
                   <el-button @click="exportDocument()" size="small">{{ $t('danJuDaoChu') }}</el-button>
                 </el-form-item>
                 </el-form-item>
+                <el-form-item v-if="currentClick == '2-1'">
+                  <el-button @click="exportDocumentFile()" size="small">{{ $t('baoXiaoPingZhengDaoChu') }}</el-button>
+                </el-form-item>
                 <el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
                 <el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
                   <el-button @click="documentIssuance(1)" size="small">{{ $t('faFang') }}</el-button>
                   <el-button @click="documentIssuance(1)" size="small">{{ $t('faFang') }}</el-button>
                 </el-form-item>
                 </el-form-item>
@@ -2425,6 +2428,24 @@ export default {
           });
           });
         });
         });
     },
     },
+    //报销凭证导出
+    exportDocumentFile() {
+      var stat = ''
+      var end = ''
+      if (this.date) {
+        stat = this.date[0]
+        end = this.date[1]
+      }
+      const formData = new FormData();
+      formData.append('code', this.code);
+      formData.append('startDate', stat);
+      formData.append('endDate', end);
+      formData.append('ownerId', this.ownerId);
+      formData.append('type', this.type);
+      formData.append('projectId', this.selectProject ? this.selectProject : null);
+      formData.append('sendState', this.sendState);
+      this.http.downloadFile(`/expense-sheet/export`, formData, '报销凭证导出.zip')
+    },
     // 单据发放
     // 单据发放
     documentIssuance(type) {
     documentIssuance(type) {
       const newList = this.multipleSelection.filter(item => item.status == 1 || item.status == 2);
       const newList = this.multipleSelection.filter(item => item.status == 1 || item.status == 2);