mobileHumiture.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div>
  3. <!-- <div class="probe_card_mobile" v-if="probeList.length > 0">
  4. <el-radio-group v-model="tabPosition" @change="tabClick">
  5. <el-radio-button :label="item.T_id" v-for="(item,index) in probeList"
  6. :key="index">{{item.T_name}}</el-radio-button>
  7. </el-radio-group>
  8. </div> -->
  9. <div class="mobile_humiture" v-if="tableData.length > 0">
  10. <div class="card_humiture">
  11. <div class="headline_item w_wsd">温度(°C)</div>
  12. <div class="headline_item w_wsd">湿度(Rh)</div>
  13. <div class="headline_item w_time">时间</div>
  14. </div>
  15. <div class="card_humiture" v-for="(item,index) in tableData" :key="index">
  16. <div class="title_item w_wsd">{{item.T_t || ''}}</div>
  17. <div class="title_item w_wsd">{{item.T_rh || ''}}</div>
  18. <div class="title_item w_time">{{item.T_time || ''}}</div>
  19. </div>
  20. <div style="width: 100%;">
  21. <el-pagination layout="prev, pager, next" :total="Total" @current-change="currentChange"></el-pagination>
  22. </div>
  23. </div>
  24. <el-empty :image-size="100" description="暂无数据" v-else></el-empty>
  25. </div>
  26. </template>
  27. <script>
  28. import {
  29. waybillTaskData,
  30. } from '@/api/waybillLogistics'
  31. export default {
  32. name: 'mobileHumiture',
  33. props: {
  34. // taskId
  35. taskId: {
  36. type: Number,
  37. default: () => null,
  38. },
  39. // 探头列表
  40. probeList: {
  41. type: Array,
  42. default: () => [],
  43. },
  44. waybillNo: {
  45. type: String,
  46. default: () => '',
  47. }
  48. },
  49. data() {
  50. return {
  51. dataList: [],
  52. tabPosition: 1,
  53. tableData: [],
  54. Pagination: {
  55. page: 1,
  56. pageSize: 10,
  57. },
  58. Total: 0,
  59. tIds: [],
  60. }
  61. },
  62. watch: {
  63. probeList: {
  64. handler(newVal) {
  65. if (newVal.length > 0) {
  66. this.tabPosition = newVal[0].T_id
  67. this.tIds = []
  68. this.tIds.push(newVal[0].T_id)
  69. }
  70. },
  71. immediate: true,
  72. deep: true // 开启深度监听
  73. }
  74. },
  75. mounted() {},
  76. methods: {
  77. tabClick(value) {
  78. this.tIds = []
  79. this.tIds.push(value)
  80. this.getHumitureList()
  81. },
  82. // 获取温湿度记录列表
  83. getHumitureList() {
  84. let params = {
  85. t_ids: this.tIds,
  86. taskId: this.taskId,
  87. waybillNo: this.waybillNo,
  88. ...this.Pagination
  89. }
  90. waybillTaskData(params).then(res => {
  91. if (res.code == 200) {
  92. if (res.data.list) {
  93. this.tableData = res.data.list
  94. this.Total = res.data.count
  95. }
  96. }
  97. })
  98. },
  99. // 分页
  100. currentChange(value) {
  101. this.Pagination.page = value
  102. this.getHumitureList()
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .probe_card_mobile {
  109. margin-left: 10px;
  110. margin-top: 10px;
  111. display: flex;
  112. }
  113. .probe_card_mobile ::v-deep .el-radio-button__inner {
  114. padding: 10px 15px !important;
  115. }
  116. .mobile_humiture {
  117. margin: 10px 0px;
  118. }
  119. .card_humiture {
  120. width: 100%;
  121. display: flex;
  122. align-items: center;
  123. padding: 10px 0px;
  124. margin-bottom: 5px;
  125. border-bottom: 1px solid #EBEEF5 !important;
  126. }
  127. .headline_item {
  128. font-size: 14px;
  129. font-weight: 600;
  130. }
  131. .title_item {
  132. font-size: 15px
  133. }
  134. .w_wsd {
  135. text-align: center;
  136. width: 27%;
  137. }
  138. .w_time {
  139. text-align: center;
  140. width: 46%;
  141. }
  142. </style>