|
|
@@ -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>
|