Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

WANG 6 жил өмнө
parent
commit
8205d99e28

+ 63 - 1
src/modules/basic/view/campus.vue

@@ -306,6 +306,7 @@
         </el-table>
         <div class="page pull-right">
           <el-pagination
+            v-if="paginationShow"
             @current-change="handleCurrentChange"
             :current-page="currentPage"
             :page-size="pageSize"
@@ -445,6 +446,20 @@ export default {
           this.tableData = response.data.list;
           this.total = response.data.total;
           this.loading = false;
+
+          this.$router.push({
+            path: "/basic/campus",
+            query: {
+              parentId: this.formSearch.parentId,
+              code: this.formSearch.code,
+              name: this.formSearch.name,
+              currentPage: this.currentPage,
+              pageSize: this.pageSize
+            }
+          });
+          this.$nextTick(function() {
+            this.paginationShow = true;
+          });
         })
         .finally(() => (this.fileLoading = false));
     },
@@ -674,13 +689,60 @@ export default {
 
       this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
         this.rootOrgList = response.data;
-        this.formSearch.parentId = this.user.rootOrgId;
+        if (this.formSearch.parentId === null)
+          this.formSearch.parentId = this.user.rootOrgId;
         this.searchForm();
       });
     }
   },
+  // beforeRouteEnter(to, from, next) {
+  //   next(vm => {
+  //     console.log("beforeRouteEnter: formSearch", vm.formSearch);
+  //     vm.formSearch.parentId = to.$route.query.parentId || "";
+  //     vm.formSearch.code = to.$route.query.code || "";
+  //     vm.formSearch.name = to.$route.query.name || "";
+  //     vm.currentPage = parseInt(to.$route.query.currentPage) || vm.currentPage;
+  //     vm.pageSize = parseInt(to.$route.query.pageSize) || vm.pageSize;
+  //   });
+  // },
+  // beforeRouteLeave(to, from, next) {
+  //   // this.$router.push(to);
+  //   // next();
+  //   // this.$route.query = {
+  //   //   parentId: this.formSearch.parentId,
+  //   //   code: this.formSearch.code,
+  //   //   name: this.formSearch.name,
+  //   //   currentPage: this.currentPage,
+  //   //   pageSize: this.pageSize
+  //   // };
+  //   // next();
+  //   this.$router.push({
+  //     path: "/basic/campus",
+  //     query: {
+  //       parentId: this.formSearch.parentId,
+  //       code: this.formSearch.code,
+  //       name: this.formSearch.name,
+  //       currentPage: this.currentPage,
+  //       pageSize: this.pageSize
+  //     }
+  //   });
+  //   setTimeout(() => {
+  //     console.log("settimeout next");
+  //     next();
+  //   }, 500);
+  // },
   //初始化查询
   created() {
+    this.formSearch.parentId = parseInt(this.$route.query.parentId);
+    if (isNaN(this.formSearch.parentId)) {
+      this.formSearch.parentId = null;
+    }
+    this.formSearch.code = this.$route.query.code || "";
+    this.formSearch.name = this.$route.query.name || "";
+    this.currentPage =
+      parseInt(this.$route.query.currentPage) || this.currentPage;
+    this.pageSize = parseInt(this.$route.query.pageSize) || this.pageSize;
+
     this.init();
     this.uploadHeaders = {
       key: this.user.key,

+ 1 - 1
src/modules/basic/view/course.vue

@@ -116,7 +116,7 @@
         </el-button>
         <el-button
           size="small"
-          type="warning"
+          type="danger"
           @click="disableByIds"
           :disabled="noBatchSelected"
           icon="el-icon-close"

+ 1 - 1
src/modules/print/routes/routes.js

@@ -22,7 +22,7 @@ export default [
         component: Project
       },
       {
-        path: "/print/project/statistic/:orgId/:examId" /* 项目统计 */,
+        path: "/print/project/statistic" /* 项目统计 */,
         meta: { privilegeCodes: "print_project_statistic" },
         component: ProjectStatistic
       },

+ 2 - 1
src/modules/print/view/Project.vue

@@ -598,7 +598,8 @@ export default {
     },
     gotoProjectStatistic(row) {
       /* 查看项目统计 */
-      let url = "/print/project/statistic/" + row.orgId + "/" + row.examId;
+      let url =
+        "/print/project/statistic?orgId=" + row.orgId + "&examId=" + row.examId;
       this.$router.push({ path: url });
     },
     editProjectSetting() {

+ 8 - 3
src/modules/print/view/ProjectStatistic.vue

@@ -47,6 +47,7 @@
               size="small"
               type="primary"
               icon="el-icon-search"
+              v-show="showSearch"
               @click="searchRecords"
               >查询
             </el-button>
@@ -407,6 +408,7 @@ export default {
       loaded: false,
       hasPermit: false,
       loading: false,
+      showSearch: true,
       showGoBack: false,
       tableData: [],
       projectId: "",
@@ -883,12 +885,15 @@ export default {
     }
 
     /* 加载默认数据 */
-    let orgId = this.$route.params.orgId;
-    let examId = this.$route.params.examId;
-    if (orgId != "0" || examId != "0") {
+    let orgId = this.$route.query.orgId;
+    let examId = this.$route.query.examId;
+    //console.log(orgId + " - " + examId);
+
+    if (!checkEmptyNumber(orgId) && !checkEmptyNumber(examId)) {
       this.loaded = true;
       this.loadOrgList();
       this.loadExamList(orgId);
+      this.showSearch = false;
       this.showGoBack = true;
       this.formSearch.orgId = parseInt(orgId);
       this.formSearch.examId = parseInt(examId);