Jelajahi Sumber

我的报表添加运行记录

zhoupeng 1 tahun lalu
induk
melakukan
b1f5b8ed19
1 mengubah file dengan 39 tambahan dan 4 penghapusan
  1. 39 4
      chuanyi_client/src/views/my_report/index.vue

+ 39 - 4
chuanyi_client/src/views/my_report/index.vue

@@ -70,9 +70,22 @@
                 prop="createTime"
                 width="200">
             </el-table-column>
-            <el-table-column v-if="false" label="操作" align="center" width="380">
+            <el-table-column label="操作" align="center" width="380">
               <template slot-scope="scope">
-                <el-button type="text"
+                <el-button
+                  type="text"
+                  v-if="
+                    uid == scope.row.userId &&
+                    (scope.row.reportTableType == 1
+                    ||scope.row.reportTableType == 2||
+                    scope.row.reportTableType == 5) 
+                  "
+                  size="small"
+                  icon="el-icon-setting"
+                  @click="tableHistoryReport(scope.row.id)"
+                  >运行记录
+                </el-button>
+                <!-- <el-button type="text"
                            v-if="uid == scope.row.userId"
                            size="small"
                            icon="el-icon-edit"
@@ -108,7 +121,7 @@
                            icon="el-icon-delete"
                            style="color: red;"
                            @click="removeReportItem(scope.row)">删除
-                </el-button>
+                </el-button> -->
               </template>
             </el-table-column>
           </el-table>
@@ -514,10 +527,14 @@
          style="display: none;position: absolute;z-index: 0;top: 0;width: 100%;height: 100vh;overflow: hidden;">
       <div id="print-html" ref="printPayFeeNew"></div>
     </div>
+
+    <!-- 报表运行记录table弹出层 -->
+    <History ref="history"></History>
   </div>
 </template>
 
 <script>
+import History from '@/views/run_config/historyReport.vue';
 import BreadcrumbView from '@/components/BreadcrumbView'
 import {
   customCompare,
@@ -557,7 +574,8 @@ import { print } from "@/utils/print.js";
 export default {
   name: "index",
   components: {
-    BreadcrumbView
+    BreadcrumbView,
+    History
   },
   computed: {
     ...mapGetters([
@@ -565,6 +583,17 @@ export default {
       'uid'
     ])
   },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      vm.pathUrl = from.fullPath
+      if(from.path=='/showReport'){
+        //如果是从展示报表中,且为运行记录,则默认打开原本的弹出层
+        if(to.query.type&&to.query.type=='history'){
+          vm.tableHistoryReport(to.query.mainReportTableId)
+        }
+      }
+    })
+  },
   data() {
     return {
       breadcrumbList: ['我的报表'],
@@ -2234,6 +2263,12 @@ export default {
         }, 500)
       }
     },
+    /** 从表格操作进入的运行记录 */
+    tableHistoryReport(id){
+      this.$refs.history.mainReportTableId=id
+      this.$refs.history.visible=true
+      this.$refs.history.getChReportTable();
+    },
     /** 报表记录 */
     historyReport() {
       const loading = showLoading(this, '加载中,请稍候···')