centerLeft1.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div id="centerLeft1">
  3. <div class="bg-color-black">
  4. <div class="d-flex pt-2 pl-2">
  5. <div class="d-flex" style="display:flex;">
  6. <span class="fs-xl text mx-2" style="margin-right:8px;">今日销量与采购</span>
  7. <dv-decoration-3 class="dv-dec-3" />
  8. </div>
  9. </div>
  10. <div class="d-flex jc-center">
  11. </div>
  12. <div class="bottom-data">
  13. <h3 class="title">今日销量</h3>
  14. <div class="item-box mt-2">
  15. <div class="d-flex">
  16. <span class="cex">{{datatodaysalesvolume.orders_number}}</span>
  17. </div>
  18. <p class="text" style="text-align: center;">
  19. 今日销售单数
  20. <span class="colorYellow">(单)</span>
  21. </p>
  22. </div>
  23. <div class="item-box mt-2">
  24. <div class="d-flex">
  25. <span class="cex">{{datatodaysalesvolume.money | getNum}}</span>
  26. </div>
  27. <p class="text" style="text-align: center;">
  28. 今日销售金额
  29. <span class="colorYellow">(元)</span>
  30. </p>
  31. </div>
  32. <h3 class="title">今日采购</h3>
  33. <div class="item-box mt-2">
  34. <div class="d-flex">
  35. <span class="cex">{{datatodaypurchase.orders_number}}</span>
  36. </div>
  37. <p class="text" style="text-align: center;">
  38. 采购订单数量
  39. <span class="colorYellow">(单)</span>
  40. </p>
  41. </div>
  42. <div class="item-box mt-2">
  43. <div class="d-flex">
  44. <span class="cex">{{datatodaypurchase.good_num}}</span>
  45. </div>
  46. <p class="text" style="text-align: center;">
  47. 商品数量
  48. <span class="colorYellow">(件)</span>
  49. </p>
  50. </div>
  51. <div class="item-box mt-2">
  52. <div class="d-flex">
  53. <span class="cex">{{datatodaypurchase.consult_info_total}}</span>
  54. </div>
  55. <p class="text" style="text-align: center;">
  56. 竞价单数
  57. <span class="colorYellow">(单)</span>
  58. </p>
  59. </div>
  60. <div class="item-box mt-2">
  61. <div class="d-flex">
  62. <span class="cex">{{datatodaypurchase.consult_bids_total}}</span>
  63. </div>
  64. <p class="text" style="text-align: center;">
  65. 反馈商品数
  66. <span class="colorYellow">(件)</span>
  67. </p>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import asyncRequest from "@/apis/service/bigScreen";
  75. // import resToken from "@/mixins/resToken";
  76. export default {
  77. data() {
  78. return {
  79. datatodaysalesvolume:{},
  80. datatodaypurchase:{},
  81. }
  82. },
  83. mounted() {
  84. this.initHttp()
  85. // console.log(this.getNum(18990.230))
  86. },
  87. methods: {
  88. async initHttp(){
  89. let res = await asyncRequest.datatodaysalesvolume();
  90. console.log(res)
  91. if(res.code == 0){
  92. this.datatodaysalesvolume = res.data;
  93. // console.log(this.datatodaysalesvolume)
  94. }else{
  95. this.$message.error(res.message)
  96. return;
  97. }
  98. let res_1 = await asyncRequest.datatodaypurchase();
  99. if(res_1.code == 0){
  100. // console.log(res_1)
  101. this.datatodaypurchase = res_1.data;
  102. // console.log(this.datatodaypurchase)
  103. }else{
  104. this.$message.error(res_1.message)
  105. return;
  106. }
  107. },
  108. getNum(num){
  109. num = Number(num);
  110. if(!num) return '0.00';
  111. if(num > 10000 || num < -10000){
  112. const moneys = num/10000
  113. const realVal =parseFloat(moneys).toFixed(2);
  114. return realVal+"万"
  115. }else{
  116. return num.toFixed(2)
  117. }
  118. }
  119. },
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. $box-width: 300px;
  124. $box-height: 410px;
  125. #centerLeft1 {
  126. padding: 16px;
  127. height: $box-height;
  128. width: 100%;
  129. border-radius: 10px;
  130. .bg-color-black {
  131. height: $box-height - 30px;
  132. border-radius: 10px;
  133. }
  134. .text {
  135. font-size: 12px;
  136. color: #c3cbde;
  137. }
  138. .dv-dec-3 {
  139. position: relative;
  140. width: 100px;
  141. height: 20px;
  142. top: -3px;
  143. }
  144. .bottom-data {
  145. .item-box {
  146. & > div {
  147. padding-right: 5px;
  148. }
  149. font-size: 14px;
  150. float: right;
  151. position: relative;
  152. width: 50%;
  153. color: #d3d6dd;
  154. margin-bottom: 20px;
  155. .dv-digital-flop {
  156. width: 120px;
  157. height: 30px;
  158. }
  159. // 金币
  160. .coin {
  161. position: relative;
  162. top: 6px;
  163. font-size: 20px;
  164. color: #ffc107;
  165. }
  166. .colorYellow {
  167. color: yellowgreen;
  168. }
  169. p {
  170. text-align: center;
  171. }
  172. }
  173. }
  174. .cex{
  175. color: #28ffcd;
  176. width: 100%;
  177. font-size: 18px;
  178. text-align: center;
  179. font-weight: 800;
  180. display: inline-block;
  181. margin: 5px 10px;
  182. }
  183. .title{
  184. width: 100%;
  185. float: left;
  186. font-size: 16px;
  187. margin-top: 40px;
  188. margin-bottom: 15px;
  189. text-indent: 10px;
  190. color: #ffbc25;
  191. }
  192. }
  193. </style>