This commit is contained in:
caozehui
2025-03-06 15:50:45 +08:00
parent 2377916f29
commit d41707fcf9
5 changed files with 44 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
export namespace CheckData {
export interface DataCheck {
scriptName: string,
errorSysName: string,
errorSysId: string,
dataRule: string,
deviceName: string,
chnNum: string,

View File

@@ -12,7 +12,8 @@ export const useCheckStore = defineStore("check", {
plan: Object<Plan.ResPlan>(),
selectTestItems: Object<CheckData.SelectTestItem>({preTest: true, timeTest: true, channelsTest: false, test: true}),
checkType:1, // 0:手动检测 1:自动检测
reCheckType: 1 // 0:不合格项复检 1:全部复检
reCheckType: 1, // 0:不合格项复检 1:全部复检
showDetailType: 0 // 0:数据查询 1:误差体系跟换
}),
getters: {},
@@ -40,6 +41,9 @@ export const useCheckStore = defineStore("check", {
},
setReCheckType(reCheckType: number) {
this.reCheckType = reCheckType
},
setShowDetailType(showDetailType: number) {
this.showDetailType = showDetailType
}
}
});

View File

@@ -8,7 +8,13 @@
<el-input v-model='formContent.scriptName' :disabled="true"/>
</el-form-item>
<el-form-item label="误差体系">
<el-input v-model='formContent.errorSysName' :disabled="true"/>
<el-select v-model="formContent.errorSysId" placeholder="请选择误差体系" autocomplete="off" :disabled="checkStore.showDetailType===0">
<el-option
v-for="(option) in pqErrorList"
:key="option.id"
:label="option.name"
:value="option.id"/>
</el-select>
</el-form-item>
<el-form-item label="数据原则">
<el-input v-model='formContent.dataRule' :disabled="true"/>
@@ -21,6 +27,9 @@
<el-option v-for="item in chnList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" :icon="Postcard" v-if="checkStore.showDetailType===1" @click="handleGenerateReport">报告生成</el-button>
</el-form-item>
</el-form>
</div>
@@ -98,9 +107,10 @@ import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
import {CheckData} from "@/api/check/interface";
import {useDictStore} from "@/stores/modules/dict";
import {useCheckStore} from "@/stores/modules/check";
import {getFormData, getTreeData, getTableData} from "@/api/check/test";
import {exportRawData, getFormData, getTableData, getTreeData} from "@/api/check/test";
import {getPqErrSysList} from '@/api/plan/plan'
import {useDownload} from "@/hooks/useDownload";
import {exportRawData} from "@/api/check/test"
import {Postcard} from "@element-plus/icons-vue";
const {appendToBody} = withDefaults(defineProps<{
appendToBody: boolean
@@ -117,6 +127,7 @@ const checkStore = useCheckStore()
const visible = ref(false)
const treeRef = ref()
const searchValue = ref<string>('')
const pqErrorList = reactive<{ id: string; name: string; }[]>([])
watch(searchValue, (val) => {
treeRef.value!.filter(val)
})
@@ -127,7 +138,7 @@ const fixed = 4;
// 表单数据
const formContent = reactive<CheckData.DataCheck>({
scriptName: '',
errorSysName: '',
errorSysId: '',
dataRule: '',
deviceName: '',
chnNum: '',
@@ -201,10 +212,17 @@ const handleNodeClick = async (data: any) => {
}
};
watch(() => formContent.errorSysId, async (newVal, oldVal) => {
if (newVal != '') {
console.log("切换误差体系");
formContent.chnNum = chnList[0].value
}
})
watch(() => formContent.chnNum, async (newVal, oldVal) => {
// console.log("通道号", newVal);
if (newVal) {
if (newVal != '') {
// 发起请求,查询该测试项的检测结果
const {data: resTreeDataTemp}: { data: CheckData.TreeItem[] } = await getTreeData({
scriptId: checkStore.plan.scriptId,
@@ -226,6 +244,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
activeTab.value = 'resultTab'
})
// watch(currentHarmNum, (newVal, oldVal) => {
// console.log("谐波次数", newVal);
// if (newVal !== '-1') {
@@ -393,10 +412,17 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul
chnNum: chnList.length > 0 ? chnList[0].value : '',
})
pqErrorList.length = 0
let {data: resPqErrorList} = await getPqErrSysList()
Object.assign(pqErrorList, resPqErrorList)
visible.value = true;
}
const handleGenerateReport = () => {
console.log("生成报告", checkStore.plan.id, deviceId)
}
const close = () => {
//数据清空
Object.assign(formContent, {
@@ -418,6 +444,7 @@ const close = () => {
activeTab.value = 'resultTab'
currentScriptTypeName.value = ''
currentDesc.value = ''
pqErrorList.length = 0
visible.value = false;
};

View File

@@ -225,11 +225,6 @@
<dataCheckPopup ref='dataCheckPopupRef'/>
<dataCheckChangeErrSysPopup
:visible='dataCheckChangeErrSysDialogVisible'
@update:visible='dataCheckChangeErrSysDialogVisible = $event'
></dataCheckChangeErrSysPopup>
<matchPopup
:visible='matchDialogVisible'
@update:visible='matchDialogVisible = $event'
@@ -305,7 +300,6 @@ const reportDialogVisible = ref(false)
const dataCheckPopupRef = ref<InstanceType<typeof dataCheckPopup>>()
const selectTestItemPopupRef = ref<InstanceType<typeof SelectTestItemPopup>>()
const dataCheckChangeErrSysDialogVisible = ref(false)
const matchDialogVisible = ref(false)
const dialogTitle = ref('手动检测')
const checkStateTable = ref<number[]>([0, 1, 2])
@@ -1082,10 +1076,12 @@ const openDrawer = async (title: string, row: any) => {
}
if (title === '检测数据查询') {
checkStore.setShowDetailType(0)
dataCheckPopupRef.value?.open(row.id, '-1', null)
}
if (title === '误差体系更换') {
dataCheckChangeErrSysDialogVisible.value = true
checkStore.setShowDetailType(1)
dataCheckPopupRef.value?.open(row.id, '-1', null)
}

View File

@@ -1117,6 +1117,7 @@ const handleClick = (item: any, chnNum: number, scriptType: string) => {
})
}
if (flag === -1 || flag === 1) {
checkStore.setShowDetailType(0)
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType);
}
};