m0_70156489 2 days ago
parent
commit
f47a32aff1

+ 5 - 40
src/view/performance/WorkScoreReporting/WorkReportEntry.vue

@@ -19,7 +19,6 @@
 <script setup>
 import { ref, onMounted } from 'vue'
 import { useRouter } from 'vue-router'
-import { ElMessage } from 'element-plus'
 import { getMachineMac } from '@/api/jixiaoguanli/jitairibaobiao'
 
 defineOptions({ name: 'WorkReportEntry' })
@@ -27,19 +26,6 @@ defineOptions({ name: 'WorkReportEntry' })
 const router = useRouter()
 const Machine = ref('')
 const process = ref('')
-const MACHINE_TIP = '未获取到机台编号,重启电脑或重新打开系统尝试'
-
-/** 机台提示:黄色缩小弹窗(进页后由各报工页再判;入口仅在无法确定跳转时提示) */
-const machineTip = (text = MACHINE_TIP) => {
-  ElMessage.closeAll()
-  ElMessage({
-    type: '',
-    dangerouslyUseHTMLString: true,
-    duration: 4000,
-    message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${text}</strong>`,
-    customClass: 'custom-warning-message',
-  })
-}
 
 // 物理地址获取机台编号和工序(仅用于产量报工跳转路由,失败不在此页弹错)
 const getMachineMacdata = async () => {
@@ -102,14 +88,12 @@ const routeMap = {
   包装: '/layout/baogong/baozhuangbaogong',
 }
 
-// 产量报工:能识别工序就进入对应页(进页后再判断机台并提示);识别不了才在入口提示
+/** 机台未识别时的产量报工默认页(进页后再提示机台) */
+const DEFAULT_YIELD_ROUTE = '/layout/baogong/chafengbaogong'
+
+// 产量报工:始终可点进去;有工序进对应页,没有则进默认页,由目标页判断机台并提示
 const navigateToReporting = () => {
-  const route = routeMap[process.value]
-  if (route) {
-    router.push(route)
-    return
-  }
-  machineTip()
+  router.push(routeMap[process.value] || DEFAULT_YIELD_ROUTE)
 }
 
 // 工分报工:直接进入,由工分页判断机台并提示
@@ -206,22 +190,3 @@ onMounted(() => {
   }
 }
 </style>
-
-<style>
-.custom-warning-message {
-  background: transparent !important;
-  border: none !important;
-  box-shadow: none !important;
-  padding: 0 !important;
-}
-.custom-warning-message .el-message__content {
-  padding: 0 !important;
-  line-height: 1 !important;
-}
-.custom-warning-message .el-message__icon {
-  display: none !important;
-}
-.custom-warning-message .el-message__closeBtn {
-  display: none !important;
-}
-</style>

+ 12 - 7
src/view/performance/WorkScoreReporting/gongfenbaogong.vue

@@ -697,7 +697,6 @@ const getMachineMacdata = async () => {
       add_formData['组别'] = ''
       add_formData['人员'] = ''
       employees.value = []
-      machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
       return
     }
     add_formData['机台号'] = data.data['机台号']
@@ -721,7 +720,6 @@ const getMachineMacdata = async () => {
     add_formData['组别'] = ''
     add_formData['人员'] = ''
     employees.value = []
-    machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
   }
 }
 
@@ -937,7 +935,6 @@ const openWorkScoreDialog = async () => {
   }
   const machineNo = String(add_formData['机台号'] || '').trim()
   if (!machineReady.value || !machineNo) {
-    machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
     return
   }
 
@@ -1576,12 +1573,10 @@ const GetAddr =  () => {
       getMachineMacdata(Machine.value)
     } else if (xmlhttp.readyState == 4) {
       machineReady.value = false
-      machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
     }
   }
   xmlhttp.onerror = function() {
     machineReady.value = false
-    machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
   }
   // 3. 打开一个连接
   xmlhttp.open("get", "http://127.0.0.1:8090/init")
@@ -1682,6 +1677,11 @@ const add_onSubmit = async ()=>{
     warningres('请先关闭工分报工窗口后再查询其他订单,避免报错单')
     return
   }
+  const machineNo = String(add_formData['机台号'] || '').trim()
+  if (!machineReady.value || !machineNo || machineNo === '测试机台') {
+    machineTip()
+    return
+  }
   const searchKey = normalizeOrderSearchInput(add_searchInfo.value)
   if (!searchKey) {
     warningres('请扫描订单二维码')
@@ -2105,7 +2105,7 @@ const warningres = (arr) => {
     });
 }
 
-/** 机台相关:黄色弹窗缩小版 */
+/** 机台相关:黄色弹窗缩小版,略往下避开顶栏 */
 const machineTip = (text) => {
   const tip = text || '未获取到机台编号,重启电脑或重新打开系统尝试'
   ElMessage.closeAll()
@@ -2113,8 +2113,9 @@ const machineTip = (text) => {
     type: '',
     dangerouslyUseHTMLString: true,
     duration: 4000,
+    offset: 110,
     message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${tip}</strong>`,
-    customClass: 'custom-warning-message',
+    customClass: 'custom-warning-message machine-tip-msg',
   })
 }
 </script>
