Browse Source

人员信息

guhongwei 3 years ago
parent
commit
79b2c6ae21
3 changed files with 26 additions and 57 deletions
  1. 6 0
      src/store/index.js
  2. 10 34
      src/views/personnel/director/index.vue
  3. 10 23
      src/views/personnel/learning/index.vue

+ 6 - 0
src/store/index.js

@@ -20,6 +20,10 @@ import technicalservice from '@common/src/store/technicalservice';
 import scienceactivities from '@common/src/store/scienceactivities';
 // 提交报告
 import report from '@common/src/store/report';
+// 主任及科研助理
+import assistant from '@common/src/store/assistant';
+// 学术委员会
+import committee from '@common/src/store/committee';
 
 Vue.use(Vuex);
 
@@ -39,5 +43,7 @@ export default new Vuex.Store({
     technicalservice,
     scienceactivities,
     report,
+    assistant,
+    committee,
   },
 });

+ 10 - 34
src/views/personnel/director/index.vue

@@ -18,6 +18,8 @@ import info1 from '@/layout/personnel/director/info-1.vue';
 import search1 from '@/layout/personnel/director/search-1.vue';
 import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('assistant');
+
 export default {
   name: 'index',
   props: {},
@@ -29,37 +31,7 @@ export default {
   },
   data: function () {
     return {
-      list: [
-        {
-          assistantArea: null,
-          assistantCardtime: null,
-          assistantJob: '',
-          assistantJobtime: null,
-          assistantName: '',
-          assistantPosition: null,
-          committeeArea: '脑功能和脑疾病机制及其神经调控',
-          committeeCardtime: '2021-10-07',
-          committeeJob: null,
-          committeeJobtime: null,
-          committeeName: '舒友生',
-          committeePosition: '副院长',
-          createBy: '1',
-          createTime: '1900-01-20 00:05:43',
-          delFlag: '0',
-          id: '1',
-          labArea: '癫痫及小儿神经系统疾病基础与临床',
-          labCardtime: '2021-09-23',
-          labJob: null,
-          labJobtime: null,
-          labName: '梁建民',
-          labPosition: '科主任',
-          params: {},
-          remark: null,
-          searchValue: null,
-          updateBy: null,
-          updateTime: '2021-09-23 13:17:54',
-        },
-      ],
+      list: [],
       total: 0,
       limit: 5,
       // 查询
@@ -74,9 +46,13 @@ export default {
     await this.search();
   },
   methods: {
-    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
-      if (searchName) info.name = searchName;
-      console.log(this.searhForm);
+    ...mapActions(['query', 'fetch']),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.rows);
+        this.$set(this, `total`, res.total);
+      }
     },
     // 查看信息
     async toView(data) {

+ 10 - 23
src/views/personnel/learning/index.vue

@@ -18,6 +18,8 @@ import info1 from '@/layout/personnel/learning/info-1.vue';
 import search1 from '@/layout/personnel/learning/search-1.vue';
 import adminFrame from '@common/src/components/mobile-frame/mobile-main.vue';
 import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('committee');
+
 export default {
   name: 'index',
   props: {},
@@ -29,26 +31,7 @@ export default {
   },
   data: function () {
     return {
-      list: [
-        {
-          age: null,
-          createBy: '1',
-          createTime: '2021-09-17 13:36:25',
-          delFlag: '0',
-          directionId: '生物钟异常与癫痫病机理',
-          id: 'c6c020e1d88643f59db9a2f7b0c533cb',
-          job: null,
-          name: '李培军',
-          params: {},
-          remark: null,
-          searchValue: null,
-          title: null,
-          type: '2',
-          unit: '温州医科大学附属第二医院、育英儿童医院',
-          updateBy: null,
-          updateTime: null,
-        },
-      ],
+      list: [],
       total: 0,
       limit: 5,
       // 查询
@@ -63,9 +46,13 @@ export default {
     await this.search();
   },
   methods: {
-    async search({ skip = 0, limit = this.limit, searchName, ...info } = {}) {
-      if (searchName) info.name = searchName;
-      console.log(this.searhForm);
+    ...mapActions(['query', 'fetch']),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      const res = await this.query({ skip, limit, ...info });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.rows);
+        this.$set(this, `total`, res.total);
+      }
     },
     // 查看信息
     async toView(data) {