Преглед на файлове

增加财务管理->账单明细->导出分项按钮,并初步实现导出excel功能

nzf преди 3 години
родител
ревизия
151e912a7d
променени са 2 файла, в които са добавени 29 реда и са изтрити 1 реда
  1. 9 0
      src/api/finance/query.js
  2. 20 1
      src/views/finance/query/index.vue

+ 9 - 0
src/api/finance/query.js

@@ -17,3 +17,12 @@ export function exportList(data) {
     params: data
   })
 }
+
+// 分项导出
+export function exportSubItemList(data){
+  return request({
+    url: '/warehouseBusiness/warehousebillsfees/exportBillSubItemDetails',
+    method: 'get',
+    params: data
+  })
+}

+ 20 - 1
src/views/finance/query/index.vue

@@ -244,6 +244,12 @@
           size="mini"
           @click="handleExport"
         >导出</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleSubItemExport"
+        >导出分项</el-button>
       </el-col>
       <div class="tabSetting">
         <div style="margin-right: 20px">
@@ -397,7 +403,7 @@ import Cookies from "js-cookie";
 import draggable from "vuedraggable";
 import { addSet, resetModule, select } from '@/api/system/set';
 import {listCorps} from "@/api/basicdata/corps";
-import {getList, exportList} from "@/api/finance/query";
+import { getList, exportList, exportSubItemList } from '@/api/finance/query'
 import {listFees} from "@/api/basicdata/fees";
 
 export default {
@@ -697,6 +703,19 @@ export default {
         this.download(res.msg)
       })
     },
+    // 分项导出
+    handleSubItemExport(){
+      console.log('分项导出点击了');
+      this.$confirm("是否确认导出分项所有账单明细数据项?","警告",{
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(()=> {
+        return exportSubItemList(this.queryParams)
+      }).then(res => {
+        this.download(res.msg)
+      })
+    },
     // 表格合计
     getSum(param) {
       const { columns, data } = param;