暂存进度

This commit is contained in:
caozehui
2026-07-15 15:57:14 +08:00
parent 8c7c34cda2
commit 3ed318530a
13 changed files with 350 additions and 49 deletions

View File

@@ -483,7 +483,11 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
sortable: true,
isShow: checkStateShow,
render: scope => {
return scope.row.checkState === 0 ? '未检' : scope.row.checkState === 1 ? '检测中' : scope.row.checkState === 2 ? '检测完成':'归档'
return scope.row.checkState === 0 ? '未检'
: scope.row.checkState === 1 ? '检测中'
: scope.row.checkState === 2 ? '检测完成'
: scope.row.checkState === 3 ? '归档'
: ''
}
},
{
@@ -586,7 +590,9 @@ const handleSelectionChange = (selection: any[]) => {
devVolt: item.devVolt,
devCurr: item.devCurr,
factorFlag: item.factorFlag,
checkResult: item.checkResult
checkResult: item.checkResult,
checkState: item.checkState,
formalCheckTime: item.formalCheckTime
}
})
@@ -600,14 +606,16 @@ const handleSelectionChange = (selection: any[]) => {
const isUncheckedDevice = (device: Device.ResPqDev) => Number(device.checkState) === 0 || Number(device.checkResult) === 2
const hasCheckedSelectedDevice = () => channelsSelection.value.some(device => !isUncheckedDevice(device))
const hasUncheckedSelectedDevice = () => channelsSelection.value.some(device => isUncheckedDevice(device))
const hasCheckedUnqualifiedSelectedDevice = () =>
channelsSelection.value.some(device => !isUncheckedDevice(device) && Number(device.checkResult) === 0)
const shouldShowRecheckModeDialog = () => hasCheckedSelectedDevice()
const isCheckedUnqualifiedDevice = (device: Device.ResPqDev) =>
Number(device.checkState) === 2 && Number(device.checkResult) === 0
const shouldShowRecheckModeDialog = () =>
channelsSelection.value.length > 0 && channelsSelection.value.every(isCheckedUnqualifiedDevice)
const canUseUnqualifiedItemRecheck = () => hasCheckedUnqualifiedSelectedDevice() && !hasUncheckedSelectedDevice()
@@ -653,7 +661,7 @@ function tableHeaderInit(val: number) {
switch (val) {
case 0: // 设备检测模式
case 1: // 手动检测模式
checkStateTable.value = [0, 1, 2] // 显示所有检测状态
checkStateTable.value = [0, 1, 2] // 显示未检、检测中、检测完成状态
tableKey.value++
operationShow.value = false // 隐藏操作列
documentStateShow.value = false // 隐藏文档状态
@@ -665,7 +673,7 @@ function tableHeaderInit(val: number) {
break
case 3: // 报告生成模式
if (modeStore.currentMode === '比对式') {
checkStateTable.value = [2, 3] // 显示检测中,检测完成和归档状态
checkStateTable.value = [2, 3] // 显示检测完成和归档状态
} else {
checkStateTable.value = [2, 3] // 显示检测完成和归档状态
}
@@ -689,7 +697,7 @@ function tableHeaderInit(val: number) {
break
case 5: // 数据查询模式
if (modeStore.currentMode === '比对式') {
checkStateTable.value = [1, 2, 3] // 显示检测中检测完成和归档状态
checkStateTable.value = [1, 2, 3] // 显示检测中检测完成和归档状态
} else {
checkStateTable.value = [2, 3] // 显示检测完成和归档状态
}
@@ -914,6 +922,14 @@ const handleTest = async (val: string) => {
// 处理检测相关操作
if (val === '手动检测' || val === '一键检测' || val === '系数校准') {
const hasCheckingDevice = channelsSelection.value.some(item => Number(item.checkState) === 1)
const hasNonCheckingDevice = channelsSelection.value.some(item => Number(item.checkState) !== 1)
if (hasCheckingDevice && hasNonCheckingDevice) {
ElMessage.warning('检测中的设备不能和未检、检测完成的设备同时检测')
return
}
checkStore.setResumeFormal(false)
// 检查选中设备的检测状态是否一致
const checkStates = channelsSelection.value.map(item => item.checkState)
const allCheckStatesEqual = new Set(checkStates).size <= 1