diff --git a/src/views/equipement/standard/checkData/checkData-interface.ts b/src/views/equipement/standard/checkData/checkData-interface.ts index 1560c2f..ae28454 100644 --- a/src/views/equipement/standard/checkData/checkData-interface.ts +++ b/src/views/equipement/standard/checkData/checkData-interface.ts @@ -35,7 +35,6 @@ checkAccord: string // 核查依据(即标准装置的作业指导书文件minio文件名,多个分号分割) createUserName: string // 核查员 stabilityExamine: string // 是否用于稳定性考核(1/0) - conclusion: string // 稳定性考核是否合格 } // 核查标准设备表格 diff --git a/src/views/equipement/standard/checkData/checkData-interface.ts b/src/views/equipement/standard/checkData/checkData-interface.ts index 1560c2f..ae28454 100644 --- a/src/views/equipement/standard/checkData/checkData-interface.ts +++ b/src/views/equipement/standard/checkData/checkData-interface.ts @@ -35,7 +35,6 @@ checkAccord: string // 核查依据(即标准装置的作业指导书文件minio文件名,多个分号分割) createUserName: string // 核查员 stabilityExamine: string // 是否用于稳定性考核(1/0) - conclusion: string // 稳定性考核是否合格 } // 核查标准设备表格 diff --git a/src/views/equipement/standard/checkData/components/first/checkDataCom.vue b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue new file mode 100644 index 0000000..d5ccf09 --- /dev/null +++ b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue @@ -0,0 +1,402 @@ + + + + + + + diff --git a/src/views/equipement/standard/checkData/checkData-interface.ts b/src/views/equipement/standard/checkData/checkData-interface.ts index 1560c2f..ae28454 100644 --- a/src/views/equipement/standard/checkData/checkData-interface.ts +++ b/src/views/equipement/standard/checkData/checkData-interface.ts @@ -35,7 +35,6 @@ checkAccord: string // 核查依据(即标准装置的作业指导书文件minio文件名,多个分号分割) createUserName: string // 核查员 stabilityExamine: string // 是否用于稳定性考核(1/0) - conclusion: string // 稳定性考核是否合格 } // 核查标准设备表格 diff --git a/src/views/equipement/standard/checkData/components/first/checkDataCom.vue b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue new file mode 100644 index 0000000..d5ccf09 --- /dev/null +++ b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue @@ -0,0 +1,402 @@ + + + + + + + diff --git a/src/views/equipement/standard/checkData/detail.vue b/src/views/equipement/standard/checkData/detail.vue index eba58e6..e4e40a4 100644 --- a/src/views/equipement/standard/checkData/detail.vue +++ b/src/views/equipement/standard/checkData/detail.vue @@ -6,6 +6,7 @@ import type { IDetailCheckData, IEquipmentList, IForm } from './checkData-interface' import selectStandardEquipmentDialog from './dialog/selectStandardEquipmentDialog.vue' import saveCheckRecord from './dialog/saveCheckRecord.vue' +import checkDataFirst from './components/first/checkDataCom.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' import { getDictByCode } from '@/api/system/dict' @@ -34,7 +35,6 @@ checkAccord: '', // 核查依据(即标准装置的作业指导书文件minio文件名,多个分号分割) createUserName: '', // 核查员 stabilityExamine: '', // 是否用于稳定性考核(1/0) - conclusion: '', // 稳定性考核是否合格 }) // 校验规则 const formRules = ref({ @@ -49,7 +49,7 @@ }) const saveCheckRecordRef = ref() // 保存核查记录dialog组件ref - +const checkDataFirstRef = ref() // 第一套多功能校准源标准装置组件ref // -------------------------------------------字典------------------------------------------ const deviceTypeList = ref([])// 设备分类 const standardList = ref([])// 检校标准装置 @@ -146,6 +146,9 @@ const selectStandardId = ref('') // 被核查设备选择的标准装置id const selectStandardName = ref('') // 被核查设备选择的标准装置名称 const belongStandardEquipment = ref('') // 检校标准装置code +const itemCategoryId = ref('') // 核查项分类id +const itemCategoryName = ref('') // 核查项分类名称 +itemCategoryId const chekedEquipmentList = ref([{ id: '', equipmentNo: '', // 设备编号 @@ -170,6 +173,8 @@ selectStandardId.value = standardId // 被核查设备选择的标准装置id selectStandardName.value = standardName // 被核查设备选择的标准装置name belongStandardEquipment.value = belongStandardEquipmentParams // 检校标准装置code + itemCategoryId.value = val[0].itemCategoryId // 核查项分类id + itemCategoryName.value = val[0].itemCategoryName // 核查项分类名称 let measureRange = '' // 测量范围 let accuracyLevel = '' // 准确度等级 if (val[0].technicalTargetList.length) { @@ -200,7 +205,7 @@ itemCategoryId: val[0].itemCategoryId, // 核查项分类id itemCategoryName: val[0].itemCategoryName, // 核查项分类名称 }] - fetchCheckItemDetail() // 获取核查数据 + checkDataFirstRef.value.fetchCheckItemDetail(val[0].id, belongStandardEquipment.value, itemCategoryId.value, itemCategoryName.value) // 获取核查数据 } // -------------------------------------------表单--请求核查依据(作业指导书)---------------------------------------- @@ -223,273 +228,37 @@ }) } -// ----------------------------------------核查数据---------------------------------------------- -const radioMenus = ref([ // 标签内容 - { name: '最佳点', value: 'best' }, - { name: '最差点', value: 'worst' }, - { name: '典型点', value: 'model' }, - -]) -const current = ref('best') // 选择的tab 默认基本信息 -const repeatabilityColumns = ref([ // 重复性表头 - { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'text' }, - { text: '单位', value: 'unit', align: 'center', required: true, type: 'text' }, - { text: '频率', value: 'frequency', align: 'center', type: 'text' }, - { text: '单位', value: 'frequencyUnit', align: 'center', type: 'text' }, - { - text: '示值', - value: 'indicatingValue', - align: 'center', - required: true, - width: '160', - children: [ - { text: '1', value: '1', align: 'center', required: true, type: 'inputNumber' }, - { text: '2', value: '2', align: 'center', required: true, type: 'inputNumber' }, - { text: '3', value: '3', align: 'center', required: true, type: 'inputNumber' }, - { text: '4', value: '4', align: 'center', required: true, type: 'inputNumber' }, - { text: '5', value: '5', align: 'center', required: true, type: 'inputNumber' }, - { text: '6', value: '6', align: 'center', required: true, type: 'inputNumber' }, - ], - }, - { text: '算数平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '标准偏差S(X)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, - { text: '相对重复性', value: 'relativeRepeatability', align: 'center', type: 'text' }, -]) -const stabilityColumns = ref([ // 稳定性表头 - { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'text' }, - { text: '单位', value: 'unit', align: 'center', required: true, type: 'text' }, - { text: '频率', value: 'frequency', align: 'center', type: 'text' }, - { text: '单位', value: 'frequencyUnit', align: 'center', type: 'text' }, - { - text: '示值', - value: 'indicatingValue', - align: 'center', - required: true, - width: '110', - children: [ - { text: '2022-12-12', value: '2022-12-12', align: 'center', required: true, type: 'text' }, - { text: '2022-12-13', value: '2022-12-13', align: 'center', required: true, type: 'text' }, - { text: '2022-12-14', value: '2022-12-14', align: 'center', required: true, type: 'text' }, - { text: '2022-12-15', value: '2022-12-15', align: 'center', required: true, type: 'text' }, - { text: '2022-12-16', value: '2022-12-16', align: 'center', required: true, type: 'text' }, - { text: '2022-12-17', value: '2022-12-17', align: 'center', required: true, type: 'text' }, - ], - }, - { text: '算数平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '标准偏差S(X)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, - { text: '相对重复性', value: 'relativeRepeatability', align: 'center', type: 'text' }, - // { text: '历次核查Sn(x)', value: 'previousCheck', align: 'center' }, - { text: 'Urel', value: 'urel', align: 'center', type: 'text' }, - { text: '相对重复性是否小于相对扩展不确定度Urel', value: 'lessThan', align: 'center', type: 'text' }, - // { text: '稳定性考核是否合格', value: 'flit', align: 'center' }, -]) - -const bestList = ref([]) // 最佳点重复性 -const bestListStability = ref([]) // 最佳点稳定性 -const worstList = ref([]) // 最差点重复性 -const worstListStability = ref([]) // 最差点稳定性 -const modelList = ref([]) // 典型点重复性 -const modelListStability = ref([]) // 典型点稳定性 - -// 获取配置详情 -function fetchCheckItemDetail() { - const loading = ElLoading.service({ - lock: true, - background: 'rgba(255, 255, 255, 0.8)', - }) - const params = { - belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置code - itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id - itemCategoryName: chekedEquipmentList.value[0].itemCategoryName, // 核查项分类名称 - } - getCheckItemDetail(params).then((res) => { - loading.close() - handleData(res.data.checkItemDataCalibratorList) - }) -} - -// 处理数据 -function handleData(list: any, type = 'edit') { -// 最佳点 - bestList.value = list.filter((item: { testType: string }) => item.testType === '最佳点') - // 最佳点重复性 - bestList.value = bestList.value.map((e: any) => { - return { - ...e, - frequency: !e.frequency ? '/' : e.frequency, // 频率 - frequencyUnit: !e.frequencyUnit ? '/' : e.frequencyUnit, // 频率单位 - 1: 0, - 2: 0, - 3: 0, - 4: 0, - 5: 0, - 6: 0, - editable: type === 'edit', - averageValue: '', // 核查读数平均值(算数平均值) - dataId: e.id, // 核查数据管理基础信息表id - id: '', // id,更新/删除使用参数 - lessThan: '', // 是否小于相对扩展不确定度Urel(0/1) - previousCheck: '', // 历次核查Sn(x)(历次核查的标准偏差)(只稳定性有该值) - qualified: '', // 稳定性考核是否合格 - relativeRepeatability: '', // Sn(x)/核查读数平均值(相对重复性) - standardDeviation: '', // Sn(x)(标准偏差) - testType: '', // 核查点类型(直接存字典value) - testValueFive: '', // 核查读数5(示值) - testValueFiveDate: '', // 核查读数5日期(稳定性) - testValueFour: '', // 核查读数4(示值) - testValueFourDate: '', // 核查读数4日期(稳定性) - testValueOne: '', // 核查读数1(示值) - testValueOneDate: '', // 核查读数1日期(稳定性) - testValueSix: '', // 核查读数6(本次示值) - testValueSixDate: '', // 核查读数6日期(稳定性) - testValueThree: '', // 核查读数3(示值) - testValueThreeDate: '', // 核查读数3日期(稳定性) - testValueTwo: '', // 核查读数2(示值) - testValueTwoDate: '', // 核查读数2日期(稳定性) - unit: e.unit, // 单位(直接存字典value) - urel: '', // UREL - } - }) - // // 最佳点稳定性 - // bestListStability.value = bestList.value.map((e: any) => { - // return { - // ...e, - // frequency: !e.frequency ? '/' : e.frequency, // 频率 - // frequencyUnit: !e.frequencyUnit ? '/' : e.frequencyUnit, // 频率单位 - // } - // }) - // 最差点 - worstList.value = list.filter((item: { testType: string }) => item.testType === '最差点') - // 最差点重复性 - worstList.value = worstList.value.map((e: any) => { - return { - ...e, - frequency: !e.frequency ? '/' : e.frequency, // 频率 - frequencyUnit: !e.frequencyUnit ? '/' : e.frequencyUnit, // 频率单位 - 1: 1, - 2: 1, - 3: 1, - 4: 1, - 5: 1, - 6: 1, - editable: type === 'edit', - averageValue: '', // 核查读数平均值(算数平均值) - dataId: e.id, // 核查数据管理基础信息表id - id: '', // id,更新/删除使用参数 - lessThan: '', // 是否小于相对扩展不确定度Urel(0/1) - previousCheck: '', // 历次核查Sn(x)(历次核查的标准偏差)(只稳定性有该值) - qualified: '', // 稳定性考核是否合格 - relativeRepeatability: '', // Sn(x)/核查读数平均值(相对重复性) - standardDeviation: '', // Sn(x)(标准偏差) - testType: '', // 核查点类型(直接存字典value) - testValueFive: '', // 核查读数5(示值) - testValueFiveDate: '', // 核查读数5日期(稳定性) - testValueFour: '', // 核查读数4(示值) - testValueFourDate: '', // 核查读数4日期(稳定性) - testValueOne: '', // 核查读数1(示值) - testValueOneDate: '', // 核查读数1日期(稳定性) - testValueSix: '', // 核查读数6(本次示值) - testValueSixDate: '', // 核查读数6日期(稳定性) - testValueThree: '', // 核查读数3(示值) - testValueThreeDate: '', // 核查读数3日期(稳定性) - testValueTwo: '', // 核查读数2(示值) - testValueTwoDate: '', // 核查读数2日期(稳定性) - unit: e.unit, // 单位(直接存字典value) - urel: '', // UREL - } - }) - // // 最差点稳定性 - // worstListStability.value = worstList.value.map((e: any) => { - // return { - // ...e, - // frequency: !e.frequency ? '/' : e.frequency, // 频率 - // frequencyUnit: !e.frequencyUnit ? '/' : e.frequencyUnit, // 频率单位 - // editable: true, - // } - // }) - // 典型点 - modelList.value = list.filter((item: { testType: string }) => item.testType === '典型点') - // 典型点重复性 - modelList.value = modelList.value.map((e: any) => { - return { - ...e, - frequency: !e.frequency ? '/' : e.frequency, // 频率 - frequencyUnit: !e.frequencyUnit ? '/' : e.frequencyUnit, // 频率单位 - 1: 2, - 2: 2, - 3: 2, - 4: 2, - 5: 2, - 6: 2, - editable: type === 'edit', - averageValue: '', // 核查读数平均值(算数平均值) - dataId: e.id, // 核查数据管理基础信息表id - id: '', // id,更新/删除使用参数 - lessThan: '', // 是否小于相对扩展不确定度Urel(0/1) - previousCheck: '', // 历次核查Sn(x)(历次核查的标准偏差)(只稳定性有该值) - qualified: '', // 稳定性考核是否合格 - relativeRepeatability: '', // Sn(x)/核查读数平均值(相对重复性) - standardDeviation: '', // Sn(x)(标准偏差) - testType: '', // 核查点类型(直接存字典value) - testValueFive: '', // 核查读数5(示值) - testValueFiveDate: '', // 核查读数5日期(稳定性) - testValueFour: '', // 核查读数4(示值) - testValueFourDate: '', // 核查读数4日期(稳定性) - testValueOne: '', // 核查读数1(示值) - testValueOneDate: '', // 核查读数1日期(稳定性) - testValueSix: '', // 核查读数6(本次示值) - testValueSixDate: '', // 核查读数6日期(稳定性) - testValueThree: '', // 核查读数3(示值) - testValueThreeDate: '', // 核查读数3日期(稳定性) - testValueTwo: '', // 核查读数2(示值) - testValueTwoDate: '', // 核查读数2日期(稳定性) - unit: e.unit, // 单位(直接存字典value) - urel: '', // UREL - } - }) - // // 典型点稳定性 - // modelListStability.value = modelList.value.map((e: any) => { - // return { - // ...e, - // frequency: !e.frequency ? '/' : e.frequency, // 频率 - // frequencyUnit: !e.frequencyUnit ? '/' : e.frequencyUnit, // 频率单位 - // editable: true, - // } - // }) -} - -// 点击生成结果处理 -const createResult = () => { - if (current.value === 'best' && !bestList.value.length) { // 最佳点 - ElMessage.warning('最佳点未配置重复性,请检查') - return false - } - if (current.value === 'worst' && !worstList.value.length) { // 最佳点 - ElMessage.warning('最差点未配置重复性,请检查') - return false - } - if (current.value === 'model' && !modelList.value.length) { // 最佳点 - ElMessage.warning('典型点未配置重复性,请检查') - return false - } - ElMessage.info('敬请期待') - const params = { - belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataCalibratorList: bestList.value.concat(bestListStability.value, worstList.value, worstListStability.value, modelList.value, modelListStability.value), - itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id - } - // calculateHandle(params).then(() => { - - // }) -} // ------------------------------------------------------------------------------------------ // 关闭新增页面的回调 const close = () => { $router.back() } +// 处理保存数据 +const solveSaveParams = () => { + let params + if (belongStandardEquipment.value === '1') { + const tempCheckDataCalibratorList = checkDataFirstRef.value.bestList.concat(checkDataFirstRef.value.bestListStability, checkDataFirstRef.value.worstList, checkDataFirstRef.value.worstListStability, checkDataFirstRef.value.modelList, checkDataFirstRef.value.modelListStability) + params = { + ...form.value, + ...checkDataFirstRef.value.form, + checkAccord: technologyFile.value.join(','), // 核查依据 + checkDataCalibratorList: tempCheckDataCalibratorList, // 核查数据 + checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 + equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id + createUserId: user.id, // 核查员id + createUserName: user.name, // 核查员 + // temperature: Number(form.value.temperature), // 环境温度 + // humidity: Number(form.value.humidity), // 环境湿度 + itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id + standardEquipmentId: selectStandardId.value, // 被核查标准装置id + id: infoId.value, + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + } + } + return params +} + // 保存 const save = () => { if (!equipmentList.value.length) { @@ -506,25 +275,7 @@ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - - const tempCheckDataCalibratorList = bestList.value.concat(bestListStability.value, worstList.value, worstListStability.value, modelList.value, modelListStability.value) - const params = { - ...form.value, - checkAccord: technologyFile.value.join(','), // 核查依据 - checkDataCalibratorList: tempCheckDataCalibratorList, - checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 - equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id - createUserId: user.id, // 核查员id - createUserName: user.name, // 核查员 - // temperature: Number(form.value.temperature), // 环境温度 - // humidity: Number(form.value.humidity), // 环境湿度 - itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id - standardEquipmentId: selectStandardId.value, // 被核查标准装置id - id: infoId.value, - belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataPistonGaugeList: [], // 第二套 - checkDataElectricalSafetyList: [], - } + const params = solveSaveParams()// 处理保存入参 if (pageType.value === 'add') { // 新建 addCheckData(params).then((res) => { ElMessage.success('保存成功') @@ -566,9 +317,6 @@ }) getInfo({ id: infoId.value }).then((res) => { form.value = { ...res.data } - // ======================暂时如此处理======================= - // handleData(res.data.checkDataCalibratorList, 'detail') - bestList.value = res.data.checkDataCalibratorList // ========================================================= chekedEquipmentList.value = [{ // 被检设备 id: '', @@ -597,7 +345,7 @@ const params = { ...form.value, checkAccord: technologyFile.value.join(','), // 核查依据 - checkDataCalibratorList: bestList.value.concat(bestListStability.value, worstList.value, worstListStability.value, modelList.value, modelListStability.value), + checkDataCalibratorList: checkDataFirstRef.value.bestList.concat(checkDataFirstRef.value.bestListStability, checkDataFirstRef.value.worstList, checkDataFirstRef.value.worstListStability, checkDataFirstRef.value.modelList, checkDataFirstRef.value.modelListStability), checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id createUserId: user.id, // 核查员id @@ -614,7 +362,7 @@ // -------------------------------------钩子----------------------------------------------------- watch(() => selectStandardId.value, (newValue) => { if (newValue) { - fetchJobInstruction(false, newValue) // 新建的时候获取核查依据 + fetchJobInstruction(false, newValue) // 请求作业指导书 } }) onMounted(async () => { @@ -799,50 +547,9 @@ - - -
- - - {{ item.name }} - - - - 生成结果处理 - -
- -
核查类型--重复性
- -
核查类型--稳定性
- - - - - - - - - - - -
+