storageRetrieval.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="page-container uni-column">
  3. <!-- 零存库部分 -->
  4. <view class="title unfit-title uni-row">
  5. <view class="title">零取</view>
  6. </view>
  7. <view class="consultation-container uni-column" style="margin-bottom: 120rpx;height: 90%;">
  8. <view style="width: 100%;height: 80%;">
  9. <zb-table
  10. :columns="column1"
  11. :stripe="true"
  12. :fit="true"
  13. @toggleRowSelection="selectionChange"
  14. :data="listData"></zb-table>
  15. <!-- <uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
  16. @selection-change="selectionChange">
  17. <uni-tr>
  18. <uni-th style="font-size: 25rpx;" width="100" align="center">批次号</uni-th>
  19. <uni-th style="font-size: 25rpx;" width="100" align="center">操作者</uni-th>
  20. <uni-th style="font-size: 25rpx;" width="80" align="center">数量</uni-th>
  21. </uni-tr>
  22. <uni-tr v-for="(item, index) in listData" :key="index">
  23. <uni-th style="font-size: 24rpx;" width="100" align="center">{{ item.lotCode }}</uni-th>
  24. <uni-th style="font-size: 24rpx;" width="100" align="center">{{ item.storagerName }}</uni-th>
  25. <uni-th style="font-size: 24rpx;" width="80" align="center">{{ item.storageNum }}</uni-th>
  26. </uni-tr>
  27. </uni-table> -->
  28. </view>
  29. </view>
  30. </view>
  31. <view class="bottom uni-row">
  32. <button class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
  33. :disabled="selections.length == 0" @click="handleAdd">确认取出</button>
  34. </view>
  35. </template>
  36. <script setup>
  37. import {
  38. ref
  39. } from 'vue'
  40. import {
  41. onMounted,
  42. getCurrentInstance
  43. } from 'vue';
  44. import {
  45. getStorageRetrievalList
  46. } from '@/api/business/storageRetrieval.js'
  47. import {
  48. onLoad,
  49. onReady,
  50. onUnload,
  51. onShow
  52. } from '@dcloudio/uni-app'
  53. import {
  54. store
  55. } from '@/store/index.js'
  56. const selections = ref([])
  57. const listData = ref([])
  58. const column1 = [
  59. { type:'selection', width:50 },
  60. { name: 'lotCode', label: '批次号',align:'center'},
  61. { name: 'storagerName', label: '操作者',align:'center' },
  62. { name: 'storageNum', label: '数量',align:'center' },
  63. ]
  64. /***************************** 页面生命周期函数 *****************************/
  65. onLoad((options) => {
  66. const data = decodeURIComponent(options.data);
  67. // 将解码后的字符串转换回对象
  68. const lotInfo = JSON.parse(data);
  69. console.log(lotInfo)
  70. init(lotInfo)
  71. })
  72. /***************************** 定义了一些方法 *****************************/
  73. const init = (data) => {
  74. console.log(data)
  75. getStorageRetrievalList(data).then(res =>{
  76. listData.value = res.rows
  77. })
  78. }
  79. function selectionChange(checked,arr) {
  80. console.log(checked,arr)
  81. getSelectionList(arr)
  82. }
  83. function getSelectionList(data) {
  84. selections.value = data
  85. console.log(selections.value)
  86. }
  87. //选择带回
  88. function handleAdd() {
  89. uni.$emit('addInfoEvent', {
  90. data:selections.value
  91. })
  92. uni.navigateBack()
  93. }
  94. </script>
  95. <style lang="scss">
  96. .unfit-title{
  97. height: 30rpx;
  98. position: fixed;
  99. top: 30rpx;
  100. }
  101. .page-container {
  102. height: 90%;
  103. background-color: #ffffff;
  104. font-size: 28rpx;
  105. >.title {
  106. position: relative;
  107. top: 0;
  108. font-weight: 700;
  109. margin: 24rpx 16rpx;
  110. }
  111. }
  112. .unfit-title {
  113. margin-bottom: 24rpx;
  114. justify-content: space-between;
  115. align-items: center;
  116. text {
  117. font-size: 28rpx;
  118. font-weight: 700;
  119. }
  120. }
  121. .bottom {
  122. height: 10%;
  123. position: fixed;
  124. right: 0;
  125. bottom: 0;
  126. left: 0;
  127. height: 100rpx;
  128. border-top: 1px solid #999999;
  129. padding: 16rpx 32rpx;
  130. align-items: center;
  131. background-color: #fff;
  132. justify-content: space-evenly;
  133. z-index: 99;
  134. .start-batch-btn {
  135. flex: 1;
  136. height: 80rpx;
  137. line-height: 80rpx;
  138. border-radius: 8rpx;
  139. color: #FFFFFF;
  140. font-size: 28rpx;
  141. }
  142. }
  143. .consultation-container {
  144. margin: 0 16rpx;
  145. padding: 24rpx;
  146. background-color: #ffffff;
  147. border-radius: 8rpx;
  148. }
  149. .zb-table .item-tr {
  150. flex-direction: row;
  151. }
  152. </style>