index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="down">
  6. <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @edit="toEdit"></data-table>
  7. </el-col>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. </template>
  12. <script>
  13. import dataTable from '@common/src/components/frame/filter-page-table.vue';
  14. import { mapState, createNamespacedHelpers } from 'vuex';
  15. const { mapActions: achieveApply } = createNamespacedHelpers('achieveApply');
  16. export default {
  17. name: 'index',
  18. props: {},
  19. components: { dataTable },
  20. data: function() {
  21. return {
  22. opera: [
  23. {
  24. label: '完善资料',
  25. method: 'edit',
  26. },
  27. ],
  28. fields: [
  29. { label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true },
  30. { label: '成果名称', prop: 'basic.achieve_name', showTip: true },
  31. { label: '成果类别', prop: 'basic.achieve_type', showTip: true },
  32. {
  33. label: '状态',
  34. prop: 'status',
  35. format: item => {
  36. return item === '4' ? '完善资料&待发放' : '未识别';
  37. },
  38. },
  39. ],
  40. list: [],
  41. total: 0,
  42. };
  43. },
  44. async created() {
  45. await this.search();
  46. },
  47. methods: {
  48. ...achieveApply(['query']),
  49. // 查询列表
  50. async search({ skip = 0, limit = 10, ...info } = {}) {
  51. const res = await this.query({ skip, limit, status: 4, user_id: this.user.id, ...info });
  52. if (this.$checkRes(res)) {
  53. this.$set(this, 'list', res.data);
  54. this.$set(this, `total`, res.total);
  55. }
  56. },
  57. // 完善资料
  58. toEdit({ data }) {
  59. this.$router.push({ path: '/perfectData/update', query: { id: data.id } });
  60. },
  61. },
  62. computed: {
  63. ...mapState(['user']),
  64. pageTitle() {
  65. return `${this.$route.meta.title}`;
  66. },
  67. },
  68. metaInfo() {
  69. return { title: this.$route.meta.title };
  70. },
  71. };
  72. </script>
  73. <style lang="less" scoped></style>