index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
  4. color="#000" @clickLeft="back">
  5. </uni-nav-bar>
  6. <view class="list_box">
  7. <u-list @scrolltolower="scrolltolower">
  8. <view class="card_box" v-for="(item,index) in List" :key="index">
  9. <workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
  10. <inspectionBom :inspectionList='inspectionList'></inspectionBom>
  11. </view>
  12. </u-list>
  13. </view>
  14. <view class="bottom-wrapper">
  15. <view class="btn_box" @click="save">确认</view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. workorderList,
  22. getLastTreeByPid
  23. } from '@/api/pda/workOrder.js'
  24. import {
  25. batchSave
  26. } from '@/api/pda/feeding.js'
  27. import workOrderBom from '../../feeding/components/workOrderBom.vue'
  28. import inspectionBom from '../components/inspectionBom.vue'
  29. export default {
  30. components: {
  31. workOrderBom,
  32. inspectionBom
  33. },
  34. data() {
  35. return {
  36. title: null,
  37. id: null,
  38. taskId: null,
  39. inspectionId: null,
  40. inspectionName: null,
  41. List: [],
  42. inspectionList: []
  43. }
  44. },
  45. onLoad(options) {
  46. this.title = options.taskName ? options.taskName + '-' + options.inspectionName : '质检'
  47. this.id = options.workOrderId
  48. this.taskId = options.taskId
  49. this.getList()
  50. this.getLastTree()
  51. },
  52. methods: {
  53. getList() {
  54. workorderList({
  55. ids: [this.id],
  56. taskId: this.taskId
  57. }).then(res => {
  58. this.List = res.map(m => {
  59. m.workOrderId = m.id
  60. delete m.id
  61. return {
  62. ...m
  63. }
  64. })
  65. })
  66. },
  67. getLastTree() {
  68. getLastTreeByPid(this.$route.query.inspectionId).then(res => {
  69. this.inspectionList = res
  70. })
  71. },
  72. scrolltolower() {},
  73. handleWordScan() {
  74. uni.showToast({
  75. icon: 'none',
  76. title: '不支持换工单'
  77. })
  78. },
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .content-box {
  84. height: 100vh;
  85. overflow: hidden;
  86. display: flex;
  87. flex-direction: column;
  88. }
  89. .list_box {
  90. flex: 1;
  91. overflow: hidden;
  92. padding: 4rpx 0;
  93. .u-list {
  94. height: 100% !important;
  95. }
  96. .card_box {
  97. padding: 16rpx 24rpx;
  98. }
  99. }
  100. .bottom-wrapper {
  101. .btn_box {
  102. width: 750rpx;
  103. height: 88rpx;
  104. line-height: 88rpx;
  105. background: $theme-color;
  106. text-align: center;
  107. font-size: 36rpx;
  108. font-style: normal;
  109. font-weight: 400;
  110. color: #fff;
  111. }
  112. }
  113. .operate_box {
  114. padding: 10rpx 160rpx;
  115. /deep/ .u-button {
  116. width: 160rpx;
  117. }
  118. }
  119. </style>