|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="page-container uni-column">
|
|
|
+ <view class="page-container uni-column" >
|
|
|
<view class="search-container uni-row">
|
|
|
<input type="text" v-model="quer.keyword" placeholder="请输入关键字" />
|
|
|
<view class="btn uni-row" @click="getList">搜索</view>
|
|
@@ -15,8 +15,7 @@
|
|
|
<view class="scan-btn " style="min-height: 80rpx;" @click.stop="handleAddOnSiteInspection">新增巡检</view>
|
|
|
<view class="scan-btn " style="background-color: #aaaaff;min-height: 80rpx;margin-left: 24rpx;" @click.stop="handleScan">扫码</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <view class="daywork-item uni-column" id ="data" v-for="(item, index) in inspecionList" :key="index"
|
|
|
+ <view class="daywork-item uni-column " id ="data" v-for="(item, index) in inspecionList" :key="index"
|
|
|
@click="handleSelection(item)">
|
|
|
<view class="lot-code uni-row">
|
|
|
<text>批次号:{{ item.lotCode }}</text>
|
|
@@ -73,7 +72,8 @@
|
|
|
onLoad,
|
|
|
onReady,
|
|
|
onUnload,
|
|
|
- onShow
|
|
|
+ onShow,
|
|
|
+ onReachBottom
|
|
|
} from '@dcloudio/uni-app'
|
|
|
import {
|
|
|
store
|
|
@@ -82,7 +82,9 @@
|
|
|
const inspecionList = ref([]); //时间后筛选数组
|
|
|
const original = ref([]); //原始数组
|
|
|
const startTime = ref(new Date().toISOString().split("T")[0])
|
|
|
-
|
|
|
+ const pageSize = ref(10)
|
|
|
+ const pageNum = ref(1)
|
|
|
+ const status = ref(true)
|
|
|
const range = [{
|
|
|
value: 0,
|
|
|
text: "待确认",
|
|
@@ -121,6 +123,29 @@
|
|
|
|
|
|
/***************************** 定义了一些方法 *****************************/
|
|
|
|
|
|
+ onReachBottom(()=>{
|
|
|
+ console.log(status.value)
|
|
|
+ if(status.value) {
|
|
|
+ pageNum.value += 1
|
|
|
+ quer.value.pageNum = pageNum.value
|
|
|
+ quer.value.pageSize = pageSize.value
|
|
|
+ getProcessInspecionList(quer.value).then(res =>{
|
|
|
+ const existingIds = new Set(inspecionList.value.map(item => item.id));
|
|
|
+
|
|
|
+ // 过滤出那些不在 existingIds 中的项,即新数据
|
|
|
+ const newRows = res.rows.filter(row => !existingIds.has(row.id));
|
|
|
+
|
|
|
+ // 如果有新数据,将其添加到 listData
|
|
|
+ if (newRows.length > 0) {
|
|
|
+ inspecionList.value = inspecionList.value.concat(newRows);
|
|
|
+ original.value = original.value.concat(newRows);
|
|
|
+ } else {
|
|
|
+ // 如果没有新数据,更新状态表示没有更多数据
|
|
|
+ status.value = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
function getList() {
|
|
|
uni.showLoading({
|
|
|
title: '加载中'
|
|
@@ -128,6 +153,8 @@
|
|
|
quer.value.startTime = startTime.value;
|
|
|
quer.value.deptId = store.curDeptDetails.deptId
|
|
|
quer.value.type = "patrolInspection"
|
|
|
+ quer.value.pageNum = pageNum.value
|
|
|
+ quer.value.pageSize = pageSize.value
|
|
|
getProcessInspecionList(quer.value).then(res => {
|
|
|
console.log("res", res);
|
|
|
if (res.code == 200) {
|
|
@@ -306,17 +333,6 @@
|
|
|
.time-controls {
|
|
|
.title {
|
|
|
margin: 20% auto 40% auto;
|
|
|
-
|
|
|
- .first {
|
|
|
- font-size: 48rpx;
|
|
|
- margin: 0 auto;
|
|
|
- }
|
|
|
-
|
|
|
- .second {
|
|
|
- color: red;
|
|
|
- font-size: 24rpx;
|
|
|
- margin: 10rpx auto 0 auto;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.sta {
|