deason 6 yıl önce
ebeveyn
işleme
8f4287af03

+ 1 - 0
src/modules/print/constants/constants.js

@@ -106,6 +106,7 @@ Vue.prototype.loadOrgList = function() {
   this.$http.post(url).then(
     response => {
       this.orgList = response.data;
+      this.selectDefault();
     },
     error => {
       console.log(error);

+ 11 - 0
src/modules/print/view/CourseStatistic.vue

@@ -546,6 +546,10 @@ export default {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {
           this.examList = response.data;
+          if (this.examList.length > 0) {
+            this.formSearch.examId = this.examList[0].examId;
+            this.searchRecords();
+          }
         });
       }
     },
@@ -853,6 +857,13 @@ export default {
           console.log(error);
         }
       );
+    },
+    selectDefault() {
+      if (this.orgList.length > 0) {
+        let firstOrgId = this.orgList[0].orgId;
+        this.formSearch.orgId = firstOrgId;
+        this.searchExamList(firstOrgId);
+      }
     }
   },
   computed: {

+ 12 - 0
src/modules/print/view/ExamStructure.vue

@@ -29,6 +29,7 @@
             <el-select
               v-model="formSearch.examId"
               placeholder="请选择"
+              @change="searchRecords"
               clearable
             >
               <el-option
@@ -440,6 +441,10 @@ export default {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {
           this.examList = response.data;
+          if (this.examList.length > 0) {
+            this.formSearch.examId = this.examList[0].examId;
+            this.searchRecords();
+          }
         });
       }
     },
@@ -593,6 +598,13 @@ export default {
         }
       }
       return "";
+    },
+    selectDefault() {
+      if (this.orgList.length > 0) {
+        let firstOrgId = this.orgList[0].orgId;
+        this.formSearch.orgId = firstOrgId;
+        this.searchExamList(firstOrgId);
+      }
     }
   },
   computed: {

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

@@ -601,11 +601,14 @@ export default {
       this.formSearch.examId = "";
       this.examList = [];
       this.tableData = [];
-      //console.log("orgId:" + orgId);
       if (!this.isEmptyNumber(orgId)) {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {
           this.examList = response.data;
+          if (this.examList.length > 0) {
+            this.formSearch.examId = this.examList[0].examId;
+            this.searchRecords();
+          }
         });
       }
     },
@@ -760,6 +763,13 @@ export default {
         return item.id === key;
       });
       this.projectSettingForm.supplierName = obj.name;
+    },
+    selectDefault() {
+      if (this.orgList.length > 0) {
+        let firstOrgId = this.orgList[0].orgId;
+        this.formSearch.orgId = firstOrgId;
+        this.searchExamList(firstOrgId);
+      }
     }
   },
   computed: {

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

@@ -367,6 +367,7 @@ export default {
       },
       curUserRole: userRole,
       groupTypeList: groupTypeList,
+      loaded: false,
       hasPermit: false,
       loading: false,
       showGoBack: false,
@@ -530,11 +531,17 @@ export default {
       this.examList = [];
       this.tableData = [];
       this.projectId = "";
-      //console.log("orgId:" + orgId);
       if (!this.isEmptyNumber(orgId)) {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {
           this.examList = response.data;
+          if (this.loaded) {
+            return;
+          }
+          if (this.examList.length > 0) {
+            this.formSearch.examId = this.examList[0].examId;
+            this.searchRecords();
+          }
         });
       }
     },
@@ -761,14 +768,22 @@ export default {
     goBack() {
       /* 返回上级界面 */
       this.$router.push({ path: "/print/project/list" });
+    },
+    selectDefault() {
+      if (this.loaded) {
+        return;
+      }
+      if (this.orgList.length > 0) {
+        let firstOrgId = this.orgList[0].orgId;
+        this.formSearch.orgId = firstOrgId;
+        this.searchExamList(firstOrgId);
+      }
     }
   },
   computed: {
     ...mapState({ user: state => state.user })
   },
   created() {
-    this.loadOrgList();
-
     this.loadUserRole(this.user);
 
     if (this.curUserRole.isSuperLeader || this.curUserRole.isPM) {
@@ -781,11 +796,16 @@ export default {
     let orgId = this.$route.params.orgId;
     let examId = this.$route.params.examId;
     if (orgId != "0" || examId != "0") {
+      this.loaded = true;
+      this.loadOrgList();
       this.searchExamList(orgId);
       this.showGoBack = true;
       this.formSearch.orgId = parseInt(orgId);
       this.formSearch.examId = parseInt(examId);
       this.searchRecords();
+    } else {
+      this.loaded = false;
+      this.loadOrgList();
     }
   }
 };

+ 11 - 0
src/modules/print/view/ProjectTemplate.vue

@@ -192,6 +192,10 @@ export default {
         let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
         this.$http.post(url).then(response => {
           this.examList = response.data;
+          if (this.examList.length > 0) {
+            this.formSearch.examId = this.examList[0].examId;
+            this.searchRecords();
+          }
         });
       }
     },
@@ -252,6 +256,13 @@ export default {
       }
       let url = PRINT_API + "/common/download?filePath=" + filePath;
       window.location.href = url;
+    },
+    selectDefault() {
+      if (this.orgList.length > 0) {
+        let firstOrgId = this.orgList[0].orgId;
+        this.formSearch.orgId = firstOrgId;
+        this.searchExamList(firstOrgId);
+      }
     }
   },
   computed: {