Browse Source

11.1loading

guoyujia 7 tháng trước cách đây
mục cha
commit
a16249552c

+ 2 - 2
api/business/processInspection.js

@@ -7,7 +7,7 @@ import req from '@/utils/request.js'
 export function getProcessInspecionList(data) {
 	return req.request({
 		url: '/business/inspecion/list',
-		method: 'post',
+		method: 'get',
 		data: data
 	})
 }
@@ -41,7 +41,7 @@ export function updateAdoptStatus(data) {
 export function getOutsourcedInspection(data) {
 	return req.request({
 		url: '/business/inspecion/outsourcedlist',
-		method: 'post',
+		method: 'get',
 		data: data
 	})
 }

+ 14 - 7
pages.json

@@ -150,7 +150,8 @@
 		{
 			"path": "pages/outsourcedInspection/index",
 			"style": {
-				"navigationBarTitleText": "外协检查"
+				"navigationBarTitleText": "外协检查",
+				"onReachBottomDistance": 100
 			}
 		},
 		{
@@ -280,7 +281,8 @@
 		{
 			"path": "pages/firstInspection/index",
 			"style": {
-				"navigationBarTitleText": "首件检"
+				"navigationBarTitleText": "首件检",
+				"onReachBottomDistance": 100
 			}
 		},
 		{
@@ -292,7 +294,8 @@
 		{
 			"path": "pages/onSiteInspection/index",
 			"style": {
-				"navigationBarTitleText": "巡检"
+				"navigationBarTitleText": "巡检",
+				"onReachBottomDistance": 100
 			}
 		},
 		{
@@ -322,7 +325,8 @@
 		{
 			"path": "pages/deliveryInspection/index",
 			"style": {
-				"navigationBarTitleText": "交检"
+				"navigationBarTitleText": "交检",
+				"onReachBottomDistance": 100
 			}
 		},
 		{
@@ -394,7 +398,8 @@
 		{
 			"path": "pages/instrumentRoomInspection/index",
 			"style": {
-				"navigationBarTitleText": "仪器室检"
+				"navigationBarTitleText": "仪器室检",
+				"onReachBottomDistance": 100
 			}
 		},
 		{
@@ -430,7 +435,8 @@
 		{
 			"path": "pages/factoryInspection/index",
 			"style": {
-				"navigationBarTitleText": "出厂检"
+				"navigationBarTitleText": "出厂检",
+				"onReachBottomDistance": 100
 			}
 		},
 		{
@@ -460,7 +466,8 @@
 		{
 			"path": "pages/inspectionDetails/index",
 			"style": {
-				"navigationBarTitleText": "检查列表"
+				"navigationBarTitleText": "检查列表",
+				"onReachBottomDistance": 100
 			}
 		}
 	],

+ 31 - 1
pages/deliveryInspection/index.vue

@@ -76,7 +76,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -86,6 +87,9 @@
 	const original = ref([]); //原始数组
 	const startTime = ref(new Date().toISOString().split("T")[0])
 	const endTime = ref(new Date().toISOString().split("T")[0])
+	const pageSize = ref(10)
+	const pageNum = ref(1)
+	const status = ref(true)
 	const showPicker = ref(false)
 	const range = [{
 		value: 0,
@@ -122,6 +126,30 @@
 		// 	}
 		// });
 	})
+	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;
+			  }
+			})
+			}
+		})
+	
 
 	/***************************** 定义了一些方法 *****************************/
 
@@ -133,6 +161,8 @@
 		quer.value.endTime = endTime.value;
 		quer.value.deptId = store.curDeptDetails.deptId
 		quer.value.type = "deliveryInspection"
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		if(!checkTime(quer.value.startTime,quer.value.endTime)) {
 			console.log("777")
 			uni.showToast({

+ 30 - 2
pages/factoryInspection/index.vue

@@ -72,7 +72,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -81,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: "待确认",
@@ -117,6 +120,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;
+			  }
+			})
+			}
+		})
 
 	/***************************** 定义了一些方法 *****************************/
 
