feat: 重构 AGV 对接与在制品查询,新增 PLC 手动监控功能
This commit is contained in:
@@ -49,7 +49,7 @@ import { setAuth } from '../utils/request'
|
||||
const router = useRouter()
|
||||
const username = ref('')
|
||||
const password = ref('')
|
||||
// null=未加载;0=上线位是合法工位,不能用 falsy 判断
|
||||
// null=未加载;工位号须为正整数,不能用 falsy 判断
|
||||
const fixedStation = ref(null)
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -57,8 +57,8 @@ const loading = ref(false)
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const cfg = await getConfig()
|
||||
// 0=上线位、13=下线位为合法虚拟工位,>=0 都算加载成功
|
||||
if (typeof cfg?.stationNo === 'number' && cfg.stationNo >= 0) fixedStation.value = cfg.stationNo
|
||||
// 工位号为正整数才算加载成功
|
||||
if (typeof cfg?.stationNo === 'number' && cfg.stationNo > 0) fixedStation.value = cfg.stationNo
|
||||
} catch {
|
||||
// 网络异常时保留 0,登录会提示配置未加载
|
||||
}
|
||||
@@ -88,7 +88,15 @@ async function submit() {
|
||||
try {
|
||||
const stats = await getSyncStats()
|
||||
const n = Number(stats?.pendingTotal || 0)
|
||||
if (n > 0) {
|
||||
const d = Number(stats?.deadTotal || 0)
|
||||
if (d > 0) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: `您有 ${d} 条数据被 MES 拒绝、需人工处理(如点位已被占用):请点顶部「待同步」查看失败原因、重选点位后再次提交`,
|
||||
duration: 8000,
|
||||
showClose: true
|
||||
})
|
||||
} else if (n > 0) {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: `您上次有 ${n} 条报工数据发送失败,仍保留在本机;留意顶部「待同步」即可,系统会自动重发`,
|
||||
|
||||
Reference in New Issue
Block a user