查验
This commit is contained in:
@@ -28,6 +28,7 @@ createApp({
|
||||
errorMsg: '',
|
||||
waitingStep: false,
|
||||
stepLabel: '',
|
||||
qrMessage: '所有姿态均未识别到二维码,请手动输入:',
|
||||
// 任务步骤控制开关(机械臂初始化并入AGV移动)
|
||||
agvMoveEnabled: true,
|
||||
qrScanEnabled: true,
|
||||
@@ -36,6 +37,8 @@ createApp({
|
||||
// 速度控制
|
||||
agvSpeed: 1.0,
|
||||
armSpeed: 1000,
|
||||
// 查验
|
||||
inspection: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -51,6 +54,14 @@ createApp({
|
||||
}
|
||||
return map[this.missionState] || '未知'
|
||||
},
|
||||
inspectionTotal() {
|
||||
if (!this.inspection || !this.inspection.items) return 0
|
||||
return this.inspection.items.reduce((s, i) => s + (i.inspected || 0), 0)
|
||||
},
|
||||
inspectionTarget() {
|
||||
if (!this.inspection || !this.inspection.items) return 0
|
||||
return this.inspection.items.reduce((s, i) => s + (i.quantify || 0), 0)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.poll()
|
||||
@@ -101,6 +112,7 @@ createApp({
|
||||
if (data.grid) this.missionGrid = data.grid
|
||||
if (data.point_status) this.pointStatus = data.point_status
|
||||
if (data.machine_status) this.machineStatus = data.machine_status
|
||||
if (data.inspection) this.inspection = data.inspection
|
||||
this.armCameraOpened = data.arm_camera_opened
|
||||
if (this.armCameraOpened && !this.armPreviewUrl) {
|
||||
this.armPreviewUrl = API + '/api/camera/arm_preview'
|
||||
@@ -122,6 +134,11 @@ createApp({
|
||||
this.waitingStep = false
|
||||
}
|
||||
|
||||
// QR 弹窗消息
|
||||
if (data.qr_message) {
|
||||
this.qrMessage = data.qr_message
|
||||
}
|
||||
|
||||
// QR 弹窗(防止提交后重复弹出)
|
||||
if (this.missionState !== 'waiting_qr') {
|
||||
this.qrSubmitting = false
|
||||
@@ -129,6 +146,9 @@ createApp({
|
||||
if (this.missionState === 'waiting_qr' && !this.showQrModal && !this.qrSubmitting) {
|
||||
this.showQrModal = true
|
||||
this.qrValue = ''
|
||||
if (!this.qrMessage) {
|
||||
this.qrMessage = '所有姿态均未识别到二维码,请手动输入:'
|
||||
}
|
||||
}
|
||||
|
||||
// 完成后获取报告
|
||||
@@ -156,6 +176,11 @@ createApp({
|
||||
},
|
||||
async startMission() {
|
||||
if (this.missionState !== 'idle') return
|
||||
// 没有设置报关单时阻止启动(后端也会校验,这里提前友好提示)
|
||||
if (!this.inspection) {
|
||||
alert('⚠️ 请先在「设置→报关单」中选择报关单并点击「开始查验」')
|
||||
return
|
||||
}
|
||||
this.logs = []
|
||||
this.progress = 0
|
||||
this.report = null
|
||||
@@ -186,6 +211,11 @@ createApp({
|
||||
},
|
||||
async startSingleStep() {
|
||||
if (this.missionState !== 'idle') return
|
||||
// 没有设置报关单时阻止启动(后端会校验,这里提前友好提示)
|
||||
if (!this.inspection) {
|
||||
alert('⚠️ 请先在「设置→报关单」中选择报关单并点击「开始查验」')
|
||||
return
|
||||
}
|
||||
this.logs = []
|
||||
this.progress = 0
|
||||
this.report = null
|
||||
|
||||
Reference in New Issue
Block a user