index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="拣货列表" @clickLeft="back"></uni-nav-bar>
  4. <CardList :list="tableData" />
  5. <view class="footBox">
  6. <view class="reg" @click="addStock">
  7. <uni-icons custom-prefix="iconfont" type="icon-shixiangxinzeng" size="20" color="#fff"></uni-icons>
  8. 新增拣货
  9. </view>
  10. </view>
  11. <!-- 搜索组件 -->
  12. <u-popup :show="searchVisible" mode="right" @close="searchVisible = false">
  13. <view class="search-container">
  14. <view class="title">筛选</view>
  15. <uni-forms ref="customForm" :modelValue="popupInfo" label-position="top" label-width="200">
  16. <uni-forms-item label="编码" name="code">
  17. <uni-easyinput v-model="popupInfo.code" :inputBorder="false" placeholder="请输入" />
  18. </uni-forms-item>
  19. <uni-forms-item label="名称" name="name">
  20. <uni-easyinput v-model="popupInfo.name" :inputBorder="false" placeholder="请输入" />
  21. </uni-forms-item>
  22. <uni-forms-item label="仓库" name="reportName">
  23. <uni-data-select v-model="popupInfo.warehouseId" :localdata="warehouseListOption"></uni-data-select>
  24. </uni-forms-item>
  25. </uni-forms>
  26. <view class="footer">
  27. <view class="btn reset" @click="handleReset">重置</view>
  28. <view class="btn search" @click="handleSearch">搜索</view>
  29. </view>
  30. </view>
  31. </u-popup>
  32. </view>
  33. </template>
  34. <script>
  35. import { getPickgoodsList, getWarehouseList } from '@/api/warehouseManagement'
  36. import CardList from './components/CardList.vue'
  37. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  38. export default {
  39. components: {
  40. CardList,
  41. baTreePicker
  42. },
  43. data() {
  44. return {
  45. listData: [],
  46. page: 1,
  47. size: 10,
  48. isEnd: true,
  49. searchVisible: false,
  50. popupInfo: {
  51. code: '',
  52. name: '',
  53. warehouseId: ''
  54. }, //筛选数据
  55. warehouseListOption: [],
  56. tableData: []
  57. }
  58. },
  59. onLoad() {
  60. this.getFirstList()
  61. this.getwarehouseList()
  62. },
  63. //触底加载
  64. onReachBottom: function () {
  65. if (this.isEnd) {
  66. return
  67. }
  68. this.getMoreLists()
  69. },
  70. methods: {
  71. //获取仓库
  72. async getwarehouseList() {
  73. let res = await getWarehouseList()
  74. this.warehouseListOption = res.data.map(item => {
  75. return {
  76. text: item.name,
  77. value: item.id
  78. }
  79. })
  80. },
  81. handleSearch() {
  82. this.getFirstList()
  83. },
  84. getFirstList() {
  85. this.searchVisible = false
  86. this.page = 1
  87. this.isEnd = true
  88. this.getList()
  89. },
  90. getMoreLists() {
  91. //获取更多数据
  92. page++
  93. this.getList()
  94. },
  95. //获取列表信息
  96. getList() {
  97. uni.showLoading({
  98. title: '加载中'
  99. })
  100. let data = {
  101. pageNum: this.page,
  102. size: this.size
  103. }
  104. getPickgoodsList(data)
  105. .then(res => {
  106. if (this.page === 1) {
  107. this.tableData = res.list
  108. } else {
  109. this.tableData = this.tableData.concat(res.list)
  110. }
  111. this.isEnd = this.tableData.length >= res.count
  112. })
  113. .finally(() => {
  114. uni.hideLoading()
  115. })
  116. },
  117. confirm(data, name) {
  118. this.popupInfo.reportDeptName = name
  119. this.popupInfo.reportDeptId = data[0]
  120. this.popupInfo.reportName = ''
  121. this.popupInfo.reportId = ''
  122. this.getUser(data[0])
  123. },
  124. //筛选
  125. handleTabSearch() {
  126. this.searchVisible = true
  127. },
  128. handleReset() {
  129. this.popupInfo = {
  130. code: '',
  131. name: '',
  132. warehouseId: ''
  133. }
  134. this.getFirstList()
  135. },
  136. //新增
  137. addStock() {
  138. uni.navigateTo({
  139. url: '/pages/warehouse/picking/add'
  140. })
  141. }
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .mainBox {
  147. padding-bottom: 120rpx;
  148. }
  149. .tab-wrapper {
  150. position: fixed;
  151. z-index: 99;
  152. width: 100%;
  153. }
  154. .footBox {
  155. position: fixed;
  156. left: 0px;
  157. bottom: 0px;
  158. height: 100rpx;
  159. width: 100%;
  160. display: flex;
  161. align-items: center;
  162. justify-content: space-between;
  163. view {
  164. width: 100%;
  165. height: 100%;
  166. text-align: center;
  167. color: #fff;
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. }
  172. .add {
  173. background: $uni-color-primary;
  174. }
  175. .reg {
  176. background: $u-success-dark;
  177. }
  178. .uni-icons {
  179. margin-right: 8rpx !important;
  180. font-weight: bold;
  181. }
  182. }
  183. .search-container {
  184. width: 70vw;
  185. padding: 30rpx 36rpx;
  186. .footer {
  187. position: absolute;
  188. bottom: 0;
  189. left: 0;
  190. width: 100%;
  191. display: flex;
  192. box-shadow: 0 10rpx 30rpx 0 #000;
  193. .btn {
  194. width: 50%;
  195. height: 80rpx;
  196. border-radius: 0 !important;
  197. flex: 1;
  198. display: flex;
  199. justify-content: center;
  200. align-items: center;
  201. &.reset {
  202. color: $j-primary-border-green;
  203. }
  204. &.search {
  205. color: #fff;
  206. background-color: $j-primary-border-green;
  207. }
  208. }
  209. }
  210. .title {
  211. font-weight: bold;
  212. font-size: 30rpx;
  213. margin-bottom: 20rpx;
  214. }
  215. /deep/.uni-date__x-input,
  216. /deep/.uni-easyinput__content,
  217. /deep/.uni-easyinput__content-input {
  218. height: 60rpx;
  219. border-radius: 30rpx;
  220. overflow: hidden;
  221. background-color: rgba(242, 242, 242, 1);
  222. }
  223. }
  224. </style>