guhongwei 4 éve
szülő
commit
abd1bf45bc
2 módosított fájl, 16 hozzáadás és 61 törlés
  1. 14 58
      src/views/service/index.vue
  2. 2 3
      src/views/service/parts/list.vue

+ 14 - 58
src/views/service/index.vue

@@ -47,6 +47,8 @@ import list from './parts/list.vue';
 import { btnList } from './btnList.js';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: organization } = createNamespacedHelpers('organization');
+const { mapActions: policy } = createNamespacedHelpers('policy');
+
 export default {
   name: 'index',
   props: {},
@@ -61,69 +63,17 @@ export default {
         phone: [{ required: true, message: '请输入用户账号', trigger: 'blur' }],
         password: [{ required: true, message: '请输入登录密码', trigger: 'blur' }],
       },
-      // 高企政策服务-列表
-      oneList: [
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-        {
-          type: '研发补贴',
-          company: '申请单位',
-          apply_personal: '申请人',
-          phone: '13678943258',
-        },
-      ],
       dialogTitle: '高企政策服务',
       dialogType: undefined,
+      // 高企政策服务-列表
+      oneList: [],
     };
   },
-  created() {},
+  async created() {
+    await this.search();
+  },
   methods: {
+    ...policy({ policyQuery: 'query' }),
     ...organization(['login']),
     link(data) {
       const { type, name } = data;
@@ -167,6 +117,12 @@ export default {
         }
       });
     },
+    // 查询列表信息
+    async search({ skip = 0, limit = 10, ...info } = {}) {
+      // 高企政策服务
+      let res = await this.policyQuery({ skip, limit: 7, status: 1, ...info });
+      if (this.$checkRes(res)) this.$set(this, `oneList`, res.data);
+    },
   },
   computed: {
     ...mapState(['user']),

+ 2 - 3
src/views/service/parts/list.vue

@@ -9,8 +9,7 @@
                 {{ item.company }}
               </el-col>
               <el-col :span="4" class="date">
-                <!-- {{ getDate(item.meta.createdAt) }} -->
-                2021-01-01
+                {{ getDate(item.meta) }}
               </el-col>
             </el-col>
             <el-col :span="24" class="other">
@@ -45,7 +44,7 @@ export default {
   created() {},
   methods: {
     getDate(date) {
-      let newDate = moment(date).format('YYYY-MM-DD');
+      let newDate = moment(date.createdAt).format('YYYY-MM-DD');
       if (newDate) return newDate;
     },
   },