humiture.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <!-- 温湿度 -->
  3. <view>
  4. <u-navbar title="温湿度记录" autoBack placeholder></u-navbar>
  5. <view v-if="humitureList.length > 0">
  6. <view class="card_particulars" v-for="(item,index) in humitureList" :key="index">
  7. <view class="card_describe">
  8. <view class="describe_title">{{item.title}}</view>
  9. <view class="describe_time">{{item.startTime}}</view>
  10. <view class="describe_time">{{item.endTime}}</view>
  11. </view>
  12. <view class="humiture_details" @click="foldingPanel(item)">
  13. <view class="title_details">温湿度</view>
  14. <view style="display: flex;">
  15. <view class="title_blue title_details">查看详情</view>
  16. <u-icon :class="item.collapseil ? '' : 'overturn'" name="arrow-down"></u-icon>
  17. </view>
  18. </view>
  19. <view v-show="item.collapseil">
  20. <x-humiture ref="humiture" :taskId="item.id" :waybillNo="orderList.waybillNo"
  21. :current="item.presentNum" :probeList="item.deviceSensorList"></x-humiture>
  22. </view>
  23. </view>
  24. </view>
  25. <view style="margin-top: 30%;" v-else>
  26. <u-empty mode="data" text="当前没有温湿度记录"></u-empty>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. orderList: {},
  35. humitureList: [],
  36. userType: '',
  37. myChart: null,
  38. chartData: {},
  39. chartData1: {},
  40. }
  41. },
  42. mounted() {
  43. var userInfo = this.$cache.getCache('userInfo')
  44. this.userType = userInfo.userType
  45. var orderList = this.$cache.getCache('orderDetails')
  46. this.orderList = orderList
  47. this.getList()
  48. },
  49. methods: {
  50. getList() {
  51. this.$api.get('/api/waybill-task', {
  52. waybillNo: this.orderList.waybillNo,
  53. }).then(res => {
  54. if (res.code == 200) {
  55. this.humitureList = res.data.list
  56. this.humitureList.forEach((item, index) => {
  57. item.title = ''
  58. item.collapseil = true
  59. if (item.coolerBox.id) {
  60. item.title = item.coolerBox.name
  61. }
  62. if (item.deviceSensorList) {
  63. this.$nextTick(() => {
  64. this.$refs.humiture[index].getlist(item.deviceSensorList[0]
  65. .T_id)
  66. })
  67. }
  68. })
  69. }
  70. })
  71. },
  72. // 折叠面板
  73. foldingPanel(value) {
  74. this.humitureList.forEach((item, index) => {
  75. if (item.id == value.id) {
  76. if (item.collapseil) {
  77. item.collapseil = false
  78. } else {
  79. this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
  80. item.collapseil = true
  81. }
  82. }
  83. })
  84. this.$forceUpdate()
  85. },
  86. open(e) {
  87. // console.log('open', e)
  88. },
  89. close(e) {
  90. // console.log('close', e)
  91. },
  92. change(e) {
  93. if (e[0].status == 'open') {
  94. this.humitureList.forEach((item, index) => {
  95. this.$refs.humiture[index].getlist(item.deviceSensorList[0].T_id)
  96. })
  97. }
  98. },
  99. }
  100. }
  101. </script>
  102. <style lang="scss">
  103. .card_particulars {
  104. display: flex;
  105. flex-direction: column;
  106. padding-top: 20rpx;
  107. margin: 30rpx 20rpx 20rpx 20rpx;
  108. border-radius: 20rpx;
  109. background-color: #fff;
  110. }
  111. .card_describe {
  112. padding-left: 20rpx;
  113. padding-bottom: 20rpx;
  114. border-bottom: 1rpx solid #EBEEF5;
  115. }
  116. .describe_title {
  117. font-size: 30rpx;
  118. font-weight: 600;
  119. }
  120. .describe_time {
  121. font-size: 28rpx;
  122. }
  123. .humiture_details {
  124. display: flex;
  125. justify-content: space-between;
  126. align-items: center;
  127. padding: 20rpx;
  128. }
  129. .title_blue {
  130. color: #2979ff;
  131. margin-right: 10rpx;
  132. }
  133. .title_details {
  134. font-size: 28rpx;
  135. }
  136. ::v-deep .u-collapse-item__content__text {
  137. padding: 0rpx 0rpx 30rpx 0rpx;
  138. }
  139. ::v-deep .u-line {
  140. display: none;
  141. }
  142. .card_qiucharts {
  143. display: flex;
  144. align-items: center;
  145. flex-direction: column;
  146. }
  147. .card_echart {
  148. width: 80%;
  149. height: 500rpx;
  150. }
  151. .card_echart {
  152. width: 80%;
  153. height: 500rpx;
  154. }
  155. .overturn {
  156. transform: rotate(180deg);
  157. }
  158. </style>