index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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="two">
  6. <el-col :span="24">
  7. <el-col :span="5">
  8. <el-card class="box-card">
  9. <el-col :span="8">
  10. <i class="icon_1 el-icon-box"></i>
  11. </el-col>
  12. <el-col :span="12" class="title">
  13. <p>
  14. <span>{{ data.notPay }}</span
  15. >(单)
  16. </p>
  17. <p>未付款数</p>
  18. </el-col>
  19. </el-card>
  20. </el-col>
  21. <el-col :span="5">
  22. <el-card class="box-card">
  23. <el-col :span="8">
  24. <i class="icon_2 el-icon-truck"></i>
  25. </el-col>
  26. <el-col :span="12" class="title">
  27. <p>
  28. <span>{{ data.notSend }}</span
  29. >(单)
  30. </p>
  31. <p>未发货数</p>
  32. </el-col>
  33. </el-card>
  34. </el-col>
  35. <el-col :span="5">
  36. <el-card class="box-card">
  37. <el-col :span="8">
  38. <i class="icon_3 el-icon-sell"></i>
  39. </el-col>
  40. <el-col :span="12" class="title">
  41. <p>
  42. <span>{{ data.notDealAfterSale }}</span
  43. >(单)
  44. </p>
  45. <p>未处理售后数</p>
  46. </el-col>
  47. </el-card>
  48. </el-col>
  49. <el-col :span="5">
  50. <el-card class="box-card">
  51. <el-col :span="8">
  52. <i class="icon_4 el-icon-price-tag"></i>
  53. </el-col>
  54. <el-col :span="12" class="title">
  55. <p>
  56. <span>{{ data.stockWarning }}</span
  57. >(单)
  58. </p>
  59. <p>库存警告</p>
  60. </el-col>
  61. </el-card>
  62. </el-col>
  63. </el-col>
  64. <el-col :span="11">
  65. <el-card class="box-card"><card-1 :list="data.sMarkOrder"></card-1></el-card>
  66. </el-col>
  67. <el-col :span="11">
  68. <el-card class="box-card"><card-2 :list="data.sAfterSale"></card-2></el-card>
  69. </el-col>
  70. <el-col :span="11" style="display: none">
  71. <el-card class="box-card"><card-3></card-3> </el-card>
  72. </el-col>
  73. <el-col :span="11" style="display: none">
  74. <el-card class="box-card"><card-4></card-4></el-card>
  75. </el-col>
  76. </el-col>
  77. </el-col>
  78. </el-row>
  79. </div>
  80. </template>
  81. <script>
  82. import * as echarts from 'echarts';
  83. import { mapState, createNamespacedHelpers } from 'vuex';
  84. const { mapActions } = createNamespacedHelpers('todo');
  85. export default {
  86. name: 'index',
  87. props: {},
  88. components: {
  89. card1: () => import('./parts/card-1.vue'),
  90. card2: () => import('./parts/card-2.vue'),
  91. card3: () => import('./parts/card-3.vue'),
  92. card4: () => import('./parts/card-4.vue'),
  93. },
  94. data: function () {
  95. return {
  96. data: {},
  97. };
  98. },
  99. computed: {
  100. ...mapState(['user']),
  101. },
  102. mounted() {},
  103. async created() {
  104. await this.search();
  105. },
  106. methods: {
  107. ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
  108. async search({ skip = 0, limit = this.$limit, ...info } = {}) {
  109. // info.shop = this.user.shop.id;
  110. let res = await this.query({ skip, limit, ...info });
  111. if (this.$checkRes(res)) this.$set(this, 'data', res.data);
  112. },
  113. },
  114. metaInfo() {
  115. return { title: this.$route.meta.title };
  116. },
  117. watch: {
  118. test: {
  119. deep: true,
  120. immediate: true,
  121. handler(val) {},
  122. },
  123. },
  124. };
  125. </script>
  126. <style lang="less" scoped>
  127. .two {
  128. margin: 5px;
  129. .title {
  130. p {
  131. text-align: center;
  132. span:first-child {
  133. color: aquamarine;
  134. font-size: 24px;
  135. }
  136. }
  137. }
  138. .data-table {
  139. margin: 5px 0;
  140. }
  141. .el-col-5 {
  142. width: 22.5%;
  143. }
  144. .el-col {
  145. margin: 0 4px;
  146. }
  147. .box-card {
  148. margin: 5px;
  149. padding: 5px 0 20px 0;
  150. }
  151. .item {
  152. margin-bottom: 18px;
  153. }
  154. .icon {
  155. font-size: 36px;
  156. padding: 10px;
  157. color: #fff;
  158. border-radius: 50%;
  159. }
  160. .icon_1 {
  161. font-size: 36px;
  162. padding: 10px;
  163. color: #fff;
  164. border-radius: 50%;
  165. background-color: aquamarine;
  166. }
  167. .icon_2 {
  168. font-size: 36px;
  169. padding: 10px;
  170. color: #fff;
  171. border-radius: 50%;
  172. background-color: aqua;
  173. }
  174. .icon_3 {
  175. font-size: 36px;
  176. padding: 10px;
  177. color: #fff;
  178. border-radius: 50%;
  179. background-color: gold;
  180. }
  181. .icon_4 {
  182. font-size: 36px;
  183. padding: 10px;
  184. color: #fff;
  185. border-radius: 50%;
  186. background-color: coral;
  187. }
  188. }
  189. </style>