Browse Source

研发领料单、动力耗用单和材料去向单导出

ljb 8 months ago
parent
commit
c6c65585fe

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

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

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

+ 19 - 2
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/cl-cost/components/common-page.vue

@@ -24,7 +24,15 @@
       <year-month-select v-model="yearAndMonth" :showAllYear="false" style="margin: 6px 0 20px;"></year-month-select>
     </div>
     <template v-if="listData.length">
-      <common-list v-for="(item, index) of listData" :data="item" :type="type" :key="index" style="margin-bottom: 25px;" @printClick="handlePrintClick"></common-list>
+      <common-list
+        v-for="(item, index) of listData"
+        :data="item"
+        :type="type"
+        :key="index"
+        style="margin-bottom: 25px;" 
+        @printClick="handlePrintClick"
+        @exportClick="handleExportClick"
+      ></common-list>
     </template>
     <el-empty v-else description="暂无数据"></el-empty>
 
@@ -63,6 +71,9 @@ import { getList } from "@/api/yfCostManage/yfCostStatistics/clCost";
 import moment from "moment";
 import Decimal from "decimal.js";
 import { mapGetters } from "vuex";
+import {exportBloByPost} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
 
 export default {
   props: {
@@ -170,7 +181,13 @@ export default {
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(true);
       })
-    }
+    },
+    handleExportClick({ xmId, useDate, yearAndMonth }) {
+      const exportParams = { useDate, xmId, yearAndMonth, type: this.type };
+      exportBloByPost(`/api/kd-scientific/goods/yanfalingliaodan/export?${this.website.tokenHeader}=${getToken()}`, exportParams).then(res => {
+        downloadXls(res.data, `${this.pageTitle}.xlsx`);
+      });
+    },
   },
 }
 </script>

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

@@ -170,7 +170,6 @@ export default {
       })
     },
     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`);