diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
index 806e280..31efbd6 100644
--- a/src/components/MultiHeaderTable/tableColumn.vue
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -58,10 +58,12 @@
:show-overflow-tooltip="showOverflowTooltip"
>
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,8 +97,10 @@
border-radius: 10px;
// width: fit-content;
background-color: v-bind(backgroundColor);
- width: 400px;
- height: 260px;
+ // width: 400px;
+ // height: 260px;
+ width: 500px;
+ height: 300px;
.left {
flex: 1;
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
index 806e280..31efbd6 100644
--- a/src/components/MultiHeaderTable/tableColumn.vue
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -58,10 +58,12 @@
:show-overflow-tooltip="showOverflowTooltip"
>
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,8 +97,10 @@
border-radius: 10px;
// width: fit-content;
background-color: v-bind(backgroundColor);
- width: 400px;
- height: 260px;
+ // width: 400px;
+ // height: 260px;
+ width: 500px;
+ height: 300px;
.left {
flex: 1;
diff --git a/src/views/business/taskMeasure/print/detail.vue b/src/views/business/taskMeasure/print/detail.vue
index a3db212..77490d2 100644
--- a/src/views/business/taskMeasure/print/detail.vue
+++ b/src/views/business/taskMeasure/print/detail.vue
@@ -72,6 +72,10 @@
])
// 选中
const handleSelectionChange = (e: any) => {
+ if (!e[0].identifyTypeName) {
+ ElMessage.warning('无标志类型, 不可打印')
+ return false
+ }
checkoutList.value = e
}
// 点击清空列表
@@ -115,7 +119,6 @@
// 选好设备
const confirmSelectEquipment = (val: any) => {
console.log(val)
-
if (val.length) {
val.forEach((item: any) => {
const index = list.value.findIndex((e: { deviceNo: string }) => e.deviceNo === item.equipmentNo)
@@ -221,12 +224,12 @@
-
- 打印
-
+
+ 打印
+
关闭
@@ -245,14 +248,14 @@
设备计量标识
-
+
清空列表
-
-
+ -->
+
+
+
+
+
+ {{ scope.$index + 1 }}
+
+
+
+
@@ -282,7 +303,6 @@
:date-title="printMenu[item.identifyTypeName].dateTitle"
:person-title="printMenu[item.identifyTypeName].personTitle"
:background-color="printMenu[item.identifyTypeName].backgroundColor"
- style="margin-top: 10px;"
/>
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
index 806e280..31efbd6 100644
--- a/src/components/MultiHeaderTable/tableColumn.vue
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -58,10 +58,12 @@
:show-overflow-tooltip="showOverflowTooltip"
>
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,8 +97,10 @@
border-radius: 10px;
// width: fit-content;
background-color: v-bind(backgroundColor);
- width: 400px;
- height: 260px;
+ // width: 400px;
+ // height: 260px;
+ width: 500px;
+ height: 300px;
.left {
flex: 1;
diff --git a/src/views/business/taskMeasure/print/detail.vue b/src/views/business/taskMeasure/print/detail.vue
index a3db212..77490d2 100644
--- a/src/views/business/taskMeasure/print/detail.vue
+++ b/src/views/business/taskMeasure/print/detail.vue
@@ -72,6 +72,10 @@
])
// 选中
const handleSelectionChange = (e: any) => {
+ if (!e[0].identifyTypeName) {
+ ElMessage.warning('无标志类型, 不可打印')
+ return false
+ }
checkoutList.value = e
}
// 点击清空列表
@@ -115,7 +119,6 @@
// 选好设备
const confirmSelectEquipment = (val: any) => {
console.log(val)
-
if (val.length) {
val.forEach((item: any) => {
const index = list.value.findIndex((e: { deviceNo: string }) => e.deviceNo === item.equipmentNo)
@@ -221,12 +224,12 @@
-
- 打印
-
+
+ 打印
+
关闭
@@ -245,14 +248,14 @@
设备计量标识
-
+
清空列表
-
-
+ -->
+
+
+
+
+
+ {{ scope.$index + 1 }}
+
+
+
+
@@ -282,7 +303,6 @@
:date-title="printMenu[item.identifyTypeName].dateTitle"
:person-title="printMenu[item.identifyTypeName].personTitle"
:background-color="printMenu[item.identifyTypeName].backgroundColor"
- style="margin-top: 10px;"
/>
diff --git a/src/views/equipement/standard/book/book-interface.ts b/src/views/equipement/standard/book/book-interface.ts
index 9cb346b..1ca7749 100644
--- a/src/views/equipement/standard/book/book-interface.ts
+++ b/src/views/equipement/standard/book/book-interface.ts
@@ -141,7 +141,7 @@
id: string
testType: string // 核查点类型
params: string // 核查项目(参数)
- checkPoint: string // 核查点
+ checkPoint: number // 核查点
unit: string // 单位
frequency: string // 频率
frequencyUnit: string // 频率单位(直接存字典value)
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
index 806e280..31efbd6 100644
--- a/src/components/MultiHeaderTable/tableColumn.vue
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -58,10 +58,12 @@
:show-overflow-tooltip="showOverflowTooltip"
>
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,8 +97,10 @@
border-radius: 10px;
// width: fit-content;
background-color: v-bind(backgroundColor);
- width: 400px;
- height: 260px;
+ // width: 400px;
+ // height: 260px;
+ width: 500px;
+ height: 300px;
.left {
flex: 1;
diff --git a/src/views/business/taskMeasure/print/detail.vue b/src/views/business/taskMeasure/print/detail.vue
index a3db212..77490d2 100644
--- a/src/views/business/taskMeasure/print/detail.vue
+++ b/src/views/business/taskMeasure/print/detail.vue
@@ -72,6 +72,10 @@
])
// 选中
const handleSelectionChange = (e: any) => {
+ if (!e[0].identifyTypeName) {
+ ElMessage.warning('无标志类型, 不可打印')
+ return false
+ }
checkoutList.value = e
}
// 点击清空列表
@@ -115,7 +119,6 @@
// 选好设备
const confirmSelectEquipment = (val: any) => {
console.log(val)
-
if (val.length) {
val.forEach((item: any) => {
const index = list.value.findIndex((e: { deviceNo: string }) => e.deviceNo === item.equipmentNo)
@@ -221,12 +224,12 @@
-
- 打印
-
+
+ 打印
+
关闭
@@ -245,14 +248,14 @@
设备计量标识
-
+
清空列表
-
-
+ -->
+
+
+
+
+
+ {{ scope.$index + 1 }}
+
+
+
+
@@ -282,7 +303,6 @@
:date-title="printMenu[item.identifyTypeName].dateTitle"
:person-title="printMenu[item.identifyTypeName].personTitle"
:background-color="printMenu[item.identifyTypeName].backgroundColor"
- style="margin-top: 10px;"
/>
diff --git a/src/views/equipement/standard/book/book-interface.ts b/src/views/equipement/standard/book/book-interface.ts
index 9cb346b..1ca7749 100644
--- a/src/views/equipement/standard/book/book-interface.ts
+++ b/src/views/equipement/standard/book/book-interface.ts
@@ -141,7 +141,7 @@
id: string
testType: string // 核查点类型
params: string // 核查项目(参数)
- checkPoint: string // 核查点
+ checkPoint: number // 核查点
unit: string // 单位
frequency: string // 频率
frequencyUnit: string // 频率单位(直接存字典value)
diff --git a/src/views/equipement/standard/book/components/config/first/config.vue b/src/views/equipement/standard/book/components/config/first/config.vue
index b3c100c..b37d416 100644
--- a/src/views/equipement/standard/book/components/config/first/config.vue
+++ b/src/views/equipement/standard/book/components/config/first/config.vue
@@ -6,6 +6,7 @@
import { useCheckList } from '@/commonMethods/useCheckList'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import { config, getCheckItemDetail } from '@/api/equipment/standard/book'
+import { calc } from '@/utils/useCalc'
const textMap: { [key: string]: string } = {
edit: '编辑',
detail: '详情',
@@ -115,7 +116,7 @@
id: '',
testType: list[list.length - 1].testType, // 核查点类型
params: list[list.length - 1].params, // 核查项目(参数)
- checkPoint: list[list.length - 1].checkPoint, // 核查点
+ checkPoint: Number(calc(Number(list[list.length - 1].checkPoint), 1, '+')), // 核查点
unit: list[list.length - 1].unit, // 单位
frequency: '', // 频率
frequencyUnit: '', // 频率单位(直接存字典value)
@@ -135,7 +136,7 @@
id: '',
testType: title, // 核查点类型
params: '', // 核查项目(参数)
- checkPoint: '', // 核查点
+ checkPoint: 1, // 核查点
unit: '', // 单位
frequency: '', // 频率
frequencyUnit: '', // 频率单位(直接存字典value)
@@ -213,6 +214,7 @@
if (!checkList(worstList.value, '最差点表格')) { return false }
if (!checkList(modelList.value, '典型点表格')) { return false }
const params = {
+ equipmentId: equipmentId.value, // 设备id
itemCategoryId: form.value.itemCategoryId, // 核查项分类id
checkItemDataCalibratorList: [
...bestList.value.map((item: any) => {
diff --git a/src/components/MultiHeaderTable/tableColumn.vue b/src/components/MultiHeaderTable/tableColumn.vue
index 806e280..31efbd6 100644
--- a/src/components/MultiHeaderTable/tableColumn.vue
+++ b/src/components/MultiHeaderTable/tableColumn.vue
@@ -58,10 +58,12 @@
:show-overflow-tooltip="showOverflowTooltip"
>
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,8 +97,10 @@
border-radius: 10px;
// width: fit-content;
background-color: v-bind(backgroundColor);
- width: 400px;
- height: 260px;
+ // width: 400px;
+ // height: 260px;
+ width: 500px;
+ height: 300px;
.left {
flex: 1;
diff --git a/src/views/business/taskMeasure/print/detail.vue b/src/views/business/taskMeasure/print/detail.vue
index a3db212..77490d2 100644
--- a/src/views/business/taskMeasure/print/detail.vue
+++ b/src/views/business/taskMeasure/print/detail.vue
@@ -72,6 +72,10 @@
])
// 选中
const handleSelectionChange = (e: any) => {
+ if (!e[0].identifyTypeName) {
+ ElMessage.warning('无标志类型, 不可打印')
+ return false
+ }
checkoutList.value = e
}
// 点击清空列表
@@ -115,7 +119,6 @@
// 选好设备
const confirmSelectEquipment = (val: any) => {
console.log(val)
-
if (val.length) {
val.forEach((item: any) => {
const index = list.value.findIndex((e: { deviceNo: string }) => e.deviceNo === item.equipmentNo)
@@ -221,12 +224,12 @@
-
- 打印
-
+
+ 打印
+
关闭
@@ -245,14 +248,14 @@
设备计量标识
-
+
清空列表
-
-
+ -->
+
+
+
+
+
+ {{ scope.$index + 1 }}
+
+
+
+
@@ -282,7 +303,6 @@
:date-title="printMenu[item.identifyTypeName].dateTitle"
:person-title="printMenu[item.identifyTypeName].personTitle"
:background-color="printMenu[item.identifyTypeName].backgroundColor"
- style="margin-top: 10px;"
/>
diff --git a/src/views/equipement/standard/book/book-interface.ts b/src/views/equipement/standard/book/book-interface.ts
index 9cb346b..1ca7749 100644
--- a/src/views/equipement/standard/book/book-interface.ts
+++ b/src/views/equipement/standard/book/book-interface.ts
@@ -141,7 +141,7 @@
id: string
testType: string // 核查点类型
params: string // 核查项目(参数)
- checkPoint: string // 核查点
+ checkPoint: number // 核查点
unit: string // 单位
frequency: string // 频率
frequencyUnit: string // 频率单位(直接存字典value)
diff --git a/src/views/equipement/standard/book/components/config/first/config.vue b/src/views/equipement/standard/book/components/config/first/config.vue
index b3c100c..b37d416 100644
--- a/src/views/equipement/standard/book/components/config/first/config.vue
+++ b/src/views/equipement/standard/book/components/config/first/config.vue
@@ -6,6 +6,7 @@
import { useCheckList } from '@/commonMethods/useCheckList'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import { config, getCheckItemDetail } from '@/api/equipment/standard/book'
+import { calc } from '@/utils/useCalc'
const textMap: { [key: string]: string } = {
edit: '编辑',
detail: '详情',
@@ -115,7 +116,7 @@
id: '',
testType: list[list.length - 1].testType, // 核查点类型
params: list[list.length - 1].params, // 核查项目(参数)
- checkPoint: list[list.length - 1].checkPoint, // 核查点
+ checkPoint: Number(calc(Number(list[list.length - 1].checkPoint), 1, '+')), // 核查点
unit: list[list.length - 1].unit, // 单位
frequency: '', // 频率
frequencyUnit: '', // 频率单位(直接存字典value)
@@ -135,7 +136,7 @@
id: '',
testType: title, // 核查点类型
params: '', // 核查项目(参数)
- checkPoint: '', // 核查点
+ checkPoint: 1, // 核查点
unit: '', // 单位
frequency: '', // 频率
frequencyUnit: '', // 频率单位(直接存字典value)
@@ -213,6 +214,7 @@
if (!checkList(worstList.value, '最差点表格')) { return false }
if (!checkList(modelList.value, '典型点表格')) { return false }
const params = {
+ equipmentId: equipmentId.value, // 设备id
itemCategoryId: form.value.itemCategoryId, // 核查项分类id
checkItemDataCalibratorList: [
...bestList.value.map((item: any) => {
diff --git a/src/views/equipement/standard/checkData/components/first/checkDataCom.vue b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue
index 0780c97..2ee13a8 100644
--- a/src/views/equipement/standard/checkData/components/first/checkDataCom.vue
+++ b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue
@@ -11,6 +11,7 @@
import { useUniqueArray } from '@/utils/useUniqueArray'
import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book'
import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData'
+import { deepCopy } from '@/utils/deepCopy'
const props = defineProps({
selectStandardId: {
type: String,
@@ -28,9 +29,9 @@
const infoId = ref('')
const ruleFormRef = ref() // 表单ref
const form = ref({
- bestQualified: '1合格', // 稳定性考核是否合格_最佳点
- worstQualified: '1合格', // 稳定性考核是否合格_最差点
- modelQualified: '1合格', // 稳定性考核是否合格_典型点
+ bestQualified: '合格', // 稳定性考核是否合格_最佳点
+ worstQualified: '合格', // 稳定性考核是否合格_最差点
+ modelQualified: '合格', // 稳定性考核是否合格_典型点
})
const belongStandardEquipment = ref('1')
const itemCategoryId = ref('')
@@ -65,8 +66,8 @@
text: '示值',
value: 'indicatingValue',
align: 'center',
- required: true,
- width: '160',
+ required: false,
+ width: '180',
children: [
{ text: '1', value: 'testValueOne', align: 'center', required: true, type: 'inputNumber', customHeader: false },
{ text: '2', value: 'testValueTwo', align: 'center', required: true, type: 'inputNumber', customHeader: false },
@@ -80,7 +81,8 @@
{ text: '标准偏差S(X)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
{ text: '相对重复性', value: 'relativeRepeatability', align: 'center', type: 'text' },
])
-const stabilityColumns = ref([ // 稳定性表头
+
+const stabilityColumnsBest = 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' },
@@ -90,15 +92,15 @@
text: '示值',
value: 'indicatingValue',
align: 'center',
- required: true,
- width: '160',
+ required: false,
+ width: '180',
children: [
- { text: '-', value: 'testValueOne', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueTwo', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueThree', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFour', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFive', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueSix', align: 'center', required: true, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '算数平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
@@ -108,8 +110,152 @@
{ text: 'Urel', value: 'urel', align: 'center', type: 'text' },
{ text: '相对重复性是否小于相对扩展不确定度Urel', value: 'lessThan', align: 'center', type: 'text' },
// { text: '稳定性考核是否合格', value: 'flit', align: 'center' },
-])
-
+]) // 稳定性表头最佳点
+const stabilityColumnsWorst = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsModel = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsBestCheckDate = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsWorstCheckDate = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsModelCheckDate = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 bestListCheckDate = ref([]) // 最佳点重复性查询数据
const bestListStabilityCheckDate = ref([]) // 最佳点稳定性查询数据
const worstListCheckDate = ref([]) // 最差点重复性查询数据
@@ -143,8 +289,8 @@
getCheckItemDetail(params).then((res) => {
loading.close()
handleData(res.data.checkItemDataCalibratorList)
+ fetchHistoryIndication() // 获取稳定性
})
- fetchHistoryIndication()
}
// 处理数据
@@ -444,74 +590,134 @@
})
}
// ------------------------------------------------------------------------------------------
+// 处理详情数据
+const solveGetDetailData = (responseList: any) => {
+ const bestList = responseList.filter((item: { testType: string; checkType: string }) => item.testType === '最佳点' && item.checkType === '重复性').map((item: any) => {
+ return {
+ ...item,
+ editable: props.pageType !== 'detail',
+ }
+ })
+ const worstList = responseList.filter((item: { testType: string ; checkType: string }) => item.testType === '最差点' && item.checkType === '重复性').map((item: any) => {
+ return {
+ ...item,
+ editable: props.pageType !== 'detail',
+ }
+ })
+ const modelList = responseList.filter((item: { testType: string ; checkType: string }) => item.testType === '典型点' && item.checkType === '重复性').map((item: any) => {
+ return {
+ ...item,
+ editable: props.pageType !== 'detail',
+ }
+ })
+ const bestListStability = responseList.filter((item: { testType: string ; checkType: string }) => item.testType === '最佳点' && item.checkType === '稳定性').map((item: any) => {
+ return {
+ ...item,
+ lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
+ }
+ })
+ const worstListStability = responseList.filter((item: { testType: string; checkType: string }) => item.testType === '最差点' && item.checkType === '稳定性').map((item: any) => {
+ return {
+ ...item,
+ lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
+ }
+ })
+ const modelListStability = responseList.filter((item: { testType: string; checkType: string }) => item.testType === '典型点' && item.checkType === '稳定性').map((item: any) => {
+ return {
+ ...item,
+ lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
+ }
+ })
+ return {
+ tempBestList: bestList,
+ tempWorstList: worstList,
+ tempModelList: modelList,
+ tempBestListStability: bestListStability,
+ tempWorstListStability: worstListStability,
+ tempModelListStability: modelListStability,
+ }
+}
// 获取详情
-function fetchInfo() {
+function fetchInfo(id = '') {
+ console.log('ididididid', id)
+
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- getInfo({ id: infoId.value }).then((res) => {
+ getInfo({ id: id || infoId.value }).then((res) => {
form.value = { ...res.data }
equipmentId.value = res.data.equipmentId
- if (currentDate.value !== '' && currentDate.value !== '核查数据') { // 查询的日期获得的数据
- bestListCheckDate.value = bestList.value// 最佳点重复性查询数据
- bestListStabilityCheckDate.value = bestListStability.value // 最佳点稳定性查询数据
- worstListCheckDate.value = worstList.value// 最差点重复性查询数据
- worstListStabilityCheckDate.value = worstListStability.value// 最差点稳定性查询数据
- modelListCheckDate.value = modelList.value// 典型点重复性查询数据
- modelListStabilityCheckDate.value = modelListStability.value// 典型点稳定性查询数据
+ const { tempBestList, tempWorstList, tempModelList, tempBestListStability, tempWorstListStability, tempModelListStability } = solveGetDetailData(res.data.checkDataCalibratorList)
+ if (id !== '') { // 查询的日期获得的数据
+ bestListCheckDate.value = tempBestList// 最佳点重复性查询数据
+ bestListStabilityCheckDate.value = tempBestListStability // 最佳点稳定性查询数据
+ worstListCheckDate.value = tempWorstList// 最差点重复性查询数据
+ worstListStabilityCheckDate.value = tempWorstListStability// 最差点稳定性查询数据
+ modelListCheckDate.value = tempModelList// 典型点重复性查询数据
+ modelListStabilityCheckDate.value = tempModelListStability// 典型点稳定性查询数据
}
else {
- bestList.value = res.data.checkDataCalibratorList.filter((item: { testType: string; checkType: string }) => item.testType === '最佳点' && item.checkType === '重复性').map((item: any) => {
- return {
- ...item,
- editable: props.pageType !== 'detail',
- }
- })
- worstList.value = res.data.checkDataCalibratorList.filter((item: { testType: string ; checkType: string }) => item.testType === '最差点' && item.checkType === '重复性').map((item: any) => {
- return {
- ...item,
- editable: props.pageType !== 'detail',
- }
- })
- modelList.value = res.data.checkDataCalibratorList.filter((item: { testType: string ; checkType: string }) => item.testType === '典型点' && item.checkType === '重复性').map((item: any) => {
- return {
- ...item,
- editable: props.pageType !== 'detail',
- }
- })
- bestListStability.value = res.data.checkDataCalibratorList.filter((item: { testType: string ; checkType: string }) => item.testType === '最佳点' && item.checkType === '稳定性').map((item: any) => {
- return {
- ...item,
- lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
- }
- })
- worstListStability.value = res.data.checkDataCalibratorList.filter((item: { testType: string; checkType: string }) => item.testType === '最差点' && item.checkType === '稳定性').map((item: any) => {
- return {
- ...item,
- lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
- }
- })
- modelListStability.value = res.data.checkDataCalibratorList.filter((item: { testType: string; checkType: string }) => item.testType === '典型点' && item.checkType === '稳定性').map((item: any) => {
- return {
- ...item,
- lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
- }
- })
+ console.log('详情,详情详情')
+
+ bestList.value = tempBestList
+ worstList.value = tempWorstList
+ modelList.value = tempModelList
+ bestListStability.value = tempBestListStability
+ worstListStability.value = tempWorstListStability
+ modelListStability.value = tempModelListStability
+ console.log('bestList.value', bestList.value)
}
- // 表头
+
nextTick(() => {
- stabilityColumns.value = handleDetailTableTableHead(stabilityColumns.value, bestListStability.value)
+ if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据
+ stabilityColumnsBestCheckDate.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsWorstCheckDate.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsModelCheckDate.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ fetchHistoryIndication(currentDate.value) // 获取稳定性
+ }
+ else { // 详情制作表头
+ stabilityColumnsBest.value = handleDetailTableTableHead(stabilityColumnsBest.value, bestListStability.value)
+ stabilityColumnsWorst.value = handleDetailTableTableHead(stabilityColumnsWorst.value, worstListStability.value)
+ stabilityColumnsModel.value = handleDetailTableTableHead(stabilityColumnsModel.value, modelListStability.value)
+ }
})
form.value.bestQualified = `${res.data.checkDataCalibratorList[0].qualified}` === '1' ? '合格' : '不合格'
form.value.worstQualified = `${res.data.checkDataCalibratorList[0].qualified}` === '1' ? '合格' : '不合格'
form.value.modelQualified = `${res.data.checkDataCalibratorList[0].qualified}` === '1' ? '合格' : '不合格'
+ if (props.pageType === 'edit') {
+ fetchHistoryIndication() // 重新拉取稳定性日期
+ }
loading.close()
})
}
-// 获取稳定性示值
+/**
+ * 获取稳定性示值
+ * @param date 查询日期
+ */
function fetchHistoryIndication(date = '') {
const params = {
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code)
@@ -526,30 +732,61 @@
if (props.selectStandardId && equipmentId.value) {
stabilityTableLoading.value = true
getHistoryIndication(params).then((res) => {
- // 最佳点
- bestListStability.value = bestListStability.value.map((item) => {
- clearDateValue(item)
- const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumns.value)
- stabilityColumns.value = columnsData
- return item = itemData
- })
- bestListStability.value = handleSaveDateParams(stabilityColumns.value, bestListStability.value)
- // 最差点
- worstListStability.value = worstListStability.value.map((item) => {
- clearDateValue(item)
- const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumns.value)
- stabilityColumns.value = columnsData
- return item = itemData
- })
- worstListStability.value = handleSaveDateParams(stabilityColumns.value, worstListStability.value)
- // 典型点
- modelListStability.value = modelListStability.value.map((item) => {
- clearDateValue(item)
- const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumns.value)
- stabilityColumns.value = columnsData
- return item = itemData
- })
- modelListStability.value = handleSaveDateParams(stabilityColumns.value, modelListStability.value)
+ if (date === '') {
+ const num = props.pageType === 'edit' ? 5 : 4
+
+ // 最佳点
+ bestListStability.value = bestListStability.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsBest.value, num)
+ stabilityColumnsBest.value = columnsData
+ return item = itemData
+ })
+ bestListStability.value = handleSaveDateParams(stabilityColumnsBest.value, bestListStability.value)
+ // 最差点
+ worstListStability.value = worstListStability.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsWorst.value, num)
+ stabilityColumnsWorst.value = columnsData
+ return item = itemData
+ })
+ worstListStability.value = handleSaveDateParams(stabilityColumnsWorst.value, worstListStability.value)
+ // 典型点
+ modelListStability.value = modelListStability.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsModel.value, num)
+ stabilityColumnsModel.value = columnsData
+ return item = itemData
+ })
+ modelListStability.value = handleSaveDateParams(stabilityColumnsModel.value, modelListStability.value)
+ }
+ else {
+ // 最佳点
+ bestListStabilityCheckDate.value = bestListStabilityCheckDate.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsBestCheckDate.value, 5)
+ stabilityColumnsBestCheckDate.value = columnsData
+ return item = itemData
+ })
+ bestListStabilityCheckDate.value = handleSaveDateParams(stabilityColumnsBestCheckDate.value, bestListStabilityCheckDate.value)
+ // 最差点
+ worstListStabilityCheckDate.value = worstListStabilityCheckDate.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsWorstCheckDate.value, 5)
+ stabilityColumnsWorstCheckDate.value = columnsData
+ return item = itemData
+ })
+ worstListStabilityCheckDate.value = handleSaveDateParams(stabilityColumnsWorstCheckDate.value, worstListStabilityCheckDate.value)
+ // 典型点
+ modelListStabilityCheckDate.value = modelListStabilityCheckDate.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsModelCheckDate.value, 5)
+ stabilityColumnsModelCheckDate.value = columnsData
+ return item = itemData
+ })
+ modelListStabilityCheckDate.value = handleSaveDateParams(stabilityColumnsModelCheckDate.value, modelListStabilityCheckDate.value)
+ }
+
stabilityTableLoading.value = false
}).catch(() => { stabilityTableLoading.value = false })
}
@@ -571,30 +808,38 @@
ElMessage.warning('请计算典型点重复性')
return false
}
- if (current.value === 'best' && `${bestListStability.value[0].averageValue}` === '') { // 最佳点
+ if (current.value === 'best' && `${bestListStability.value[0].lessThan}` === '') { // 最佳点
ElMessage.warning('请计算最佳点稳定性')
return false
}
- if (current.value === 'worst' && `${worstListStability.value[0].averageValue}` === '') { // 最差点
+ if (current.value === 'worst' && `${worstListStability.value[0].lessThan}` === '') { // 最差点
ElMessage.warning('请计算最差点稳定性')
return false
}
- if (current.value === 'model' && `${modelListStability.value[0].averageValue}` === '') { // 典型点
+ if (current.value === 'model' && `${modelListStability.value[0].lessThan}` === '') { // 典型点
ElMessage.warning('请计算典型点稳定性')
return false
}
+ const dateNum = 0 // 稳定性表格有几个日期
- // 保存之前判断一下结论 如果所有的相对重复性是否小于相对扩展不确定度Urel全为是,则结论合格
- if (bestListStability.value.every(item => item.lessThan === '是') && worstListStability.value.every(item => item.lessThan === '是') && modelListStability.value.every(item => item.lessThan === '是')) {
- form.value.bestQualified = '合格'
- form.value.worstQualified = '合格'
- form.value.modelQualified = '合格'
- }
- else {
- form.value.bestQualified = '不合格'
- form.value.worstQualified = '不合格'
- form.value.modelQualified = '不合格'
- }
+ // 统计有几个日期
+ // stabilityColumns.value[5].children?.forEach((item) => {
+ // if (item.text !== '-' && item.text !== '') {
+ // dateNum += 1
+ // }
+ // })
+
+ // // 保存之前判断一下结论 如果所有的相对重复性是否小于相对扩展不确定度Urel全为是,则结论合格
+ // if (bestListStability.value.every(item => item.lessThan === '是') && worstListStability.value.every(item => item.lessThan === '是') && modelListStability.value.every(item => item.lessThan === '是')) {
+ // form.value.bestQualified = '合格'
+ // form.value.worstQualified = '合格'
+ // form.value.modelQualified = '合格'
+ // }
+ // else {
+ // form.value.bestQualified = dateNum < 4 ? '合格' : '不合格'
+ // form.value.worstQualified = dateNum < 4 ? '合格' : '不合格'
+ // form.value.modelQualified = dateNum < 4 ? '合格' : '不合格'
+ // }
return true
}
@@ -602,62 +847,109 @@
// =======================点击表头日期查询历史稳定性数据===================
// 点击表头
const handleClickHeader = (val: any, checkDateDetailId: string) => {
- console.log(val, checkDateDetailId)
- // dateArrStability.value.push(val.label)
dateArrStability.value = ['核查数据', val.label]
+ fetchInfo(checkDateDetailId) // 获取此次历史日期的详情
}
// 日期变化
const handleChangeRadio = (date: string) => {
- console.log(date)
currentDate.value = date
- if (date !== '核查数据') {
- // fetchHistoryIndication(date)
- }
}
// ======================================================================
// -------------------------------------钩子-----------------------------------------------------
-// 监听最佳点稳定性表格--判断稳定性考核是否合格
+// 统计日期
+const dateCount = (columns: TableColumn[]) => {
+ let dateNum = 0 // 稳定性表格有几个日期
+
+ // 统计有几个日期
+ columns[5].children?.forEach((item) => {
+ if (item.text !== '-' && item.text !== '') {
+ dateNum += 1
+ }
+ })
+ return dateNum
+}
+
+// 监听稳定性表格--判断稳定性考核是否合格
watch([() => bestListStability.value, () => worstListStability.value, () => modelListStability.value], (newValue: any) => {
+ console.log('监听稳定性表格')
+
if (newValue[0] && newValue[0].length && newValue[0].averageValue) { // 最佳点
const result = newValue[0].every((item: { lessThan: string }) => {
return item.lessThan === '是'
})
- form.value.bestQualified = result ? '合格' : '不合格'
+ const dateNum = dateCount(stabilityColumnsBest.value)
+ form.value.bestQualified = dateNum < 4 ? '合格' : result ? '合格' : '不合格'
}
if (newValue[1] && newValue[1].length && newValue[0].averageValue) { // 最差点
const result = newValue[1].every((item: { lessThan: string }) => {
return item.lessThan === '是'
})
- form.value.worstQualified = result ? '合格' : '不合格'
+ const dateNum = dateCount(stabilityColumnsWorst.value)
+ form.value.worstQualified = dateNum < 4 ? '合格' : result ? '合格' : '不合格'
}
if (newValue[2] && newValue[2].length && newValue[0].averageValue) { // 典型点
const result = newValue[2].every((item: { lessThan: string }) => {
return item.lessThan === '是'
})
- form.value.modelQualified = result ? '合格' : '不合格'
+ const dateNum = dateCount(stabilityColumnsModel.value)
+ form.value.modelQualified = dateNum < 4 ? '合格' : result ? '合格' : '不合格'
}
-})
+}, { deep: true, immediate: true })
+
+/**
+ * 初始化表头
+ * @param soveLastColumnDate 是否处理最后一列
+ */
+function initColumns() {
+ stabilityColumnsBest.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsWorst.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsModel.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ const index = stabilityColumnsBest.value.findIndex(item => item.text === '示值')
+ if (index !== -1) {
+ stabilityColumnsBest.value[index].children![5].text = props.checkDate! // 最后一列的表头日期
+ }
+ const indexWorst = stabilityColumnsWorst.value.findIndex(item => item.text === '示值')
+ if (index !== -1) {
+ stabilityColumnsWorst.value[indexWorst].children![5].text = props.checkDate! // 最后一列的表头日期
+ }
+ const indexModel = stabilityColumnsModel.value.findIndex(item => item.text === '示值')
+ if (index !== -1) {
+ stabilityColumnsModel.value[indexModel].children![5].text = props.checkDate! // 最后一列的表头日期
+ }
+}
// 监听核查日期变化
watch(() => props.checkDate, (newValue) => {
- stabilityColumns.value[5].children = [
- { text: '-', value: 'testValueOne', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueTwo', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueThree', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFour', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFive', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueSix', align: 'center', required: true, type: 'text', customHeader: true },
- ]
- const index = stabilityColumns.value.findIndex(item => item.text === '示值')
- if (index !== -1) {
- stabilityColumns.value[index].children![5].text = newValue! // 最后一列的表头日期
- }
- fetchHistoryIndication() // 重新拉取稳定性日期
+ initColumns()
+ nextTick(() => {
+ fetchHistoryIndication() // 重新拉取稳定性日期
+ })
}, { immediate: true })
watch(() => props.pageType, (newValue) => {
@@ -698,6 +990,7 @@
- {{ currentDate }}
+
+
+
-
+
*{{ item.text }}
- *{{ item.text }}
+
+ *{{ item.text }}
+
-
+
@@ -80,7 +80,7 @@
-
+
@@ -97,8 +97,10 @@
border-radius: 10px;
// width: fit-content;
background-color: v-bind(backgroundColor);
- width: 400px;
- height: 260px;
+ // width: 400px;
+ // height: 260px;
+ width: 500px;
+ height: 300px;
.left {
flex: 1;
diff --git a/src/views/business/taskMeasure/print/detail.vue b/src/views/business/taskMeasure/print/detail.vue
index a3db212..77490d2 100644
--- a/src/views/business/taskMeasure/print/detail.vue
+++ b/src/views/business/taskMeasure/print/detail.vue
@@ -72,6 +72,10 @@
])
// 选中
const handleSelectionChange = (e: any) => {
+ if (!e[0].identifyTypeName) {
+ ElMessage.warning('无标志类型, 不可打印')
+ return false
+ }
checkoutList.value = e
}
// 点击清空列表
@@ -115,7 +119,6 @@
// 选好设备
const confirmSelectEquipment = (val: any) => {
console.log(val)
-
if (val.length) {
val.forEach((item: any) => {
const index = list.value.findIndex((e: { deviceNo: string }) => e.deviceNo === item.equipmentNo)
@@ -221,12 +224,12 @@
-
- 打印
-
+
+ 打印
+
关闭
@@ -245,14 +248,14 @@
设备计量标识
-
+
清空列表
-
-
+ -->
+
+
+
+
+
+ {{ scope.$index + 1 }}
+
+
+
+
@@ -282,7 +303,6 @@
:date-title="printMenu[item.identifyTypeName].dateTitle"
:person-title="printMenu[item.identifyTypeName].personTitle"
:background-color="printMenu[item.identifyTypeName].backgroundColor"
- style="margin-top: 10px;"
/>
diff --git a/src/views/equipement/standard/book/book-interface.ts b/src/views/equipement/standard/book/book-interface.ts
index 9cb346b..1ca7749 100644
--- a/src/views/equipement/standard/book/book-interface.ts
+++ b/src/views/equipement/standard/book/book-interface.ts
@@ -141,7 +141,7 @@
id: string
testType: string // 核查点类型
params: string // 核查项目(参数)
- checkPoint: string // 核查点
+ checkPoint: number // 核查点
unit: string // 单位
frequency: string // 频率
frequencyUnit: string // 频率单位(直接存字典value)
diff --git a/src/views/equipement/standard/book/components/config/first/config.vue b/src/views/equipement/standard/book/components/config/first/config.vue
index b3c100c..b37d416 100644
--- a/src/views/equipement/standard/book/components/config/first/config.vue
+++ b/src/views/equipement/standard/book/components/config/first/config.vue
@@ -6,6 +6,7 @@
import { useCheckList } from '@/commonMethods/useCheckList'
import type { TableColumn } from '@/components/NormalTable/table_interface'
import { config, getCheckItemDetail } from '@/api/equipment/standard/book'
+import { calc } from '@/utils/useCalc'
const textMap: { [key: string]: string } = {
edit: '编辑',
detail: '详情',
@@ -115,7 +116,7 @@
id: '',
testType: list[list.length - 1].testType, // 核查点类型
params: list[list.length - 1].params, // 核查项目(参数)
- checkPoint: list[list.length - 1].checkPoint, // 核查点
+ checkPoint: Number(calc(Number(list[list.length - 1].checkPoint), 1, '+')), // 核查点
unit: list[list.length - 1].unit, // 单位
frequency: '', // 频率
frequencyUnit: '', // 频率单位(直接存字典value)
@@ -135,7 +136,7 @@
id: '',
testType: title, // 核查点类型
params: '', // 核查项目(参数)
- checkPoint: '', // 核查点
+ checkPoint: 1, // 核查点
unit: '', // 单位
frequency: '', // 频率
frequencyUnit: '', // 频率单位(直接存字典value)
@@ -213,6 +214,7 @@
if (!checkList(worstList.value, '最差点表格')) { return false }
if (!checkList(modelList.value, '典型点表格')) { return false }
const params = {
+ equipmentId: equipmentId.value, // 设备id
itemCategoryId: form.value.itemCategoryId, // 核查项分类id
checkItemDataCalibratorList: [
...bestList.value.map((item: any) => {
diff --git a/src/views/equipement/standard/checkData/components/first/checkDataCom.vue b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue
index 0780c97..2ee13a8 100644
--- a/src/views/equipement/standard/checkData/components/first/checkDataCom.vue
+++ b/src/views/equipement/standard/checkData/components/first/checkDataCom.vue
@@ -11,6 +11,7 @@
import { useUniqueArray } from '@/utils/useUniqueArray'
import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book'
import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData'
+import { deepCopy } from '@/utils/deepCopy'
const props = defineProps({
selectStandardId: {
type: String,
@@ -28,9 +29,9 @@
const infoId = ref('')
const ruleFormRef = ref() // 表单ref
const form = ref({
- bestQualified: '1合格', // 稳定性考核是否合格_最佳点
- worstQualified: '1合格', // 稳定性考核是否合格_最差点
- modelQualified: '1合格', // 稳定性考核是否合格_典型点
+ bestQualified: '合格', // 稳定性考核是否合格_最佳点
+ worstQualified: '合格', // 稳定性考核是否合格_最差点
+ modelQualified: '合格', // 稳定性考核是否合格_典型点
})
const belongStandardEquipment = ref('1')
const itemCategoryId = ref('')
@@ -65,8 +66,8 @@
text: '示值',
value: 'indicatingValue',
align: 'center',
- required: true,
- width: '160',
+ required: false,
+ width: '180',
children: [
{ text: '1', value: 'testValueOne', align: 'center', required: true, type: 'inputNumber', customHeader: false },
{ text: '2', value: 'testValueTwo', align: 'center', required: true, type: 'inputNumber', customHeader: false },
@@ -80,7 +81,8 @@
{ text: '标准偏差S(X)', value: 'standardDeviation', align: 'center', required: true, type: 'text' },
{ text: '相对重复性', value: 'relativeRepeatability', align: 'center', type: 'text' },
])
-const stabilityColumns = ref([ // 稳定性表头
+
+const stabilityColumnsBest = 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' },
@@ -90,15 +92,15 @@
text: '示值',
value: 'indicatingValue',
align: 'center',
- required: true,
- width: '160',
+ required: false,
+ width: '180',
children: [
- { text: '-', value: 'testValueOne', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueTwo', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueThree', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFour', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFive', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueSix', align: 'center', required: true, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
],
},
{ text: '算数平均值', value: 'averageValue', align: 'center', required: true, type: 'text' },
@@ -108,8 +110,152 @@
{ text: 'Urel', value: 'urel', align: 'center', type: 'text' },
{ text: '相对重复性是否小于相对扩展不确定度Urel', value: 'lessThan', align: 'center', type: 'text' },
// { text: '稳定性考核是否合格', value: 'flit', align: 'center' },
-])
-
+]) // 稳定性表头最佳点
+const stabilityColumnsWorst = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsModel = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsBestCheckDate = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsWorstCheckDate = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 stabilityColumnsModelCheckDate = 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: false,
+ width: '180',
+ children: [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ],
+ },
+ { 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 bestListCheckDate = ref([]) // 最佳点重复性查询数据
const bestListStabilityCheckDate = ref([]) // 最佳点稳定性查询数据
const worstListCheckDate = ref([]) // 最差点重复性查询数据
@@ -143,8 +289,8 @@
getCheckItemDetail(params).then((res) => {
loading.close()
handleData(res.data.checkItemDataCalibratorList)
+ fetchHistoryIndication() // 获取稳定性
})
- fetchHistoryIndication()
}
// 处理数据
@@ -444,74 +590,134 @@
})
}
// ------------------------------------------------------------------------------------------
+// 处理详情数据
+const solveGetDetailData = (responseList: any) => {
+ const bestList = responseList.filter((item: { testType: string; checkType: string }) => item.testType === '最佳点' && item.checkType === '重复性').map((item: any) => {
+ return {
+ ...item,
+ editable: props.pageType !== 'detail',
+ }
+ })
+ const worstList = responseList.filter((item: { testType: string ; checkType: string }) => item.testType === '最差点' && item.checkType === '重复性').map((item: any) => {
+ return {
+ ...item,
+ editable: props.pageType !== 'detail',
+ }
+ })
+ const modelList = responseList.filter((item: { testType: string ; checkType: string }) => item.testType === '典型点' && item.checkType === '重复性').map((item: any) => {
+ return {
+ ...item,
+ editable: props.pageType !== 'detail',
+ }
+ })
+ const bestListStability = responseList.filter((item: { testType: string ; checkType: string }) => item.testType === '最佳点' && item.checkType === '稳定性').map((item: any) => {
+ return {
+ ...item,
+ lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
+ }
+ })
+ const worstListStability = responseList.filter((item: { testType: string; checkType: string }) => item.testType === '最差点' && item.checkType === '稳定性').map((item: any) => {
+ return {
+ ...item,
+ lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
+ }
+ })
+ const modelListStability = responseList.filter((item: { testType: string; checkType: string }) => item.testType === '典型点' && item.checkType === '稳定性').map((item: any) => {
+ return {
+ ...item,
+ lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
+ }
+ })
+ return {
+ tempBestList: bestList,
+ tempWorstList: worstList,
+ tempModelList: modelList,
+ tempBestListStability: bestListStability,
+ tempWorstListStability: worstListStability,
+ tempModelListStability: modelListStability,
+ }
+}
// 获取详情
-function fetchInfo() {
+function fetchInfo(id = '') {
+ console.log('ididididid', id)
+
const loading = ElLoading.service({
lock: true,
background: 'rgba(255, 255, 255, 0.8)',
})
- getInfo({ id: infoId.value }).then((res) => {
+ getInfo({ id: id || infoId.value }).then((res) => {
form.value = { ...res.data }
equipmentId.value = res.data.equipmentId
- if (currentDate.value !== '' && currentDate.value !== '核查数据') { // 查询的日期获得的数据
- bestListCheckDate.value = bestList.value// 最佳点重复性查询数据
- bestListStabilityCheckDate.value = bestListStability.value // 最佳点稳定性查询数据
- worstListCheckDate.value = worstList.value// 最差点重复性查询数据
- worstListStabilityCheckDate.value = worstListStability.value// 最差点稳定性查询数据
- modelListCheckDate.value = modelList.value// 典型点重复性查询数据
- modelListStabilityCheckDate.value = modelListStability.value// 典型点稳定性查询数据
+ const { tempBestList, tempWorstList, tempModelList, tempBestListStability, tempWorstListStability, tempModelListStability } = solveGetDetailData(res.data.checkDataCalibratorList)
+ if (id !== '') { // 查询的日期获得的数据
+ bestListCheckDate.value = tempBestList// 最佳点重复性查询数据
+ bestListStabilityCheckDate.value = tempBestListStability // 最佳点稳定性查询数据
+ worstListCheckDate.value = tempWorstList// 最差点重复性查询数据
+ worstListStabilityCheckDate.value = tempWorstListStability// 最差点稳定性查询数据
+ modelListCheckDate.value = tempModelList// 典型点重复性查询数据
+ modelListStabilityCheckDate.value = tempModelListStability// 典型点稳定性查询数据
}
else {
- bestList.value = res.data.checkDataCalibratorList.filter((item: { testType: string; checkType: string }) => item.testType === '最佳点' && item.checkType === '重复性').map((item: any) => {
- return {
- ...item,
- editable: props.pageType !== 'detail',
- }
- })
- worstList.value = res.data.checkDataCalibratorList.filter((item: { testType: string ; checkType: string }) => item.testType === '最差点' && item.checkType === '重复性').map((item: any) => {
- return {
- ...item,
- editable: props.pageType !== 'detail',
- }
- })
- modelList.value = res.data.checkDataCalibratorList.filter((item: { testType: string ; checkType: string }) => item.testType === '典型点' && item.checkType === '重复性').map((item: any) => {
- return {
- ...item,
- editable: props.pageType !== 'detail',
- }
- })
- bestListStability.value = res.data.checkDataCalibratorList.filter((item: { testType: string ; checkType: string }) => item.testType === '最佳点' && item.checkType === '稳定性').map((item: any) => {
- return {
- ...item,
- lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
- }
- })
- worstListStability.value = res.data.checkDataCalibratorList.filter((item: { testType: string; checkType: string }) => item.testType === '最差点' && item.checkType === '稳定性').map((item: any) => {
- return {
- ...item,
- lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
- }
- })
- modelListStability.value = res.data.checkDataCalibratorList.filter((item: { testType: string; checkType: string }) => item.testType === '典型点' && item.checkType === '稳定性').map((item: any) => {
- return {
- ...item,
- lessThan: `${item.lessThan}` === '1' ? '是' : `${item.lessThan}` === '0' ? '否' : item.lessThan,
- }
- })
+ console.log('详情,详情详情')
+
+ bestList.value = tempBestList
+ worstList.value = tempWorstList
+ modelList.value = tempModelList
+ bestListStability.value = tempBestListStability
+ worstListStability.value = tempWorstListStability
+ modelListStability.value = tempModelListStability
+ console.log('bestList.value', bestList.value)
}
- // 表头
+
nextTick(() => {
- stabilityColumns.value = handleDetailTableTableHead(stabilityColumns.value, bestListStability.value)
+ if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据
+ stabilityColumnsBestCheckDate.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsWorstCheckDate.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsModelCheckDate.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ fetchHistoryIndication(currentDate.value) // 获取稳定性
+ }
+ else { // 详情制作表头
+ stabilityColumnsBest.value = handleDetailTableTableHead(stabilityColumnsBest.value, bestListStability.value)
+ stabilityColumnsWorst.value = handleDetailTableTableHead(stabilityColumnsWorst.value, worstListStability.value)
+ stabilityColumnsModel.value = handleDetailTableTableHead(stabilityColumnsModel.value, modelListStability.value)
+ }
})
form.value.bestQualified = `${res.data.checkDataCalibratorList[0].qualified}` === '1' ? '合格' : '不合格'
form.value.worstQualified = `${res.data.checkDataCalibratorList[0].qualified}` === '1' ? '合格' : '不合格'
form.value.modelQualified = `${res.data.checkDataCalibratorList[0].qualified}` === '1' ? '合格' : '不合格'
+ if (props.pageType === 'edit') {
+ fetchHistoryIndication() // 重新拉取稳定性日期
+ }
loading.close()
})
}
-// 获取稳定性示值
+/**
+ * 获取稳定性示值
+ * @param date 查询日期
+ */
function fetchHistoryIndication(date = '') {
const params = {
belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code)
@@ -526,30 +732,61 @@
if (props.selectStandardId && equipmentId.value) {
stabilityTableLoading.value = true
getHistoryIndication(params).then((res) => {
- // 最佳点
- bestListStability.value = bestListStability.value.map((item) => {
- clearDateValue(item)
- const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumns.value)
- stabilityColumns.value = columnsData
- return item = itemData
- })
- bestListStability.value = handleSaveDateParams(stabilityColumns.value, bestListStability.value)
- // 最差点
- worstListStability.value = worstListStability.value.map((item) => {
- clearDateValue(item)
- const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumns.value)
- stabilityColumns.value = columnsData
- return item = itemData
- })
- worstListStability.value = handleSaveDateParams(stabilityColumns.value, worstListStability.value)
- // 典型点
- modelListStability.value = modelListStability.value.map((item) => {
- clearDateValue(item)
- const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumns.value)
- stabilityColumns.value = columnsData
- return item = itemData
- })
- modelListStability.value = handleSaveDateParams(stabilityColumns.value, modelListStability.value)
+ if (date === '') {
+ const num = props.pageType === 'edit' ? 5 : 4
+
+ // 最佳点
+ bestListStability.value = bestListStability.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsBest.value, num)
+ stabilityColumnsBest.value = columnsData
+ return item = itemData
+ })
+ bestListStability.value = handleSaveDateParams(stabilityColumnsBest.value, bestListStability.value)
+ // 最差点
+ worstListStability.value = worstListStability.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsWorst.value, num)
+ stabilityColumnsWorst.value = columnsData
+ return item = itemData
+ })
+ worstListStability.value = handleSaveDateParams(stabilityColumnsWorst.value, worstListStability.value)
+ // 典型点
+ modelListStability.value = modelListStability.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsModel.value, num)
+ stabilityColumnsModel.value = columnsData
+ return item = itemData
+ })
+ modelListStability.value = handleSaveDateParams(stabilityColumnsModel.value, modelListStability.value)
+ }
+ else {
+ // 最佳点
+ bestListStabilityCheckDate.value = bestListStabilityCheckDate.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsBestCheckDate.value, 5)
+ stabilityColumnsBestCheckDate.value = columnsData
+ return item = itemData
+ })
+ bestListStabilityCheckDate.value = handleSaveDateParams(stabilityColumnsBestCheckDate.value, bestListStabilityCheckDate.value)
+ // 最差点
+ worstListStabilityCheckDate.value = worstListStabilityCheckDate.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsWorstCheckDate.value, 5)
+ stabilityColumnsWorstCheckDate.value = columnsData
+ return item = itemData
+ })
+ worstListStabilityCheckDate.value = handleSaveDateParams(stabilityColumnsWorstCheckDate.value, worstListStabilityCheckDate.value)
+ // 典型点
+ modelListStabilityCheckDate.value = modelListStabilityCheckDate.value.map((item) => {
+ clearDateValue(item)
+ const { itemData, columnsData } = solveHistoryIndicationTableData(res.data, item, stabilityColumnsModelCheckDate.value, 5)
+ stabilityColumnsModelCheckDate.value = columnsData
+ return item = itemData
+ })
+ modelListStabilityCheckDate.value = handleSaveDateParams(stabilityColumnsModelCheckDate.value, modelListStabilityCheckDate.value)
+ }
+
stabilityTableLoading.value = false
}).catch(() => { stabilityTableLoading.value = false })
}
@@ -571,30 +808,38 @@
ElMessage.warning('请计算典型点重复性')
return false
}
- if (current.value === 'best' && `${bestListStability.value[0].averageValue}` === '') { // 最佳点
+ if (current.value === 'best' && `${bestListStability.value[0].lessThan}` === '') { // 最佳点
ElMessage.warning('请计算最佳点稳定性')
return false
}
- if (current.value === 'worst' && `${worstListStability.value[0].averageValue}` === '') { // 最差点
+ if (current.value === 'worst' && `${worstListStability.value[0].lessThan}` === '') { // 最差点
ElMessage.warning('请计算最差点稳定性')
return false
}
- if (current.value === 'model' && `${modelListStability.value[0].averageValue}` === '') { // 典型点
+ if (current.value === 'model' && `${modelListStability.value[0].lessThan}` === '') { // 典型点
ElMessage.warning('请计算典型点稳定性')
return false
}
+ const dateNum = 0 // 稳定性表格有几个日期
- // 保存之前判断一下结论 如果所有的相对重复性是否小于相对扩展不确定度Urel全为是,则结论合格
- if (bestListStability.value.every(item => item.lessThan === '是') && worstListStability.value.every(item => item.lessThan === '是') && modelListStability.value.every(item => item.lessThan === '是')) {
- form.value.bestQualified = '合格'
- form.value.worstQualified = '合格'
- form.value.modelQualified = '合格'
- }
- else {
- form.value.bestQualified = '不合格'
- form.value.worstQualified = '不合格'
- form.value.modelQualified = '不合格'
- }
+ // 统计有几个日期
+ // stabilityColumns.value[5].children?.forEach((item) => {
+ // if (item.text !== '-' && item.text !== '') {
+ // dateNum += 1
+ // }
+ // })
+
+ // // 保存之前判断一下结论 如果所有的相对重复性是否小于相对扩展不确定度Urel全为是,则结论合格
+ // if (bestListStability.value.every(item => item.lessThan === '是') && worstListStability.value.every(item => item.lessThan === '是') && modelListStability.value.every(item => item.lessThan === '是')) {
+ // form.value.bestQualified = '合格'
+ // form.value.worstQualified = '合格'
+ // form.value.modelQualified = '合格'
+ // }
+ // else {
+ // form.value.bestQualified = dateNum < 4 ? '合格' : '不合格'
+ // form.value.worstQualified = dateNum < 4 ? '合格' : '不合格'
+ // form.value.modelQualified = dateNum < 4 ? '合格' : '不合格'
+ // }
return true
}
@@ -602,62 +847,109 @@
// =======================点击表头日期查询历史稳定性数据===================
// 点击表头
const handleClickHeader = (val: any, checkDateDetailId: string) => {
- console.log(val, checkDateDetailId)
- // dateArrStability.value.push(val.label)
dateArrStability.value = ['核查数据', val.label]
+ fetchInfo(checkDateDetailId) // 获取此次历史日期的详情
}
// 日期变化
const handleChangeRadio = (date: string) => {
- console.log(date)
currentDate.value = date
- if (date !== '核查数据') {
- // fetchHistoryIndication(date)
- }
}
// ======================================================================
// -------------------------------------钩子-----------------------------------------------------
-// 监听最佳点稳定性表格--判断稳定性考核是否合格
+// 统计日期
+const dateCount = (columns: TableColumn[]) => {
+ let dateNum = 0 // 稳定性表格有几个日期
+
+ // 统计有几个日期
+ columns[5].children?.forEach((item) => {
+ if (item.text !== '-' && item.text !== '') {
+ dateNum += 1
+ }
+ })
+ return dateNum
+}
+
+// 监听稳定性表格--判断稳定性考核是否合格
watch([() => bestListStability.value, () => worstListStability.value, () => modelListStability.value], (newValue: any) => {
+ console.log('监听稳定性表格')
+
if (newValue[0] && newValue[0].length && newValue[0].averageValue) { // 最佳点
const result = newValue[0].every((item: { lessThan: string }) => {
return item.lessThan === '是'
})
- form.value.bestQualified = result ? '合格' : '不合格'
+ const dateNum = dateCount(stabilityColumnsBest.value)
+ form.value.bestQualified = dateNum < 4 ? '合格' : result ? '合格' : '不合格'
}
if (newValue[1] && newValue[1].length && newValue[0].averageValue) { // 最差点
const result = newValue[1].every((item: { lessThan: string }) => {
return item.lessThan === '是'
})
- form.value.worstQualified = result ? '合格' : '不合格'
+ const dateNum = dateCount(stabilityColumnsWorst.value)
+ form.value.worstQualified = dateNum < 4 ? '合格' : result ? '合格' : '不合格'
}
if (newValue[2] && newValue[2].length && newValue[0].averageValue) { // 典型点
const result = newValue[2].every((item: { lessThan: string }) => {
return item.lessThan === '是'
})
- form.value.modelQualified = result ? '合格' : '不合格'
+ const dateNum = dateCount(stabilityColumnsModel.value)
+ form.value.modelQualified = dateNum < 4 ? '合格' : result ? '合格' : '不合格'
}
-})
+}, { deep: true, immediate: true })
+
+/**
+ * 初始化表头
+ * @param soveLastColumnDate 是否处理最后一列
+ */
+function initColumns() {
+ stabilityColumnsBest.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsWorst.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ stabilityColumnsModel.value[5].children = [
+ { text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true },
+ { text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true },
+ ]
+ const index = stabilityColumnsBest.value.findIndex(item => item.text === '示值')
+ if (index !== -1) {
+ stabilityColumnsBest.value[index].children![5].text = props.checkDate! // 最后一列的表头日期
+ }
+ const indexWorst = stabilityColumnsWorst.value.findIndex(item => item.text === '示值')
+ if (index !== -1) {
+ stabilityColumnsWorst.value[indexWorst].children![5].text = props.checkDate! // 最后一列的表头日期
+ }
+ const indexModel = stabilityColumnsModel.value.findIndex(item => item.text === '示值')
+ if (index !== -1) {
+ stabilityColumnsModel.value[indexModel].children![5].text = props.checkDate! // 最后一列的表头日期
+ }
+}
// 监听核查日期变化
watch(() => props.checkDate, (newValue) => {
- stabilityColumns.value[5].children = [
- { text: '-', value: 'testValueOne', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueTwo', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueThree', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFour', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueFive', align: 'center', required: true, type: 'text', customHeader: true },
- { text: '-', value: 'testValueSix', align: 'center', required: true, type: 'text', customHeader: true },
- ]
- const index = stabilityColumns.value.findIndex(item => item.text === '示值')
- if (index !== -1) {
- stabilityColumns.value[index].children![5].text = newValue! // 最后一列的表头日期
- }
- fetchHistoryIndication() // 重新拉取稳定性日期
+ initColumns()
+ nextTick(() => {
+ fetchHistoryIndication() // 重新拉取稳定性日期
+ })
}, { immediate: true })
watch(() => props.pageType, (newValue) => {
@@ -698,6 +990,7 @@
- {{ currentDate }}
+
+
+ i.params === item.params && i.checkPoint === item.checkPoint)
// 按照时间倒序排序
@@ -76,10 +89,11 @@
})
list.forEach((e: { testValueDate: string; testValue: string; id: string }, index: number) => {
- stabilityColumns[5].children![4 - index].text = e.testValueDate // 填表头
- stabilityColumns[5].children![4 - index].checkDateDetailId = e.id // id用来查对应日期的详情
- item[stabilityColumns[5].children![4 - index].value] = e.testValue // 填表格数据
+ stabilityColumns[5].children![num - index].text = e.testValueDate // 填表头
+ stabilityColumns[5].children![num - index].checkDateDetailId = e.id // id用来查对应日期的详情
+ item[stabilityColumns[5].children![num - index].value] = e.testValue // 填表格数据
})
+
return {
itemData: item,
columnsData: stabilityColumns,