@@ -3304,6 +3305,10 @@ const machineTip = (text) => {
 .custom-warning-message .el-message__closeBtn {
   display: none !important;
 }
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
 
 .gy-detail-filter-popper {
   z-index: 10050 !important;

+ 67 - 17
src/view/performance/baozhuangbaogong.vue

@@ -601,6 +601,7 @@ const currentDates = `${year}-${month}-${day}`;
 const _code = '包装'
 //全局接口接受的物理地址
 const Machine = ref('')
+const machineReady = ref(false)
 //全局获取UniqId
 const UniqId = ref('')
 
@@ -610,17 +611,15 @@ const getMachineMacdata = async () => {
 	try {
 		const data = await getMachineMac({sys_sbID: Machine.value});
 		if (data.data === null) {
-			// ElMessage({
-			// 	type: 'error',
-			// 	message: '未获取到机台编号请确认MAC地址或与管理员联系'
-			// })
-			add_formData['机台号'] = '测试机台'
-			add_formData['工序'] = _code
-			add_formData['组别'] = "测试"
-			add_formData['人员'] = "测试"
-			return;
-		} else {
-			add_formData['机台号'] = data.data['机台号']
+		machineReady.value = false
+		add_formData['机台号'] = ''
+		add_formData['工序'] = ''
+		add_formData['组别'] = ''
+		add_formData['人员'] = ''
+		return;
+	} else {
+			machineReady.value = true
+	add_formData['机台号'] = data.data['机台号']
 			add_formData['工序'] = data.data['生产工序']
 			add_formData['工序名称'] = data.data['生产工序']
 			add_formData['组别'] = data.data['组别']
@@ -633,8 +632,13 @@ const getMachineMacdata = async () => {
 			}, 100); // 延迟100毫秒
 		}
 	} catch (error) {
-		console.error(error)
-	}
+    console.error(error)
+    machineReady.value = false
+    add_formData['机台号'] = ''
+    add_formData['工序'] = ''
+    add_formData['组别'] = ''
+    add_formData['人员'] = ''
+  }
 }
 //自动获取物理地址
 const GetAddr = () => {
@@ -800,6 +804,12 @@ const selectedOrder = ref(''); // 选中的订单
 
 //查询按钮
 const add_onSubmit = async() => {
+  const machineNo = String(add_formData['机台号'] || '').trim()
+    if (!machineReady.value || !machineNo || machineNo === '测试机台') {
+      machineTip()
+      return
+    }
+  
 	if(add_formData['机台号'] === ''){
 		warningres('未获取到机台')
 		return false;
@@ -1087,10 +1097,11 @@ const add_Dialog = async () => {
         isClickable = true;
     }, 2000);
 
-		if(add_formData['机台号'] === '测试机台'){
-			warningres('测试机台禁止报工')
-			return;
-		}
+		const _machineNo = String(add_formData['机台号'] || '').trim()
+	if (!machineReady.value || !_machineNo || _machineNo === '测试机台') {
+		machineTip()
+		return
+	}
 		sizeDatas.length = 0;
 		add_tableData.length = 0;
 		// console.log(_serial.value)
@@ -1540,6 +1551,22 @@ const warningres = (arr) => {
         customClass: 'custom-warning-message'
     });
 }
