batch.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. console.log(option)
  70. this.dimension = option.dimension
  71. this.categoryCode = option.categoryCode
  72. this.categoryId = option.categoryId
  73. if (option.info) {
  74. // option.info.dimension = option.dimension
  75. this.info = JSON.parse(decodeURIComponent(option.info))
  76. this.info.dimension = this.dimension
  77. console.log('this.info', this.info)
  78. }
  79. },
  80. computed: {
  81. title() {
  82. // if (this.dimension == 1) {
  83. // return `${this.info.assetCode || ''} ${this.info.assetName || ''}`
  84. // }
  85. // return '批次号 ' + this.batchNum
  86. return this.info.categoryName
  87. },
  88. scrollTitle() {
  89. let list = [
  90. // {
  91. // name: '基本信息',
  92. // components: 'BaseInfo'
  93. // },
  94. {
  95. name: '库存明细',
  96. components: 'inventoryDetail'
  97. },
  98. {
  99. name: '入库',
  100. components: 'putStorage'
  101. },
  102. {
  103. name: '调拨',
  104. components: 'allot'
  105. },
  106. {
  107. name: '出库',
  108. components: 'outboundDelivery'
  109. },
  110. {
  111. name: '报损溢',
  112. components: 'ReportLoss'
  113. }
  114. ]
  115. // if (this.dimension == 1) {
  116. // list.splice(2, 0, {
  117. // name: '批次明细',
  118. // components: 'BatchDetail'
  119. // })
  120. // }
  121. // if (this.info.assetType == 3 && this.dimension == 2) {
  122. // list.push({
  123. // name: '质检单',
  124. // components: 'InspectionSheet'
  125. // })
  126. // }
  127. return list
  128. }
  129. },
  130. methods: {
  131. changeActive(item) {
  132. this.active = item.components
  133. },
  134. handlPopMessage() {
  135. this.$refs.PopMessage.open()
  136. }
  137. // getInfo () {
  138. // let par = {
  139. // inventoryCode: this.inventoryCode,
  140. // batchNum: this.batchNum,
  141. // code: this.code
  142. // }
  143. // post(this.apiUrl + '/InventoryBook/select/getDetail', par).then(res => {
  144. // if (res.success) {
  145. // this.info = res.data.records[0]
  146. // }
  147. // })
  148. // }
  149. }
  150. }
  151. </script>
  152. <style lang="scss" scoped>
  153. page {
  154. height: 100%;
  155. }
  156. .main {
  157. height: 100vh;
  158. display: flex;
  159. flex-direction: column;
  160. overflow: hidden;
  161. }
  162. .scroll-view_H {
  163. padding: 20rpx;
  164. border-bottom: 5rpx solid #70b603;
  165. display: flex;
  166. justify-content: space-between;
  167. align-items: center;
  168. .item {
  169. font-size: 32rpx;
  170. &.active {
  171. color: #70b603;
  172. }
  173. }
  174. }
  175. .wl-bar {
  176. height: 60rpx;
  177. background-color: #70b603;
  178. font-size: 28rpx;
  179. color: #fff;
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. padding: 0 20rpx;
  184. }
  185. .scroll_box {
  186. flex: 1;
  187. overflow: hidden;
  188. }
  189. </style>