index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. inWarehouseType: null,
  61. }
  62. },
  63. onLoad(options) {
  64. this.id = options.workOrderId
  65. this.taskId = options.taskId
  66. this.workReportId = options.workReportId
  67. this.getList()
  68. this.getWarehouseListFn()
  69. if (this.clientEnvironmentId == 3) {
  70. this.getTgWarehouse()
  71. } else {
  72. this.getWarehouse()
  73. }
  74. },
  75. methods: {
  76. getList() {
  77. getByIdReport(this.id, this.taskId).then(res => {
  78. this.objData = res
  79. if (res.workOrderType == 1) {
  80. this.inWarehouseType = 1
  81. } else if (res.workOrderType == 2) {
  82. this.inWarehouseType = 8 // "1入库类型1生产入库2半成品入库"
  83. }
  84. this.objData.workReportInfo = {
  85. formingNum: null,
  86. formingWeight: null,
  87. formedNum: null,
  88. formedWeight: null,
  89. taskId: this.taskId
  90. }
  91. })
  92. },
  93. getWarehouseListFn() {
  94. getWarehouseList().then(res => {
  95. this.warehouseList = res
  96. })
  97. },
  98. getWarehouse() {
  99. let param = {
  100. workOrderId: this.id,
  101. taskId: this.taskId,
  102. workReportId: this.workReportId
  103. }
  104. listPDAToWarehouse(param).then(res => {
  105. this.List = res
  106. })
  107. },
  108. getTgWarehouse() {
  109. let param = {
  110. workOrderId: this.id,
  111. taskId: this.taskId,
  112. workReportId: this.workReportId
  113. }
  114. listPDAToWarehouseTG(param).then(res => {
  115. this.tgList = res
  116. })
  117. },
  118. handleScan() {
  119. },
  120. scrolltolower() { },
  121. save() {
  122. if (!this.warehouseId) {
  123. uni.showToast({
  124. icon: 'none',
  125. title: '请先选择入库仓库'
  126. })
  127. return false
  128. }
  129. let storageInfo = {
  130. warehouseId: this.warehouseId,
  131. inWarehouseType: this.inWarehouseType,
  132. toWarehouseList: this.clientEnvironmentId == 3 ? this.tgList : this.List,
  133. }
  134. this.objData['storageInfo'] = storageInfo
  135. jobSave(this.objData).then(res => {
  136. uni.navigateBack()
  137. })
  138. },
  139. }
  140. }
  141. </script>
  142. <style lang="scss" scoped>
  143. .content-box {
  144. height: 100vh;
  145. overflow: hidden;
  146. display: flex;
  147. flex-direction: column;
  148. }
  149. .list_box {
  150. flex: 1;
  151. overflow: hidden;
  152. padding: 4rpx 0;
  153. .u-list {
  154. height: 100% !important;
  155. }
  156. .card_box {
  157. padding: 16rpx 24rpx;
  158. }
  159. }
  160. .bottom-wrapper {
  161. .btn_box {
  162. width: 750rpx;
  163. height: 88rpx;
  164. line-height: 88rpx;
  165. background: $theme-color;
  166. text-align: center;
  167. font-size: 36rpx;
  168. font-style: normal;
  169. font-weight: 400;
  170. color: #fff;
  171. }
  172. }
  173. .select_box {
  174. margin-top: 20rpx;
  175. }
  176. .list_box {
  177. margin-top: 40rpx;
  178. .time {
  179. font-size: 28rpx;
  180. }
  181. }
  182. </style>