ezhizao_zx 1 سال پیش
والد
کامیت
c1bc01db09

+ 72 - 70
components/dialog-end-work/dialog-end-work.vue

@@ -131,7 +131,7 @@
 
 				}
 				if (specialDeptProcessList.value.includes(workInfo.value.processId)) {
-					workInfo.value.qualifiedNum = store.dayworkInfo.processQualifiedNum > 0 ?
+					workInfo.value.qualifiedNum = store.dayworkInfo.prevProcess != null ?
 						Math.max(0, store.dayworkInfo.processQualifiedNum - lotPreSumQualifiedNum.value -
 							lotPreSumReject.value) :
 						Math.max(0, store.dayworkInfo.productionQuantity - lotPreSumQualifiedNum.value -
@@ -234,93 +234,95 @@
 		// }
 	}
 
-/*
-	function handleScanCode() {
-		// 引入原生插件
-		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
-		if (mpaasScanModule) {
-		//调用插件的 mpaasScan 方法
-		mpaasScanModule.mpaasScan({
-				// 扫码识别类型,参数可多选,qrCode、barCode,
-				// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
-				scanType: ["qrCode", "barCode"],
-				// 是否隐藏相册,默认false不隐藏
-				hideAlbum: false,
-			},
-			(ret) => {
-				let vehicleObj = JSON.parse(ret.resp_result);
-				let hasInFlag = false
-				for (let i = 0; i < bindList.value.length; i++) {
-					if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
-						hasInFlag = true
-						if (!bindList.value[i].flag) {
-							endFlag.value += 1;
+	/*
+		function handleScanCode() {
+			// 引入原生插件
+			const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+			if (mpaasScanModule) {
+			//调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					let vehicleObj = JSON.parse(ret.resp_result);
+					let hasInFlag = false
+					for (let i = 0; i < bindList.value.length; i++) {
+						if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
+							hasInFlag = true
+							if (!bindList.value[i].flag) {
+								endFlag.value += 1;
+							}
+							bindList.value[i].flag = true;
 						}
-						bindList.value[i].flag = true;
+					}
+					if(!hasInFlag) {
+						uni.showToast({
+							icon: 'none',
+							title: '该批次没有绑定此箱',
+							duration: 2000
+						})
+					}
+					if (endFlag.value < bindList.value.length && hasInFlag) {
+							 setTimeout(() => {
+							    handleScanCode();
+							  }, 700);
 					}
 				}
-				if(!hasInFlag) {
-					uni.showToast({
-						icon: 'none',
-						title: '该批次没有绑定此箱',
-						duration: 2000
-					})
-				}
-				if (endFlag.value < bindList.value.length && hasInFlag) {
-						 setTimeout(() => {
-						    handleScanCode();
-						  }, 700);
-				}
+			);
 			}
-		);
 		}
-	}
-*/
+	*/
 
 	function handleScanCode() {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
 		if (mpaasScanModule) {
-		//调用插件的 mpaasScan 方法
-		mpaasScanModule.mpaasScan({
-				// 扫码识别类型,参数可多选,qrCode、barCode,
-				// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
-				scanType: ["qrCode", "barCode"],
-				// 是否隐藏相册,默认false不隐藏
-				hideAlbum: false,
-			},
-			(ret) => {
-				let vehicleObj = {carrierCode: ret.resp_result};
-				let hasInFlag = false
-				for (let i = 0; i < bindList.value.length; i++) {
-					if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
-						hasInFlag = true
-						if (!bindList.value[i].flag) {
-							endFlag.value += 1;
+			//调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					let vehicleObj = {
+						carrierCode: ret.resp_result
+					};
+					let hasInFlag = false
+					for (let i = 0; i < bindList.value.length; i++) {
+						if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
+							hasInFlag = true
+							if (!bindList.value[i].flag) {
+								endFlag.value += 1;
+							}
+							bindList.value[i].flag = true;
 						}
-						bindList.value[i].flag = true;
+					}
+					if (!hasInFlag) {
+						uni.showToast({
+							icon: 'none',
+							title: '该批次没有绑定此箱',
+							duration: 2000
+						})
+					}
+					if (endFlag.value < bindList.value.length && hasInFlag) {
+						setTimeout(() => {
+							handleScanCode();
+						}, 700);
 					}
 				}
-				if(!hasInFlag) {
-					uni.showToast({
-						icon: 'none',
-						title: '该批次没有绑定此箱',
-						duration: 2000
-					})
-				}
-				if (endFlag.value < bindList.value.length && hasInFlag) {
-						 setTimeout(() => {
-						    handleScanCode();
-						  }, 700);
-				}
-			}
-		);
+			);
 		}
 	}
 
 	function handlePreFinishReporting() {
 		//投产数
-		let number = store.dayworkInfo.processQualifiedNum == 0 ? store.dayworkInfo.productionQuantity : store.dayworkInfo
+		let number = store.dayworkInfo.prevProcess == null ? store.dayworkInfo.productionQuantity : store.dayworkInfo
 			.processQualifiedNum;
 		workInfo.value.prodNum = number
 

+ 17 - 16
pages/batchReporting/index.vue

@@ -291,7 +291,7 @@
 		getDayWorkList(reqData).then(res => {
 			if (res.code == 200) {
 				tempList.value = res.data
-				console.log(res)
+				// console.log(res)
 				if (normalStatus.value) {
 					listData.value = res.data.filter(item => {
 						return item.isWasteRecycling == 0 && item.isAmend == 0;
@@ -301,21 +301,22 @@
 						return item.isWasteRecycling == 1 || item.isAmend == 1;
 					})
 				}
-				for (let i = 0; i < listData.value.length; i++) {
-					if (listData.value[i].prevProcess) {
-						let sum = 0;
-						for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
-							if (listData.value[i].dayworkItemList[j].processId == listData.value[i]
-								.prevProcess
-								.id && (listData.value[i].dayworkItemList[j].status == 2 || listData
-									.value[i]
-									.dayworkItemList[j].status == 3)) {
-								sum += listData.value[i].dayworkItemList[j].qualifiedNum;
-							}
-						}
-						listData.value[i].processQualifiedNum = sum;
-					}
-				}
+				// 20240614 分批投产数量不按照上到序的完成数量来。
+				// for (let i = 0; i < listData.value.length; i++) {
+				// 	if (listData.value[i].prevProcess) {
+				// 		let sum = 0;
+				// 		for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
+				// 			if (listData.value[i].dayworkItemList[j].processId == listData.value[i]
+				// 				.prevProcess
+				// 				.id && (listData.value[i].dayworkItemList[j].status == 2 || listData
+				// 					.value[i]
+				// 					.dayworkItemList[j].status == 3)) {
+				// 				sum += listData.value[i].dayworkItemList[j].qualifiedNum;
+				// 			}
+				// 		}
+				// 		listData.value[i].processQualifiedNum = sum;
+				// 	}
+				// }
 			}
 
 			uni.hideLoading();

+ 84 - 81
pages/fastProductionPlan/index.vue

@@ -162,103 +162,103 @@
 		keyword.value = input
 		handleChangeWorkshop(workshopId.value)
 	}
-/*  【原有代码】
-	function handleAdd() {
-		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
-		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;
-					}
-					getDayworkByCarrierId({
-						carrierId: vehicleObj.carrierId,
-						deptId: store.curDeptDetails.deptId,
-						status: 7
-					}).then(response => {
-						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);
+	/*  【原有代码】
+		function handleAdd() {
+			const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+			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;
+						}
+						getDayworkByCarrierId({
+							carrierId: vehicleObj.carrierId,
+							deptId: store.curDeptDetails.deptId,
+							status: 7
+						}).then(response => {
+							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: '该批次不在此计划单内, 或不在当前工段',
+										duration: 2000
+									})
+								}
 							} else {
 								uni.showToast({
 									icon: 'none',
-									title: '该批次不在此计划单内, 或不在当前工段',
+									title: response.msg,
 									duration: 2000
 								})
 							}
+						})
+					}
+				);
+			} else {
+				// 测试时用
+				getDayworkByCarrierId({
+					carrierId: '1747500987688890381',
+					status: 7,
+					deptId: store.curDeptDetails.deptId,
+				}).then(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: response.msg,
+								title: '该批次不在此计划单内, 或不在当前工段',
 								duration: 2000
 							})
 						}
-					})
-				}
-			);
-		} else {
-			// 测试时用
-			getDayworkByCarrierId({
-				carrierId: '1747500987688890381',
-				status: 7,
-				deptId: store.curDeptDetails.deptId,
-			}).then(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: response.msg,
 							duration: 2000
 						})
 					}
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: response.msg,
-						duration: 2000
-					})
-				}
-			})
+				})
+			}
+			// lotReporting.value.open(data);
 		}
-		// lotReporting.value.open(data);
-	}
-*/
+	*/
 
 	function handleAdd() {
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
@@ -272,7 +272,9 @@
 					hideAlbum: false,
 				},
 				(ret) => {
-					let vehicleObj = {carrierCode: ret.resp_result};
+					let vehicleObj = {
+						carrierCode: ret.resp_result
+					};
 					if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
 						uni.showToast({
 							icon: "none",
@@ -308,7 +310,7 @@
 			);
 		} else {
 			// 测试时用
-			getDayworkByCarrierId({
+			getDayworkByCarrierCode({
 				carrierId: '1747500987688890381',
 				status: 7,
 				deptId: store.curDeptDetails.deptId,
@@ -370,7 +372,8 @@
 		// console.log(workshop)
 		// 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) || v.carrierName.includes(keyword.value)))
+			.includes(keyword.value) || v.productDescription.includes(keyword.value) || v.carrierName.includes(
+				keyword.value)))
 		selection.value = []
 	}
 

+ 30 - 2
pages/outsourcedInspection/scan.vue

@@ -120,7 +120,7 @@
 		}
 	}
 	*/
-	
+
 	const handleScanCode = () => {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
@@ -148,7 +148,7 @@
 						return
 					}
 					//判断该箱是否绑定批次
-	
+
 					result.processCode = store.outsourcedCode;
 					/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
 					getLotOutsourcedInfo(result).then(resqust => {
@@ -176,6 +176,34 @@
 					})
 				}
 			)
