batch.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <!-- 批次明细 -->
  3. <view class="main">
  4. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="back">
  5. </uni-nav-bar>
  6. <view class="scroll-view_H">
  7. <view class="item" :class="{ active: active == item.components }" v-for="(item, index) in scrollTitle"
  8. :key="index" @click="changeActive(item)">
  9. {{ item.name }}
  10. </view>
  11. </view>
  12. <view class="wl-bar" @click="handlPopMessage" v-if="info">
  13. <text>物品基本信息</text>
  14. <text>查看</text>
  15. </view>
  16. <component v-bind:is="active" :batchNum="batchNum" :baseInfo="info" :isUnpack="info.isUnpack" :dimension="dimension"
  17. :inventoryCode="inventoryCode" :code="code" :isInfo="Boolean(info)"></component>
  18. <PopMessage ref="PopMessage" :info="info"></PopMessage>
  19. </view>
  20. </template>
  21. <script>
  22. import inventoryDetail from './components/inventoryDetail.vue'
  23. import putStorage from './components/putStorage.vue'
  24. import allot from './components/allot.vue'
  25. import outboundDelivery from './components/outboundDelivery.vue'
  26. import ReportLoss from './components/ReportLoss.vue'
  27. import InspectionSheet from './components/InspectionSheet.vue'
  28. import BaseInfo from './components/BaseInfo.vue'
  29. import PopMessage from './components/PopMessage.vue'
  30. import BatchDetail from './components/BatchDetail.vue'
  31. import {
  32. post,
  33. get
  34. } from '@/utils/api.js'
  35. export default {
  36. components: {
  37. inventoryDetail,
  38. putStorage,
  39. allot,
  40. outboundDelivery,
  41. ReportLoss,
  42. BaseInfo,
  43. InspectionSheet,
  44. BatchDetail,
  45. PopMessage
  46. },
  47. data() {
  48. return {
  49. batchNum: '',
  50. dimension: '',
  51. inventoryCode: '',
  52. code: '',
  53. active: 'inventoryDetail',
  54. // 物料信息
  55. info: {}
  56. }
  57. },
  58. onLoad(option) {
  59. this.batchNum = option.batchNum === 'null' ? '' : option.batchNum
  60. this.dimension = option.dimension
  61. this.inventoryCode = option.inventoryCode
  62. this.code = option.code
  63. // this.getInfo()
  64. if (option.info) {
  65. this.info = JSON.parse(decodeURIComponent(option.info))
  66. console.log('this.info', this.info)
  67. }
  68. },
  69. computed: {
  70. title() {
  71. if (this.dimension == 1) {
  72. return `${this.info.assetCode || ''} ${this.info.assetName || ''}`
  73. }
  74. return '批次号 ' + this.batchNum
  75. },
  76. scrollTitle() {
  77. let list = [
  78. // {
  79. // name: '基本信息',
  80. // components: 'BaseInfo'
  81. // },
  82. {
  83. name: '库存明细',
  84. components: 'inventoryDetail'
  85. },
  86. {
  87. name: '入库',
  88. components: 'putStorage'
  89. },
  90. {
  91. name: '调拨',
  92. components: 'allot'
  93. },
  94. {
  95. name: '出库',
  96. components: 'outboundDelivery'
  97. },
  98. {
  99. name: '报损溢',
  100. components: 'ReportLoss'
  101. }
  102. ]
  103. if (this.dimension == 1) {
  104. list.splice(2, 0, {
  105. name: '批次明细',
  106. components: 'BatchDetail'
  107. })
  108. }
  109. if (this.info.assetType == 3 && this.dimension == 2) {
  110. list.push({
  111. name: '质检单',
  112. components: 'InspectionSheet'
  113. })
  114. }
  115. return list
  116. }
  117. },
  118. methods: {
  119. changeActive(item) {
  120. this.active = item.components
  121. },
  122. handlPopMessage() {
  123. this.$refs.PopMessage.open()
  124. }
  125. // getInfo () {
  126. // let par = {
  127. // inventoryCode: this.inventoryCode,
  128. // batchNum: this.batchNum,
  129. // code: this.code
  130. // }
  131. // post(this.apiUrl + '/InventoryBook/select/getDetail', par).then(res => {
  132. // if (res.success) {
  133. // this.info = res.data.records[0]
  134. // }
  135. // })
  136. // }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. page {
  142. height: 100%;
  143. }
  144. .main {
  145. height: 100%;
  146. }
  147. .scroll-view_H {
  148. padding: 20rpx;
  149. border-bottom: 5rpx solid #70b603;
  150. display: flex;
  151. justify-content: space-between;
  152. align-items: center;
  153. .item {
  154. font-size: 32rpx;
  155. &.active {
  156. color: #70b603;
  157. }
  158. }
  159. }
  160. .wl-bar {
  161. height: 60rpx;
  162. background-color: #70b603;
  163. font-size: 28rpx;
  164. color: #fff;
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. padding: 0 20rpx;
  169. }
  170. </style>