detail.vue 2.4 KB

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