index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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" @click.native="toUrl('notPay')">
  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" @click.native="toUrl('notSend')">
  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" @click.native="toUrl('notDealAfterSale')">
  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" @click.native="toUrl('sMarkOrder')"><card-1 :list="data.sMarkOrder"></card-1></el-card>
  66. </el-col>
  67. <el-col :span="11">
  68. <el-card class="box-card" @click.native="toUrl('sAfterSale')"><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. toUrl(value) {
  114. // 未付款
  115. if (value == 'notPay') this.$router.push({ path: `/selfShop/order`, query: { activeName: '1' } });
  116. // 未发货
  117. else if (value == 'notSend') this.$router.push({ path: `/selfShop/order`, query: { activeName: '2' } });
  118. // 未处理售后
  119. else if (value == 'notDealAfterSale') this.$router.push({ path: `/selfShop/sales` });
  120. // 下单数
  121. else if (value == 'sMarkOrder') this.$router.push({ path: `/platfinance/statistics`, query: { activeName: '2' } });
  122. // 售后数
  123. else if (value == 'sAfterSale') this.$router.push({ path: `/platfinance/statistics`, query: { activeName: '4' } });
  124. },
  125. },
  126. metaInfo() {
  127. return { title: this.$route.meta.title };
  128. },
  129. watch: {
  130. test: {
  131. deep: true,
  132. immediate: true,
  133. handler(val) {},
  134. },
  135. },
  136. };
  137. </script>
  138. <style lang="less" scoped>
  139. .two {
  140. margin: 5px;
  141. .title {
  142. p {
  143. text-align: center;
  144. span:first-child {
  145. color: aquamarine;
  146. font-size: 24px;
  147. }
  148. }
  149. }
  150. .data-table {
  151. margin: 5px 0;
  152. }
  153. .el-col-5 {
  154. width: 22.5%;
  155. }
  156. .el-col {
  157. margin: 0 4px;
  158. }
  159. .box-card {
  160. margin: 5px;
  161. padding: 5px 0 20px 0;
  162. }
  163. .item {
  164. margin-bottom: 18px;
  165. }
  166. .icon {
  167. font-size: 36px;
  168. padding: 10px;
  169. color: #fff;
  170. border-radius: 50%;
  171. }
  172. .icon_1 {
  173. font-size: 36px;
  174. padding: 10px;
  175. color: #fff;
  176. border-radius: 50%;
  177. background-color: aquamarine;
  178. }
  179. .icon_2 {
  180. font-size: 36px;
  181. padding: 10px;
  182. color: #fff;
  183. border-radius: 50%;
  184. background-color: aqua;
  185. }
  186. .icon_3 {
  187. font-size: 36px;
  188. padding: 10px;
  189. color: #fff;
  190. border-radius: 50%;
  191. background-color: gold;
  192. }
  193. .icon_4 {
  194. font-size: 36px;
  195. padding: 10px;
  196. color: #fff;
  197. border-radius: 50%;
  198. background-color: coral;
  199. }
  200. }
  201. </style>