index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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' :newTurnover='item.newTurnover'
  10. @handleScan='handleScan'></turnoverBom>
  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 workOrderBom from '../../feeding/components/workOrderBom.vue'
  21. import turnoverBom from '../components/turnoverBom.vue'
  22. import {
  23. getVehicle,
  24. } from '@/api/pda/workOrder.js'
  25. import {
  26. batchSave
  27. } from '@/api/pda/feeding.js'
  28. export default {
  29. components: {
  30. workOrderBom,
  31. turnoverBom
  32. },
  33. data() {
  34. return {
  35. title: '',
  36. workOrderId: null,
  37. List: [],
  38. taskId: null
  39. }
  40. },
  41. onLoad(options) {
  42. this.title = options.taskName ? options.taskName + '-更换周转车' : '更换周转车'
  43. this.workOrderId = options.workOrderId;
  44. this.taskId = options.taskId
  45. this.taskName = options.taskName
  46. this.getList()
  47. },
  48. methods: {
  49. scrolltolower() {},
  50. save() {
  51. batchSave(this.List).then(res => {
  52. })
  53. },
  54. getList() {
  55. getVehicle({
  56. workOrderId: this.workOrderId,
  57. taskId: this.taskId
  58. }).then(res => {
  59. this.List = []
  60. if (res.turnover && res.turnover.length) {
  61. res.newTurnover = []
  62. res.turnover.forEach(e => {
  63. e.extInfo.positionList.length && e.extInfo.positionList.forEach(o => {
  64. o['check'] = false
  65. })
  66. })
  67. }
  68. this.List.push(res)
  69. console.log(this.List)
  70. })
  71. },
  72. handleWordScan(id, type) {
  73. uni.showToast({
  74. icon: 'none',
  75. title: '不支持更换工单'
  76. })
  77. },
  78. handleScan(id, type) {
  79. console.log(id)
  80. console.log(type)
  81. // this.scanData('SCJHGD20240117002', type, id)
  82. // return false
  83. let _this = this
  84. uni.scanCode({
  85. success: function(res) {
  86. _this.scanData(res.result, type, id)
  87. }
  88. })
  89. },
  90. },
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .content-box {
  95. height: 100vh;
  96. overflow: hidden;
  97. display: flex;
  98. flex-direction: column;
  99. }
  100. .list_box {
  101. flex: 1;
  102. overflow: hidden;
  103. padding: 4rpx 0;
  104. .u-list {
  105. height: 100% !important;
  106. }
  107. .card_box {
  108. padding: 16rpx 24rpx;
  109. }
  110. }
  111. .bottom-wrapper {
  112. .btn_box {
  113. width: 750rpx;
  114. height: 88rpx;
  115. line-height: 88rpx;
  116. background: $theme-color;
  117. text-align: center;
  118. font-size: 36rpx;
  119. font-style: normal;
  120. font-weight: 400;
  121. color: #fff;
  122. }
  123. }
  124. .operate_box {
  125. padding: 10rpx 160rpx;
  126. /deep/ .u-button {
  127. width: 160rpx;
  128. }
  129. }
  130. </style>