batch.vue 4.5 KB

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