<!-- 核查数据管理详情--核查项---第14套:铯原子 -->
<script lang="ts" setup name="checkDataDetail">
import { ref, watch } from 'vue'
import { ElLoading, ElMessage } from 'element-plus'
import saveCheckRecord from '../../dialog/saveCheckRecord.vue'
import { clearDateValue, handleDetailTableTableHead, handleSaveDateParams, solveHistoryIndicationTableData } from '../useStabilityCaculate'
import type { IList } from './fourteen-interface'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import useUserStore from '@/store/modules/user'
import type { dictType } from '@/global'
import { getDictByCode } from '@/api/system/dict'
import multiTable from '@/components/MultiHeaderTable/index.vue'
import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book'
import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData'
import { uniqueMultiArray } from '@/utils/Array'
// 表单ref
const props = defineProps({
selectStandardId: {
type: String,
},
pageType: { // 页面类型
type: String,
},
checkDate: { // 核查日期
type: String,
},
})
const user = useUserStore() // 用户信息
const $router = useRouter() // 关闭页面使用
const $route = useRoute() // 路由参数
const pageType = ref('add') // 页面类型: add, edit, detail
const equipmentId = ref('')
const currentDate = ref('') // 要查询历史稳定性的日期
const dateArrStability = ref<string[]>([]) // 稳定性日期数组
const infoId = ref('')
const ruleFormRef = ref()
const form = ref({
'1-flit': '',
'2-flit': '',
'3-flit': '',
})
const belongStandardEquipment = ref('9')
const itemCategoryId = ref('') // 核查项分类id
const itemCategoryName = ref('') // 核查项分类名称
// ----------------------------------路由参数------------------------------------------------
if ($route.params && $route.params.type) {
pageType.value = $route.params.type as string
console.log(pageType.value)
if ($route.params.id) {
infoId.value = $route.params.id as string
}
}
// ------------------------------------------字典----------------------------------------------
const conclusionList = ref<dictType[]>([]) // 结论
function getDict() {
// 结论
getDictByCode('conclusion').then((response) => {
conclusionList.value = response.data
})
}
// getDict()
// ----------------------------------------核查数据----------------------------------------------
const radioMenus = ref([ // 标签内容
{ name: '铯原子频标核查', value: 'frequency', params: '1' },
{ name: '函数信号发生器核查', value: 'power', params: '2' },
{ name: '信号源核查', value: 'relative-level', params: '3' },
])
const current = ref('frequency') // 选择的tab 默认基本信息
const repeatabilityColumns = ref<TableColumn[]>([]) // 重复性表头
const stabilityColumns = ref<TableColumn[]>([]) // 稳定性表头
const repeatabilityColumnsCheckData = ref<TableColumn[]>([]) // 重复性表头
const stabilityColumnsCheckData = ref<TableColumn[]>([]) // 稳定性表头
const columns_repeatability_frequency = ref<TableColumn[]>([ // 重复性表头--铯原子频标核查
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '核查方法', value: 'checkMethod', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '160',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
])
const columns_repeatability_frequency_check_data = ref<TableColumn[]>([ // 重复性表头--铯原子频标核查 -- 日期选择
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '核查方法', value: 'checkMethod', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '160',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
])
const columns_repeatability_power = ref<TableColumn[]>([ // 重复性表头--函数信号发生器核查
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '电平', value: 'electricalLevel', align: 'center', required: true, type: 'text', unit: 'electricalLevelUnit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '160',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text', unit: 'powerUnit' },
{ text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
])
const columns_repeatability_power_check_data = ref<TableColumn[]>([ // 重复性表头--函数信号发生器核查 -- 日期选择
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '电平', value: 'electricalLevel', align: 'center', required: true, type: 'text', unit: 'electricalLevelUnit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '160',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text', unit: 'powerUnit' },
{ text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
])
const columns_repeatability_relative_level = ref<TableColumn[]>([ // 重复性表头--信号源核查
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'text', unit: 'amplitudeUnit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '160',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
])
const columns_repeatability_relative_level_check_data = ref<TableColumn[]>([ // 重复性表头--信号源核查 -- 日期选择
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'text', unit: 'amplitudeUnit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '160',
children: [
{ text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X2', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X3', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X4', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X5', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X6', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X7', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X8', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X9', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
{ text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', unit: 'unit', precision: 3 },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '平均值', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
])
// 稳定性表头--铯原子频标核查
const columns_stability_frequency = ref<TableColumn[]>([
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '核查方法', value: 'checkMethod', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '110',
children: [
{ text: '-', value: 'testValueOneDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFourDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueSixDate', align: 'center', required: true, type: 'text' },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', type: 'text' },
])
// 稳定性表头--铯原子频标核查 -- 日期选择
const columns_stability_frequency_check_data = ref<TableColumn[]>([
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '核查方法', value: 'checkMethod', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '110',
children: [
{ text: '-', value: 'testValueOneDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFourDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueSixDate', align: 'center', required: true, type: 'text' },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', type: 'text' },
])
// 稳定性表头--函数信号发生器核查
const columns_stability_power = ref<TableColumn[]>([
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '电平', value: 'electricalLevel', align: 'center', required: true, type: 'text', unit: 'electricalLevelUnit' },
{
text: '测量值/1MΩ',
value: 'indicatingValue',
align: 'center',
required: true,
width: '110',
children: [
{ text: '-', value: 'testValueOneDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFourDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueSixDate', align: 'center', required: true, type: 'text' },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', type: 'text' },
])
// 稳定性表头--函数信号发生器核查 -- 日期选择
const columns_stability_power_check_data = ref<TableColumn[]>([
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '电平', value: 'electricalLevel', align: 'center', required: true, type: 'text', unit: 'electricalLevelUnit' },
{
text: '测量值/1MΩ',
value: 'indicatingValue',
align: 'center',
required: true,
width: '110',
children: [
{ text: '-', value: 'testValueOneDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFourDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueSixDate', align: 'center', required: true, type: 'text' },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', type: 'text' },
])
// 稳定性表头--信号源核查
const columns_stability_relative_level = ref<TableColumn[]>([
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'text', unit: 'amplitudeUnit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '110',
children: [
{ text: '-', value: 'testValueOneDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFourDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueSixDate', align: 'center', required: true, type: 'text' },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', type: 'text' },
])
// 稳定性表头--信号源核查 -- 日期选择
const columns_stability_relative_level_check_data = ref<TableColumn[]>([
{ text: '核查项目', value: 'checkParam', align: 'center', required: true, type: 'text' },
{ text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'text', unit: 'unit' },
{ text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'text', unit: 'amplitudeUnit' },
{
text: '测量值',
value: 'indicatingValue',
align: 'center',
required: true,
width: '110',
children: [
{ text: '-', value: 'testValueOneDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFourDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: true, type: 'text' },
{ text: '-', value: 'testValueSixDate', align: 'center', required: true, type: 'text' },
],
},
{ text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
{ text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' },
{ text: 'U(k=2)', value: 'urel', align: 'center', type: 'text' },
{ text: '结论', value: 'lessThan', align: 'center', type: 'text' },
])
const listRepeatability = ref<any[]>([]) // 重复性数据
const listStability = ref<any[]>([]) // 稳定性数据
const listRepeatabilityCheckData = ref<any[]>([]) // 重复性数据
const listStabilityCheckData = ref<any[]>([]) // 稳定性数据
const frequencyListRepeatability = ref<any[]>([]) // 铯原子频标核查重复性
const frequencyListRepeatabilityCheckData = ref<any[]>([]) // 铯原子频标核查重复性 -- 日期选择
const frequencyListStability = ref<any[]>([]) // 铯原子频标核查率稳定性
const frequencyListStabilityCheckData = ref<any[]>([]) // 铯原子频标核查稳定性 -- 日期选择
const powerListRepeatability = ref<any[]>([]) // 函数信号发生器核查重复性
const powerListRepeatabilityCheckData = ref<any[]>([]) // 函数信号发生器核查重复性 -- 日期选择
const powerListStability = ref<any[]>([]) // 函数信号发生器核查稳定性
const powerListStabilityCheckData = ref<any[]>([]) // 函数信号发生器核查稳定性 -- 日期选择
const relativeLevelListRepeatability = ref<any[]>([]) // 信号源核查重复性
const relativeLevelListRepeatabilityCheckData = ref<any[]>([]) // 信号源核查重复性 -- 日期选择
const relativeLevelListStability = ref<any[]>([]) // 信号源核查稳定性
const relativeLevelListStabilityCheckData = ref<any[]>([]) // 信号源核查平稳定性 -- 日期选择
// 获取配置详情
function fetchCheckItemDetail(cequipmentId: string, belongStandardEquipmentParam: string, itemCategoryIdParam: string, itemCategoryNameParam: string) {
belongStandardEquipment.value = belongStandardEquipmentParam // 检校标准装置
itemCategoryId.value = itemCategoryIdParam // 核查分类id
itemCategoryName.value = itemCategoryNameParam // 核查分类名称
equipmentId.value = cequipmentId
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
const params = {
equipmentId: cequipmentId, // 设备id
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置code
itemCategoryId: itemCategoryId.value, // 核查项分类id
itemCategoryName: itemCategoryName.value, // 核查项分类名称
}
getCheckItemDetail(params).then((res) => {
loading.close()
handleData(res.data.checkItemDataCesiumAtomList)
fetchHistoryIndication() // 获取稳定性
})
}
// 处理数据
function handleData(data: any) {
if (!data) { return }
// 控制tab
const needShowTab = uniqueMultiArray(data, 'params').map((item: any) => item.params)
radioMenus.value = radioMenus.value.filter((item: any) => needShowTab.includes(item.params))
current.value = ''
setTimeout(() => {
current.value = radioMenus.value[0]?.value
})
const handlerData = (type: string, paramsNum: string, paramsName: string, data: any) => {
let result = []
if (type === '重复性') {
const params = props.pageType !== 'add'
? {}
: {
testValueOne: '0',
testValueTwo: '0',
testValueThree: '0',
testValueFour: '0',
testValueFive: '0',
testValueSix: '0',
testValueSeven: '0',
testValueEight: '0',
testValueNine: '0',
testValueTen: '0',
averageValue: '0',
standardDeviation: '0',
}
result = data.filter((item: any) => item.params === paramsNum).map((item: any) => ({
...item,
checkParam: paramsName,
checkType: '重复性',
...params,
editable: true,
}))
}
else {
const params = props.pageType !== 'add'
? {}
: {
testValueOne: '',
testValueTwo: '',
testValueThree: '',
testValueFour: '',
testValueFive: '',
testValueSix: '',
testValueOneDate: '',
testValueTwoDate: '',
testValueThreeDate: '',
testValueFourDate: '',
testValueFiveDate: '',
testValueSixDate: '',
averageValue: '',
stability: '',
lessThan: '',
}
result = data.filter((item: any) => item.params === paramsNum).map((item: any) => ({
...item,
checkParam: paramsName,
checkType: '稳定性',
...params,
// urel: item.urel,
editable: true,
}))
}
return result
}
// 铯原子频标核查重复性
frequencyListRepeatability.value = handlerData('重复性', '1', '铯原子频标核查', data)
// 铯原子频标核查稳定性
frequencyListStability.value = handlerData('稳定性', '1', '铯原子频标核查', data)
// 函数信号发生器核查重复性
powerListRepeatability.value = handlerData('重复性', '2', '函数信号发生器核查', data)
// 函数信号发生器核查稳定性
powerListStability.value = handlerData('稳定性', '2', '函数信号发生器核查', data)
// 信号源核查重复性
relativeLevelListRepeatability.value = handlerData('重复性', '3', '信号源核查', data)
// 信号源核查稳定性
relativeLevelListStability.value = handlerData('稳定性', '3', '信号源核查', data)
}
// 点击生成结果处理
const createResult = (params: string, type: string) => {
// 公共请求函数
const handleResult = (list: any, fun: any) => {
const data = {
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置
checkDataCesiumAtomList: [],
itemCategoryId: itemCategoryId.value, // 核查项分类id
itemCategoryName: itemCategoryName.value, // 核查项分类id
}
data.checkDataCesiumAtomList = list.map((item: any) => ({ ...item, params: item.params === '1' ? '铯原子频标核查' : item.params === '2' ? '函数信号发生器核查' : '信号源核查' }))
calculateHandle(data).then((res) => {
fun(res.data)
})
}
// 公共处理结果函数
const handeData = (initData: any, handleData: any) => {
return handleData.map((item: any, index: number) => {
return {
...item,
averageValue: initData[index].averageValue || item.averageValue, // 核查读数6(本次重复性示值算术平均值)
standardDeviation: initData[index].standardDeviation || item.standardDeviation, // 标准偏差S(X)
testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期)
testValueSix: initData[index].testValueSix || item.testValueSix, // 核查读数6日期(本次核查日期)
}
})
}
// 重复性处理结果
const repeatabilityResult = (params: string) => {
handleResult(
listRepeatability.value, (data: any) => {
listRepeatability.value = handeData(data, listRepeatability.value)
switch (params) {
case '1':
frequencyListRepeatability.value = handeData(data, listRepeatability.value)
break
case '2':
powerListRepeatability.value = handeData(data, listRepeatability.value)
break
case '3':
relativeLevelListRepeatability.value = handeData(data, listRepeatability.value)
break
}
})
}
// 稳定性处理结果
const stabilityResult = (params: string) => {
handleResult(
listStability.value.map((item: any, index: number) => ({
...item,
testValueSix: listRepeatability.value[index].averageValue,
testValueSixDate: props.checkDate,
})), (data: any) => {
listStability.value = handeData(data, listStability.value)
switch (params) {
case '1':
frequencyListStability.value = handeData(data, listStability.value)
break
case '2':
powerListStability.value = handeData(data, listStability.value)
break
case '3':
relativeLevelListStability.value = handeData(data, listStability.value)
break
}
})
}
switch (params) {
case 'frequency':
// 铯原子频标核查
if (!frequencyListRepeatability.value.length) {
ElMessage.warning('铯原子频标核查未配置重复性,请检查')
break
}
switch (type) {
case '重复性':
repeatabilityResult('1')
break
case '稳定性':
if (!frequencyListRepeatability.value[0].averageValue) {
ElMessage.warning('请先计算铯原子频标核查重复性')
break
}
stabilityResult('1')
break
}
break
case 'power':
// 函数信号发生器核查
if (!powerListRepeatability.value.length) {
ElMessage.warning('函数信号发生器核查未配置重复性,请检查')
break
}
switch (type) {
case '重复性':
repeatabilityResult('2')
break
case '稳定性':
if (!powerListRepeatability.value[0].averageValue) {
ElMessage.warning('请先计算函数信号发生器核查重复性')
break
}
stabilityResult('2')
break
}
break
case 'relative-level':
// 信号源核查
if (!relativeLevelListRepeatability.value.length) {
ElMessage.warning('信号源核查未配置重复性,请检查')
break
}
switch (type) {
case '重复性':
repeatabilityResult('3')
break
case '稳定性':
if (!relativeLevelListRepeatability.value[0].averageValue) {
ElMessage.warning('请先计算信号源核查重复性')
break
}
stabilityResult('3')
break
}
break
}
}
// ------------------------------------------------------------------------------------------
// 处理详情数据
const solveGetDetailData = (responseList: any) => {
const dep = JSON.parse(JSON.stringify(responseList))
// 控制tab
const needShowTab = uniqueMultiArray(dep, 'params').map((item: any) => item.params)
radioMenus.value = radioMenus.value.filter((item: any) => needShowTab.includes(item.params))
current.value = ''
setTimeout(() => {
current.value = radioMenus.value[0]?.value
})
const handlerData = (data: any[]) => {
return data.map((item: any) => ({
...item,
editable: props.pageType !== 'detail',
checkParam: item.params === '1' ? '铯原子频标核查' : item.params === '2' ? '函数信号发生器核查' : '信号源核查',
}))
}
// 铯原子频标核查 重复性
const frequencyListRepeatabilityList = handlerData(dep.filter((item: { params: string; checkType: string }) => item.params === '1' && item.checkType === '重复性'))
// 铯原子频标核查 稳定性
const frequencyListStabilityList = handlerData(dep.filter((item: { params: string; checkType: string }) => item.params === '1' && item.checkType === '稳定性'))
// 函数信号发生器核查 重复性
const powerListRepeatabilityList = handlerData(dep.filter((item: { params: string; checkType: string }) => item.params === '2' && item.checkType === '重复性'))
// 函数信号发生器核查 稳定性
const powerListStabilityList = handlerData(dep.filter((item: { params: string; checkType: string }) => item.params === '2' && item.checkType === '稳定性'))
// 信号源核查 重复性
const relativeLevelListRepeatabilityList = handlerData(dep.filter((item: { params: string; checkType: string }) => item.params === '3' && item.checkType === '重复性'))
// 信号源核查 稳定性
const relativeLevelListStabilityList = handlerData(dep.filter((item: { params: string; checkType: string }) => item.params === '3' && item.checkType === '稳定性'))
return {
frequencyListRepeatabilityList,
frequencyListStabilityList,
powerListRepeatabilityList,
powerListStabilityList,
relativeLevelListRepeatabilityList,
relativeLevelListStabilityList,
}
}
// ------------------------------------------------------------------------------------------
// 获取详情
function fetchInfo(id = '') {
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
getInfo({ id: infoId.value }).then((res) => {
form.value = { ...res.data }
equipmentId.value = res.data.equipmentId
const { frequencyListRepeatabilityList, frequencyListStabilityList, powerListRepeatabilityList, powerListStabilityList, relativeLevelListRepeatabilityList, relativeLevelListStabilityList } = solveGetDetailData(res.data.checkDataCesiumAtomList || [])
if (id !== '') { // 查询的日期获得的数据
frequencyListRepeatabilityCheckData.value = frequencyListRepeatabilityList
frequencyListStabilityCheckData.value = frequencyListStabilityList
powerListRepeatabilityCheckData.value = powerListRepeatabilityList
powerListStabilityCheckData.value = powerListStabilityList
relativeLevelListRepeatabilityCheckData.value = relativeLevelListRepeatabilityList
relativeLevelListStabilityCheckData.value = relativeLevelListStabilityList
}
else {
frequencyListRepeatability.value = frequencyListRepeatabilityList
frequencyListStability.value = frequencyListStabilityList
powerListRepeatability.value = powerListRepeatabilityList
powerListStability.value = powerListStabilityList
relativeLevelListRepeatability.value = relativeLevelListRepeatabilityList
relativeLevelListStability.value = relativeLevelListStabilityList
}
nextTick(() => {
if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据
const data = [
{ text: '-', value: 'testValueOneDate', align: 'center', required: false, type: 'text', customHeader: true },
{ text: '-', value: 'testValueTwoDate', align: 'center', required: false, type: 'text', customHeader: true },
{ text: '-', value: 'testValueThreeDate', align: 'center', required: false, type: 'text', customHeader: true },
{ text: '-', value: 'testValueFourDate', align: 'center', required: false, type: 'text', customHeader: true },
{ text: '-', value: 'testValueFiveDate', align: 'center', required: false, type: 'text', customHeader: true },
{ text: '-', value: 'testValueSixDate', align: 'center', required: false, type: 'text', customHeader: true },
] as any[]
columns_stability_frequency.value[3].children = data
columns_stability_power.value[3].children = data
columns_stability_relative_level.value[3].children = data
fetchHistoryIndication(currentDate.value) // 获取稳定性
}
else { // 详情制作表头
columns_stability_frequency.value = handleDetailTableTableHead(columns_stability_frequency.value, frequencyListStability.value, 3)
columns_stability_power.value = handleDetailTableTableHead(columns_stability_power.value, powerListStability.value, 3)
columns_stability_relative_level.value = handleDetailTableTableHead(columns_stability_relative_level.value, relativeLevelListStability.value, 3)
}
// resetCurrent()
})
form.value['1-flit'] = `${frequencyListStability.value.every(item => item.lessThan === 1 || item.lessThan === '1') ? '合格' : '不合格'}`
form.value['2-flit'] = `${powerListStability.value.every(item => item.lessThan === 1 || item.lessThan === '1') ? '合格' : '不合格'}`
form.value['3-flit'] = `${relativeLevelListStability.value.every(item => item.lessThan === 1 || item.lessThan === '1') ? '合格' : '不合格'}`
if (props.pageType === 'edit') {
fetchHistoryIndication() // 重新拉取稳定性日期
}
loading.close()
})
}
function resetCurrent() {
const currentBak = current.value
current.value = ''
setTimeout(() => {
current.value = currentBak
})
}
/**
* 获取稳定性示值
* @param date 查询日期
*/
function fetchHistoryIndication(date = '') {
const params = {
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code)
checkDate: date || props.checkDate!, // 核查日期
checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量))
conclusion: '合格', // 结论
equipmentId: equipmentId.value, // 被核查设备id
params: radioMenus.value[0]?.params, // 核查项目
stabilityExamine: '1', // 是否用于稳定性考核(1/0)
standardEquipmentId: props.selectStandardId!, // 被核查标准装置id
}
if (props.selectStandardId && equipmentId.value) {
getHistoryIndication(params).then((res) => {
if (date === '') { // 正常核查数据
const num = props.pageType === 'edit' ? 5 : 4
// 铯原子频标核查
if (radioMenus.value.filter((item: { name: string }) => item.name === '铯原子频标核查').length) {
frequencyListStability.value = frequencyListStability.value.map((item) => {
// clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_frequency.value, num, 3, '14')
columns_stability_frequency.value = columnsData
return item = itemData
})
frequencyListStability.value = handleSaveDateParams(columns_stability_frequency.value, frequencyListStability.value, 3)
}
// 函数信号发生器核查
if (radioMenus.value.filter((item: { name: string }) => item.name === '函数信号发生器核查').length) {
powerListStability.value = powerListStability.value.map((item) => {
// clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_power.value, num, 3, '14')
columns_stability_power.value = columnsData
return item = itemData
})
powerListStability.value = handleSaveDateParams(columns_stability_power.value, powerListStability.value, 3)
}
// 信号源核查
if (radioMenus.value.filter((item: { name: string }) => item.name === '信号源核查').length) {
relativeLevelListStability.value = relativeLevelListStability.value.map((item) => {
// clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_relative_level.value, num, 3, '14')
columns_stability_relative_level.value = columnsData
return item = itemData
})
relativeLevelListStability.value = handleSaveDateParams(columns_stability_relative_level.value, relativeLevelListStability.value, 3)
}
}
else {
// 铯原子频标核查
if (radioMenus.value.filter((item: { name: string }) => item.name === '信号源核查').length) {
frequencyListStabilityCheckData.value = frequencyListStabilityCheckData.value.map((item) => {
// clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, columns_stability_frequency_check_data.value, 5, 3, '14')
columns_stability_frequency_check_data.value = columnsData
return item = itemData
})
frequencyListStabilityCheckData.value = handleSaveDateParams(columns_stability_frequency_check_data.value, frequencyListStabilityCheckData.value, 3)
}
// 函数信号发生器核查
if (radioMenus.value.filter((item: { name: string }) => item.name === '信号源核查').length) {
powerListStabilityCheckData.value = powerListStabilityCheckData.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, columns_stability_power_check_data.value, 5, 3, '14')
columns_stability_power_check_data.value = columnsData
return item = itemData
})
powerListStabilityCheckData.value = handleSaveDateParams(columns_stability_power_check_data.value, powerListStabilityCheckData.value, 3)
}
// 信号源核查
if (radioMenus.value.filter((item: { name: string }) => item.name === '信号源核查').length) {
relativeLevelListStabilityCheckData.value = relativeLevelListStabilityCheckData.value.map((item) => {
clearDateValue(item)
const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, columns_stability_relative_level_check_data.value, 5, 3, '14')
columns_stability_relative_level_check_data.value = columnsData
return item = itemData
})
relativeLevelListStabilityCheckData.value = handleSaveDateParams(columns_stability_relative_level_check_data.value, relativeLevelListStabilityCheckData.value, 3)
}
}
})
}
}
// =======================点击表头日期查询历史稳定性数据===================
// 点击表头
const handleClickHeader = (val: any, checkDateDetailId: string) => {
dateArrStability.value = ['核查数据', val.label]
fetchInfo(checkDateDetailId) // 获取此次历史日期的详情
}
// 日期变化
const handleChangeRadio = (date: string) => {
currentDate.value = date
}
// 监听核查日期变化
watch(() => props.checkDate, (newValue) => {
initColumns()
nextTick(() => {
fetchHistoryIndication() // 重新拉取稳定性日期
})
}, { immediate: true })
/**
* 初始化表头
* @param soveLastColumnDate 是否处理最后一列
*/
function initColumns() {
columns_stability_frequency.value[3].children = [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
]
columns_stability_power.value[3].children = [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
]
columns_stability_relative_level.value[3].children = [
{ width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
{ width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
]
const index = columns_stability_frequency.value.findIndex(item => item.text === '测量值')
if (index !== -1) {
columns_stability_frequency.value[index].children![5].text = props.checkDate! // 最后一列的表头日期
}
const indexWorst = columns_stability_power.value.findIndex(item => item.text === '测量值/1MΩ')
if (index !== -1) {
columns_stability_power.value[indexWorst].children![5].text = props.checkDate! // 最后一列的表头日期
}
const indexModel = columns_stability_relative_level.value.findIndex(item => item.text === '测量值')
if (index !== -1) {
columns_stability_relative_level.value[indexModel].children![5].text = props.checkDate! // 最后一列的表头日期
}
}
// / 保存之前的校验
function checkList() {
// 新建核查数据的时候,在保存之前要先校验一下本次核查日期有没有数据,没有不允许保存
if (`${frequencyListRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请计算铯原子频标核查重复性')
return false
}
if (`${powerListRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请计算函数信号发生器核查重复性')
return false
}
if (`${relativeLevelListRepeatability.value[0].averageValue}` === '') {
ElMessage.warning('请计算信号源核查重复性')
return false
}
return true
}
// -------------------------------------钩子-----------------------------------------------------
// 统计日期
const dateCount = (columns: TableColumn[], index: number) => {
let dateNum = 0 // 稳定性表格有几个日期
// 统计有几个日期
columns[index].children?.forEach((item) => {
if (item.text !== '-' && item.text !== '') {
dateNum += 1
}
})
return dateNum
}
watch(() => [frequencyListStability.value, powerListStability.value, relativeLevelListStability.value], (newVal) => {
const dateNum1 = dateCount(columns_stability_frequency.value, 3)
const dateNum2 = dateCount(columns_stability_power.value, 3)
const dateNum3 = dateCount(columns_stability_relative_level.value, 3)
form.value['1-flit'] = dateNum1 < 4 ? '合格' : newVal[0]?.every(item => item.lessThan === 1 || item.lessThan === '1') ? '合格' : '不合格'
form.value['2-flit'] = dateNum2 < 4 ? '合格' : newVal[1]?.every(item => item.lessThan === 1 || item.lessThan === '1') ? '合格' : '不合格'
form.value['3-flit'] = dateNum3 < 4 ? '合格' : newVal[2]?.every(item => item.lessThan === 1 || item.lessThan === '1') ? '合格' : '不合格'
}, { deep: true })
watch(() => current.value, (newValue) => {
if (currentDate.value.includes('-')) { return }
switch (newValue) {
case 'frequency': // 铯原子频标核查
repeatabilityColumns.value = columns_repeatability_frequency.value // 重复性表头
stabilityColumns.value = columns_stability_frequency.value // 稳定性表头
listRepeatability.value = frequencyListRepeatability.value // 重复性数据
listStability.value = frequencyListStability.value // 稳定性数据
break
case 'power': // 函数信号发生器核查
repeatabilityColumns.value = columns_repeatability_power.value // 重复性表头
stabilityColumns.value = columns_stability_power.value // 稳定性表头
listRepeatability.value = powerListRepeatability.value // 重复性数据
listStability.value = powerListStability.value // 稳定性数据
break
case 'relative-level': // 信号源核查
repeatabilityColumns.value = columns_repeatability_relative_level.value // 重复性表头
stabilityColumns.value = columns_stability_relative_level.value // 稳定性表头
listRepeatability.value = relativeLevelListRepeatability.value // 重复性数据
listStability.value = relativeLevelListStability.value // 稳定性数据
break
}
}, { immediate: true })
watch(() => [currentDate.value, current.value], (newValue) => {
if (newValue[0] === '核查数据') { return }
switch (newValue[1]) {
case 'frequency': // 铯原子频标核查
listRepeatabilityCheckData.value = frequencyListRepeatabilityCheckData.value
repeatabilityColumnsCheckData.value = columns_repeatability_frequency.value
listStabilityCheckData.value = frequencyListStabilityCheckData.value
stabilityColumnsCheckData.value = columns_stability_frequency_check_data.value
break
case 'power': // 函数信号发生器核查
listRepeatabilityCheckData.value = powerListRepeatabilityCheckData.value
repeatabilityColumnsCheckData.value = columns_repeatability_power.value
listStabilityCheckData.value = powerListStabilityCheckData.value
stabilityColumnsCheckData.value = columns_stability_power_check_data.value
break
case 'relative-level': // 信号源核查
listRepeatabilityCheckData.value = relativeLevelListRepeatabilityCheckData.value
repeatabilityColumnsCheckData.value = columns_repeatability_relative_level.value
listStabilityCheckData.value = relativeLevelListStabilityCheckData.value
stabilityColumnsCheckData.value = columns_stability_relative_level_check_data.value
break
}
})
onMounted(async () => {
belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置
itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id
itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称
if (pageType.value !== 'add') {
fetchInfo()
}
})
const getList = () => {
const arr = [...frequencyListRepeatability.value || [], ...frequencyListStability.value || [], ...powerListRepeatability.value || [], ...powerListStability.value || [], ...relativeLevelListRepeatability.value || [], ...relativeLevelListStability.value || []] as any[]
return arr
}
// watch(() => props.pageType, (newVal) => {
// console.log(newVal, 'newVal')
// })
defineExpose({ fetchCheckItemDetail, form, checkList, getList })
</script>
<template>
<!-- 核查数据 -->
<detail-block :title="dateArrStability.length > 1 ? ' ' : '核查数据'" :title-menus="dateArrStability" @handle-change-radio="handleChangeRadio">
<div style="display: flex;justify-content: space-between;">
<el-radio-group v-model="current" style="margin-bottom: 20px;">
<el-radio-button v-for="item in radioMenus" :key="item.value" :label="item.value">
{{ item.name }}
</el-radio-button>
</el-radio-group>
</div>
<div style="display: flex;justify-content: space-between;align-items: center;">
<h5>核查类型--重复性</h5>
<el-button v-if="pageType !== 'detail'" type="primary" @click="createResult(current, '重复性')">
生成结果处理
</el-button>
</div>
<multi-table
v-show="currentDate === '核查数据' || currentDate === ''"
:table-data="listRepeatability"
:table-header="repeatabilityColumns"
:merge-rows="[]"
:need-index="true"
/>
<!-- 历史日期重复性数据 -->
<multi-table
v-show="currentDate !== '核查数据' && currentDate !== ''"
:table-data="listRepeatabilityCheckData"
:table-header="repeatabilityColumnsCheckData"
:merge-rows="[]"
:need-index="true"
max-height="300"
/>
<div style="display: flex;justify-content: space-between;align-items: center;">
<h5>核查类型--稳定性</h5>
<el-button v-if="pageType !== 'detail'" type="primary" @click="createResult(current, '稳定性')">
生成结果处理
</el-button>
</div>
<multi-table
v-show="currentDate === '核查数据' || currentDate === ''"
:table-data="listStability"
:table-header="stabilityColumns"
:merge-rows="[]"
:need-index="true"
max-height="500"
@handle-click-header="handleClickHeader"
/>
<multi-table
v-show="currentDate !== '核查数据' && currentDate !== ''"
:table-data="listStabilityCheckData"
:table-header="stabilityColumnsCheckData"
:merge-rows="[]"
:need-index="true"
max-height="500"
@handle-click-header="handleClickHeader"
/>
<!-- 稳定性考核是否合格 -->
<el-form
style="margin-top: 20px;"
:model="form"
label-width="160"
label-position="right"
>
<el-row :gutter="24">
<el-col :span="12">
<el-form-item v-if="current === 'frequency'" label="稳定性考核是否合格:" prop="flit">
<el-input v-model="form['1-flit']" class="full-width-input" disabled :placeholder="pageType === 'detail' ? ' ' : '稳定性考核是否合格'" />
</el-form-item>
<el-form-item v-if="current === 'power'" label="稳定性考核是否合格:" prop="flit">
<el-input v-model="form['2-flit']" class="full-width-input" disabled :placeholder="pageType === 'detail' ? ' ' : '稳定性考核是否合格'" />
</el-form-item>
<el-form-item v-if="current === 'relative-level'" label="稳定性考核是否合格:" prop="flit">
<el-input v-model="form['3-flit']" class="full-width-input" disabled :placeholder="pageType === 'detail' ? ' ' : '稳定性考核是否合格'" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</detail-block>
<!-- 保存核查记录 -->
<save-check-record ref="saveCheckRecordRef" />
</template>
<style lang="scss" scoped>
.link {
text-decoration: underline;
color: #3d7eff;
cursor: pointer;
}
.file-area {
display: flex;
align-items: center;
font-size: 14px;
color: #60627f;
margin-bottom: 10px;
margin-left: 40px;
white-space: nowrap;
.tech-file {
display: flex;
align-items: center;
margin-left: 20px;
.file-text {
margin-right: 10px;
}
}
}
</style>