+
+
+/** 机台未获取统一黄字提示(查询时) */
+const machineTip = (text) => {
+  const tip = text || '未获取到机台编号,重启电脑或重新打开系统尝试'
+  ElMessage.closeAll()
+  ElMessage({
+    type: '',
+    dangerouslyUseHTMLString: true,
+    duration: 4000,
+    offset: 110,
+    message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${tip}</strong>`,
+    customClass: 'custom-warning-message machine-tip-msg',
+  })
+}
+
 </script>
 <style scoped>
 	:deep(.el-table__body .status-plan-usage-low) {
@@ -2088,3 +2115,26 @@ const warningres = (arr) => {
 	  font-weight: bold;
 	}
 </style>
+
+<style>
+.custom-warning-message {
+  background: transparent !important;
+  border: none !important;
+  box-shadow: none !important;
+  padding: 0 !important;
+}
+.custom-warning-message .el-message__content {
+  padding: 0 !important;
+  line-height: 1 !important;
+}
+.custom-warning-message .el-message__icon {
+  display: none !important;
+}
+.custom-warning-message .el-message__closeBtn {
+  display: none !important;
+}
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
+</style>

+ 61 - 11
src/view/performance/caiqiebaogong.vue

@@ -344,6 +344,7 @@ const add_searchInfo = ref('')
 const _code = '裁剪'
 //全局接口接受的物理地址
 const Machine = ref('')
+const machineReady = ref(false)
 //全局获取UniqId
 const UniqId = ref('')
 
@@ -352,16 +353,14 @@ const getMachineMacdata = async () => {
   try {
     const data  = await getMachineMac({sys_sbID:Machine.value});
 	if (data.data === null) {
-		// ElMessage({
-		// 	type: 'error',
-		// 	message: '未获取到机台编号请确认MAC地址或与管理员联系'
-		// })
-		add_formData['机台号'] = '测试机台'
-		add_formData['工序'] = _code
-		add_formData['组别'] = "测试"
-		add_formData['人员'] = "测试"
+		machineReady.value = false
+		add_formData['机台号'] = ''
+		add_formData['工序'] = ''
+		add_formData['组别'] = ''
+		add_formData['人员'] = ''
 		return;
 	}
+	machineReady.value = true
 	add_formData['机台号'] = data.data['机台号']
 	add_formData['工序'] = data.data['生产工序']
 	add_formData['组别'] = data.data['组别']
@@ -374,6 +373,11 @@ const getMachineMacdata = async () => {
 	}, 100); // 延迟100毫秒
   } catch (error) {
     console.error(error)
+    machineReady.value = false
+    add_formData['机台号'] = ''
+    add_formData['工序'] = ''
+    add_formData['组别'] = ''
+    add_formData['人员'] = ''
   }
 }
 //自动获取物理地址
@@ -506,6 +510,12 @@ const _list = ref('');
 
 //查询
 const add_onSubmit = async ()=>{
+  const machineNo = String(add_formData['机台号'] || '').trim()
+    if (!machineReady.value || !machineNo || machineNo === '测试机台') {
+      machineTip()
+      return
+    }
+  
   if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
 	const WorkListdata = [];
 	// add_tableData.splice(0,add_tableData.length,...WorkListdata);
@@ -653,9 +663,10 @@ const add_Dialog = async () => {
     }, 2000);
 
 
-	if(add_formData['机台号'] === '测试机台'){
-		warningres('测试机台禁止报工')
-		return;
+	const _machineNo = String(add_formData['机台号'] || '').trim()
+	if (!machineReady.value || !_machineNo || _machineNo === '测试机台') {
+		machineTip()
+		return
 	}
 	if (!add_formData['机台号']) {
 		warningres('未获取到机台')
@@ -904,6 +915,22 @@ const warningres = (arr) => {
         customClass: 'custom-warning-message'
     });
 }
+
+
+/** 机台未获取统一黄字提示(查询时) */
+const machineTip = (text) => {
+  const tip = text || '未获取到机台编号,重启电脑或重新打开系统尝试'
+  ElMessage.closeAll()
+  ElMessage({
+    type: '',
+    dangerouslyUseHTMLString: true,
+    duration: 4000,
+    offset: 110,
+    message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${tip}</strong>`,
+    customClass: 'custom-warning-message machine-tip-msg',
+  })
+}
+
 </script>
 
 <style scoped>
@@ -1211,3 +1238,26 @@ const warningres = (arr) => {
 }
 
 </style>
+
+<style>
+.custom-warning-message {
+  background: transparent !important;
+  border: none !important;
+  box-shadow: none !important;
+  padding: 0 !important;
+}
+.custom-warning-message .el-message__content {
+  padding: 0 !important;
+  line-height: 1 !important;
+}
+.custom-warning-message .el-message__icon {
+  display: none !important;
+}
+.custom-warning-message .el-message__closeBtn {
+  display: none !important;
+}
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
+</style>

