index.vue 2.9 KB

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