Home.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div class="home">
  3. <el-row :gutter="20" class="card-statistics" >
  4. <div v-for='(res,i) in statisticsList' :key='i' @click='toPageFun(res)'>
  5. <el-col :md="12" :xl="6" >
  6. <div class="card block">
  7. <div class="val">
  8. <div class="left">
  9. <i class="el-icon-s-marketing"></i>
  10. </div>
  11. <div class="right">
  12. <p>{{res.name}}</p>
  13. <p>¥{{res.amount}}</p>
  14. </div>
  15. </div>
  16. </div>
  17. </el-col>
  18. </div>
  19. </el-row>
  20. </div>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. statisticsList:null,
  27. crud: {
  28. service: this.$service.test,
  29. table: {
  30. columns: [
  31. {
  32. type: 'index',
  33. align: 'center',
  34. width: 100
  35. }
  36. ],
  37. op: {
  38. hidden: true
  39. },
  40. props: {
  41. 'max-height': '500px'
  42. }
  43. },
  44. }
  45. };
  46. },
  47. mounted(){
  48. this.init();
  49. },
  50. methods: {
  51. init(){
  52. this.$service.ptAsset.ptAssetApi().then((res)=>{
  53. this.statisticsList = res.top;
  54. })
  55. },
  56. toPageFun(item){
  57. this.$router.push({ path: '/assets/ptYeChange', query: { type: item.id }})
  58. },
  59. toDocs() {
  60. window.open('');
  61. },
  62. onCrudLoad({ ctx, app }) {
  63. ctx({
  64. service: this.$service.test,
  65. table: {
  66. columns: [
  67. {
  68. type: 'index',
  69. align: 'center',
  70. width: 100
  71. }
  72. ],
  73. op: {
  74. visible: false
  75. },
  76. props: {
  77. 'max-height': '500px'
  78. }
  79. },
  80. layout: [['data-table']]
  81. }).done();
  82. app.refresh();
  83. }
  84. }
  85. };
  86. </script>
  87. <style lang="stylus" scoped>
  88. .home {
  89. overflow-y: auto;
  90. overflow-x: hidden;
  91. .card {
  92. background-color: #fff;
  93. border-radius: 5px;
  94. margin-bottom: 20px;
  95. .card-title {
  96. color: #000;
  97. padding: 20px 20px 0 20px;
  98. }
  99. .card-body {
  100. padding: 10px;
  101. }
  102. }
  103. .tips {
  104. display: flex;
  105. align-items: center;
  106. background-color: #ECEFF0;
  107. padding: 15px 20px;
  108. border-radius: 3px;
  109. margin-bottom: 20px;
  110. .flex1 {
  111. flex: 1;
  112. }
  113. span {
  114. color: #7e7e7e;
  115. font-size: 12px;
  116. }
  117. .doc-btn {
  118. margin-right: 10px;
  119. }
  120. }
  121. .card-statistics {
  122. .block {
  123. background-color: #fff;
  124. /*height: 60px;*/
  125. padding: 20px;
  126. cursor:pointer;
  127. .val {
  128. display: flex;
  129. justify-content: space-between;
  130. align-items: center;
  131. height: 50px;
  132. .left {
  133. i {
  134. font-size: 34px;
  135. &.el-icon-s-goods {
  136. color: #EC5555;
  137. }
  138. &.el-icon-s-flag {
  139. color: #FFB431;
  140. }
  141. &.el-icon-s-custom {
  142. color: #9257DB;
  143. }
  144. &.el-icon-s-marketing {
  145. color: #00D06F;
  146. }
  147. }
  148. }
  149. .right {
  150. p {
  151. &:first-child {
  152. font-size: 13px;
  153. text-align: right;
  154. }
  155. &:last-child {
  156. font-size: 24px;
  157. margin-top: 5px;
  158. }
  159. }
  160. }
  161. }
  162. .desc {
  163. color: #999;
  164. font-size: 13px;
  165. margin-top: 20px;
  166. span {
  167. margin-left: 5px;
  168. }
  169. }
  170. }
  171. }
  172. .sales-top {
  173. color: red;
  174. }
  175. .sales-bottom {
  176. color: green;
  177. }
  178. }
  179. </style>