+ 6 - 5
src/view/performance/chafengbaogong.vue

@@ -469,7 +469,6 @@ const UniqId = ref('')
 				add_formData['工序名称'] = ''
 				add_formData['组别'] = ''
 				add_formData['人员'] = ''
-				machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
 				return;
 			} else {
 				add_formData['机台号'] = data.data['机台号']
@@ -493,7 +492,6 @@ const UniqId = ref('')
 			add_formData['工序名称'] = ''
 			add_formData['组别'] = ''
 			add_formData['人员'] = ''
-			machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
 		}
 	}
 	//自动获取物理地址
@@ -520,12 +518,10 @@ const UniqId = ref('')
 				getMachineMacdata(Machine.value)
 			} else if (xmlhttp.readyState == 4) {
 				machineReady.value = false
-				machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
 			}
 		}
 		xmlhttp.onerror = function() {
 			machineReady.value = false
-			machineTip('未获取到机台编号,重启电脑或重新打开系统尝试')
 		}
 		// 3. 打开一个连接
 		xmlhttp.open("get", "http://127.0.0.1:8090/init")
@@ -1242,8 +1238,9 @@ const machineTip = (msg) => {
     type: '',
     dangerouslyUseHTMLString: true,
     duration: 4000,
+    offset: 110,
     message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${text}</strong>`,
-    customClass: 'custom-warning-message',
+    customClass: 'custom-warning-message machine-tip-msg',
   })
 }
 </script>
@@ -1782,4 +1779,8 @@ const machineTip = (msg) => {
 .custom-warning-message .el-message__closeBtn {
   display: none !important;
 }
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
 </style>

+ 60 - 6
src/view/performance/datangbaogong.vue

@@ -328,6 +328,7 @@ const _code = '大烫'
 const _gx = '5'
 //全局接口接受的物理地址
 const Machine = ref('')
+const machineReady = ref(false)
 //全局获取UniqId
 const UniqId = ref('')
 //全局获取工序名称
@@ -350,12 +351,14 @@ const getMachineMacdata = async () => {
   try {
     const data  = await getMachineMac({sys_sbID:Machine.value});
 	if (data.data === null) {
-		add_formData['机台号'] = '测试机台'
+		machineReady.value = false
+		add_formData['机台号'] = ''
 		add_formData['工序'] = "测试"
-		add_formData['组别'] = "测试"
-		add_formData['人员'] = "测试"
+		add_formData['组别'] = ''
+		add_formData['人员'] = ''
 		return;
 	}
+	machineReady.value = true
 	add_formData['机台号'] = data.data['机台号']
 	add_formData['工序'] = data.data['生产工序']
 	add_formData['组别'] = data.data['组别']
@@ -368,6 +371,11 @@ const getMachineMacdata = async () => {
 	 }, 100); // 延迟100毫秒
   } catch (error) {
     console.error(error)
+    machineReady.value = false
+    add_formData['机台号'] = ''
+    add_formData['工序'] = ''
+    add_formData['组别'] = ''
+    add_formData['人员'] = ''
   }
 }
 //自动获取物理地址
@@ -423,6 +431,12 @@ const ddtableData = reactive([])
 
 // 查询按钮
 const add_onSubmit = async ()=>{
+  const machineNo = String(add_formData['机台号'] || '').trim()
+    if (!machineReady.value || !machineNo || machineNo === '测试机台') {
+      machineTip()
+      return
+    }
+  
 	if(add_formData['机台号'] === ''){
 		warningres('未获取到机台');
 		return false;
@@ -569,9 +583,10 @@ const currentSlValue=ref('')
 
 //报工
 const add_Dialog = async ()=>{
-	if(add_formData['机台号'] === '测试机台'){
-		warningres('测试机台禁止报工');
-		return;
+	const _machineNo = String(add_formData['机台号'] || '').trim()
+	if (!machineReady.value || !_machineNo || _machineNo === '测试机台') {
+		machineTip()
+		return
 	}
  if(add_formData['上报数量'] === ''){
     warningres('上报数量为空,请填写上报数量');
@@ -770,6 +785,22 @@ const warningres = (arr) => {
         customClass: 'custom-warning-message'
     });
 }
+
+
+/** 机台未获取统一黄字提示(查询时) */
+const machineTip = (text) => {
+  const tip = text || '未获取到机台编号,重启电脑或重新打开系统尝试'
+  ElMessage.closeAll()
+  ElMessage({
+    type: '',
+    dangerouslyUseHTMLString: true,
+    duration: 4000,
+    offset: 110,
+    message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${tip}</strong>`,
+    customClass: 'custom-warning-message machine-tip-msg',
+  })
+}
+
 </script>
 <style scoped>
 .form-container {
@@ -925,3 +956,26 @@ margin-bottom: 5px;
   color: red;
 } 
 </style>
