guoyujia 3 bulan lalu
induk
melakukan
01f7e515ee

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
 	"name": "(测试)德迈仕数字生产管理平台",
 	"appid": "__UNI__54D8B02",
 	"description": "",
-	"versionName": "1.0.35",
-	"versionCode": 135,
+	"versionName": "1.0.37",
+	"versionCode": 137,
 	"transformPx": false,
 	/* 5+App特有相关 */
 	"app-plus": {

+ 1 - 1
pages/deliveryInspection/scan.vue

@@ -455,7 +455,7 @@
 		uni.showLoading({
 			title: '加载中'
 		});
-		getLotInfo(query.value).then(res => {
+		getDeliveryLotInfo(query.value).then(res => {
 			if (res.code == 200) {
 				console.log(res)
 

+ 132 - 81
pages/firstInspection/reviewScan.vue

@@ -56,6 +56,9 @@
 			<view class="btn uni-row" style="margin-top: 48rpx;" @click.stop="handleConfirm">确定</view>
 		</view>
 		<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
+		<dialog-processInspection ref='selectProcessInspection'
+			@handleSelectProcessInspection='handleSelectProcessInspection'></dialog-processInspection>
+
 	</view>
 </template>
 
@@ -88,104 +91,105 @@
 	const carrierCode = ref('')
 	const equipmentList = ref([])
 	const inspectionChamber = ref(null)
+	const selectProcessInspection = ref(null)
 	const userList = ref([])
 	const userId = ref(null)
 	const equipment = ref(null)
 	const lot = ref({})
 	const query = ref({})
 	const showQrCodeReader = ref(false);
-	
+
 	function onDecodeHandler(data) {
 		showQrCodeReader.value = false;
-			const result = {
-						carrierCode: data,
-						processCode: '',
-						deptId: store.curDeptDetails.deptId
-					}
-					if (!result.carrierCode || result.carrierCode == "") {
-						uni.showToast({
-							icon: "none",
-							title: "请扫载具码",
-							duration: 1000
-						})
-						return
-					}
-					//判断该箱是否绑定批次
-
-					result.processCode = store.outsourcedCode;
-					// console.log(result.processCode)
-					/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
-					getCarrierInfo(result).then(response => {
-						if (response.code == 200) {
-							// 判断是哪种返回值 假设是想信息则给lot附检查箱信息
-							// 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
-							if (response.data.dayworkCarriers != null) {
-								if (response.data.dayworkCarriers.length > 1) {
-									query.value = result;
-									selectProcessInspection.value.open(response.data.dayworkCarriers)
-								} else {
-									// console.log(response)
-									uni.showLoading({
-										title: '加载中'
-									});
-									// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
-									// 需要定义一个请求方法, 从后端获取
-									result.deptId = store.curDeptDetails.deptId
-									getFirstInspectionLotInfo(result).then(res => {
-										if (res.code == 200) {
-											console.log(res)
-											getUser(res.data.dayworkItemList)
-											getEquipment(res.data.dayworkItemList)
-											lot.value = {
-												...lot.value,
-												...res.data
-											};
-											lot.value.carrierCode = result.carrierCode
-											carrierCode.value = result.carrierCode;
-											// console.log("res", res);
-											uni.hideLoading();
-											// 判断是否批次号和检查箱码都扫完
-											checkSave()
-										} else {
-											uni.showToast({
-												icon: 'none',
-												title: res.msg,
-												duration: 2000
-											})
-										}
-									}).catch(err => {
-										uni.showToast({
-											icon: 'none',
-											title: err.message,
-											duration: 2000
-										})
-									})
-
-								}
-							} else if (response.data.inspectionCarrier != null) {
-								console.log(response)
-								lot.value.inspectionCarrierCode = response.data.inspectionCarrier.code
-								lot.value.inspectionCarrierId = response.data.inspectionCarrier.id
+		const result = {
+			carrierCode: data,
+			processCode: '',
+			deptId: store.curDeptDetails.deptId
+		}
+		if (!result.carrierCode || result.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return
+		}
+		//判断该箱是否绑定批次
+
+		result.processCode = store.outsourcedCode;
+		// console.log(result.processCode)
+		/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
+		getCarrierInfo(result).then(response => {
+			if (response.code == 200) {
+				// 判断是哪种返回值 假设是想信息则给lot附检查箱信息
+				// 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
+				if (response.data.dayworkCarriers != null) {
+					if (response.data.dayworkCarriers.length > 1) {
+						query.value = result;
+						selectProcessInspection.value.open(response.data.dayworkCarriers)
+					} else {
+						// console.log(response)
+						uni.showLoading({
+							title: '加载中'
+						});
+						// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
+						// 需要定义一个请求方法, 从后端获取
+						result.deptId = store.curDeptDetails.deptId
+						getFirstInspectionLotInfo(result).then(res => {
+							if (res.code == 200) {
+								console.log(res)
+								getUser(res.data.dayworkItemList)
+								getEquipment(res.data.dayworkItemList)
+								lot.value = {
+									...lot.value,
+									...res.data
+								};
+								lot.value.carrierCode = result.carrierCode
+								carrierCode.value = result.carrierCode;
+								// console.log("res", res);
+								uni.hideLoading();
 								// 判断是否批次号和检查箱码都扫完
 								checkSave()
+							} else {
+								uni.showToast({
+									icon: 'none',
+									title: res.msg,
+									duration: 2000
+								})
 							}
-						} else {
+						}).catch(err => {
 							uni.showToast({
 								icon: 'none',
-								title: response.msg,
+								title: err.message,
 								duration: 2000
 							})
-						}
-					}).catch(err => {
-						uni.showToast({
-							icon: 'none',
-							title: err.message,
-							duration: 2000
 						})
-					})
+
+					}
+				} else if (response.data.inspectionCarrier != null) {
+					console.log(response)
+					lot.value.inspectionCarrierCode = response.data.inspectionCarrier.code
+					lot.value.inspectionCarrierId = response.data.inspectionCarrier.id
+					// 判断是否批次号和检查箱码都扫完
+					checkSave()
+				}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: response.msg,
+					duration: 2000
+				})
+			}
+		}).catch(err => {
+			uni.showToast({
+				icon: 'none',
+				title: err.message,
+				duration: 2000
+			})
+		})
 	}
-	
-	
+
+
 	//H5扫码器关闭
 	function qrReaderClose() {
 		showQrCodeReader.value = false;
@@ -410,6 +414,53 @@
 	function handleGetEquipmentList() {
 		getEquipment(lot.value.dayworkItemList)
 	}
+	//选择批号弹窗带回
+	function handleSelectProcessInspection(data) {
+		console.log("带回", data)
+		query.value.lotCode = data
+		uni.showLoading({
+			title: '加载中'
+		});
+		getFirstInspectionLotInfo(query.value).then(res => {
+			if (res.code == 200) {
+				console.log(res)
+
+				if (res.data.dayworkItemList.length == 0) {
+					uni.showToast({
+						icon: 'none',
+						title: "该批次当天没有报工",
+						duration: 2000
+					})
+				} else {
+					console.log("888")
+					getUser(res.data.dayworkItemList)
+					getEquipment(res.data.dayworkItemList)
+					lot.value = {
+						...lot.value,
+						...res.data
+					};
+					lot.value.carrierCode = query.value.carrierCode
+					carrierCode.value = query.value.carrierCode;
+					// console.log("res", res);
+					uni.hideLoading();
+					// 判断是否批次号和检查箱码都扫完
+					checkSave()
+				}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg,
+					duration: 2000
+				})
+			}
+		}).catch(err => {
+			uni.showToast({
+				icon: 'none',
+				title: err.message,
+				duration: 2000
+			})
+		})
+	}
 
 	function getEquipment(data) {
 		const uniqueEquipmentMap = new Map();

+ 1 - 1
pages/onSiteInspection/scan.vue

@@ -465,7 +465,7 @@
 			title: '加载中'
 		});
 
-		getLotInfo(query.value).then(res => {
+		getPatrolLotInfo(query.value).then(res => {
 			if (res.code == 200) {
 				console.log(res)
 

+ 70 - 69
pages/outsourcedInspection/scan.vue

@@ -38,7 +38,7 @@
 		</view>
 		<dialog-processInspection ref='selectProcessInspection'
 			@handleSelectProcessInspection='handleSelectProcessInspection'></dialog-processInspection>
-			<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
+		<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
 	</view>
 </template>
 
@@ -77,89 +77,89 @@
 	//H5扫码器回调
 	function onDecodeHandler(data) {
 		showQrCodeReader.value = false;
-	const result = {
-				carrierCode: data,
-				processCode: ''
-			}
-			if (!result.carrierCode || result.carrierCode == "") {
-				uni.showToast({
-					icon: "none",
-					title: "请扫载具码",
-					duration: 1000
-				})
-				return
-			}
-			//判断该箱是否绑定批次
+		const result = {
+			carrierCode: data,
+			processCode: ''
+		}
+		if (!result.carrierCode || result.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return
+		}
+		//判断该箱是否绑定批次
 
-			result.processCode = store.outsourcedCode;
-			// console.log(result.processCode)
-			/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
-			getCarrierInfo(result).then(response => {
-				if (response.code == 200) {
-					// 判断是哪种返回值 假设是想信息则给lot附检查箱信息
-					// 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
-					if (response.data.dayworkCarriers != null) {
-						if (response.data.dayworkCarriers.length > 1) {
-							query.value = result;
-							selectProcessInspection.value.open(response.data.dayworkCarriers)
-						} else {
-							// console.log(response)
-							uni.showLoading({
-								title: '加载中'
-							});
-							// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
-							// 需要定义一个请求方法, 从后端获取
-							getLotOutsourcedInfo(result).then(res => {
-								if (res.code == 200) {
-									lot.value = {
-										...lot.value,
-										...res.data,
-										processNames: res.data.processList
-									};
-									lot.value.carrierCode = result.carrierCode
-									carrierCode.value = result.carrierCode;
-									// console.log("res", res);
-									uni.hideLoading();
-									checkSave()
-								} else {
-									uni.showToast({
-										icon: 'none',
-										title: res.msg,
-										duration: 2000
-									})
-								}
-							}).catch(err => {
+		result.processCode = store.outsourcedCode;
+		// console.log(result.processCode)
+		/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
+		getCarrierInfo(result).then(response => {
+			if (response.code == 200) {
+				// 判断是哪种返回值 假设是想信息则给lot附检查箱信息
+				// 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
+				if (response.data.dayworkCarriers != null) {
+					if (response.data.dayworkCarriers.length > 1) {
+						query.value = result;
+						selectProcessInspection.value.open(response.data.dayworkCarriers)
+					} else {
+						// console.log(response)
+						uni.showLoading({
+							title: '加载中'
+						});
+						// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
+						// 需要定义一个请求方法, 从后端获取
+						getLotOutsourcedInfo(result).then(res => {
+							if (res.code == 200) {
+								lot.value = {
+									...lot.value,
+									...res.data,
+									processNames: res.data.processList
+								};
+								lot.value.carrierCode = result.carrierCode
+								carrierCode.value = result.carrierCode;
+								// console.log("res", res);
+								uni.hideLoading();
+								checkSave()
+							} else {
 								uni.showToast({
 									icon: 'none',
-									title: err.message,
+									title: res.msg,
 									duration: 2000
 								})
+							}
+						}).catch(err => {
+							uni.showToast({
+								icon: 'none',
+								title: err.message,
+								duration: 2000
 							})
+						})
 
-						}
-					} else if (response.data.inspectionCarrier != null) {
-						console.log(response)
-						lot.value.inspectionCarrierCode = response.data.inspectionCarrier.code
-						lot.value.inspectionCarrierId = response.data.inspectionCarrier.id
-						checkSave()
 					}
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: response.msg,
-						duration: 2000
-					})
+				} else if (response.data.inspectionCarrier != null) {
+					console.log(response)
+					lot.value.inspectionCarrierCode = response.data.inspectionCarrier.code
+					lot.value.inspectionCarrierId = response.data.inspectionCarrier.id
+					checkSave()
 				}
-			}).catch(err => {
+			} else {
 				uni.showToast({
 					icon: 'none',
-					title: err.message,
+					title: response.msg,
 					duration: 2000
 				})
+			}
+		}).catch(err => {
+			uni.showToast({
+				icon: 'none',
+				title: err.message,
+				duration: 2000
 			})
+		})
 	}
-	
-	
+
+
 	//H5扫码器关闭
 	function qrReaderClose() {
 		showQrCodeReader.value = false;
@@ -348,6 +348,7 @@
 		getLotOutsourcedInfo(query.value).then(res => {
 			if (res.code == 200) {
 				lot.value = res.data;
+				lot.value.processNames = res.data.processList
 				console.log(res)
 				lot.value.carrierCode = query.value.carrierCode
 				carrierCode.value = query.value.carrierCode;