切换数据处理原则

This commit is contained in:
caozehui
2025-12-10 11:15:18 +08:00
parent 6334681dc5
commit 03d1db3bb4
3 changed files with 54 additions and 31 deletions

View File

@@ -18,7 +18,7 @@
v-model="formContent.errorSysId"
placeholder="请选择误差体系"
autocomplete="off"
@change="handleErrorSysChange"
@change="handleErrorSysChange('切换误差体系成功')"
>
<el-option
v-for="option in pqErrorList"
@@ -29,7 +29,20 @@
</el-select>
</el-form-item>
<el-form-item label="数据原则">
<el-input v-model="formContent.dataRule" :disabled="true" />
<!-- <el-input v-model="formContent.dataRule" :disabled="true" />-->
<el-select
:disabled="checkStore.showDetailType === 2 || checkStore.showDetailType === 0"
v-model="formContent.dataRule"
placeholder="请选择数据原则"
autocomplete="off"
@change="handleErrorSysChange('切换数据处理原则成功')">
<el-option
v-for="item in dictStore.getDictData('Data_Rule')"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="设备名称">
<el-input v-model="formContent.deviceName" :disabled="true" />
@@ -392,6 +405,7 @@ const getBasicInformation = async (scriptType: any) => {
})
formContent.dataRule = res.data.dataRule
console.log('formContent.dataRule',formContent.dataRule)
formContent.deviceName = res.data.deviceName
formContent.errorSysId = res.data.errorSysId
chnMapList.value = res.data.chnMap
@@ -507,6 +521,7 @@ const getResults = async (code: any) => {
// 判断是否为录波数据请求
const isWaveDataRequest = code === 'wave_data' || isWaveData.value
console.log(checkStore.plan)
getContrastResult({
planId: checkStore.plan.id,
scriptType: rowList.value.scriptType,
@@ -515,7 +530,8 @@ const getResults = async (code: any) => {
num: formContent.num == '' ? null : formContent.num,
waveNum: isWaveDataRequest ? waveNumber.value : null,
isWave: isWaveDataRequest,
patternId: pattern.value
patternId: pattern.value,
code: checkStore.plan.code + (formContent.errorSysId!=checkStore.plan.errorSysId || formContent.dataRule!=checkStore.plan.dataRule? '_temp':'')
}).then((res: any) => {
let list: string[] = []
for (let key in res.data.resultMap) {
@@ -556,7 +572,7 @@ const close = async () => {
}
}
const handleErrorSysChange = async () => {
const handleErrorSysChange = async (msg:string) => {
changeErrorSystem({
planId: checkStore.plan.id,
scriptId: '',
@@ -564,10 +580,11 @@ const handleErrorSysChange = async () => {
deviceId: formContent.deviceId,
code: checkStore.plan.code + '',
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
chnNum: formContent.chnNum
chnNum: formContent.chnNum,
dataRuleId: formContent.dataRule
}).then(res => {
if (res.code === ResultEnum.SUCCESS) {
ElMessage.success('切换误差体系成功')
ElMessage.success(msg)
handleChnNumChange(formContent.chnNum)
}
})
@@ -581,7 +598,8 @@ const handleReCalculate = async () => {
deviceId: formContent.deviceId,
code: checkStore.plan.code + '',
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? '',
chnNum: formContent.chnNum
chnNum: formContent.chnNum,
dataRuleId: formContent.dataRule,
}).then(res => {
if (res.code === ResultEnum.SUCCESS) {
ElMessage.success('重新计算成功!')