guoyujia 9 ماه پیش
والد
کامیت
d6a48ed0eb

+ 7 - 0
api/business/processInspection.js

@@ -242,6 +242,13 @@ export function getDeliveryLotInfo(data) {
 		data: data
 	})
 }
+export function getPatrolLotInfo(data) {
+	return req.request({
+		url: '/business/inspecion/getPatrolLotInfo',
+		method: 'post',
+		data: data
+	})
+}
 export function getLotInfoByFirstInspection(data) {
 	return req.request({
 		url: '/business/inspecion/getLotInfoByFirstInspection',

+ 0 - 7
pages/dashboard/index.vue

@@ -554,15 +554,8 @@
 	}
 	//仪器室
 	function handleToInstrumentInspection() {
-		if (curSelectedDeptId.value) {
 			//选择仪器室
 			inspectionChanberRef.value.open()
-		} else {
-			uni.showToast({
-				icon: "none",
-				title: "请选择工段"
-			})
-		}
 		
 	}
 	function handleSelectInspectionChamber(data) {

+ 17 - 7
pages/firstInspection/scan.vue

@@ -134,7 +134,7 @@
 				if (res.data.dayworkItemList.length == 0) {
 					uni.showToast({
 						icon: 'none',
-						title: "该批次当前操作者没有报工",
+						title: "该批次今日没有报工",
 						duration: 2000
 					})
 				} else {
@@ -229,7 +229,7 @@
 			const result = {
 				dayworkId: store.dayworkInfo.id,
 				deptId: store.curDeptDetails.deptId,
-				carrierCode: '100023'
+				carrierCode: '000493'
 			}
 			getFirstCarrierInfo(result).then(response => {
 				if (response.code == 200) {
@@ -265,12 +265,22 @@
 	}
 
 	function getEquipment(data) {
-		equipmentList.value = data.map(item => {
-			return {
-				value: item.equipmentDetailId,
-				text: item.equipmentDetailCode
-			};
+		const uniqueEquipmentMap = new Map();
+		let filterList = data.filter(info => info.userId == store.userInfo.userId)
+		console.log(filterList)
+		filterList.forEach(item => {
+		  // 检查 Map 中是否已经有这个 equimentDetailId
+		  if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
+		    // 如果没有,添加到 Map 中
+		    uniqueEquipmentMap.set(item.equipmentDetailId, {
+		      value: item.equipmentDetailId,
+		      text: item.equipmentDetailCode
+		    });
+		  }
 		});
+		// 将 Map 的值转换为数组
+		equipmentList.value = Array.from(uniqueEquipmentMap.values());
+		equipment.value = equipmentList.value[0].value
 		if (equipmentList.value.length > 0) {
 			equipment.value = equipmentList.value[0].value
 		}

+ 1 - 1
pages/instrumentRoomInspection/index.vue

@@ -137,7 +137,7 @@
 			title: '加载中'
 		});
 		quer.value.startTime = startTime.value;
-		quer.value.deptId = store.curDeptDetails.deptId
+		// quer.value.deptId = store.curDeptDetails.deptId
 		quer.value.type = "instrumentRoomInspection"
 		getProcessInspecionList(quer.value).then(res => {
 			console.log("res", res);

+ 4 - 6
pages/onSiteInspection/scan.vue

@@ -72,7 +72,7 @@
 		onShow
 	} from '@dcloudio/uni-app'
 	import {
-		getLotInfo,
+		getPatrolLotInfo,
 		getCarrierInfoProcess,
 		getCarrierInfo,
 	} from '@/api/business/processInspection.js'
@@ -142,7 +142,7 @@
 									// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
 									// 需要定义一个请求方法, 从后端获取
 									result.deptId = store.curDeptDetails.deptId
-									getLotInfo(result).then(res => {
+									getPatrolLotInfo(result).then(res => {
 										if (res.code == 200) {
 											console.log(res)
 											
@@ -207,7 +207,7 @@
 			)
 		} else {
 			const result = {
-				carrierCode: '000391',
+				carrierCode: '000493',
 				deptId : store.curDeptDetails.deptId
 			}
 			getCarrierInfo(result).then(response => {
@@ -229,7 +229,7 @@
 							// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
 							// 需要定义一个请求方法, 从后端获取
 							
-							getLotInfo(result).then(res => {
+							getPatrolLotInfo(result).then(res => {
 								if (res.code == 200) {
 									console.log(res)
 									
@@ -326,8 +326,6 @@
 		// 将 Map 的值转换为数组
 		equipmentList.value = Array.from(uniqueEquipmentMap.values());
 		equipment.value = equipmentList.value[0].value
-		console.log(equipmentList.value)
-		console.log(equipmentList.value)
 	}
 	function getUser(data) {