Browse Source

对外报表模块导出

ljb 8 months ago
parent
commit
7ba079a942

+ 6 - 5
src/views/external-reports/external-manage/107-1.vue

@@ -30,7 +30,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { exportBloByPost } from "@/api/common";
+import { exportBlob } from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import YearMonthSelect from "@/components/year-month-select";
 import moment from "moment";
 import moment from "moment";
 import { getToken } from "@/util/auth";
 import { getToken } from "@/util/auth";
@@ -67,7 +67,8 @@ export default window.$crudCommon({
         this.api.getList(this.getSearchParams()).then(res => {
         this.api.getList(this.getSearchParams()).then(res => {
           this.loading = false;
           this.loading = false;
           if (res.data.code == 200) {
           if (res.data.code == 200) {
-            this.data = res.data.data.map(item => {
+            this.data = res.data.data.map((item, idx) => {
+              item.xuhao = idx + 1;
               item.xmStageField = item.xmStage;
               item.xmStageField = item.xmStage;
               item.govBonusField = item.govBonus;
               item.govBonusField = item.govBonus;
               return item;
               return item;
@@ -79,15 +80,15 @@ export default window.$crudCommon({
       return { yearAndMonth: this.params.year, xmId: this.form.xmId, id: this.form.id, xmStage: this.form.xmStageField, govBonus: this.form.govBonusField };
       return { yearAndMonth: this.params.year, xmId: this.form.xmId, id: this.form.id, xmStage: this.form.xmStageField, govBonus: this.form.govBonusField };
     },
     },
     handleExport() {
     handleExport() {
-      exportBloByPost(
-        `/api/kd-scientific/qyyjkfhdjxgqk/export?${
+      exportBlob(
+        `/api/kd-scientific/qyyjkfxmqk/export?${
           this.website.tokenHeader
           this.website.tokenHeader
         }=${getToken()}`,
         }=${getToken()}`,
         this.params
         this.params
       ).then((res) => {
       ).then((res) => {
         downloadXls(
         downloadXls(
           res.data,
           res.data,
-          `${this.params.year}企业研究开发项目情况.xlsx`
+          `${this.pageTitle}.xlsx`
         );
         );
       });
       });
     },
     },

+ 27 - 2
src/views/external-reports/external-manage/107-2.vue

@@ -4,7 +4,7 @@
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
     </div>
     </div>
     <div class="doc-page">
     <div class="doc-page">
-      <h3 class="page-title" style="margin: 24px 0 16px">企业研究开发活动及相关情况</h3>
+      <h3 class="page-title" style="margin: 24px 0 16px">{{ pageTitle }}</h3>
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <el-button
         <el-button
@@ -12,6 +12,7 @@
           size="small"
           size="small"
           plain
           plain
           icon="el-icon-download"
           icon="el-icon-download"
+          @click="handleExport"
         >
         >
           导出
           导出
         </el-button>
         </el-button>
@@ -478,6 +479,10 @@
 import moment from "moment";
 import moment from "moment";
 import yearMonthSelect from "@/components/year-month-select";
 import yearMonthSelect from "@/components/year-month-select";
 import { getList, update } from "@/api/externalReports/107-2";
 import { getList, update } from "@/api/externalReports/107-2";
+import { exportBlob } from "@/api/common";
+import { getToken } from "@/util/auth";
+import { downloadXls } from "@/util/util";
+import { mapGetters } from "vuex";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -495,6 +500,13 @@ export default {
       this.getData();
       this.getData();
     },
     },
   },
   },
+  computed: {
+    ...mapGetters(['tag']),
+    pageTitle() {
+      let yearCN = this.year ? moment(this.year).format('yyyy年') : '';
+      return `${yearCN}${this.tag.label}`
+    }
+  },
   methods: {
   methods: {
     getData() {
     getData() {
       this.loading = true;
       this.loading = true;
@@ -537,7 +549,20 @@ export default {
           this.getData();
           this.getData();
         }
         }
       });
       });
-    }
+    },
+    handleExport() {      
+      exportBlob(
+        `/api/kd-scientific/qyyjkfhdjxgqk/export?${
+          this.website.tokenHeader
+        }=${getToken()}`,
+        { year: this.year }
+      ).then((res) => {
+        downloadXls(
+          res.data,
+          `${this.pageTitle}.xlsx`
+        );
+      });
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 28 - 2
src/views/external-reports/external-manage/high-comp-annual-report.vue

@@ -4,7 +4,7 @@
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
     </div>
     </div>
     <div class="doc-page">
     <div class="doc-page">
-      <h3 class="page-title" style="margin: 24px 0 16px">高企年报</h3>
+      <h3 class="page-title" style="margin: 24px 0 16px">{{ pageTitle }}</h3>
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <el-button
         <el-button
@@ -12,6 +12,7 @@
           size="small"
           size="small"
           plain
           plain
           icon="el-icon-download"
           icon="el-icon-download"
+          @click="handleExport"
         >
         >
           导出
           导出
         </el-button>
         </el-button>
@@ -168,6 +169,10 @@
 import { getList, update } from "@/api/externalReports/highCompAnnualReport";
 import { getList, update } from "@/api/externalReports/highCompAnnualReport";
 import moment from "moment";
 import moment from "moment";
 import yearMonthSelect from "@/components/year-month-select";
 import yearMonthSelect from "@/components/year-month-select";
+import { exportBlob } from "@/api/common";
+import { getToken } from "@/util/auth";
+import { downloadXls } from "@/util/util";
+import { mapGetters } from "vuex";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -185,6 +190,13 @@ export default {
       this.getData();
       this.getData();
     },
     },
   },
   },
+  computed: {
+    ...mapGetters(['tag']),
+    pageTitle() {
+      let yearCN = this.year ? moment(this.year).format('yyyy年') : '';
+      return `${yearCN}${this.tag.label}`
+    }
+  },
   methods: {
   methods: {
     getData() {
     getData() {
       this.loading = true;
       this.loading = true;
@@ -210,7 +222,21 @@ export default {
           this.getData();
           this.getData();
         }
         }
       });
       });
-    }
+    },
+    handleExport() {
+      this.$message.warning('功能建设中...');
+      // exportBlob(
+      //   `/api/kd-scientific/gxjsqyyhqkjmxb/export?${
+      //     this.website.tokenHeader
+      //   }=${getToken()}`,
+      //   { year: this.year }
+      // ).then((res) => {
+      //   downloadXls(
+      //     res.data,
+      //     `${this.pageTitle}.xlsx`
+      //   );
+      // });
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 27 - 2
src/views/external-reports/external-manage/high-comp-discount-details.vue

@@ -4,7 +4,7 @@
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
     </div>
     </div>
     <div class="doc-page">
     <div class="doc-page">
-      <h3 class="page-title" style="margin: 24px 0 16px">A107041高新技术企业优惠情况及明细表</h3>
+      <h3 class="page-title" style="margin: 24px 0 16px">{{ pageTitle }}</h3>
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <el-button
         <el-button
@@ -12,6 +12,7 @@
           size="small"
           size="small"
           plain
           plain
           icon="el-icon-download"
           icon="el-icon-download"
+          @click="handleExport"
         >
         >
           导出
           导出
         </el-button>
         </el-button>
@@ -302,6 +303,10 @@ import { getList, update } from "@/api/externalReports/highCompDiscountDetails";
 import moment from "moment";
 import moment from "moment";
 import yearMonthSelect from "@/components/year-month-select";
 import yearMonthSelect from "@/components/year-month-select";
 import { HIGH_TECH_FIELDS } from "@/config/dict";
 import { HIGH_TECH_FIELDS } from "@/config/dict";
+import { exportBlob } from "@/api/common";
+import { getToken } from "@/util/auth";
+import { downloadXls } from "@/util/util";
+import { mapGetters } from "vuex";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -319,6 +324,13 @@ export default {
       this.getData();
       this.getData();
     },
     },
   },
   },
