|
@@ -202,8 +202,9 @@
|
|
|
row-key="id"
|
|
row-key="id"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:datasource="form.items"
|
|
:datasource="form.items"
|
|
|
- cache-key="mes-selfInspectionRequest-20251201"
|
|
|
|
|
|
|
+ cache-key="mes-selfInspectionReporting-20260417"
|
|
|
:need-page="false"
|
|
:need-page="false"
|
|
|
|
|
+ :fit="false"
|
|
|
@refresh="getData"
|
|
@refresh="getData"
|
|
|
:selection.sync="selection"
|
|
:selection.sync="selection"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
@@ -237,13 +238,12 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:defaultValue="{ row }">
|
|
<template v-slot:defaultValue="{ row }">
|
|
|
- <div
|
|
|
|
|
- style="width: 100%; display: flex; justify-content: space-between"
|
|
|
|
|
- >
|
|
|
|
|
- <div style="width: 17%">
|
|
|
|
|
|
|
+ <div class="process-param-cell">
|
|
|
|
|
+ <div class="process-param-symbol">
|
|
|
<DictSelection
|
|
<DictSelection
|
|
|
clearable
|
|
clearable
|
|
|
dictName="数学字符"
|
|
dictName="数学字符"
|
|
|
|
|
+ value-name="dictValue"
|
|
|
disabled
|
|
disabled
|
|
|
v-model="row.symbol"
|
|
v-model="row.symbol"
|
|
|
></DictSelection>
|
|
></DictSelection>
|
|
@@ -255,18 +255,15 @@
|
|
|
placement="top"
|
|
placement="top"
|
|
|
v-if="row.textType == 3"
|
|
v-if="row.textType == 3"
|
|
|
>
|
|
>
|
|
|
- <div
|
|
|
|
|
- style="
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
- width: 65%;
|
|
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
- <el-input style="width: 45%" v-model="row.minValue" disabled />
|
|
|
|
|
- <span> -</span>
|
|
|
|
|
|
|
+ <div class="process-param-range">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ class="process-param-range-input"
|
|
|
|
|
+ v-model="row.minValue"
|
|
|
|
|
+ disabled
|
|
|
|
|
+ />
|
|
|
|
|
+ <span class="process-param-range-sep"> -</span>
|
|
|
<el-input
|
|
<el-input
|
|
|
- style="width: 45%; margin-left: 10px"
|
|
|
|
|
|
|
+ class="process-param-range-input process-param-range-input--tail"
|
|
|
v-model="row.maxValue"
|
|
v-model="row.maxValue"
|
|
|
disabled
|
|
disabled
|
|
|
/>
|
|
/>
|
|
@@ -279,7 +276,7 @@
|
|
|
placement="top"
|
|
placement="top"
|
|
|
v-else
|
|
v-else
|
|
|
>
|
|
>
|
|
|
- <div style="width: 65%">
|
|
|
|
|
|
|
+ <div class="process-param-default">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="row.defaultValue"
|
|
v-model="row.defaultValue"
|
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
@@ -288,9 +285,10 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
- <div style="width: 17%">
|
|
|
|
|
|
|
+ <div class="process-param-unit">
|
|
|
<DictSelection
|
|
<DictSelection
|
|
|
dictName="工艺参数单位"
|
|
dictName="工艺参数单位"
|
|
|
|
|
+ value-name="dictValue"
|
|
|
clearable
|
|
clearable
|
|
|
filterable
|
|
filterable
|
|
|
disabled
|
|
disabled
|
|
@@ -471,7 +469,7 @@
|
|
|
slot: 'defaultValue',
|
|
slot: 'defaultValue',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
label: '工艺参数',
|
|
label: '工艺参数',
|
|
|
- minWidth: 340
|
|
|
|
|
|
|
+ minWidth: 380
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: 'toolList',
|
|
prop: 'toolList',
|
|
@@ -739,6 +737,27 @@
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ parseInspectionNumber(val) {
|
|
|
|
|
+ if (val === null || val === undefined) return NaN;
|
|
|
|
|
+ if (typeof val === 'number') {
|
|
|
|
|
+ return Number.isFinite(val) ? val : NaN;
|
|
|
|
|
+ }
|
|
|
|
|
+ const s = String(val)
|
|
|
|
|
+ .trim()
|
|
|
|
|
+ .replace(/\uFF0E/g, '.')
|
|
|
|
|
+ .replace(/./g, '.')
|
|
|
|
|
+ .replace(/[,,]/g, '.');
|
|
|
|
|
+ if (s === '') return NaN;
|
|
|
|
|
+ const n = Number(s);
|
|
|
|
|
+ return Number.isFinite(n) ? n : NaN;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ nearlyEqualNumbers(a, b) {
|
|
|
|
|
+ const diff = Math.abs(a - b);
|
|
|
|
|
+ const scale = Math.abs(a) + Math.abs(b) || 1;
|
|
|
|
|
+ return diff < Number.EPSILON * scale * 10;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
calcCheckResult(row, field) {
|
|
calcCheckResult(row, field) {
|
|
|
const rawValue = row[field];
|
|
const rawValue = row[field];
|
|
|
|
|
|
|
@@ -748,8 +767,8 @@
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const value = Number(rawValue);
|
|
|
|
|
- if (isNaN(value)) return;
|
|
|
|
|
|
|
+ const value = this.parseInspectionNumber(rawValue);
|
|
|
|
|
+ if (Number.isNaN(value)) return;
|
|
|
|
|
|
|
|
let pass = true;
|
|
let pass = true;
|
|
|
|
|
|
|
@@ -757,26 +776,35 @@
|
|
|
'≥': '>=',
|
|
'≥': '>=',
|
|
|
'≤': '<=',
|
|
'≤': '<=',
|
|
|
'>': '>',
|
|
'>': '>',
|
|
|
- '<': '<'
|
|
|
|
|
|
|
+ '<': '<',
|
|
|
|
|
+ '=': '='
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const symbol = symbolMap[row.symbol] || row.symbol;
|
|
const symbol = symbolMap[row.symbol] || row.symbol;
|
|
|
if (row.textType == 3) {
|
|
if (row.textType == 3) {
|
|
|
- let min = Number(row.minValue);
|
|
|
|
|
- let max = Number(row.maxValue);
|
|
|
|
|
|
|
+ let min = this.parseInspectionNumber(row.minValue);
|
|
|
|
|
+ let max = this.parseInspectionNumber(row.maxValue);
|
|
|
|
|
|
|
|
- if (isNaN(min) && isNaN(max)) return;
|
|
|
|
|
|
|
+ if (Number.isNaN(min) && Number.isNaN(max)) return;
|
|
|
|
|
|
|
|
// 自动排序区间
|
|
// 自动排序区间
|
|
|
- if (!isNaN(min) && !isNaN(max) && min > max) {
|
|
|
|
|
|
|
+ if (!Number.isNaN(min) && !Number.isNaN(max) && min > max) {
|
|
|
[min, max] = [max, min];
|
|
[min, max] = [max, min];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (!isNaN(min) && value < min) pass = false;
|
|
|
|
|
- if (!isNaN(max) && value > max) pass = false;
|
|
|
|
|
|
|
+ if (!Number.isNaN(min) && value < min) pass = false;
|
|
|
|
|
+ if (!Number.isNaN(max) && value > max) pass = false;
|
|
|
} else {
|
|
} else {
|
|
|
- const defaultVal = Number(row.defaultValue);
|
|
|
|
|
- if (isNaN(defaultVal)) return;
|
|
|
|
|
|
|
+ const rawDefault = row.defaultValue;
|
|
|
|
|
+ if (
|
|
|
|
|
+ rawDefault === '' ||
|
|
|
|
|
+ rawDefault === null ||
|
|
|
|
|
+ rawDefault === undefined
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const defaultVal = this.parseInspectionNumber(rawDefault);
|
|
|
|
|
+ if (Number.isNaN(defaultVal)) return;
|
|
|
|
|
|
|
|
switch (symbol) {
|
|
switch (symbol) {
|
|
|
case '>':
|
|
case '>':
|
|
@@ -792,7 +820,7 @@
|
|
|
pass = value <= defaultVal;
|
|
pass = value <= defaultVal;
|
|
|
break;
|
|
break;
|
|
|
case '=':
|
|
case '=':
|
|
|
- pass = value == defaultVal;
|
|
|
|
|
|
|
+ pass = this.nearlyEqualNumbers(value, defaultVal);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -861,4 +889,60 @@
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
background: #fff;
|
|
background: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-cell {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-symbol {
|
|
|
|
|
+ flex: 0 0 60px;
|
|
|
|
|
+ width: 60px;
|
|
|
|
|
+ min-width: 60px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-default {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-range {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-range-input {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-range-input--tail {
|
|
|
|
|
+ margin-left: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-range-sep {
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-unit {
|
|
|
|
|
+ flex: 0 0 80px;
|
|
|
|
|
+ width: 80px;
|
|
|
|
|
+ min-width: 80px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-symbol ::v-deep .el-select,
|
|
|
|
|
+ .process-param-unit ::v-deep .el-select {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .process-param-symbol ::v-deep .el-input__inner,
|
|
|
|
|
+ .process-param-unit ::v-deep .el-input__inner {
|
|
|
|
|
+ padding-left: 8px;
|
|
|
|
|
+ padding-right: 28px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|