|
@@ -6,7 +6,10 @@
|
|
|
<view class="shelfName flex">
|
|
|
<view>{{shelfInfo.shelfName}}</view>
|
|
|
</view>
|
|
|
- <view class="btns" @click="showTab = true">筛选<u-icon size="20" name="arrow-down"></u-icon></view>
|
|
|
+ <view class="btns" @click="showTab = true">
|
|
|
+ 筛选:({{curTab!='all'?(curTab+'层'):'全部'}})
|
|
|
+ <u-icon size="20" name="arrow-down"></u-icon>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="search flex align_center">
|
|
|
<view class="input">
|
|
@@ -27,7 +30,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="moreShelfPart-body">
|
|
|
- <scroll-view class="nav-right" scroll-y>
|
|
|
+ <scroll-view class="nav-right" scroll-y @scrolltolower="onreachBottom">
|
|
|
<view class="partList-list-box" v-for="item in partList" :key="item.id">
|
|
|
<view class="product flex align_center">
|
|
|
<view class="flex align_center flex_1">
|
|
@@ -67,13 +70,10 @@
|
|
|
<view class="tabBox flex flex_column">
|
|
|
<view class="tabs">
|
|
|
<view class="flex">
|
|
|
- <view :class="item==curTab?'active':''" v-for="item in placeTab" :key="item" @click="curTab=curTab==item?'':item">{{item}}层</view>
|
|
|
+ <view :class="curTab=='all'?'active':''" @click="tabChange('all')">全部层</view>
|
|
|
+ <view :class="item==curTab?'active':'all'" v-for="item in placeTab" :key="item" @click="tabChange(item)">{{item}}层</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="btns">
|
|
|
- <u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClear">重置</u-button>
|
|
|
- <u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="clearSearch">查询</u-button>
|
|
|
- </view>
|
|
|
</view>
|
|
|
</u-popup>
|
|
|
</view>
|
|
@@ -87,8 +87,9 @@
|
|
|
queryWord: '',
|
|
|
isGobleSearch: false,
|
|
|
partList: [],
|
|
|
+ allList: [],
|
|
|
pageNo:1,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 15,
|
|
|
total: 0, // 列表总数
|
|
|
noDataText: '暂无数据',
|
|
|
status: 'loading',
|
|
@@ -100,7 +101,7 @@
|
|
|
theme: '',
|
|
|
showTab: false,
|
|
|
placeTab: [],
|
|
|
- curTab: '',
|
|
|
+ curTab: 'all',
|
|
|
customBtnStyle: { // 自定义按钮样式
|
|
|
borderColor: this.$config('primaryColor'),
|
|
|
backgroundColor: this.$config('primaryColor'),
|
|
@@ -119,11 +120,19 @@
|
|
|
},
|
|
|
// 批量打印
|
|
|
onNavigationBarButtonTap(e) {
|
|
|
- const data = Object.assign(this.shelfInfo, {list:this.partList.filter(item => item.qty)})
|
|
|
- console.log(data)
|
|
|
- if(data.list.length){
|
|
|
+ if(this.curTab=='all'){
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '请先筛选层,按层批量打印!',
|
|
|
+ duration: 5000
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const list = this.allList.filter(item => item.qty>0)
|
|
|
+ this.$store.state.vuex_tempPrintList = list
|
|
|
+ if(this.shelfInfo&&list.length){
|
|
|
uni.navigateTo({
|
|
|
- url: "/pages/shelfSetting/batchPrint?page=bdtq&data="+encodeURIComponent(JSON.stringify(data))
|
|
|
+ url: "/pages/shelfSetting/batchPrint?page=bdtq&data="+encodeURIComponent(JSON.stringify(this.shelfInfo))
|
|
|
})
|
|
|
}else{
|
|
|
uni.showToast({
|
|
@@ -141,7 +150,7 @@
|
|
|
this.placeTab.push(a)
|
|
|
}
|
|
|
if(!flag){
|
|
|
- this.curTab = ''
|
|
|
+ this.curTab = 'all'
|
|
|
}
|
|
|
} else {
|
|
|
this.placeTab = []
|
|
@@ -149,8 +158,8 @@
|
|
|
})
|
|
|
},
|
|
|
handleClear(){
|
|
|
- this.curTab = ''
|
|
|
- this.clearSearch()
|
|
|
+ this.curTab = 'all'
|
|
|
+ this.changeSearch()
|
|
|
},
|
|
|
// -------------------
|
|
|
clearSearch(){
|
|
@@ -159,9 +168,15 @@
|
|
|
},
|
|
|
changeSearch(v){
|
|
|
this.pageNo = 1
|
|
|
+ this.allList = []
|
|
|
this.partList = []
|
|
|
this.getpartList()
|
|
|
},
|
|
|
+ tabChange(item){
|
|
|
+ this.curTab=item
|
|
|
+ this.showTab = false
|
|
|
+ this.changeSearch()
|
|
|
+ },
|
|
|
// 搜索配件
|
|
|
searchPart(){
|
|
|
this.getpartList()
|
|
@@ -172,24 +187,21 @@
|
|
|
let params = {
|
|
|
shelfSn: this.shelfInfo.shelfSn,
|
|
|
queryWord: this.queryWord,
|
|
|
- shelfPlaceCodeHead: this.curTab
|
|
|
+ shelfPlaceCodeHead: this.curTab == 'all' ? '' : this.curTab
|
|
|
}
|
|
|
_this.status = 'loading'
|
|
|
queryShelfProductList(params).then(res => {
|
|
|
uni.hideLoading()
|
|
|
if(res.status == 200){
|
|
|
let list = res.data
|
|
|
- console.log(list)
|
|
|
if (list && list.length){
|
|
|
- // 分页 拼接数据
|
|
|
- if (_this.pageNo != 1) {
|
|
|
- _this.partList = _this.partList ? _this.partList.concat(list) : list
|
|
|
- } else {
|
|
|
- _this.partList = list
|
|
|
- }
|
|
|
+ _this.allList = list
|
|
|
+ _this.partList = list.slice(0,this.pageSize)
|
|
|
+ _this.total = _this.allList.length
|
|
|
_this.status = 'nomore'
|
|
|
} else {
|
|
|
- _this.partList = list || []
|
|
|
+ _this.allList = []
|
|
|
+ _this.partList = []
|
|
|
_this.status = 'loadmore'
|
|
|
}
|
|
|
_this.noDataText = '没有搜索到产品'
|
|
@@ -202,6 +214,15 @@
|
|
|
this.showTab = false
|
|
|
})
|
|
|
},
|
|
|
+ // 加载更多
|
|
|
+ onreachBottom () {
|
|
|
+ if(this.partList.length < this.total ){
|
|
|
+ this.pageNo = this.pageNo + 1
|
|
|
+ this.partList = this.allList.slice(0,this.pageSize*this.pageNo)
|
|
|
+ }else{
|
|
|
+ this.status = "nomore"
|
|
|
+ }
|
|
|
+ },
|
|
|
print(data){
|
|
|
uni.navigateTo({ url: "/pages/common/printTag/printTag?page=bdtq&data="+JSON.stringify(data)})
|
|
|
},
|
|
@@ -299,7 +320,7 @@
|
|
|
}
|
|
|
}
|
|
|
.btns{
|
|
|
- width:100rpx;
|
|
|
+ width:200rpx;
|
|
|
text-align: right;
|
|
|
font-size: 28rpx;
|
|
|
color: #0485F6;
|