ezhizao_zx 1 年間 前
コミット
905edbfb5d

+ 1 - 0
pages/batchReporting/index.vue

@@ -291,6 +291,7 @@
 		getDayWorkList(reqData).then(res => {
 			if (res.code == 200) {
 				tempList.value = res.data
+				console.log(res)
 				if (normalStatus.value) {
 					listData.value = res.data.filter(item => {
 						return item.isWasteRecycling == 0 && item.isAmend == 0;

+ 19 - 3
pages/fastProductionPlan/index.vue

@@ -191,12 +191,20 @@
 						if (response.code == 200) {
 							// console.log(response.data.items.length)
 							// console.log(response.data)
+							// if (response.data.items[0].deptId !== store.curDeptDetails.deptId) {
+							// 	uni.showToast({
+							// 		icon: 'none',
+							// 		title: '该批次不在当前工段',
+							// 		duration: 2000
+							// 	})
+							// 	return
+							// }
 							if (response.data.items.length > 0) {
 								lotReporting.value.open(response.data);
 							} else {
 								uni.showToast({
 									icon: 'none',
-									title: '该批次不在此计划单内',
+									title: '该批次不在此计划单内, 或不在当前工段',
 									duration: 2000
 								})
 							}
@@ -217,16 +225,24 @@
 				status: 7,
 				deptId: store.curDeptDetails.deptId,
 			}).then(response => {
-				// console.log(response)
+				console.log(response)
 				if (response.code == 200) {
 					// 
+					// if (response.data.items[0].deptId !== store.curDeptDetails.deptId) {
+					// 	uni.showToast({
+					// 		icon: 'none',
+					// 		title: '该批次不在当前工段',
+					// 		duration: 2000
+					// 	})
+					// 	return
+					// }
 					if (response.data.items.length > 0) {
 						// console.log(response.data)
 						lotReporting.value.open(response.data);
 					} else {
 						uni.showToast({
 							icon: 'none',
-							title: '该批次不在此计划单内',
+							title: '该批次不在此计划单内, 或不在当前工段',
 							duration: 2000
 						})
 					}

+ 41 - 1
pages/outsourcedReturnCheck/carriers.vue

@@ -150,7 +150,7 @@
 						if (checked) {
 							checkedCarriers.value.push(vehicleObj.carrierId)
 						}
-						allChecked = allChecked && checkedCarriers.values.includes(l.carriers)
+						allChecked = allChecked && l.carriers.every(t => checkedCarriers.value.includes(t.id))
 					})
 					if (checked) {
 						uni.showToast({
@@ -184,6 +184,46 @@
 			// 	checkedCarriers.value.pop()
 			// }
 			// debounce(handleScanCode, 700)
+			let vehicleObj = {
+				carrierId: "1",
+				carrierCode: "1"
+			};
+
+			if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
+				message.value = '请扫载具码'
+				inputDialog.value.open()
+				return;
+			}
+			let checked = false
+			let allChecked = true
+			details.value.forEach(l => {
+				checked = checked || (l.carriers.findIndex(e => e.id === vehicleObj.carrierId) >= 0)
+				// allChecked = allChecked && (l.carriers.findIndex(e => e.id === vehicleObj.carrierId) >= 0)
+				if (checked) {
+					checkedCarriers.value.push(vehicleObj.carrierId)
+				}
+				allChecked = allChecked && l.carriers.every(t => checkedCarriers.value.includes(t.id))
+			})
+			if (checked) {
+				uni.showToast({
+					icon: 'none',
+					title: '已扫箱' + vehicleObj.carrierCode
+				})
+				if (allChecked) {
+					debonce(() => {
+						uni.showToast({
+							icon: 'none',
+							title: '已验证所有箱码'
+						})
+					}, 700)
+				} else {
+					debounce(handleScanCode, 700)
+				}
+			} else {
+				message.value = '该箱号' + vehicleObj.carrierCode + '不在此发出单'
+				inputDialog.value.open()
+				return
+			}
 		}
 	}
 </script>

+ 17 - 2
pages/sortBatchReporting/index.vue

@@ -68,8 +68,7 @@
 					<text class="label">当前工序</text>
 					<!-- <text
 						class="label right">{{ item.currentProcess ? item.prevProcess && item['currentProcess'].processAlias == item['prevProcess'].processAlias ? '-' : item['currentProcess'].processAlias : '-'}}</text> -->
-						<text
-							class="label right">{{ item.currentProcess ?item['currentProcess'].processAlias : '-'}}</text>
+					<text class="label right">{{ item.currentProcess ?item['currentProcess'].processAlias : '-'}}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">下道工序</text>
@@ -429,6 +428,14 @@
 							// console.log(response)
 							// console.log(response.data[0].productionPlanDetailId)
 							// console.log(store.planDetails.id)
+							if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+								uni.showToast({
+									icon: 'none',
+									title: '该批次不在当前工段',
+									duration: 2000
+								})
+								return
+							}
 							if (response.data[0].productionPlanDetailId == store.planDetails.id) {
 								// console.log(response.data)
 								lotDialog.value.open(response.data);
@@ -456,6 +463,14 @@
 				status: 7
 			}).then(response => {
 				if (response.code == 200) {
+					if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+						uni.showToast({
+							icon: 'none',
+							title: '该批次不在当前工段',
+							duration: 2000
+						})
+						return
+					}
 					if (response.data[0].productionPlanDetailId == store.planDetails.id) {
 						console.log(response.data)
 						lotDialog.value.open(response.data);

+ 70 - 43
pages/startTurnover/index.vue

@@ -61,7 +61,7 @@
 	const turnoverTask = ref(null)
 	const flag = ref(false);
 
-	onLoad(() => { 
+	onLoad(() => {
 		init();
 		uni.$once('clearListData', () => {
 			listData.value = [];
@@ -75,50 +75,77 @@
 	function HandleScanCode() {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
-		// 调用插件的 mpaasScan 方法
-		mpaasScanModule.mpaasScan({
-				// 扫码识别类型,参数可多选,qrCode、barCode,
-				// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
-				scanType: ["qrCode", "barCode"],
-				// 是否隐藏相册,默认false不隐藏
-				hideAlbum: false,
-			},
-			(ret) => {
-				let vehicleObj = JSON.parse(ret.resp_result);
-				if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
-					uni.showToast({
-						icon: "none",
-						title: "请扫载具码",
-						duration: 1000
+		if (mpaasScanModule) {
+			// 调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					let vehicleObj = JSON.parse(ret.resp_result);
+					if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
+						uni.showToast({
+							icon: "none",
+							title: "请扫载具码",
+							duration: 1000
+						})
+						return;
+					}
+					getDayworkItemByCarrierId({
+						carrierId: vehicleObj.carrierId,
+						status: 4
+					}).then(response => {
+						console.log(response)
+						for (let i = 0; i < listData.value.length; i++) {
+							if (listData.value[i].lotCode === response.data[0].lotCode) {
+								uni.showToast({
+									icon: "none",
+									title: "该批次已存在"
+								})
+								console.log("该批次已存在")
+								return;
+							}
+						}
+						for (let i = 0; i < response.data.length; i++) {
+							listData.value.push(response.data[i]);
+						}
+						for (let i = 0; i < listData.value.length; i++) {
+							listData.value[i].carriers = listData.value[i].carrierName.split('、').length;
+						}
+						console.log(listData.value);
+						init();
 					})
-					return;
 				}
-				getDayworkItemByCarrierId({
-					carrierId: vehicleObj.carrierId,
-					status: 4
-				}).then(response => {
-					console.log(response)
-					for (let i = 0; i < listData.value.length; i++) {
-						if (listData.value[i].lotCode === response.data[0].lotCode) {
-							uni.showToast({
-								icon: "none",
-								title: "该批次已存在"
-							}) 
-							console.log("该批次已存在")
-							return;
-						}
-					}
-					for (let i = 0; i < response.data.length; i++) {
-						listData.value.push(response.data[i]);
-					}
-					for (let i = 0; i < listData.value.length; i++) {
-						listData.value[i].carriers = listData.value[i].carrierName.split('、').length;
+			);
+		} else {
+			getDayworkItemByCarrierId({
+				carrierId: '1747500989324668942',
+				status: 4
+			}).then(response => {
+				console.log(response)
+				for (let i = 0; i < listData.value.length; i++) {
+					if (listData.value[i].lotCode === response.data[0].lotCode) {
+						uni.showToast({
+							icon: "none",
+							title: "该批次已存在"
+						})
+						console.log("该批次已存在")
+						return;
 					}
-					console.log(listData.value);
-					init();
-				})
-			}
-		);
+				}
+				for (let i = 0; i < response.data.length; i++) {
+					listData.value.push(response.data[i]);
+				}
+				for (let i = 0; i < listData.value.length; i++) {
+					listData.value[i].carriers = listData.value[i].carrierName.split('、').length;
+				}
+				console.log(listData.value);
+				init();
+			})
+		}
 	}
 
 	function handleStartTurnover() {
@@ -154,7 +181,7 @@
 						icon: 'none',
 						title: '该箱子绑定的所有批次已删除',
 						duration: 2000
-					}) 
+					})
 				}
 			}
 		});