+
+<style>
+.custom-warning-message {
+  background: transparent !important;
+  border: none !important;
+  box-shadow: none !important;
+  padding: 0 !important;
+}
+.custom-warning-message .el-message__content {
+  padding: 0 !important;
+  line-height: 1 !important;
+}
+.custom-warning-message .el-message__icon {
+  display: none !important;
+}
+.custom-warning-message .el-message__closeBtn {
+  display: none !important;
+}
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
+</style>

+ 60 - 6
src/view/performance/houdaoshougong.vue

@@ -330,6 +330,7 @@ const _code = '手工'
 const _gx = '4'
 //全局接口接受的物理地址
 const Machine = ref('')
+const machineReady = ref(false)
 //全局获取UniqId
 const UniqId = ref('')
 //全局获取工序名称
@@ -354,12 +355,14 @@ const getMachineMacdata = async () => {
   try {
     const data  = await getMachineMac({sys_sbID:Machine.value});
 	if (data.data === null) {
-		add_formData['机台号'] = '测试机台'
+		machineReady.value = false
+		add_formData['机台号'] = ''
 		add_formData['工序'] = "测试"
-		add_formData['组别'] = "测试"
-		add_formData['人员'] = "测试"
+		add_formData['组别'] = ''
+		add_formData['人员'] = ''
 		return;
 	}
+	machineReady.value = true
 	add_formData['机台号'] = data.data['机台号']
 	add_formData['工序'] = data.data['生产工序']
 	add_formData['组别'] = data.data['组别']
@@ -372,6 +375,11 @@ const getMachineMacdata = async () => {
 	 }, 100); // 延迟100毫秒
   } catch (error) {
     console.error(error)
+    machineReady.value = false
+    add_formData['机台号'] = ''
+    add_formData['工序'] = ''
+    add_formData['组别'] = ''
+    add_formData['人员'] = ''
   }
 }
 //自动获取物理地址
