比对系数下发全局配置

This commit is contained in:
caozehui
2026-01-16 10:44:41 +08:00
parent cdc19e1db9
commit c30569f5e1
4 changed files with 30 additions and 18 deletions

View File

@@ -14,7 +14,8 @@ export const getScriptList = (params: {
devId:string,
chnNum:number,
num:number,
planId:string
planId:string,
code:string
}) => {
return http.post('/result/getCheckItem', params, {loading: false})
}

View File

@@ -14,6 +14,7 @@ export namespace Base {
createTime?: string| null; //创建时间
updateBy?: string| null; //更新用户
updateTime?: string| null; //更新时间
coefficient:number //比对监测后,当电压、电流不符合时,是否对标准设备进行系数校准
}
}

View File

@@ -198,8 +198,8 @@
</template>
<script setup lang="tsx" name="useProTable">
import { onBeforeMount, onMounted, type PropType, reactive, ref, watch } from 'vue'
import { type Action, ElMessage, ElMessageBox } from 'element-plus'
import {onBeforeMount, onMounted, type PropType, reactive, ref, watch} from 'vue'
import {type Action, ElMessage, ElMessageBox} from 'element-plus'
import TestPopup from './testPopup.vue'
import dataCheckPopup from './dataCheckSingleChannelSingleTestPopup.vue'
import CompareDataCheckSingleChannelSingleTestPopup from '@/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue'
@@ -207,20 +207,20 @@ import ProTable from '@/components/ProTable/index.vue'
import SelectTestItemPopup from '@/views/home/components/selectTestItemPopup.vue'
import WriteTHPopup from '@/views/home/components/writeTHPopup.vue'
import DeviceConnectionPopup from '@/views/home/components/deviceConnectionPopup.vue'
import { type Device } from '@/api/device/interface/device'
import { type ColumnProps, type ProTableInstance } from '@/components/ProTable/interface'
import { type Plan } from '@/api/plan/interface'
import { type StandardDevice } from '@/api/device/interface/standardDevice'
import { downloadDevData, generateDevReport, getBoundPqDevList } from '@/api/plan/plan'
import { getPqDev } from '@/api/device/device'
import { useAppSceneStore, useModeStore } from '@/stores/modules/mode' // 引入模式 store
import { useCheckStore } from '@/stores/modules/check'
import { CheckData } from '@/api/check/interface'
import { useAuthStore } from '@/stores/modules/auth'
import { useDownload } from '@/hooks/useDownload'
import { documentedPqDev } from '@/api/device/report'
import { ResultEnum } from '@/enums/httpEnum'
import { getPqMonList } from '@/api/device/monitor/index'
import {type Device} from '@/api/device/interface/device'
import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/interface'
import {type Plan} from '@/api/plan/interface'
import {type StandardDevice} from '@/api/device/interface/standardDevice'
import {downloadDevData, generateDevReport, getBoundPqDevList} from '@/api/plan/plan'
import {getPqDev} from '@/api/device/device'
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode' // 引入模式 store
import {useCheckStore} from '@/stores/modules/check'
import {CheckData} from '@/api/check/interface'
import {useAuthStore} from '@/stores/modules/auth'
import {useDownload} from '@/hooks/useDownload'
import {documentedPqDev} from '@/api/device/report'
import {ResultEnum} from '@/enums/httpEnum'
import {getPqMonList} from '@/api/device/monitor/index'
import ReportResultPopup from '@/views/home/components/reportResultPopup.vue'
const checkStore = useCheckStore()
@@ -539,6 +539,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
{ prop: 'operation', label: '操作', fixed: 'right', minWidth :200,isShow: operationShow }
])
let testType = 'test' // 检测类型:'test'-检测 'reTest'-复检
let qualifiedCount = 0 //合格数量
//比对单个报告生成
@@ -568,12 +569,14 @@ const handleSelectionChange = (selection: any[]) => {
}
// 统计已完成检测的设备数量
const result = selection.filter(item => item.checkResult != 0)
let result = selection.filter(item => item.checkState == 0)
if (result.length > 0) {
testType = 'test'
} else {
testType = 'reTest'
}
qualifiedCount=selection.filter(item => item.checkResult == 1).length
let devices: CheckData.Device[] = selection.map((item: any) => {
return {
deviceId: item.id,
@@ -925,6 +928,7 @@ const handleTest = async (val: string) => {
distinguishCancelAndClose: true,
confirmButtonText: '不合格项复检',
cancelButtonText: '全部复检',
showConfirmButton:qualifiedCount<=0,
type: 'warning'
})
.then(() => {

View File

@@ -25,6 +25,11 @@
<el-input number v-model.number='TestConfigForm.scale' placeholder="请输入误差保留小数位" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/>
</el-form-item>
</el-col>
<el-col :span="8" v-if="modeStore.currentMode=='比对式'">
<el-form-item label='是否进行系数校准' prop='coefficient' :label-width="140">
<el-switch v-model="TestConfigForm.coefficient" :active-value="1" :inactive-value="0" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</el-form-item>
</el-col>
<!-- <el-col :span="8">-->
<!-- <el-form-item label='数据处理原则' prop='dataRule' :label-width="140">-->
<!-- <el-select v-model="TestConfigForm.dataRule" clearable placeholder="请选择数据处理原则">-->
@@ -235,6 +240,7 @@ const TestConfigForm = ref<Base.ResTestConfig>({
maxTime: 3,
state: 1, //状态
scale:4,
coefficient:0,
})
const RegResForm = ref<VersionRegister.ResSys_Reg_Res>({