This commit is contained in:
sjl
2025-11-17 10:48:27 +08:00
3 changed files with 43 additions and 7 deletions

View File

@@ -59,6 +59,7 @@
collapse-tags
filterable
placeholder="请选择检测源"
@change="handleSourceChange"
>
<el-option
v-for="(option, index) in pqSourceArray"
@@ -105,6 +106,7 @@
:key="index"
:label="option.label"
:value="option.value"
:disabled="option.fluke!=1&&pqSourceArray?.find(item=>formContent.sourceIds==item.value)?.label.includes('FLUKE')"
/>
</el-select>
</el-form-item>
@@ -474,7 +476,7 @@ const pqStandardDevList = ref<StandardDevice.ResPqStandardDevice[]>([]) //获取
const pqReportName = ref<{ name: string }[]>([])
const pqSourceArray = ref<{ label: string; value: string }[]>()
const pqScriptArray = ref<{ label: string; value: string }[]>()
const pqScriptArray = ref<{ label: string; value: string,fluke?:number|boolean}[]>()
const pqErrorArray = ref<{ label: string; value: string }[]>()
const pqStandardDevArray = ref<{ label: string; value: string }[]>()
const secondLevelOptions: any[] = []
@@ -533,6 +535,8 @@ const generateData = () => {
})
}
function useMetaInfo() {
const dialogVisible = ref(false)
const titleType = ref('add')
@@ -602,6 +606,18 @@ watch(
}
)
const handleSourceChange = () => {
let pqSource = pqSourceArray.value?.find(item => item.value === formContent.sourceIds)
if (pqSource?.label.includes('FLUKE')) {
let pqScript = pqScriptArray.value?.find(item => item.value === formContent.scriptId)
if (pqScript?.fluke!=1) {
formContent.scriptId = ''
ElMessage.warning('专用检测脚本只能使用福禄克检测源!')
}
}
}
// 清空formContent
const resetFormContent = () => {
Object.assign(formContent, {
@@ -1211,7 +1227,8 @@ function pqToArray() {
const sourceArray2 = Array.isArray(pqScriptList.value) ? pqScriptList.value : []
pqScriptArray.value = sourceArray2.map(item => ({
label: item.name || '',
value: item.id || ''
value: item.id || '',
fluke:item.fluke
}))
const sourceArray3 = Array.isArray(pqErrSysList.value) ? pqErrSysList.value : []