index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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"></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. const { mapActions: verifyRecord } = createNamespacedHelpers('verifyRecord');
  17. export default {
  18. metaInfo() {
  19. return { title: this.$route.meta.title };
  20. },
  21. name: 'index',
  22. props: {},
  23. components: {
  24. dataTable,
  25. },
  26. data: function() {
  27. return {
  28. opera: [],
  29. fields: [
  30. { label: '成果编号', prop: 'basic.achieve_num', filter: 'input', showTip: true },
  31. { label: '成果名称', prop: 'basic.achieve_name', showTip: true },
  32. { label: '成果类别', prop: 'basic.achieve_type', showTip: true },
  33. ],
  34. list: [],
  35. total: 0,
  36. };
  37. },
  38. async created() {
  39. await this.search();
  40. },
  41. methods: {
  42. ...achieveApply(['query']),
  43. ...verifyRecord(['create']),
  44. // 查询列表
  45. async search({ skip = 0, limit = 10, ...info } = {}) {
  46. const res = await this.query({ skip, limit, ...info, status: '6' });
  47. if (this.$checkRes(res)) {
  48. this.$set(this, 'list', res.data);
  49. this.$set(this, `total`, res.total);
  50. }
  51. },
  52. },
  53. computed: {
  54. ...mapState(['user']),
  55. },
  56. watch: {},
  57. };
  58. </script>
  59. <style lang="less" scoped></style>