Browse Source

报告分组

zhuliu 1 year ago
parent
commit
cb76029039

+ 22 - 2
src/views/report/components/index.vue

@@ -36,10 +36,19 @@
 
         </div>
       </el-header>
-      <el-main id="patent-list-container" class="main" v-loading="loading">
-        <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList" @tabChange="tabChange"
+      <el-main id="patent-list-container" class="main" v-loading="loading" style="display: flex;">
+        <div>
+          <el-tabs v-model="tab" tab-position="left" @tab-click="(tab)=>tabChange(tab.name)" style="height:100%">
+            <el-tab-pane label="总表" name="1"></el-tab-pane>
+            <el-tab-pane label="官方无效" name='2'></el-tab-pane>
+          </el-tabs>
+        </div>
+        <div style="width:100%;padding-right:5px">
+          <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList" @tabChange="tabChange" :fixedSearch="fixedSearch"
           :state="state" :queryParams="queryParams" @option="handleOption" @on-sort="handleSort" :groupBy="groupingValue"
           :groupingOption="groupingOption" :commonData="commonData" :searchOption="searchOption" :column="columnList" @params="getParams"></component>
+        </div>
+        
       </el-main>
       <el-footer class="pagination" v-if="viewType != 'visual'">
         <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current"
@@ -93,6 +102,7 @@ export default {
   },
   data() {
     return {
+      tab:'1',
       //视图类型
       viewTypes: [
         // {
@@ -453,6 +463,16 @@ export default {
         ],//排序
         groupBy: this.groupingValue,//分组信息
       }
+      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.groupReportProject(params).then(res => {
         if (res.code == 200) {
           this.commonData = res.data.data.values

+ 2 - 1
src/views/report/components/view/mergeTable.vue

@@ -49,7 +49,8 @@ export default {
          
         ]
       }
-    }
+    },
+    
   },
   mixins: [],
   components: {

+ 29 - 8
src/views/report/components/view/table.vue

@@ -2,12 +2,12 @@
   <div class="height_100">
     <div class="height_100" v-DivHeight="getDivHeight">
       <el-container>
-        <el-aside width="95px">
+        <!-- <el-aside width="95px">
           <el-tabs v-model="tab" tab-position="left" @tab-click="tabClick">
             <el-tab-pane label="总表" name="1"></el-tab-pane>
             <el-tab-pane label="官方无效" name='2'></el-tab-pane>
           </el-tabs>
-        </el-aside>
+        </el-aside> -->
         <el-main style="padding:0 0 0 10px !important">
           <el-table :data="tableData" border style="width: 100%" header-row-class-name="custom-table-header"
           @sort-change="sortChange" v-if="showTable" :height="tableHeight" v-el-table-infinite-scroll="getList" :infinite-scroll-distance="10" 
@@ -91,11 +91,12 @@ export default {
     },
     row: null,
     //操作信息
-    handleMessage:''
+    handleMessage:'',
+    fixedSearch:{}
   },
   data() {
     return {
-      tab:'1',
+      // tab:'1',
       // 报告类型
       reportTypeName: {
         '0':'无效分析报告',
@@ -155,10 +156,10 @@ export default {
   },
   methods: {
     //左侧标签点击
-    tabClick(tab, event){
-      var name = tab.name
-      this.$emit('tabChange',name)
-    },
+    // tabClick(tab, event){
+    //   var name = tab.name
+    //   this.$emit('tabChange',name)
+    // },
 
      //更新数据
     updateData() {
@@ -190,6 +191,16 @@ export default {
     },
 
     getList2(params,type){
+      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.queryReportProject(params).then(res => {
         if (res.code == 200) {
           if(type == 1){
@@ -230,6 +241,16 @@ export default {
         groupField: this.row.groupBy,
         groupFieldValue: this.row.row.value,
       }
+      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.isMore = false;
       this.isFlag = true;
       this.$api.queryReportProject(params).then(res => {