index.vue 4.4 KB

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