|
@@ -10,8 +10,11 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <view class="scroll-container" style="padding-bottom: 150rpx">
|
|
|
- <view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
|
|
|
+ <scroll-view class="scroll-container" scroll-y @scrolltolower="handleScrollToLower" style="padding-bottom: 150rpx">
|
|
|
+ <view v-if="listData.length == 0" style="text-align: center;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #666;
|
|
|
+ padding-top: 16px;">
|
|
|
<text>暂无批次</text>
|
|
|
</view>
|
|
|
<!-- 批次列表 -->
|
|
@@ -45,7 +48,7 @@
|
|
|
<text class="label right">{{ item['taksStockNum']}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </scroll-view>
|
|
|
<view class="bottom uni-row">
|
|
|
<button class="add" type="primary" v-if="listData.length != 0"
|
|
|
@click="handleScanCode">扫码盘点批次</button>
|
|
@@ -65,7 +68,8 @@
|
|
|
onLoad,
|
|
|
onReady,
|
|
|
onUnload,
|
|
|
- onShow
|
|
|
+ onShow,
|
|
|
+ onReachBottom
|
|
|
} from '@dcloudio/uni-app'
|
|
|
import {
|
|
|
getTakesStockList,
|
|
@@ -83,6 +87,9 @@
|
|
|
|
|
|
const listData = ref([])
|
|
|
const keywords = ref(null)
|
|
|
+ const pageSize = ref(10)
|
|
|
+ const pageNum = ref(1)
|
|
|
+ const status = ref(true)
|
|
|
|
|
|
// 页面下拉刷新操作
|
|
|
onPullDownRefresh(() => {
|
|
@@ -95,7 +102,27 @@
|
|
|
reflush();
|
|
|
})
|
|
|
|
|
|
- ;
|
|
|
+ function handleScrollToLower(){
|
|
|
+ console.log(status.value)
|
|
|
+ if(status.value) {
|
|
|
+ pageNum.value += 1
|
|
|
+
|
|
|
+ getTakesStockList({deptId:store.curDeptDetails.deptId,keywords:keywords.value,pageSize:pageSize.value,pageNum:pageNum.value}).then(res =>{
|
|
|
+ const existingIds = new Set(listData.value.map(item => item.id));
|
|
|
+
|
|
|
+ // 过滤出那些不在 existingIds 中的项,即新数据
|
|
|
+ const newRows = res.rows.filter(row => !existingIds.has(row.id));
|
|
|
+
|
|
|
+ // 如果有新数据,将其添加到 listData
|
|
|
+ if (newRows.length > 0) {
|
|
|
+ listData.value = listData.value.concat(newRows);
|
|
|
+ } else {
|
|
|
+ // 如果没有新数据,更新状态表示没有更多数据
|
|
|
+ status.value = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
function reflush() {
|
|
|
init(store.curDeptDetails.deptId);
|
|
@@ -105,7 +132,7 @@
|
|
|
uni.showLoading({
|
|
|
title: '加载中'
|
|
|
});
|
|
|
- getTakesStockList({deptId:id,keywords:keywords.value}).then(res =>{
|
|
|
+ getTakesStockList({deptId:id,keywords:keywords.value,pageSize:pageSize.value,pageNum:pageNum.value}).then(res =>{
|
|
|
listData.value = res.rows
|
|
|
uni.hideLoading();
|
|
|
})
|
|
@@ -212,25 +239,6 @@
|
|
|
<style lang="scss">
|
|
|
$nav-height: 60rpx;
|
|
|
|
|
|
- /* 遮罩层样式 */
|
|
|
- .mask {
|
|
|
- position: fixed;
|
|
|
- /* 固定定位,覆盖整个屏幕 */
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- background-color: rgba(0, 0, 0, 0.3);
|
|
|
- /* 黑色背景,透明度30% */
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- /* 水平居中 */
|
|
|
- align-items: center;
|
|
|
- /* 垂直居中 */
|
|
|
- z-index: 1000;
|
|
|
- /* 确保遮罩层在其他元素之上 */
|
|
|
- }
|
|
|
-
|
|
|
.box-bg {
|
|
|
width: 94%;
|
|
|
background-color: #F5F5F5;
|
|
@@ -298,8 +306,8 @@
|
|
|
.scroll-container {
|
|
|
width: 92%;
|
|
|
margin: 24rpx auto 0 auto;
|
|
|
- height: calc(90% - 100rpx);
|
|
|
- overflow: auto;
|
|
|
+ height: calc(87% - 90rpx);
|
|
|
+ // overflow: auto;
|
|
|
}
|
|
|
|
|
|
.list-item {
|
|
@@ -403,6 +411,16 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .page {
|
|
|
+ background-color: white;
|
|
|
+ width: 100%;
|
|
|
+ position: fixed;
|
|
|
+ bottom: 90rpx;
|
|
|
+ align-items: center;
|
|
|
+ background-color: #ffffff;
|
|
|
+ padding: 16rpx 0;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
.bottom {
|
|
|
background-color: white;
|
|
@@ -418,6 +436,5 @@
|
|
|
width: 80%;
|
|
|
height: 80rpx;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
</style>
|