+		} else {
+			const result = {
+				carrierCode: '000657',
+				processCode: store.outsourcedCode
+			}
+			getLotOutsourcedInfo(result).then(resqust => {
+				if (resqust.code == 200) {
+					lot.value = resqust.data;
+					lot.value.carrierCode = result.carrierCode
+					carrierCode.value = result.carrierCode;
+					// store.processInspection = null;
+					console.log("resqust", resqust);
+					uni.hideLoading();
+				} else {
+					// uni.hideLoading();
+					uni.showToast({
+						icon: 'none',
+						title: resqust.msg,
+						duration: 2000
+					})
+				}
+			}).catch(err => {
+				uni.showToast({
+					icon: 'none',
+					title: err.message,
+					duration: 2000
+				})
+			})
 		}
 	}
 

+ 111 - 1
pages/processInspection/scan.vue

@@ -210,7 +210,9 @@
 				},
 				(ret) => {
 					console.log(ret);
-					const result = {carrierCode: ret.resp_result};
+					const result = {
+						carrierCode: ret.resp_result
+					};
 					if (!result.carrierCode || result.carrierCode == "") {
 						uni.showToast({
 							icon: "none",
@@ -305,6 +307,62 @@
 	const handleConfirm = () => {
 		if (lot.carrierCode || carrierCode.value !== "") {
 			lot.value.carrierCode = carrierCode.value
+			const result = {
+				...lot.value
+			}
+			if (lot.value.lotCode == "" || lot.value.lotCode == null || lot.value.carrierCode != carrierCode.value) {
+				getCarrierInfo(result).then(resqust => {
+					if (resqust.code == 200) {
+						//返回数据大于一条,跳转选择批次弹窗
+						if (resqust.data.length > 1) {
+							query.value = result;
+							console.log("查询箱号信息", resqust)
+							selectProcessInspection.value.open(resqust.data)
+						} else {
+							uni.showLoading({
+								title: '加载中'
+							});
+							// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
+							// 需要定义一个请求方法, 从后端获取
+							getLotInfo(result).then(res => {
+								if (res.code == 200) {
+									lot.value = res.data;
+									lot.value.carrierCode = result.carrierCode
+									carrierCode.value = result.carrierCode;
+									console.log("res", res);
+									uni.hideLoading();
+								} else {
+									uni.showToast({
+										icon: 'none',
+										title: res.msg,
+										duration: 2000
+									})
+								}
+							}).catch(err => {
+								uni.showToast({
+									icon: 'none',
+									title: err.message,
+									duration: 2000
+								})
+							})
+
+						}
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: resqust.msg,
+							duration: 2000
+						})
+					}
+				}).catch(err => {
+					uni.showToast({
+						icon: 'none',
+						title: err.message,
+						duration: 2000
+					})
+				})
+				return
+			}
 			uni.showLoading({
 				title: '加载中'
 			});
@@ -334,6 +392,58 @@
 				}
 			})
 
+			// console.log(result)
+			// getCarrierInfo(result).then(resqust => {
+			// 	if (resqust.code == 200) {
+			// 		//返回数据大于一条,跳转选择批次弹窗
+			// 		if (resqust.data.length > 1) {
+			// 			query.value = result;
+			// 			console.log("查询箱号信息", resqust)
+			// 			selectProcessInspection.value.open(resqust.data)
+			// 		} else {
+			// 			uni.showLoading({
+			// 				title: '加载中'
+			// 			});
+			// 			// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
+			// 			// 需要定义一个请求方法, 从后端获取
+			// 			getLotInfo(result).then(res => {
+			// 				if (res.code == 200) {
+			// 					lot.value = res.data;
+			// 					lot.value.carrierCode = result.carrierCode
+			// 					carrierCode.value = result.carrierCode;
+			// 					console.log("res", res);
+			// 					uni.hideLoading();
+			// 				} else {
+			// 					uni.showToast({
+			// 						icon: 'none',
+			// 						title: res.msg,
+			// 						duration: 2000
+			// 					})
+			// 				}
+			// 			}).catch(err => {
+			// 				uni.showToast({
+			// 					icon: 'none',
+			// 					title: err.message,
+			// 					duration: 2000
+			// 				})
+			// 			})
+
+			// 		}
+			// 	} else {
+			// 		uni.showToast({
+			// 			icon: 'none',
+			// 			title: resqust.msg,
+			// 			duration: 2000
+			// 		})
+			// 	}
+			// }).catch(err => {
+			// 	uni.showToast({
+			// 		icon: 'none',
+			// 		title: err.message,
+			// 		duration: 2000
+			// 	})
+			// })
+
 		} else {
 			uni.showToast({
 				icon: 'none',

+ 3 - 3
pages/reportingForWork/index.vue

@@ -45,7 +45,7 @@
 				<view class="item-info uni-row">
 					<text class="label">投入数</text>
 					<text
-						class="label right">{{store.dayworkInfo['processQualifiedNum'] == 0 ?  store.dayworkInfo['productionQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
+						class="label right">{{store.dayworkInfo.prevProcess == null ?  store.dayworkInfo['productionQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">设备</text>
@@ -329,7 +329,7 @@
 				productionPlanId: curPlan.value.productionPlanId,
 				productionPlanDetailId: curPlan.value.id,
 				technologicalProcessId: dayWorkInfo.value.technologicalProcessId,
-				prodNum: store.dayworkInfo['processQualifiedNum'] == 0 ?
+				prodNum: store.dayworkInfo.prevProcess == null ?
 					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
 						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
 				deptId: store.curDeptDetails.deptId,
@@ -343,7 +343,7 @@
 				productionPlanId: curPlan.value.productionPlanId,
 				productionPlanDetailId: curPlan.value.id,
 				technologicalProcessId: dayWorkInfo.value.technologicalProcessId,
-				prodNum: store.dayworkInfo['processQualifiedNum'] == 0 ?
+				prodNum: store.dayworkInfo.prevProcess == null ?
 					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
 						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
 				status: 1,

+ 1 - 1
pages/sortBatchReporting/index.vue

@@ -62,7 +62,7 @@
 				<view class="item-info uni-row">
 					<text class="label">投入数</text>
 					<text
-						class="label right">{{item['processQualifiedNum'] == 0 ?  item['productionQuantity']  : item['processQualifiedNum']}}</text>
+						class="label right">{{item.prevProcess == null ?  item['productionQuantity']  : item['processQualifiedNum']}}</text>
 				</view>
 				<view class="item-info uni-row">
 					<text class="label">上道工序</text>