sales-reached.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="home-container">
  3. <el-card class="home-container__card">
  4. <div class="title">
  5. <span>
  6. 今日业务总量
  7. </span>
  8. <span>
  9. <i
  10. class="el-icon-refresh-right"
  11. style="cursor: pointer;font-size:20px"
  12. @click="refresh"
  13. ></i>
  14. </span>
  15. </div>
  16. <div class="content" v-loading="loading">
  17. <div style="width: 100%;height: 300px;display: flex;justify-content: space-around;flex-wrap: wrap">
  18. <div id="totalContainer" style="width: 26%;height: 210px;"></div>
  19. <div id="totalBulkCargo" style="width: 26%;height: 210px;"></div>
  20. <div id="specialTotal" style="width: 26%;height: 210px;"></div>
  21. <!-- <div id="totalContainerTwo" style="width: 26%;height: 210px;"></div>-->
  22. <!-- <div id="totalBulkCargoTwo" style="width: 26%;height: 210px;"></div>-->
  23. <!-- <div id="specialTotalTwo" style="width: 26%;height: 210px;"></div>-->
  24. </div>
  25. </div>
  26. </el-card>
  27. </div>
  28. </template>
  29. <script>
  30. import {bizCount} from "@/api/wel";
  31. export default {
  32. name: "basicContainer",
  33. data() {
  34. return {
  35. loading: false,
  36. tradeType: null,
  37. tableData: []
  38. };
  39. },
  40. created() {
  41. this.getSysType();
  42. },
  43. mounted() {
  44. this.getSysType();
  45. },
  46. methods: {
  47. //点击获取图表数据
  48. handleMousedown(params){
  49. this.$emit('handleMousedown',params.data)
  50. },
  51. //箱分布图表
  52. rankingTwo(id, name, data) {
  53. // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用
  54. let myChart = this.$echarts.init(document.getElementById(id));
  55. // 绘制图表
  56. myChart.setOption(
  57. {
  58. title: {
  59. text: name,
  60. left: 'center'
  61. },
  62. tooltip: {
  63. trigger: 'item'
  64. },
  65. legend: {
  66. top: 'bottom'
  67. },
  68. series: [
  69. {
  70. type: 'pie',
  71. radius: '50%',
  72. data: data,
  73. emphasis: {
  74. itemStyle: {
  75. shadowBlur: 10,
  76. shadowOffsetX: 0,
  77. shadowColor: 'rgba(0, 0, 0, 0.5)'
  78. }
  79. }
  80. }
  81. ]
  82. }
  83. );
  84. myChart.on("click", this.handleMousedown);
  85. },
  86. init() {
  87. this.getSysType();
  88. },
  89. getSysType() {
  90. this.loading = true
  91. bizCount({mold:1}).then(res=>{
  92. this.rankingTwo('totalContainer', '集装箱:'+res.data.data.flow.all, res.data.data.flow.list)
  93. // this.rankingTwo('totalContainerTwo', '集装箱总量:'+res.data.data.dept.all, res.data.data.dept.list)
  94. })
  95. bizCount({mold:2}).then(res=>{
  96. this.rankingTwo('totalBulkCargo', '散货:'+res.data.data.flow.all, res.data.data.flow.list)
  97. // this.rankingTwo('totalBulkCargoTwo', '散货总量:'+res.data.data.dept.all, res.data.data.dept.list)
  98. })
  99. bizCount({mold:3}).then(res=>{
  100. this.rankingTwo('specialTotal', '特种车辆:'+res.data.data.flow.all,res.data.data.flow.list)
  101. // this.rankingTwo('specialTotalTwo', '特种车辆总量:'+res.data.data.dept.all,res.data.data.dept.list)
  102. })
  103. this.loading = false
  104. },
  105. //刷新按钮
  106. refresh() {
  107. this.init();
  108. },
  109. }
  110. };
  111. </script>
  112. <style lang="scss" scoped>
  113. .home-container {
  114. padding: 0px 5px 5px 5px;
  115. box-sizing: border-box;
  116. height: 100%;
  117. ::v-deep .el-card__body {
  118. padding: 10px 15px;
  119. font-size: 14px;
  120. }
  121. &__card {
  122. width: 100%;
  123. height: 100%;
  124. }
  125. .title {
  126. display: flex;
  127. justify-content: space-between;
  128. }
  129. }
  130. .content {
  131. display: flex;
  132. &_item {
  133. margin-top: 20px;
  134. .divider {
  135. display: block;
  136. height: 0px;
  137. width: 12vw;
  138. border-top: 1px dashed #dcdfe6;
  139. }
  140. &_num {
  141. font-size: 18px;
  142. font-weight: 600;
  143. }
  144. &_text {
  145. color: #909399;
  146. }
  147. }
  148. }
  149. </style>