zhuliu 3 veckor sedan
förälder
incheckning
8aa3110a83
2 ändrade filer med 48 tillägg och 1 borttagningar
  1. 7 0
      src/api/newApi/report.js
  2. 41 1
      src/views/report/components/index.vue

+ 7 - 0
src/api/newApi/report.js

@@ -876,4 +876,11 @@ updateSupplyEvidence(data) {
   queryStatuesVOS(data) {
     return axios.post("/xiaoshi/invalidStatutes/queryStatuesVOS", data);
   },
+  /**
+    * 官方无效-韶音
+    * 导出报告清单
+  */
+  exportReportList(data) {
+    return axios.post("/xiaoshi/reportExport/exportReportList", data);
+  },
 };

+ 41 - 1
src/views/report/components/index.vue

@@ -33,6 +33,7 @@
             </el-dropdown>
             <el-button type="primary" class="margin-left_10 margin-right_10" size="small" @click="showField">显示栏位管理</el-button>
             <el-button v-if="$permission.FunPermissions('xiaoshi/IPREmail')" type="primary" class="margin-right_10" size="small" @click="IPREmail">联系邮箱</el-button>
+            <el-button type="primary" class="margin-right_10" size="small" v-loading="exportBtnLoading" @click="exportExcel">导出</el-button>
           </div>
 
         </div>
@@ -82,6 +83,7 @@ import patentShare from '@/views/components/drawer/Share.vue';
 
 import IPREmailDialog from '../InvalidResponse/components/dialog/IPREmail.vue'
 import handlePersonDialog from './dialog/handlePerson.vue'
+import { formatDate } from '@/utils';
 export default {
   components: {
     Table,
@@ -182,7 +184,8 @@ export default {
           label:'被动',
           value:0
         },
-      ]
+      ],
+      exportBtnLoading:false
     };
   },
   watch: {
@@ -290,6 +293,43 @@ export default {
     IPREmail(){
       this.$refs.IPREmailDialog.open()
     },
+    //导出报告成excel
+    exportExcel(){
+      let params = {
+        searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
+        orderDTOList: this.sort,//排序信息
+      }
+      params.ifInvalidReport = 0
+      if(this.fixedSearch.reportType){
+        params.ifInvalidReport = 1
+        if(params.searchQuery){
+          params.searchQuery = params.searchQuery + ' and reportType=(' + this.fixedSearch.reportType.join(' OR ') + ')'
+        }else{
+          params.searchQuery ='reportType=(' + this.fixedSearch.reportType.join(' OR ') + ')'
+        }
+      }
+      this.$api.exportReportList(params).then(response=>{
+        this.exportBtnLoading = false
+        const anchor = document.createElement('a');
+        if ('download' in anchor) {
+          anchor.href = URL.createObjectURL(response);
+          let now = formatDate(new Date(),"YYYY-MM-DD")
+          anchor.setAttribute("download", now + '- 无效案件详情表.xlsx');
+          anchor.className = "download-js-link";
+          anchor.innerHTML = "downloading...";
+          anchor.style.display = "none";
+          document.body.appendChild(anchor);
+          setTimeout(function () {
+            anchor.click();
+            document.body.removeChild(anchor);
+          }, 66);
+          return true;
+        }
+      }).catch(error=>{
+        this.$message.error('导出失败')
+        this.exportBtnLoading = false
+      })
+    },
     //标签页点击
     async tabChange(name){
       var type = Number(name)