+  computed: {
+    ...mapGetters(['tag']),
+    pageTitle() {
+      let yearCN = this.year ? moment(this.year).format('yyyy年') : '';
+      return `${yearCN}${this.tag.label}`
+    }
+  },
   methods: {
   methods: {
     // 转译高新领域
     // 转译高新领域
     formatHighTechField(id) {
     formatHighTechField(id) {
@@ -375,7 +387,20 @@ export default {
           this.getData();
           this.getData();
         }
         }
       });
       });
-    }
+    },
+    handleExport() {      
+      exportBlob(
+        `/api/kd-scientific/gxjsqyyhqkjmxb/export?${
+          this.website.tokenHeader
+        }=${getToken()}`,
+        { year: this.year }
+      ).then((res) => {
+        downloadXls(
+          res.data,
+          `${this.pageTitle}.xlsx`
+        );
+      });
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 27 - 3
src/views/external-reports/external-manage/jjkc-discount-details.vue

@@ -4,7 +4,7 @@
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
       <el-button type="primary" icon="el-icon-edit" @click="handleSaveBtn">保存</el-button>
     </div>
     </div>
     <div class="doc-page">
     <div class="doc-page">
-      <h3 class="page-title" style="margin: 24px 0 16px">A107012研发费用加计扣除优惠明细表</h3>
+      <h3 class="page-title" style="margin: 24px 0 16px">{{ pageTitle }}</h3>
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
       <div style="display: flex; justify-content: space-between; margin: 12px 0;">
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <year-month-select v-model="year" :showMonth="false" style="margin: 0;"></year-month-select>
         <el-button
         <el-button
@@ -12,6 +12,7 @@
           size="small"
           size="small"
           plain
           plain
           icon="el-icon-download"
           icon="el-icon-download"
+          @click="handleExport"
         >
         >
           导出
           导出
         </el-button>
         </el-button>
@@ -307,7 +308,10 @@
 import moment from "moment";
 import moment from "moment";
 import yearMonthSelect from "@/components/year-month-select";
 import yearMonthSelect from "@/components/year-month-select";
 import { getList, update } from "@/api/externalReports/jjkcDisCountDetails";
 import { getList, update } from "@/api/externalReports/jjkcDisCountDetails";
-
+import { exportBlob } from "@/api/common";
+import { getToken } from "@/util/auth";
+import { downloadXls } from "@/util/util";
+import { mapGetters } from "vuex";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -325,6 +329,13 @@ export default {
       this.getData();
       this.getData();
     },
     },
   },
   },
+  computed: {
+    ...mapGetters(['tag']),
+    pageTitle() {
+      let yearCN = this.year ? moment(this.year).format('yyyy年') : '';
+      return `${yearCN}${this.tag.label}`
+    }
+  },
   methods: {
   methods: {
     getData() {
     getData() {
       this.loading = true;
       this.loading = true;
@@ -352,7 +363,20 @@ export default {
           this.getData();
           this.getData();
         }
         }
       });
       });
-    }
+    },
+    handleExport() {      
+      exportBlob(
+        `/api/kd-scientific/yffyjjkcyhmxb/export?${
+          this.website.tokenHeader
+        }=${getToken()}`,
+        { year: this.year }
+      ).then((res) => {
+        downloadXls(
+          res.data,
+          `${this.pageTitle}.xlsx`
+        );
+      });
+    },
   },
   },
 };
 };
 </script>
 </script>