detail.vue 3.6 KB

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