@@ -427,6 +435,12 @@ const ddtableData = reactive([])
 
 // 查询按钮
 const add_onSubmit = async ()=>{
+  const machineNo = String(add_formData['机台号'] || '').trim()
+    if (!machineReady.value || !machineNo || machineNo === '测试机台') {
+      machineTip()
+      return
+    }
+  
 	if(add_formData['机台号'] === ''){
 		warningres('未获取到机台')
 		return false;
@@ -587,9 +601,10 @@ const add_Dialog = async () => {
         isClickable = true;
     }, 2000);
 
-	if(add_formData['机台号'] === '测试机台'){
-		warningres('测试机台禁止报工')
-		return;
+	const _machineNo = String(add_formData['机台号'] || '').trim()
+	if (!machineReady.value || !_machineNo || _machineNo === '测试机台') {
+		machineTip()
+		return
 	}
  if(add_formData['上报数量'] === ''){
 	warningres('上报数量为空,请填写上报数量')
@@ -822,6 +837,22 @@ const warningres = (arr) => {
         customClass: 'custom-warning-message'
     });
 }
+
+
+/** 机台未获取统一黄字提示(查询时) */
+const machineTip = (text) => {
+  const tip = text || '未获取到机台编号,重启电脑或重新打开系统尝试'
+  ElMessage.closeAll()
+  ElMessage({
+    type: '',
+    dangerouslyUseHTMLString: true,
+    duration: 4000,
+    offset: 110,
+    message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${tip}</strong>`,
+    customClass: 'custom-warning-message machine-tip-msg',
+  })
+}
+
 </script>
 <style scoped>
 .form-container {
@@ -977,3 +1008,26 @@ margin-bottom: 5px;
   color: red;
 } 
 </style>
+
+<style>
+.custom-warning-message {
+  background: transparent !important;
+  border: none !important;
+  box-shadow: none !important;
+  padding: 0 !important;
+}
+.custom-warning-message .el-message__content {
+  padding: 0 !important;
+  line-height: 1 !important;
+}
+.custom-warning-message .el-message__icon {
+  display: none !important;
+}
+.custom-warning-message .el-message__closeBtn {
+  display: none !important;
+}
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
+</style>

+ 67 - 17
src/view/performance/zongjianbaogong.vue

@@ -601,6 +601,7 @@ const currentDates = `${year}-${month}-${day}`;
 const _code = '总检'
 //全局接口接受的物理地址
 const Machine = ref('')
+const machineReady = ref(false)
 //全局获取UniqId
 const UniqId = ref('')
 
@@ -610,17 +611,15 @@ const getMachineMacdata = async () => {
 	try {
 		const data = await getMachineMac({sys_sbID: Machine.value});
 		if (data.data === null) {
-			// ElMessage({
-			// 	type: 'error',
-			// 	message: '未获取到机台编号请确认MAC地址或与管理员联系'
-			// })
-			add_formData['机台号'] = '测试机台'
-			add_formData['工序'] = _code
-			add_formData['组别'] = "测试"
-			add_formData['人员'] = "测试"
-			return;
-		} else {
-			add_formData['机台号'] = data.data['机台号']
+		machineReady.value = false
+		add_formData['机台号'] = ''
+		add_formData['工序'] = ''
+		add_formData['组别'] = ''
+		add_formData['人员'] = ''
+		return;
+	} else {
+			machineReady.value = true
+	add_formData['机台号'] = data.data['机台号']
 			add_formData['工序'] = data.data['生产工序']
 			add_formData['工序名称'] = data.data['生产工序']
 			add_formData['组别'] = data.data['组别']
@@ -633,8 +632,13 @@ const getMachineMacdata = async () => {
 			}, 100); // 延迟100毫秒
 		}
 	} catch (error) {
-		console.error(error)
-	}
+    console.error(error)
+    machineReady.value = false
+    add_formData['机台号'] = ''
+    add_formData['工序'] = ''
+    add_formData['组别'] = ''
+    add_formData['人员'] = ''
+  }
 }
 //自动获取物理地址
 const GetAddr = () => {
@@ -795,6 +799,12 @@ const selectedOrder = ref(''); // 选中的订单
 
 //查询按钮
 const add_onSubmit = async() => {
+  const machineNo = String(add_formData['机台号'] || '').trim()
+    if (!machineReady.value || !machineNo || machineNo === '测试机台') {
+      machineTip()
+      return
+    }
+  
 	if(add_formData['机台号'] === ''){
 		warningres('未获取到机台')
 		return false;
@@ -1076,10 +1086,11 @@ const add_Dialog = async () => {
         isClickable = true;
     }, 2000);
 
-		if(add_formData['机台号'] === '测试机台'){
-			warningres('测试机台禁止报工')
-			return;
-		}
+		const _machineNo = String(add_formData['机台号'] || '').trim()
+	if (!machineReady.value || !_machineNo || _machineNo === '测试机台') {
+		machineTip()
+		return
+	}
 		sizeDatas.length = 0;
 		add_tableData.length = 0;
 		// console.log(_serial.value)
@@ -1529,6 +1540,22 @@ const warningres = (arr) => {
         customClass: 'custom-warning-message'
     });
 }
+
+
+/** 机台未获取统一黄字提示(查询时) */
+const machineTip = (text) => {
+  const tip = text || '未获取到机台编号,重启电脑或重新打开系统尝试'
+  ElMessage.closeAll()
+  ElMessage({
+    type: '',
+    dangerouslyUseHTMLString: true,
+    duration: 4000,
+    offset: 110,
+    message: `<strong style="font-size: 28px; color: black; background-color: #f5ff2f; padding: 14px 36px; line-height: 1.4; text-align: center; display: inline-block; border-radius: 4px;">${tip}</strong>`,
+    customClass: 'custom-warning-message machine-tip-msg',
+  })
+}
+
 </script>
 <style scoped>
 	:deep(.el-table__body .status-plan-usage-low) {
@@ -2077,3 +2104,26 @@ const warningres = (arr) => {
 	  font-weight: bold;
 	}
 </style>
+
+<style>
+.custom-warning-message {
+  background: transparent !important;
+  border: none !important;
+  box-shadow: none !important;
+  padding: 0 !important;
+}
+.custom-warning-message .el-message__content {
+  padding: 0 !important;
+  line-height: 1 !important;
+}
+.custom-warning-message .el-message__icon {
+  display: none !important;
+}
+.custom-warning-message .el-message__closeBtn {
+  display: none !important;
+}
+.machine-tip-msg.el-message {
+  left: 68% !important;
+  transform: translateX(-50%) !important;
+}
+</style>