From 6ae6ee885f0acb59f4c8b2d2439fb58a0a345701 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 19 十月 2026 16:29:14 +0800
Subject: [PATCH] feat: support formatted inspection values
---
src/views/business/inspectionTask/inspection.vue | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/src/views/business/inspectionTask/inspection.vue b/src/views/business/inspectionTask/inspection.vue
index a39d7c2..0150dfc 100644
--- a/src/views/business/inspectionTask/inspection.vue
+++ b/src/views/business/inspectionTask/inspection.vue
@@ -121,9 +121,6 @@
</el-radio-group>
</div>
<div style="display: flex; align-items: center">
- <el-button v-if="state == 1" size="small" type="primary" @click="openAddUnpass">鏂板涓嶅悎鏍煎娴�</el-button>
- <el-button v-if="state == 1" size="small" type="primary" @click="unpassCheck">涓嶅悎鏍煎娴�</el-button>
- <el-button v-if="state > 1" size="small" type="primary" @click="viewUnpassCheck">鏌ョ湅涓嶅悎鏍煎娴�</el-button>
<span v-if="cableTagList.length > 0"> 鐢电紗閰嶇疆锛�</span>
<el-select v-if="cableTagList.length > 0" v-model="currentTab" clearable placeholder="璇烽�夋嫨" size="small"
@change="(m) => handleChangeCableTag(currentSample.id, 0, 'cableTag', m)
@@ -524,6 +521,7 @@
import { mapGetters } from "@/utils/store-compat";
import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
import {getDicts} from "@/api/system/dict/data";
+import { parseInspectionValueAnnotation, formatInspectionValue } from "@/utils/inspectionValueFormat";
export default {
name: 'Inspection',
components: {
@@ -688,7 +686,7 @@
page: {
total: 0,
size: 10,
- current: 0,
+ current: 1,
},
// 鏂囦欢鍒楄〃鐩稿叧--缁撴潫
// 浠诲姟鍒囨崲鍒楄〃--寮�濮�
@@ -1578,6 +1576,17 @@
// 妫�楠屽�艰緭鍏ュ悗瑙﹀彂鐨勫嚱鏁�
changeInput(m, code, n) {
if (n) {
+ const config = parseInspectionValueAnnotation(n.v && n.v.ps && n.v.ps.value);
+ if (config && !config.error && config.decimalPlaces != null && typeof n.v.v === 'string') {
+ const numericPattern = config.displayMode === 'SCIENTIFIC'
+ ? /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/
+ : /^[+-]?\d*\.?\d+$/;
+ if (n.v.v.trim() && !numericPattern.test(n.v.v.trim())) {
+ this.$message.warning('璇ユ楠屽�煎繀椤诲~鍐欐暟瀛�');
+ return;
+ }
+ n.v.v = formatInspectionValue(n.v.v, config);
+ }
// 瀹氫箟涓�涓嚱鏁版潵楠岃瘉鍒嗘暟鏄惁鏈夋晥
if (typeof n.v.v == "string") {
function isValidFraction(fraction) {
@@ -1708,7 +1717,7 @@
const v = n.v.v;
// 鑳藉姏鑼冨洿宸插簾寮�,妫�楠屽�肩被鍨嬩笉鍐嶄綔涓哄垽鏂緷鎹�傛暣涓插彧鐢辩畻寮忓瓧绗︾粍鎴愭椂鎵嶈鑼冨寲鏍煎紡,
// 鍑虹幇涓枃绛夊叾瀹冨瓧绗﹀嵆鎸夋枃鏈鐞嗗師鏍蜂繚鐣�,鍚﹀垯鏂囧瓧浼氳閫愬瓧鍒犳帀
- if (typeof v !== "string" || /[^\d.^e>锛炩墺鈮�<锛滄柇瑁傝剢鍖朶-/+]/.test(v)) {
+ if (typeof v !== "string" || /[^\d.^eE>锛炩墺鈮�<锛滄柇瑁傝剢鍖朶-/+]/.test(v)) {
return;
}
n.v.v = v
@@ -2284,7 +2293,7 @@
/* 褰撳墠妫�楠屾ā鏉跨殑妫�娴嬫潯浠朵笌妫�楠岀粨璁� */
.template-panel {
background-color: #f8f9fb;
- border: 1px solid #ebeef5;
+ border: 1px solid var(--el-border-color-light);
border-radius: 3px;
padding: 16px 16px 4px;
margin-bottom: 12px;
@@ -2304,11 +2313,11 @@
.template-panel__unit {
margin-left: 4px;
- color: #606266;
+ color: var(--lims-text-2);
}
.template-panel__conclusion--divided {
- border-top: 1px dashed #e4e7ed;
+ border-top: 1px dashed var(--el-border-color);
padding-top: 12px;
}
@@ -2487,7 +2496,7 @@
}
.inspection .el-drawer__header {
- color: #303133;
+ color: var(--lims-text);
text-align: left;
}
--
Gitblit v1.9.3