index.vue 4.6 KB

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