index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 class="list_box" v-for="(item, index) in List" :key="index">
  15. <view class="time">打包时间: {{item.createTime}}</view>
  16. <packingBom :objData="item.extInfo"></packingBom>
  17. </view>
  18. </view>
  19. </u-list>
  20. </view>
  21. <view class="bottom-wrapper">
  22. <view class="btn_box" @click="save">一键报工</view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. getByIdReport,
  29. jobSave
  30. } from '@/api/pda/jobBooking.js'
  31. import {
  32. getWarehouseList,
  33. listPDAToWarehouse,
  34. } from '@/api/pda/workOrder.js'
  35. import packingBom from './components/packingBom.vue'
  36. import workOrderBom from '../feeding/components/workOrderBom.vue'
  37. export default {
  38. components: {
  39. workOrderBom,
  40. packingBom
  41. },
  42. data() {
  43. return {
  44. id: null,
  45. taskId: null,
  46. objData: {},
  47. warehouseList: [],
  48. warehouseId: null,
  49. List: []
  50. }
  51. },
  52. onLoad(options) {
  53. this.id = options.workOrderId
  54. this.taskId = options.taskId
  55. this.workReportId = options.workReportId
  56. this.getList()
  57. this.getWarehouseListFn()
  58. this.getWarehouse()
  59. },
  60. methods: {
  61. getList() {
  62. getByIdReport(this.id, this.taskId).then(res => {
  63. this.objData = res
  64. this.objData.workReportInfo = {
  65. formingNum: null,
  66. formingWeight: null,
  67. formedNum: null,
  68. formedWeight: null,
  69. taskId: this.taskId
  70. }
  71. })
  72. },
  73. getWarehouseListFn() {
  74. getWarehouseList().then(res => {
  75. this.warehouseList = res
  76. })
  77. },
  78. getWarehouse() {
  79. let param = {
  80. workOrderId: this.id,
  81. taskId: this.taskId,
  82. workReportId: this.workReportId
  83. }
  84. listPDAToWarehouse(param).then(res => {
  85. console.log(res)
  86. this.List = res
  87. })
  88. },
  89. handleScan() {
  90. },
  91. scrolltolower() {},
  92. save() {
  93. if (!this.warehouseId) {
  94. uni.showToast({
  95. icon: 'none',
  96. title: '请先选择入库仓库'
  97. })
  98. return false
  99. }
  100. let storageInfo = {
  101. warehouseId: this.warehouseId,
  102. toWarehouseList: this.List,
  103. }
  104. this.objData['storageInfo'] = storageInfo
  105. jobSave(this.objData).then(res => {
  106. uni.navigateBack()
  107. })
  108. },
  109. }
  110. }
  111. </script>
  112. <style lang="scss" scoped>
  113. .content-box {
  114. height: 100vh;
  115. overflow: hidden;
  116. display: flex;
  117. flex-direction: column;
  118. }
  119. .list_box {
  120. flex: 1;
  121. overflow: hidden;
  122. padding: 4rpx 0;
  123. .u-list {
  124. height: 100% !important;
  125. }
  126. .card_box {
  127. padding: 16rpx 24rpx;
  128. }
  129. }
  130. .bottom-wrapper {
  131. .btn_box {
  132. width: 750rpx;
  133. height: 88rpx;
  134. line-height: 88rpx;
  135. background: $theme-color;
  136. text-align: center;
  137. font-size: 36rpx;
  138. font-style: normal;
  139. font-weight: 400;
  140. color: #fff;
  141. }
  142. }
  143. .select_box {
  144. margin-top: 20rpx;
  145. }
  146. .list_box {
  147. margin-top: 40rpx;
  148. .time {
  149. font-size: 28rpx;
  150. }
  151. }
  152. </style>