detail.vue 3.5 KB

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