|
|
@@ -253,8 +253,9 @@ const loading = ref(false)
|
|
|
async function loadData() {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
- // 调用 alarm_data 真实接口,只取未处理报警(alarmStatus=0)
|
|
|
- const res = await getAlarmDataPage(1, 200, { equipmentType: 'drainage', alarmStatus: 0 })
|
|
|
+ // 查询排水全部报警,由综合审核状态筛选待审核/已审核。
|
|
|
+ // 不能固定传 alarmStatus=0,否则已审核记录无法在页面显示。
|
|
|
+ const res = await getAlarmDataPage(1, 200, { equipmentType: 'drainage' })
|
|
|
const pageData = res.code !== undefined ? res.data : res
|
|
|
const records = pageData.records || pageData.rows || []
|
|
|
let tableData_local = records.map(row => ({
|
|
|
@@ -270,7 +271,10 @@ async function loadData() {
|
|
|
currentValue: row.actualValue,
|
|
|
thresholdValue: row.maxValue,
|
|
|
warningType: row.warningType,
|
|
|
- status: 1, // 未处理(alarmStatus=0)在审核页面显示为"待审核"
|
|
|
+ // 以接口返回的综合审核状态为准;已有工单的历史报警不能继续显示为待审核。
|
|
|
+ status: row.auditStatus != null
|
|
|
+ ? Number(row.auditStatus)
|
|
|
+ : (row.hasWorkOrder || row.alarmStatus === 1 ? 2 : 1),
|
|
|
source: 'alarm_data'
|
|
|
}))
|
|
|
|
|
|
@@ -373,7 +377,7 @@ async function submitAudit() {
|
|
|
})
|
|
|
: await handleAlarm(currentAlarm.value.id, userStore.name || 'admin', auditForm.value.opinion || auditForm.value.result)
|
|
|
if (res.code === 200 || res.code === 0) {
|
|
|
- ElMessage.success(isApproved ? '审核通过,已自动上传至工单' : '审核提交成功')
|
|
|
+ ElMessage.success(res.msg || (isApproved ? '审核通过,已自动上传至工单' : '审核提交成功'))
|
|
|
auditVisible.value = false
|
|
|
loadData()
|
|
|
} else {
|