| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <template>
- <view class="mainBox">
- <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="拣货列表" @clickLeft="back"></uni-nav-bar>
- <CardList :list="tableData" />
- <view class="footBox">
- <view class="reg" @click="addStock">
- <uni-icons custom-prefix="iconfont" type="icon-shixiangxinzeng" size="20" color="#fff"></uni-icons>
- 新增拣货
- </view>
- </view>
- <!-- 搜索组件 -->
- <u-popup :show="searchVisible" mode="right" @close="searchVisible = false">
- <view class="search-container">
- <view class="title">筛选</view>
- <uni-forms ref="customForm" :modelValue="popupInfo" label-position="top" label-width="200">
- <uni-forms-item label="编码" name="code">
- <uni-easyinput v-model="popupInfo.code" :inputBorder="false" placeholder="请输入" />
- </uni-forms-item>
- <uni-forms-item label="名称" name="name">
- <uni-easyinput v-model="popupInfo.name" :inputBorder="false" placeholder="请输入" />
- </uni-forms-item>
- <uni-forms-item label="仓库" name="reportName">
- <uni-data-select v-model="popupInfo.warehouseId" :localdata="warehouseListOption"></uni-data-select>
- </uni-forms-item>
- </uni-forms>
- <view class="footer">
- <view class="btn reset" @click="handleReset">重置</view>
- <view class="btn search" @click="handleSearch">搜索</view>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import { getPickgoodsList, getWarehouseList } from '@/api/warehouseManagement'
- import CardList from './components/CardList.vue'
- import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
- export default {
- components: {
- CardList,
- baTreePicker
- },
- data() {
- return {
- listData: [],
- page: 1,
- size: 10,
- isEnd: true,
- searchVisible: false,
- popupInfo: {
- code: '',
- name: '',
- warehouseId: ''
- }, //筛选数据
- warehouseListOption: [],
- tableData: []
- }
- },
- onLoad() {
- this.getFirstList()
- this.getwarehouseList()
- },
- //触底加载
- onReachBottom: function () {
- if (this.isEnd) {
- return
- }
- this.getMoreLists()
- },
- methods: {
- //获取仓库
- async getwarehouseList() {
- let res = await getWarehouseList()
- this.warehouseListOption = res.data.map(item => {
- return {
- text: item.name,
- value: item.id
- }
- })
- },
- handleSearch() {
- this.getFirstList()
- },
- getFirstList() {
- this.searchVisible = false
- this.page = 1
- this.isEnd = true
- this.getList()
- },
- getMoreLists() {
- //获取更多数据
- page++
- this.getList()
- },
- //获取列表信息
- getList() {
- uni.showLoading({
- title: '加载中'
- })
- let data = {
- pageNum: this.page,
- size: this.size
- }
- getPickgoodsList(data)
- .then(res => {
- if (this.page === 1) {
- this.tableData = res.list
- } else {
- this.tableData = this.tableData.concat(res.list)
- }
- this.isEnd = this.tableData.length >= res.count
- })
- .finally(() => {
- uni.hideLoading()
- })
- },
- confirm(data, name) {
- this.popupInfo.reportDeptName = name
- this.popupInfo.reportDeptId = data[0]
- this.popupInfo.reportName = ''
- this.popupInfo.reportId = ''
- this.getUser(data[0])
- },
- //筛选
- handleTabSearch() {
- this.searchVisible = true
- },
- handleReset() {
- this.popupInfo = {
- code: '',
- name: '',
- warehouseId: ''
- }
- this.getFirstList()
- },
- //新增
- addStock() {
- uni.navigateTo({
- url: '/pages/warehouse/picking/add'
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .mainBox {
- padding-bottom: 120rpx;
- }
- .tab-wrapper {
- position: fixed;
- z-index: 99;
- width: 100%;
- }
- .footBox {
- position: fixed;
- left: 0px;
- bottom: 0px;
- height: 100rpx;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- view {
- width: 100%;
- height: 100%;
- text-align: center;
- color: #fff;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .add {
- background: $uni-color-primary;
- }
- .reg {
- background: $u-success-dark;
- }
- .uni-icons {
- margin-right: 8rpx !important;
- font-weight: bold;
- }
- }
- .search-container {
- width: 70vw;
- padding: 30rpx 36rpx;
- .footer {
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- display: flex;
- box-shadow: 0 10rpx 30rpx 0 #000;
- .btn {
- width: 50%;
- height: 80rpx;
- border-radius: 0 !important;
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- &.reset {
- color: $j-primary-border-green;
- }
- &.search {
- color: #fff;
- background-color: $j-primary-border-green;
- }
- }
- }
- .title {
- font-weight: bold;
- font-size: 30rpx;
- margin-bottom: 20rpx;
- }
- /deep/.uni-date__x-input,
- /deep/.uni-easyinput__content,
- /deep/.uni-easyinput__content-input {
- height: 60rpx;
- border-radius: 30rpx;
- overflow: hidden;
- background-color: rgba(242, 242, 242, 1);
- }
- }
- </style>
|