瀏覽代碼

Merge branch 'master' of http://git.cc-lotus.info/new_train/train-school

lrf402788946 4 年之前
父節點
當前提交
86524f4162
共有 3 個文件被更改,包括 11 次插入7 次删除
  1. 2 5
      src/views/kaoqin/index.vue
  2. 7 1
      src/views/leave/index.vue
  3. 2 1
      src/views/new-plan/index.vue

+ 2 - 5
src/views/kaoqin/index.vue

@@ -102,7 +102,7 @@ export default {
   created() {
   created() {
     this.searchinfo();
     this.searchinfo();
   },
   },
-  computed: { ...mapState(['user']) },
+  computed: { ...mapState(['user', 'defaultOption']) },
   methods: {
   methods: {
     ...mapActions(['query', 'delete']),
     ...mapActions(['query', 'delete']),
     ...student({ stuquery: 'query' }),
     ...student({ stuquery: 'query' }),
@@ -110,7 +110,7 @@ export default {
     ...util({ fetchUtil: 'fetch' }),
     ...util({ fetchUtil: 'fetch' }),
     ...classes({ classesquery: 'query' }),
     ...classes({ classesquery: 'query' }),
     async searchinfo() {
     async searchinfo() {
-      // let stuid = this.user.id;
+      let stuid = this.user.id;
       const res = await this.schPlanquery();
       const res = await this.schPlanquery();
       this.$set(this, `planList`, res.data);
       this.$set(this, `planList`, res.data);
     },
     },
@@ -135,9 +135,6 @@ export default {
 
 
     async onsearch({ skip = 0, limit = 10, ...info } = {}) {
     async onsearch({ skip = 0, limit = 10, ...info } = {}) {
       const res = await this.query({ skip, termid: this.form.termid, classid: this.form.classid, limit, ...info });
       const res = await this.query({ skip, termid: this.form.termid, classid: this.form.classid, limit, ...info });
-
-      console.log(res.data);
-
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `list`, res.data);
         this.$set(this, `total`, res.total);
         this.$set(this, `total`, res.total);

+ 7 - 1
src/views/leave/index.vue

@@ -61,7 +61,7 @@ export default {
     this.search();
     this.search();
   },
   },
   computed: {
   computed: {
-    ...mapState(['user']),
+    ...mapState(['user', 'defaultOption']),
     mainTitle() {
     mainTitle() {
       let meta = this.$route.meta;
       let meta = this.$route.meta;
       let main = meta.title || '';
       let main = meta.title || '';
@@ -78,6 +78,12 @@ export default {
     ...mapActions(['query', 'delete', 'update']),
     ...mapActions(['query', 'delete', 'update']),
     ...student({ allRequest: 'mergeRequest' }),
     ...student({ allRequest: 'mergeRequest' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.defaultOption.termid) {
+        info = { termid: this.defaultOption.termid };
+      }
+      if (!this.defaultOption.termid && this.defaultOption.planid) {
+        info = { termid: this.defaultOption.planid };
+      }
       const res = await this.query({ skip, limit, ...info, schid: this.user.code });
       const res = await this.query({ skip, limit, ...info, schid: this.user.code });
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
         let studs = await this.allRequest({ method: 'fetch', data: _.uniq(res.data.map(i => i.studentid)) });
         let studs = await this.allRequest({ method: 'fetch', data: _.uniq(res.data.map(i => i.studentid)) });

+ 2 - 1
src/views/new-plan/index.vue

@@ -69,6 +69,7 @@ export default {
     ...trainplan(['query', 'create', 'delete', 'update']),
     ...trainplan(['query', 'create', 'delete', 'update']),
     ...schPlan({ schPlanQuery: 'query', createSchPlan: 'create', updateSchPlan: 'update' }),
     ...schPlan({ schPlanQuery: 'query', createSchPlan: 'create', updateSchPlan: 'update' }),
     async search({ skip = 0, limit = 10, ...info } = {}) {
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      info = { planyearid: this.defaultOption.planyearid };
       const res = await this.query({ skip, limit, ...info });
       const res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);
         this.$set(this, `list`, res.data);
@@ -114,7 +115,7 @@ export default {
     },
     },
   },
   },
   computed: {
   computed: {
-    ...mapState(['user']),
+    ...mapState(['user', 'defaultOption']),
     pageTitle() {
     pageTitle() {
       return `${this.$route.meta.title}`;
       return `${this.$route.meta.title}`;
     },
     },