wangxin 1 жил өмнө
parent
commit
0f968ccf76

+ 6 - 0
pages.json

@@ -116,6 +116,12 @@
 				"navigationBarTitleText": "分选报工"
 				"navigationBarTitleText": "分选报工"
 			}
 			}
 		},
 		},
+		{
+			"path": "pages/processInspection/consultation",
+			"style": {
+				"navigationBarTitleText": "序检"
+			}
+		},
 		{
 		{
 			"path": "pages/processInspection/index",
 			"path": "pages/processInspection/index",
 			"style": {
 			"style": {

+ 23 - 4
pages/fastProductionPlan/index.vue

@@ -103,6 +103,8 @@
 
 
 	const form = ref([]); //表单数据true
 	const form = ref([]); //表单数据true
 	const checkAll = ref(false); //是否全选
 	const checkAll = ref(false); //是否全选
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
 	const listData = ref([]);
 	const listData = ref([]);
 	const allData = ref([])
 	const allData = ref([])
 	const selection = ref([]); //选中数据
 	const selection = ref([]); //选中数据
@@ -134,7 +136,8 @@
 					text: v.name,
 					text: v.name,
 					depts: v.depts
 					depts: v.depts
 				}))
 				}))
-				if ((workshopId.value == null || !workshopList.value.some(e => e.value === workshopId.value)) && workshopList.value.length > 0) {
+				if ((workshopId.value == null || !workshopList.value.some(e => e.value === workshopId.value)) &&
+					workshopList.value.length > 0) {
 					workshopId.value = workshopList.value[0].value
 					workshopId.value = workshopList.value[0].value
 					handleChangeWorkshop(workshopId.value)
 					handleChangeWorkshop(workshopId.value)
 				} else {
 				} else {
@@ -152,7 +155,7 @@
 	function handleSearch() {
 	function handleSearch() {
 		searchRef.value.open();
 		searchRef.value.open();
 	}
 	}
-	
+
 	function refreshSearch(input) {
 	function refreshSearch(input) {
 		// console.log(input)
 		// console.log(input)
 		keyword.value = input
 		keyword.value = input
@@ -243,7 +246,7 @@
 		// lotReporting.value.open('test')
 		// lotReporting.value.open('test')
 		handleAdd()
 		handleAdd()
 	}
 	}
-	
+
 	// 全选按钮操作
 	// 全选按钮操作
 	function handleAll() {
 	function handleAll() {
 		//清空选中数据
 		//清空选中数据
@@ -262,7 +265,8 @@
 		// console.log(allData.value)
 		// console.log(allData.value)
 		// console.log(workshop)
 		// console.log(workshop)
 		// console.log()
 		// console.log()
-		listData.value = allData.value.filter(v => workshop.depts.some(e => e.deptId === v.quickInfo.deptId) && (v.lotCode.includes(keyword.value) || v.productDescription.includes(keyword.value)))
+		listData.value = allData.value.filter(v => workshop.depts.some(e => e.deptId === v.quickInfo.deptId) && (v.lotCode
+			.includes(keyword.value) || v.productDescription.includes(keyword.value)))
 	}
 	}
 
 
 
 
@@ -309,6 +313,20 @@
 			})
 			})
 			return
 			return
 		}
 		}
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经有请求发出,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
+		// 更新请求时间戳
+		lastRequestTimestamp.value = currentTime;
 		finishQuick(selection.value).then(res => {
 		finishQuick(selection.value).then(res => {
 			// console.log(res)
 			// console.log(res)
 			if (res.code === 200) {
 			if (res.code === 200) {
@@ -322,6 +340,7 @@
 
 
 <style lang="scss">
 <style lang="scss">
 	$nav-height: 60rpx;
 	$nav-height: 60rpx;
+
 	.bottom-btn-container {
 	.bottom-btn-container {
 		position: fixed;
 		position: fixed;
 		top: 80%;
 		top: 80%;

+ 5 - 5
pages/handlingList/index.vue

@@ -240,7 +240,7 @@
 					for (var i = 0; i < listData.value.length; i++) {
 					for (var i = 0; i < listData.value.length; i++) {
 						listData.value[i].carriers = listData.value[i].carrierName.split('、').length;
 						listData.value[i].carriers = listData.value[i].carrierName.split('、').length;
 					}
 					}
-					console.log(res1)
+					console.log("待周转任务", res1)
 				}
 				}
 				//周转
 				//周转
 				if (res2.code == 200) {
 				if (res2.code == 200) {
@@ -304,7 +304,7 @@
 				content: `是否${str}?`,
 				content: `是否${str}?`,
 				success: function(res) {
 				success: function(res) {
 					if (res.confirm) {
 					if (res.confirm) {
-						handleUpadteStatus(status,isBack);
+						handleUpadteStatus(status, isBack);
 					} else if (res.cancel) {
 					} else if (res.cancel) {
 
 
 					}
 					}
@@ -319,12 +319,12 @@
 		}
 		}
 	}
 	}
 
 
-	function handleUpadteStatus(status,isBack) {
+	function handleUpadteStatus(status, isBack) {
 		// 设置周转状态
 		// 设置周转状态
 		for (let i = 0; i < selection.value.length; i++) {
 		for (let i = 0; i < selection.value.length; i++) {
 			selection.value[i].status = status;
 			selection.value[i].status = status;
 		}
 		}
-		if(isBack){
+		if (isBack) {
 			updateBatchBack(selection.value).then(res => {
 			updateBatchBack(selection.value).then(res => {
 				if (res.code === 200) {
 				if (res.code === 200) {
 					uni.showToast({
 					uni.showToast({
@@ -341,7 +341,7 @@
 					});
 					});
 				}
 				}
 			})
 			})
-		}else{
+		} else {
 			updateDayWorkItemBatch(selection.value).then(res => {
 			updateDayWorkItemBatch(selection.value).then(res => {
 				if (res.code === 200) {
 				if (res.code === 200) {
 					uni.showToast({
 					uni.showToast({

+ 14 - 0
pages/outsourcedInspection/form.vue

@@ -135,6 +135,8 @@
 	} from '@/api/business/processInspection.js'
 	} from '@/api/business/processInspection.js'
 	const lot = ref({})
 	const lot = ref({})
 	const unfitInfos = ref([]) //废品信息
 	const unfitInfos = ref([]) //废品信息
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
 	const consultations = ref([]) //咨询信息
 	const consultations = ref([]) //咨询信息
 	const processInspecion = ref({
 	const processInspecion = ref({
 		remark: "",
 		remark: "",
@@ -283,6 +285,18 @@
 
 
 
 
 	function save() {
 	function save() {
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
 
 
 		let pages = getCurrentPages();
 		let pages = getCurrentPages();
 		processInspecion.value.dayworkItemConsults = consultations.value;
 		processInspecion.value.dayworkItemConsults = consultations.value;

+ 20 - 18
pages/outsourcedInspection/index.vue

@@ -92,21 +92,22 @@
 
 
 	/***************************** 页面生命周期函数 *****************************/
 	/***************************** 页面生命周期函数 *****************************/
 	onShow(() => {
 	onShow(() => {
-		uni.showLoading({
-			title: '加载中'
-		});
-		quer.value.userId = store.userInfo.userId;
-		getP2();
-		getOutsourcedInspection(quer.value).then(res => {
-			console.log("res", res);
-			if (res.code == 200) {
-				original.value = res.rows;
-				timeSizer();
-				uni.hideLoading();
-				// uni.hideLoading();
-			}
-
-		});
+		getList();
+		// uni.showLoading({
+		// 	title: '加载中'
+		// });
+		// quer.value.userId = store.userInfo.userId;
+		// getP2();
+		// getOutsourcedInspection(quer.value).then(res => {
+		// 	console.log("res", res);
+		// 	if (res.code == 200) {
+		// 		original.value = res.rows;
+		// 		timeSizer();
+		// 		uni.hideLoading();
+		// 		// uni.hideLoading();
+		// 	}
+
+		// });
 	})
 	})
 
 
 	/***************************** 定义了一些方法 *****************************/
 	/***************************** 定义了一些方法 *****************************/
@@ -115,12 +116,13 @@
 			title: '加载中'
 			title: '加载中'
 		});
 		});
 		quer.value.userId = store.userInfo.userId;
 		quer.value.userId = store.userInfo.userId;
-		// quer.value.startTime = startTime.value;
+		quer.value.startTime = startTime.value;
 		getOutsourcedInspection(quer.value).then(res => {
 		getOutsourcedInspection(quer.value).then(res => {
 			console.log("res", res);
 			console.log("res", res);
 			if (res.code == 200) {
 			if (res.code == 200) {
 				original.value = res.rows;
 				original.value = res.rows;
-				timeSizer();
+				inspecionList.value = res.rows;
+				// timeSizer();
 				uni.hideLoading();
 				uni.hideLoading();
 				// uni.hideLoading();
 				// uni.hideLoading();
 			}
 			}
@@ -152,7 +154,7 @@
 
 
 	//时间筛选
 	//时间筛选
 	function timeSizer() {
 	function timeSizer() {
-		inspecionList.value = filterSameDayItems(original.value, startTime.value);
+		// inspecionList.value = filterSameDayItems(original.value, startTime.value);
 	}
 	}
 
 
 	// 筛选函数
 	// 筛选函数

+ 17 - 0
pages/processInspection/consultation.vue

@@ -45,6 +45,8 @@
 	} from '@/api/business/processInspection.js'
 	} from '@/api/business/processInspection.js'
 
 
 	const lot = ref({});
 	const lot = ref({});
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
 	const daywork = ref({
 	const daywork = ref({
 		lot_code: 'D35400554012',
 		lot_code: 'D35400554012',
 		product_description: '电机-254.364.14552',
 		product_description: '电机-254.364.14552',
@@ -54,6 +56,7 @@
 	// 页面生命周期函数
 	// 页面生命周期函数
 
 
 	onMounted(() => {
 	onMounted(() => {
+		console.log("咨询页面打开");
 		const instance = getCurrentInstance().proxy
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 		const eventChannel = instance.getOpenerEventChannel();
 
 
@@ -84,6 +87,20 @@
 			})
 			})
 			return
 			return
 		}
 		}
+
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
+
 		store.processInspection = null;
 		store.processInspection = null;
 		uni.$emit('addWasteConsultationEvent', {
 		uni.$emit('addWasteConsultationEvent', {
 			question: lot.value.question
 			question: lot.value.question

+ 18 - 5
pages/processInspection/form.vue

@@ -93,8 +93,9 @@
 			</view>
 			</view>
 			<view class="result uni-row">
 			<view class="result uni-row">
 				<view class="label" style="margin-top: 20rpx; margin-right: 10rpx;">序检状态</view>
 				<view class="label" style="margin-top: 20rpx; margin-right: 10rpx;">序检状态</view>
-				<uni-data-checkbox style="margin-top: 20rpx;" v-model="processInspecion.status" :localdata="range"
-					@change="change"></uni-data-checkbox>
+				<uni-data-checkbox style="margin-top: 20rpx;" v-model="processInspecion.status"
+					:localdata="range"></uni-data-checkbox>
+				<!-- @change="change" -->
 			</view>
 			</view>
 			<view class="remark uni-row">
 			<view class="remark uni-row">
 				<view class="label">备注</view>
 				<view class="label">备注</view>
@@ -136,6 +137,8 @@
 	const lot = ref({})
 	const lot = ref({})
 	const unfitInfos = ref([]) //废品信息
 	const unfitInfos = ref([]) //废品信息
 	const consultations = ref([]) //咨询信息
 	const consultations = ref([]) //咨询信息
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
 	const processInspecion = ref({
 	const processInspecion = ref({
 		remark: "",
 		remark: "",
 		rejectNum: 0,
 		rejectNum: 0,
@@ -284,6 +287,18 @@
 
 
 
 
 	function save() {
 	function save() {
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
 
 
 		let pages = getCurrentPages();
 		let pages = getCurrentPages();
 		processInspecion.value.dayworkItemConsults = consultations.value;
 		processInspecion.value.dayworkItemConsults = consultations.value;
@@ -387,9 +402,7 @@
 				})
 				})
 			}
 			}
 		})
 		})
-		// uni.navigateTo({
-		// 	url: "/pages/processInspection/consultation"
-		// })
+
 	}
 	}
 </script>
 </script>
 
 

+ 20 - 34
pages/processInspection/index.vue

@@ -8,7 +8,7 @@
 
 
 		<view class="time-controls" style="margin-top: 10rpx;">
 		<view class="time-controls" style="margin-top: 10rpx;">
 			<uni-section title="检查日期:" type="square" class="uni-row sta">
 			<uni-section title="检查日期:" type="square" class="uni-row sta">
-				<input v-model="quer.startTime" type="date" @input="timeSizer" />
+				<input v-model="startTime" type="date" @input="timeSizer" />
 			</uni-section>
 			</uni-section>
 		</view>
 		</view>
 
 
@@ -66,7 +66,7 @@
 	const keyword = ref('')
 	const keyword = ref('')
 	const inspecionList = ref([]); //时间后筛选数组
 	const inspecionList = ref([]); //时间后筛选数组
 	const original = ref([]); //原始数组
 	const original = ref([]); //原始数组
-	const startTime = ref(new Date().toISOString().split('T')[0])
+	const startTime = ref(new Date().toISOString().split("T")[0])
 
 
 	const range = [{
 	const range = [{
 		value: 0,
 		value: 0,
@@ -87,20 +87,21 @@
 
 
 	/***************************** 页面生命周期函数 *****************************/
 	/***************************** 页面生命周期函数 *****************************/
 	onShow(() => {
 	onShow(() => {
-		// getList()
-		uni.showLoading({
-			title: '加载中'
-		});
-		quer.value.userId = store.userInfo.userId;
-		getProcessInspecionList(quer.value).then(res => {
-			console.log("res", res);
-			if (res.code == 200) {
-				original.value = res.rows;
-				timeSizer();
-				uni.hideLoading();
-				// uni.hideLoading();
-			}
-		});
+		getList()
+		// uni.showLoading({
+		// 	title: '加载中'
+		// });
+		// quer.value.userId = store.userInfo.userId;
+		// quer.value.startTime = startTime.value;
+		// getProcessInspecionList(quer.value).then(res => {
+		// 	console.log("res", res);
+		// 	if (res.code == 200) {
+		// 		original.value = res.rows;
+		// 		// timeSizer();
+		// 		uni.hideLoading();
+		// 		// uni.hideLoading();
+		// 	}
+		// });
 	})
 	})
 
 
 	/***************************** 定义了一些方法 *****************************/
 	/***************************** 定义了一些方法 *****************************/
@@ -110,34 +111,19 @@
 			title: '加载中'
 			title: '加载中'
 		});
 		});
 		quer.value.userId = store.userInfo.userId;
 		quer.value.userId = store.userInfo.userId;
-		// quer.value.startTime = startTime.value;
+		quer.value.startTime = startTime.value;
 		getProcessInspecionList(quer.value).then(res => {
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);
 			console.log("res", res);
 			if (res.code == 200) {
 			if (res.code == 200) {
 				original.value = res.rows;
 				original.value = res.rows;
-				timeSizer();
+				inspecionList.value = res.rows;
 				uni.hideLoading();
 				uni.hideLoading();
-				// uni.hideLoading();
 			}
 			}
 		});
 		});
 	}
 	}
 
 
 	//时间筛选,暂时注释,使用搜索向
 	//时间筛选,暂时注释,使用搜索向
-	function timeSizer() {
-		// quer.value.startTime = startTime.value;
-		// 显示加载指示器
-		// uni.showLoading();
-		// getProcessInspecionList(quer.value).then(res => {
-		// 	console.log("res", res);
-		// 	if (res.code == 200) {
-		// 		original.value = res.rows;
-		// 		timeSizer();
-		// 		uni.hideLoading();
-		// 		// uni.hideLoading();
-		// 	}
-		// });
-		inspecionList.value = filterSameDayItems(original.value, startTime.value);
-	}
+	function timeSizer() {}
 
 
 	// 筛选函数
 	// 筛选函数
 	const filterSameDayItems = (inspectionList, startTime) => {
 	const filterSameDayItems = (inspectionList, startTime) => {

+ 15 - 0
pages/sorting/consultation.vue

@@ -44,6 +44,9 @@
 	const data = ref({
 	const data = ref({
 		content: ''
 		content: ''
 	})
 	})
+
+	const lastExecutionTime = ref(0);
+
 	onMounted(() => {
 	onMounted(() => {
 		const instance = getCurrentInstance().proxy
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 		const eventChannel = instance.getOpenerEventChannel();
@@ -70,6 +73,18 @@
 			})
 			})
 			return
 			return
 		}
 		}
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
 		uni.$emit('addConsulttationEvent', {
 		uni.$emit('addConsulttationEvent', {
 			content: data.value.content
 			content: data.value.content
 		})
 		})

+ 14 - 1
pages/sorting/form.vue

@@ -114,6 +114,8 @@
 	const unfitInfos = ref([])
 	const unfitInfos = ref([])
 	const consultations = ref([])
 	const consultations = ref([])
 	const dayworkInfo = ref({})
 	const dayworkInfo = ref({})
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
 	const dayworkItem = ref({})
 	const dayworkItem = ref({})
 
 
 	/***************************** 页面生命周期函数 *****************************/
 	/***************************** 页面生命周期函数 *****************************/
@@ -341,7 +343,18 @@
 			qualifiedNum: dayworkItem.value.qualifiedNum,
 			qualifiedNum: dayworkItem.value.qualifiedNum,
 			remark: dayworkItem.value.remark
 			remark: dayworkItem.value.remark
 		}
 		}
-		console.log(saveData)
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
 		finish(saveData).then(res => {
 		finish(saveData).then(res => {
 			if (res.code === 200) {
 			if (res.code === 200) {
 				uni.navigateBack()
 				uni.navigateBack()