index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="入库" background-color="#F7F9FA" color="#000"
  4. @clickLeft="back">
  5. </uni-nav-bar>
  6. <view class="list_box">
  7. <u-list @scrolltolower="scrolltolower">
  8. <view class="card_box">
  9. <workOrderBom :item='objData' v-if='objData' @handleScan='handleScan'></workOrderBom>
  10. <view class="select_box">
  11. <zxz-uni-data-select :localdata="warehouseList" placeholder="请选择入库仓库" v-model="warehouseId"
  12. dataValue='id' dataKey="name" filterable format='{name}'></zxz-uni-data-select>
  13. </view>
  14. <view>
  15. <packingBom></packingBom>
  16. </view>
  17. </view>
  18. </u-list>
  19. </view>
  20. <view class="bottom-wrapper">
  21. <view class="btn_box" @click="save">一键报工</view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. getByIdReport
  28. } from '@/api/pda/jobBooking.js'
  29. import {
  30. getWarehouseList,
  31. listPDAToWarehouse,
  32. } from '@/api/pda/workOrder.js'
  33. import packingBom from './components/packingBom.vue'
  34. import workOrderBom from '../feeding/components/workOrderBom.vue'
  35. export default {
  36. components: {
  37. workOrderBom,
  38. packingBom
  39. },
  40. data() {
  41. return {
  42. id: null,
  43. taskId: null,
  44. objData: {},
  45. warehouseList: [],
  46. warehouseId: null,
  47. List: []
  48. }
  49. },
  50. onLoad(options) {
  51. this.id = options.workOrderId
  52. this.taskId = options.taskId
  53. this.workReportId = options.workReportId
  54. this.getList()
  55. this.getWarehouseListFn()
  56. this.getWarehouse()
  57. },
  58. methods: {
  59. getList() {
  60. getByIdReport(this.id, this.taskId).then(res => {
  61. this.objData = res
  62. })
  63. },
  64. getWarehouseListFn() {
  65. getWarehouseList().then(res => {
  66. this.warehouseList = res
  67. })
  68. },
  69. getWarehouse() {
  70. let param = {
  71. workOrderId: this.id,
  72. taskId: this.taskId,
  73. workReportId: this.workReportId || '1780209440937308162'
  74. }
  75. listPDAToWarehouse(param).then(res => {
  76. console.log(res)
  77. this.List = res
  78. })
  79. },
  80. handleScan() {
  81. },
  82. scrolltolower() {},
  83. save() {
  84. if (!this.warehouseId) {
  85. uni.showToast({
  86. icon: 'none',
  87. title: '请先选择入库仓库'
  88. })
  89. }
  90. },
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .content-box {
  96. height: 100vh;
  97. overflow: hidden;
  98. display: flex;
  99. flex-direction: column;
  100. }
  101. .list_box {
  102. flex: 1;
  103. overflow: hidden;
  104. padding: 4rpx 0;
  105. .u-list {
  106. height: 100% !important;
  107. }
  108. .card_box {
  109. padding: 16rpx 24rpx;
  110. }
  111. }
  112. .bottom-wrapper {
  113. .btn_box {
  114. width: 750rpx;
  115. height: 88rpx;
  116. line-height: 88rpx;
  117. background: $theme-color;
  118. text-align: center;
  119. font-size: 36rpx;
  120. font-style: normal;
  121. font-weight: 400;
  122. color: #fff;
  123. }
  124. }
  125. .select_box {
  126. margin-top: 20rpx;
  127. }
  128. </style>