detail.vue 2.6 KB

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