wangxin 1 سال پیش
والد
کامیت
52084ac089
2فایلهای تغییر یافته به همراه91 افزوده شده و 31 حذف شده
  1. 42 31
      pages/processInspection/scan.vue
  2. 49 0
      pages/sorting/form.vue

+ 42 - 31
pages/processInspection/scan.vue

@@ -76,8 +76,10 @@
 				}
 				const result = JSON.parse(res.result)
 
+				/************************ 查询是否一批多箱 ************************/
 				getCarrierInfo(result).then(resqust => {
 					if (resqust.code == 200) {
+						//返回数据大于一条,跳转选择批次弹窗
 						if (resqust.data.length > 1) {
 							query.value = result;
 							console.log("查询箱号信息", resqust)
@@ -86,7 +88,6 @@
 							uni.showLoading({
 								title: '加载中'
 							});
-
 							// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
 							// 需要定义一个请求方法, 从后端获取
 							getLotInfo(result).then(res => {
@@ -106,7 +107,6 @@
 							});
 
 						}
-
 					} else {
 						uni.showToast({
 							icon: 'none',
@@ -146,35 +146,46 @@
 
 	// 确定后,将批次id,批次号,传递过去
 	const handleConfirm = () => {
-		lot.value.carrierCode = carrierCode.value
-		uni.showLoading({
-			title: '加载中'
-		});
-		console.log("加载", lot.value);
-		getLotInfo(lot.value).then(res => {
-			if (res.code == 200) {
-				lot.value = res.data;
-				lot.value.carrierCode = carrierCode.value
-				store.processInspection = null;
-				uni.hideLoading();
-				uni.navigateTo({
-					url: "/pages/processInspection/form",
-					success: (res) => {
-						// 通过eventChannel向被打开页面传送数据
-						res.eventChannel.emit("processInspectionFrom", {
-							data: lot.value
-						})
-					}
-				})
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration: 2000
-				})
-				return;
-			}
-		})
+		if (lot.carrierCode || carrierCode.value !== "") {
+			lot.value.carrierCode = carrierCode.value
+			uni.showLoading({
+				title: '加载中'
+			});
+			console.log("加载", lot.value);
+			getLotInfo(lot.value).then(res => {
+				if (res.code == 200) {
+					lot.value = res.data;
+					lot.value.carrierCode = carrierCode.value
+					store.processInspection = null;
+					uni.hideLoading();
+					uni.navigateTo({
+						url: "/pages/processInspection/form",
+						success: (res) => {
+							// 通过eventChannel向被打开页面传送数据
+							res.eventChannel.emit("processInspectionFrom", {
+								data: lot.value
+							})
+						}
+					})
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					})
+					return;
+				}
+			})
+
+		} else {
+			uni.showToast({
+				icon: 'none',
+				title: "请输入箱号或扫描箱码",
+				duration: 2000
+			})
+			return;
+		}
+
 
 	}
 </script>

+ 49 - 0
pages/sorting/form.vue

@@ -288,6 +288,31 @@
 	}
 
 	const handleFinishDaywork = () => {
+		let unf = unfitInfos.value
+		console.log("unf", unf);
+		for (var i = 0; i < unfitInfos.value.length; i++) {
+			console.log("废品", unf[i].reason, unf[i].rejectNum)
+			if ((!unf[i].reason || unf[i].reason == "") || (!unf[i].rejectNum || unf[i].rejectNum == 0)) {
+				uni.showToast({
+					icon: 'none',
+					title: "废品信息不能为空",
+					duration: 2000
+				})
+				return;
+			}
+		}
+
+		if (!dayworkItem.value.qualifiedNum) {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能为空",
+				duration: 2000
+			})
+			return;
+		}
+
+
+
 		const saveData = {
 			rejectList: unfitInfos.value,
 			consult: consultations.value,
@@ -309,6 +334,30 @@
 		})
 	}
 	const handleUpdateDaywork = () => {
+		let unf = unfitInfos.value
+
+		console.log("unf", unf);
+		for (var i = 0; i < unfitInfos.value.length; i++) {
+			console.log("废品", unf[i].reason, unf[i].rejectNum)
+			if ((!unf[i].reason || unf[i].reason == "") || (!unf[i].rejectNum || unf[i].rejectNum == 0)) {
+				uni.showToast({
+					icon: 'none',
+					title: "废品信息不能为空",
+					duration: 2000
+				})
+				return;
+			}
+		}
+
+		if (!dayworkItem.value.qualifiedNum) {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能为空",
+				duration: 2000
+			})
+			return;
+		}
+
 		const saveData = {
 			rejectList: unfitInfos.value,
 			consult: consultations.value,