RealTimeDeliveryOrder.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="group-praise">
  3. <div class="group-praise__content">
  4. <div class="group-praise__circle">
  5. <header class="group-praise__title">待接单</header>
  6. <div class="group-praise__circleContent">
  7. <p class="group-praise__circlePercent">
  8. {{ dataInfo.waitCount || 0 }}
  9. </p>
  10. <div class="lineTopRight"></div>
  11. <div class="lineBottomLeft"></div>
  12. </div>
  13. </div>
  14. <div class="group-praise__circle">
  15. <header class="group-praise__title">处理中</header>
  16. <div class="group-praise__circleContent">
  17. <p class="group-praise__circlePercent">
  18. {{ dataInfo.doingCount || 0 }}
  19. </p>
  20. <div class="lineTopRight"></div>
  21. <div class="lineBottomLeft"></div>
  22. </div>
  23. </div>
  24. <div class="group-praise__circle">
  25. <header class="group-praise__title">紧急工单</header>
  26. <div class="group-praise__circleContent">
  27. <p class="group-praise__circlePercent">
  28. {{ dataInfo.emergencyCount || 0 }}
  29. </p>
  30. <div class="lineTopRight"></div>
  31. <div class="lineBottomLeft"></div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. import { post, timerCommon } from './../http/http'
  39. export default {
  40. name: 'RealTimeDeliveryOrder',
  41. inject: ['parentDutyId', 'hosId', 'dutyId'],
  42. data () {
  43. return {
  44. timer: null,
  45. dataInfo: {}
  46. }
  47. },
  48. methods: {
  49. // 故障工单实时动态
  50. async getRealTimeDeliveryOrder () {
  51. const startTime = this.$moment()
  52. .startOf('day')
  53. .format('YYYY-MM-DD HH:mm:ss') // 今日
  54. const endTime = this.$moment()
  55. .endOf('day')
  56. .format('YYYY-MM-DD HH:mm:ss') // 今日
  57. const result = await post(
  58. '/itsm/report/index',
  59. {
  60. parentDutyId: this.parentDutyId,
  61. hosId: this.hosId,
  62. dutyId: this.dutyId,
  63. startDate: startTime,
  64. endDate: endTime,
  65. type: 'hsmsOrderCount',
  66. businessType: 'hsms'
  67. }
  68. )
  69. this.dataInfo = result.data ? result.data[0] : {}
  70. this.polling()
  71. },
  72. // 轮询请求
  73. polling () {
  74. clearTimeout(this.timer)
  75. this.timer = setTimeout(() => {
  76. this.getRealTimeDeliveryOrder()
  77. }, timerCommon)
  78. }
  79. },
  80. mounted () {
  81. this.getRealTimeDeliveryOrder()
  82. },
  83. beforeDestroy () {
  84. clearTimeout(this.timer)
  85. }
  86. }
  87. </script>
  88. <style lang="less" scoped>
  89. .group-praise {
  90. height: 2.6625rem;
  91. .group-praise__content {
  92. display: flex;
  93. justify-content: space-between;
  94. align-items: center;
  95. padding: 0 .2rem;
  96. height: 100%;
  97. .group-praise__title {
  98. color: #fff;
  99. font-size: .2rem;
  100. text-align: center;
  101. }
  102. .group-praise__circleContent {
  103. color: #fff;
  104. font-size: 0.175rem;
  105. height: .7875rem;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. margin-top: .2rem;
  110. background: linear-gradient( 90deg, #032430 0%, #023645 13%, #0B4D61 38%, #105A70 61%, #023645 87%, #06252B 100%);
  111. position: relative;
  112. .group-praise__circlePercent{
  113. font-size: .475rem;
  114. }
  115. }
  116. .group-praise__circle {
  117. width: 1.425rem;
  118. }
  119. }
  120. }
  121. </style>