index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. o['isend'] = false
  66. o['newQuantity'] = o.quantity
  67. })
  68. })
  69. }
  70. this.List.push(res)
  71. console.log(this.List)
  72. })
  73. },
  74. handleWordScan(id, type) {
  75. uni.showToast({
  76. icon: 'none',
  77. title: '不支持更换工单'
  78. })
  79. },
  80. handleScan(id, type) {
  81. console.log(id)
  82. console.log(type)
  83. // this.scanData('SCJHGD20240117002', type, id)
  84. // return false
  85. let _this = this
  86. uni.scanCode({
  87. success: function(res) {
  88. _this.scanData(res.result, type, id)
  89. }
  90. })
  91. },
  92. },
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .content-box {
  97. height: 100vh;
  98. overflow: hidden;
  99. display: flex;
  100. flex-direction: column;
  101. }
  102. .list_box {
  103. flex: 1;
  104. overflow: hidden;
  105. padding: 4rpx 0;
  106. .u-list {
  107. height: 100% !important;
  108. }
  109. .card_box {
  110. padding: 16rpx 24rpx;
  111. }
  112. }
  113. .bottom-wrapper {
  114. .btn_box {
  115. width: 750rpx;
  116. height: 88rpx;
  117. line-height: 88rpx;
  118. background: $theme-color;
  119. text-align: center;
  120. font-size: 36rpx;
  121. font-style: normal;
  122. font-weight: 400;
  123. color: #fff;
  124. }
  125. }
  126. .operate_box {
  127. padding: 10rpx 160rpx;
  128. /deep/ .u-button {
  129. width: 160rpx;
  130. }
  131. }
  132. </style>