ezhizao_zx 1 жил өмнө
parent
commit
57583fc50d

+ 8 - 4
components/dialog-lot/dialog-lot.vue

@@ -103,11 +103,13 @@
 				for (let i = 0; i < filteredData.length; i++) {
 					processList.value[i] = {
 						text: filteredData[i].processAlias,
-						value: filteredData[i].id
+						value: filteredData[i].technologicalProcessDetailId,
+						processId: filteredData[i].id
 					}
 				}
-				// selectedProcess.value = filteredData[0].processId;
+				selectedProcess.value = filteredData[0].technologicalProcessDetailId;
 			}
+			// console.log(selectedProcess.value)
 		})
 	}
 
@@ -118,9 +120,11 @@
 	function handleConfirm() {
 		// 添加选择的工序
 		for (let i = 0; i < selection.value.length; i++) {
-			selection.value[i].daywork.processId = selectedProcess.value;
+			selection.value[i].daywork.technologicalProcessDetailId = selectedProcess.value;
+			selection.value[i].daywork.processId = processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ? processList.value.find(v => v.value === selectedProcess.value).processId : null
+			console.log(processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ? processList.value.find(v => v.value === selectedProcess.value).processId : null)
 		}
-		console.log(selection.value)
+		// console.log(selection.value)
 		// 执行确认
 		if (selectedProcess.value && selection.value.length > 0) {
 			close();

+ 1 - 1
components/dialog-selectInviteUser/dialog-selectInviteUser.vue

@@ -158,7 +158,7 @@
 							inviteUser.commonName = selectedUserList.value[i].nickName
 							inviteUser.protemDayworkId = store.dayworkInfo.id
 							inviteUser.protemProcessId = itemList.value[0].processId
-							inviteUser.technologicalProcessDetailId = itemList.value[0].technologicalProcessDetail.id
+							inviteUser.technologicalProcessDetailId = itemList.value[0].technologicalProcessDetailId
 							inviteUserList.push(inviteUser)
 						}
 						console.log(inviteUserList)

+ 65 - 35
pages/batchReporting/index.vue

@@ -303,53 +303,83 @@
 	function handleScanCode() {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
-		// 调用插件的 mpaasScan 方法
-		mpaasScanModule.mpaasScan({
-				// 扫码识别类型,参数可多选,qrCode、barCode,
-				// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
-				scanType: ["qrCode", "barCode"],
-				// 是否隐藏相册,默认false不隐藏
-				hideAlbum: false,
-			},
-			(ret) => {
-				console.log(ret);
-				let vehicleObj = JSON.parse(ret.resp_result);
-				if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
-					uni.showToast({
-						icon: "none",
-						title: "请扫载具码",
-						duration: 1000
-					})
-					return;
-				}
-				showDaywork({
-					carrierId: vehicleObj.carrierId,
-					status: 7
-				}).then(response => {
-					if (response.code == 200) {
-						console.log(response)
-						console.log(response.data[0].productionPlanDetailId)
-						console.log(store.planDetails.id)
-						if (response.data[0].productionPlanDetailId == store.planDetails.id) {
-							console.log(response.data)
-							lotDialog.value.open(response.data);
+		if (mpaasScanModule) {
+			// 调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					console.log(ret);
+					let vehicleObj = JSON.parse(ret.resp_result);
+					if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
+						uni.showToast({
+							icon: "none",
+							title: "请扫载具码",
+							duration: 1000
+						})
+						return;
+					}
+					showDaywork({
+						carrierId: vehicleObj.carrierId,
+						status: 7
+					}).then(response => {
+						if (response.code == 200) {
+							console.log(response)
+							console.log(response.data[0].productionPlanDetailId)
+							console.log(store.planDetails.id)
+							if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+								console.log(response.data)
+								lotDialog.value.open(response.data);
+							} else {
+								uni.showToast({
+									icon: 'none',
+									title: '该批次不在此计划单内',
+									duration: 2000
+								})
+							}
 						} else {
 							uni.showToast({
 								icon: 'none',
-								title: '该批次不在此计划单内',
+								title: response.msg,
 								duration: 2000
 							})
 						}
+					})
+				}
+			);
+		} else {
+			// 测试时用
+			showDaywork({
+				carrierId: '1770342949110988804',
+				status: 7
+			}).then(response => {
+				if (response.code == 200) {
+					console.log(response)
+					console.log(response.data[0].productionPlanDetailId)
+					console.log(store.planDetails.id)
+					if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+						console.log(response.data)
+						lotDialog.value.open(response.data);
 					} else {
 						uni.showToast({
 							icon: 'none',
-							title: response.msg,
+							title: '该批次不在此计划单内',
 							duration: 2000
 						})
 					}
-				})
-			}
-		);
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: response.msg,
+						duration: 2000
+					})
+				}
+			})
+		}
 	}
 
 	function handleAddDaywork(data) {