Browse Source

会计科目设置增加导出功能

ljb 6 months ago
parent
commit
88f06838f9

+ 19 - 0
src/views/basic-resource/basic-database/subject-setting.vue

@@ -11,6 +11,17 @@
       @row-save="rowSave"
       @row-update="rowUpdate"
     >
+      <template slot="menuLeft">
+        <el-button
+          type="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+        >
+          导出
+        </el-button>
+      </template>
       <template slot="icon" slot-scope="scope">
         <i :class="scope.row.icon" style="font-size: 24px"></i>
       </template>
@@ -34,6 +45,9 @@
 </template>
 <script>
 import { getList, add, update, remove } from "@/api/basicResource/subjectSetting";
+import {exportBloByPost} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
 import { mapGetters } from "vuex";
 
 export default {
@@ -200,6 +214,11 @@ export default {
     this.getMenuData();
   },
   methods: {
+    handleExport() {
+      exportBloByPost(`/api/kd-scientific/subject/export?${this.website.tokenHeader}=${getToken()}`, this.query).then(res => {
+        downloadXls(res.data, `${this.tag.label}.xlsx`);
+      });
+    },
     loopData(data, level, maxLevel) {
       level++;
       return data.map(item => {

+ 7 - 0
src/views/wel/index.vue

@@ -107,6 +107,7 @@ import { getList as getCostSummaryList } from "@/api/yfCostManage/yfCostStatisti
 import { getList as getCyPersonList } from "@/api/techPerson/cyPersonRoster";
 import { getXmysygjqst, getZl } from "@/api/wel";
 import Decimal from "decimal.js";
+import { mapGetters } from "vuex";
 
 export default {
   name: "home",
@@ -146,6 +147,7 @@ export default {
     };
   },
   computed: {
+    ...mapGetters(['pageYear']),
     projectTotalOpt() {
       return {
         span: 24,
@@ -213,6 +215,11 @@ export default {
       this.getXmysygjqstFunc(0);
     }
   },
+  activated() {
+    if (this.pageYear && this.currYear && this.currYear != this.pageYear) {
+      this.currYear = this.pageYear;
+    }
+  },
   methods: {
     handleSearchBtn() {
       this.getProjectListByYearFunc();