detail.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view>
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="检查详情" @clickLeft="back"></uni-nav-bar>
  4. <view class="check-content">
  5. <view class="title">
  6. <text>{{ equiName }}</text>
  7. <text>{{ equiCode }}</text>
  8. </view>
  9. <view class="check-list">
  10. <CheckCard v-for="(item, index) in equipList" :item="item" class="mb20" :index="index" type="view">
  11. </CheckCard>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {
  18. getDeviceInfo,
  19. mattersChecked
  20. } from '@/api/myTicket/index.js'
  21. import {
  22. post
  23. } from '@/utils/api.js'
  24. import CheckCard from './components/CheckCard.vue'
  25. export default {
  26. components: {
  27. CheckCard
  28. },
  29. data() {
  30. return {
  31. id: '',
  32. pageId: '',
  33. page: 1,
  34. equipList: [],
  35. isEnd: false,
  36. equiName: '',
  37. equiCode: '',
  38. workOrderId: ''
  39. }
  40. },
  41. onLoad(options) {
  42. this.id = options.id
  43. // this.equiName = options.equiName
  44. // this.equiCode = options.equiCode
  45. // this.workOrderId = +options.workOrderId
  46. this.getList()
  47. },
  48. onReachBottom() {
  49. if (this.isEnd) return
  50. this.page++
  51. this.getList()
  52. },
  53. methods: {
  54. getList() {
  55. getDeviceInfo({
  56. id: this.id
  57. }).then(data => {
  58. this.equiName = data.name
  59. this.equiCode = data.code
  60. this.equipList = data.workItems.map(item => {
  61. return {
  62. ...item,
  63. id: data.id,
  64. executeStatus: 1
  65. }
  66. })
  67. })
  68. // const { page } = this
  69. // post(
  70. // this.apiUrl +
  71. // `/workOrder/getEquipmentItemsListApp?size=10&page=${page}`,
  72. // { planEquiId: +this.pageId, workOrderId: this.workOrderId },
  73. // true
  74. // ).then(res => {
  75. // if (res?.success) {
  76. // if (page === 1) {
  77. // this.equipList = res.data.records
  78. // } else {
  79. // this.equipList.push(...res.data.records)
  80. // }
  81. // this.isEnd = this.equipList.length >= res.data.total
  82. // }
  83. // })
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .check-content {
  90. box-sizing: border-box;
  91. // height: calc(100vh - 88rpx);
  92. display: flex;
  93. flex-direction: column;
  94. .title {
  95. line-height: 80rpx;
  96. display: flex;
  97. justify-content: space-between;
  98. padding: 0 30rpx;
  99. font-size: 28rpx;
  100. }
  101. .check-list {
  102. flex: 1;
  103. overflow: auto;
  104. padding: 0 30rpx 30rpx;
  105. }
  106. .footer {
  107. height: 100rpx;
  108. display: flex;
  109. border: 1rpx solid $j-primary-border-green;
  110. .btn {
  111. display: flex;
  112. flex: 1;
  113. justify-content: center;
  114. align-items: center;
  115. border-radius: 0;
  116. &.primary {
  117. background-color: $j-primary-border-green;
  118. color: #fff;
  119. }
  120. }
  121. }
  122. .mb20 {
  123. margin-bottom: 20rpx;
  124. }
  125. }
  126. </style>