batch.vue 4.6 KB

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