index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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"></uni-nav-bar>
  5. <view class="list_box">
  6. <u-list @scrolltolower="scrolltolower">
  7. <view v-for="(item,index) in List" :key="index" class="card_box">
  8. <workOrderBom :item='item' @handleScan='handleWordScan'></workOrderBom>
  9. <turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item'
  10. :newTurnover='item.newTurnover' @handleScan='handleScan' @refreshList='getList'></turnoverBom>
  11. </view>
  12. </u-list>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import workOrderBom from '../../feeding/components/workOrderBom.vue'
  18. import turnoverBom from '../components/turnoverBom.vue'
  19. import {
  20. getVehicle,
  21. } from '@/api/pda/workOrder.js'
  22. export default {
  23. components: {
  24. workOrderBom,
  25. turnoverBom
  26. },
  27. data() {
  28. return {
  29. title: '',
  30. workOrderId: null,
  31. List: [],
  32. taskId: null
  33. }
  34. },
  35. onLoad(options) {
  36. this.title = options.taskName ? options.taskName + '-更换周转车' : '更换周转车'
  37. this.workOrderId = options.workOrderId;
  38. this.taskId = options.taskId
  39. this.taskName = options.taskName
  40. this.getList()
  41. },
  42. methods: {
  43. scrolltolower() {},
  44. getList() {
  45. getVehicle({
  46. workOrderId: this.workOrderId,
  47. taskId: this.taskId
  48. }).then(res => {
  49. this.List = []
  50. if (res.turnover && res.turnover.length) {
  51. res.newTurnover = []
  52. res.turnover.forEach(e => {
  53. e.extInfo.positionList.length && e.extInfo.positionList.forEach(o => {
  54. o['check'] = false
  55. o['isend'] = false
  56. o['newQuantity'] = o.quantity
  57. })
  58. })
  59. }
  60. this.List.push(res)
  61. })
  62. },
  63. handleWordScan(id, type) {
  64. uni.showToast({
  65. icon: 'none',
  66. title: '不支持更换工单'
  67. })
  68. },
  69. handleScan(id, type) {
  70. uni.scanCode({
  71. success: (res) => {
  72. this.scanData(res.result, type, id)
  73. }
  74. })
  75. },
  76. },
  77. }
  78. </script>
  79. <style lang="scss" scoped>
  80. .content-box {
  81. height: 100vh;
  82. overflow: hidden;
  83. display: flex;
  84. flex-direction: column;
  85. }
  86. .list_box {
  87. flex: 1;
  88. overflow: hidden;
  89. padding: 4rpx 0;
  90. .u-list {
  91. height: 100% !important;
  92. }
  93. .card_box {
  94. padding: 16rpx;
  95. }
  96. }
  97. .operate_box {
  98. padding: 10rpx 160rpx;
  99. /deep/ .u-button {
  100. width: 160rpx;
  101. }
  102. }
  103. </style>