index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight">
  5. <el-col :span="24" class="one"> <span>订单管理</span> </el-col>
  6. <el-col :span="24" class="four">
  7. <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
  8. <el-tab-pane label="待付款" name="1">
  9. <card-1 :statusList="statusList"></card-1>
  10. </el-tab-pane>
  11. <el-tab-pane label="待发货" name="2">
  12. <card-2 :statusList="statusList"></card-2>
  13. </el-tab-pane>
  14. <el-tab-pane label="待收货" name="3">
  15. <card-3 :statusList="statusList"></card-3>
  16. </el-tab-pane>
  17. <el-tab-pane label="已收货" name="4">
  18. <card-4 :statusList="statusList"></card-4>
  19. </el-tab-pane>
  20. </el-tabs>
  21. </el-col>
  22. </el-col>
  23. </el-row>
  24. </div>
  25. </template>
  26. <script>
  27. const _ = require('lodash');
  28. import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
  29. const { mapActions: dictData } = createNamespacedHelpers('dictData');
  30. const { mapActions: shop } = createNamespacedHelpers('shop');
  31. export default {
  32. name: 'index',
  33. props: {},
  34. components: {
  35. card1: () => import('./parts/card-1.vue'),
  36. card2: () => import('./parts/card-2.vue'),
  37. card3: () => import('./parts/card-3.vue'),
  38. card4: () => import('./parts/card-4.vue'),
  39. },
  40. data: function () {
  41. const that = this;
  42. return {
  43. activeName: '2',
  44. // 类型列表
  45. statusList: [],
  46. // 店铺列表
  47. shopList: [],
  48. };
  49. },
  50. async created() {
  51. await this.searchOther();
  52. },
  53. methods: {
  54. ...dictData({ dictQuery: 'query' }),
  55. ...shop({ shopQuery: 'query' }),
  56. handleClick(tab, event) {},
  57. // 查询其他信息
  58. async searchOther() {
  59. let res;
  60. // 类型
  61. res = await this.dictQuery({ code: 'order_process' });
  62. if (this.$checkRes(res)) {
  63. this.$set(this, `statusList`, res.data);
  64. }
  65. res = await this.shopQuery();
  66. if (this.$checkRes(res)) this.$set(this, `shopList`, res.data);
  67. },
  68. },
  69. computed: {
  70. ...mapState(['user']),
  71. },
  72. metaInfo() {
  73. return { title: this.$route.meta.title };
  74. },
  75. watch: {
  76. test: {
  77. deep: true,
  78. immediate: true,
  79. handler(val) {},
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang="less" scoped>
  85. .main {
  86. .one {
  87. margin: 0 0 10px 0;
  88. span:nth-child(1) {
  89. font-size: 20px;
  90. font-weight: 700;
  91. margin-right: 10px;
  92. }
  93. }
  94. .two {
  95. margin: 0 0 10px 0;
  96. }
  97. .thr {
  98. margin: 0 0 10px 0;
  99. }
  100. }
  101. </style>