@@ -129,6 +155,8 @@
 		// }
 		quer.value.startTime = startTime.value;
 		quer.value.type = "factoryInspection"
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);
 			if (res.code == 200) {

+ 30 - 2
pages/firstInspection/index.vue

@@ -72,7 +72,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -81,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: "待确认",
@@ -117,6 +120,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;
+			  }
+			})
+			}
+		})
 
 	/***************************** 定义了一些方法 *****************************/
 	// 新增出厂检
@@ -135,6 +161,8 @@
 		quer.value.deptId = store.curDeptDetails.deptId
 		quer.value.startTime = startTime.value;
 		quer.value.type = "firstArticleInspection"
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);
 			if (res.code == 200) {

+ 30 - 1
pages/inspectionDetails/index.vue

@@ -67,7 +67,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -76,6 +77,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: "待确认",
@@ -125,6 +129,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;
+			  }
+			})
+			}
+		})
 
 	/***************************** 定义了一些方法 *****************************/
 
@@ -135,6 +162,8 @@
 		quer.value.startTime = startTime.value;
 		quer.value.deptId = store.curDeptDetails.deptId
 		quer.value.userId = store.userInfo.userId
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);
 			if (res.code == 200) {

+ 30 - 2
pages/instrumentRoomInspection/index.vue

@@ -71,7 +71,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -81,7 +82,9 @@
 	
 	const startTime = ref(new Date().toISOString().split("T")[0])
 	const shouldCallList = ref(false)
-
+	const pageSize = ref(10)
+	const pageNum = ref(1)
+	const status = ref(true)
 	const range = [{
 		value: 0,
 		text: "待确认",
@@ -132,6 +135,29 @@
 	  }
 	}, 1000); // 例如,1 秒后执行
 	})
+	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;
+			  }
+			})
+			}
+		})
 
 	/***************************** 定义了一些方法 *****************************/
 
@@ -142,6 +168,8 @@
 		quer.value.startTime = startTime.value;
 		// quer.value.deptId = store.curDeptDetails.deptId
 		quer.value.type = "instrumentRoomInspection"
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);
 			if (res.code == 200) {

+ 32 - 16
pages/onSiteInspection/index.vue

@@ -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 {

+ 30 - 2
pages/outsourcedInspection/index.vue

@@ -78,7 +78,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -92,7 +93,9 @@
 	const original = ref([]); //原始数组
 	const startTime = ref(new Date().toISOString().split('T')[0])
 	const userId = ref(store.userInfo.userId)
-
+	const pageSize = ref(10)
+	const pageNum = ref(1)
+	const status = ref(true)
 	const range = [{
 		value: 0,
 		text: "待确认",
@@ -115,6 +118,29 @@
 		getList();
 		getP2();
 	})
+	onReachBottom(()=>{
+		console.log(status.value)
+		if(status.value) {
+		pageNum.value += 1
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
+		getOutsourcedInspection(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() {
@@ -125,6 +151,8 @@
 		quer.value.startTime = startTime.value;
 		quer.value.isAuto = 0
 		quer.value.type = "outsourcedInspector"
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		getOutsourcedInspection(quer.value).then(res => {
 			console.log("res", res);
 			if (res.code == 200) {

+ 32 - 5
pages/processInspection/index.vue

@@ -58,7 +58,8 @@
 		onLoad,
 		onReady,
 		onUnload,
-		onShow
+		onShow,
+		onReachBottom
 	} from '@dcloudio/uni-app'
 	import {
 		store
@@ -67,7 +68,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: "待确认",
@@ -103,15 +106,39 @@
 		// 	}
 		// });
 	})
-
+		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: '加载中'
 		});
-		quer.value.userId = store.userInfo.userId;
-		quer.value.startTime = startTime.value;
+		// quer.value.userId = store.userInfo.userId;
+		// quer.value.startTime = startTime.value;
+		quer.value.pageNum = pageNum.value
+		quer.value.pageSize = pageSize.value
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);
 			if (res.code == 200) {