Browse Source

固定资产租赁费用导出

ljb 8 months ago
parent
commit
7ff9973c7b

+ 2 - 2
src/views/yf-cost-manage/basic-data-setting/lease-records.vue

@@ -72,7 +72,7 @@
 import YearMonthSelect from "@/components/year-month-select";
 import YearMonthSelect from "@/components/year-month-select";
 import UploadExcelDialog from "@/components/upload-excel-dialog";
 import UploadExcelDialog from "@/components/upload-excel-dialog";
 import projectSelect from "@/components/project-select";
 import projectSelect from "@/components/project-select";
-import {exportBlob} from "@/api/common";
+import {exportBloByPost} from "@/api/common";
 import {getToken} from "@/util/auth";
 import {getToken} from "@/util/auth";
 import {downloadXls, summaryMethod} from "@/util/util";
 import {downloadXls, summaryMethod} from "@/util/util";
 import moment from "moment";
 import moment from "moment";
@@ -127,7 +127,7 @@ export default window.$crudCommon({
       this.getList(this.page);
       this.getList(this.page);
     },
     },
     handleExport() {
     handleExport() {
-      exportBlob(`/api/kd-scientific/lease/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      exportBloByPost(`/api/kd-scientific/lease/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
         downloadXls(res.data, `${this.pageTitle}.xlsx`);
         downloadXls(res.data, `${this.pageTitle}.xlsx`);
       });
       });
     },
     },

+ 2 - 1
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/dev-cost/components/common-list.vue

@@ -14,6 +14,7 @@
           plain
           plain
           icon="el-icon-download"
           icon="el-icon-download"
           style="margin-right: 10px;"
           style="margin-right: 10px;"
+          @click="handleExport"
         >
         >
           导出
           导出
         </el-button>
         </el-button>
@@ -123,7 +124,7 @@ export default {
       return summaryMethod(columns, data, this.options.sumColumnList, 'model');
       return summaryMethod(columns, data, this.options.sumColumnList, 'model');
     },
     },
     handleExport() {
     handleExport() {
-      this.$message.warning("功能建设中...");
+      this.$emit("exportClick", this.currProjectObj);
     },
     },
     printTable() {
     printTable() {
       let tableColumns = this.$refs.crud.tableOption.column.map(item => {
       let tableColumns = this.$refs.crud.tableOption.column.map(item => {

+ 18 - 13
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/dev-cost/yf-lease-allocation-list.vue

@@ -19,24 +19,19 @@
         <el-button :size="size" icon="el-icon-delete" @click="handleResetBtn">清空</el-button>
         <el-button :size="size" icon="el-icon-delete" @click="handleResetBtn">清空</el-button>
       </template>
       </template>
     </avue-form>
     </avue-form>
-    <div>
-      <el-button
-        type="warning"
-        size="small"
-        plain
-        icon="el-icon-download"
-        @click="handleExport"
-        style="margin-right: 10px;"
-      >
-        导出
-      </el-button>
-    </div>
     <h3 class="page-title">{{ pageTitle }}</h3>
     <h3 class="page-title">{{ pageTitle }}</h3>
     <div style="display: flex; align-items: center;">
     <div style="display: flex; align-items: center;">
       <year-month-select v-model="yearAndMonth" :showAllYear="false" style="margin: 6px 0 20px;"></year-month-select>
       <year-month-select v-model="yearAndMonth" :showAllYear="false" style="margin: 6px 0 20px;"></year-month-select>
     </div>
     </div>
     <template v-if="listData.length">
     <template v-if="listData.length">
-      <common-list v-for="(item, index) of listData" :data="item" :key="index" @printClick="handlePrintClick" style="margin-bottom: 25px;"></common-list>
+      <common-list
+        v-for="(item, index) of listData"
+        :data="item"
+        :key="index"
+        @printClick="handlePrintClick"
+        @exportClick="handleExportClick"
+        style="margin-bottom: 25px;"
+      ></common-list>
     </template>
     </template>
     <el-empty v-else description="暂无数据"></el-empty>
     <el-empty v-else description="暂无数据"></el-empty>
 
 
@@ -70,6 +65,9 @@ import commonList from "./components/common-list.vue";
 import { getList } from "@/api/yfCostManage/yfCostStatistics/yfLeaseAllocationList";
 import { getList } from "@/api/yfCostManage/yfCostStatistics/yfLeaseAllocationList";
 import moment from "moment";
 import moment from "moment";
 import { mapGetters } from "vuex";
 import { mapGetters } from "vuex";
+import {exportBloByPost} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -170,6 +168,13 @@ export default {
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(true);
         this.$refs.printWideTable.printTable(true);
       })
       })
+    },
+    handleExportClick({ leaseDate, xmId }) {
+      console.log(xmId)
+      const exportParams = { leaseDate, xmId, yearAndMonth: this.yearAndMonth };
+      exportBloByPost(`/api/kd-scientific/lease/yfzlzcfyfpb/export?${this.website.tokenHeader}=${getToken()}`, exportParams).then(res => {
+        downloadXls(res.data, `${this.pageTitle}.xlsx`);
+      });
     }
     }
   },
   },
 }
 }