From 05c6ee06af8164aea9346368875c539f253a89b9 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 17 九月 2026 19:44:21 +0800
Subject: [PATCH] 新疆——新聚lims 1.检验任务单详情输入检验值时不限制小数点位数
---
src/workers/InspectionWorker.worker.js | 69 +---------------------------------
1 files changed, 2 insertions(+), 67 deletions(-)
diff --git a/src/workers/InspectionWorker.worker.js b/src/workers/InspectionWorker.worker.js
index 8319427..119d3ce 100644
--- a/src/workers/InspectionWorker.worker.js
+++ b/src/workers/InspectionWorker.worker.js
@@ -227,8 +227,6 @@
break;
}
}
- let isToExponential = ""; //鏄惁涓虹瀛﹁鏁版硶
- let list2 = []; //涓�涓暟缁勶紝閲岄潰淇濆瓨鏈夊綋鍓嶆楠岄」鐨勬墍鏈夊弬鏁板��
let isPoint = ""; //鏄惁涓哄皬鏁扮偣
let inputType = null;
let currentInsItemId = "";
@@ -262,7 +260,6 @@
break;
}
}
- list2.push(c.v.v);
// 缁勮鍙傛暟鐨勫璞¢泦鍚堝苟璧嬪�硷紝鍒楀{A3:12,B4:15}
if (
(getInspectionValueType(item.i) == 1 ||
@@ -341,22 +338,7 @@
}
// 鏍规嵁杈撳叆鐨勬暟鍊硷紝杩涜璁$畻
comResult = compute(item.v.f.replace(/=/g, " "), comValue, isPoint);
- // 妫�楠岄」涓哄瘑搴︽椂锛屾牴鎹姹傚�肩殑灏忔暟浣嶆敼鍙樻渶缁堝�肩殑灏忔暟浣�
- if (inspectionItem == "瀵嗗害") {
- const str = "" + tell;
- const indexOfDecimal = str.indexOf(".");
- if (indexOfDecimal > -1) {
- const length = str.length - indexOfDecimal - 1;
- comResult = comResult.toFixed(length);
- }
- } else if (
- inspectionItemClass == "澶栨姢濂楁満姊扮墿鐞嗘�ц兘" &&
- inspectionItem == "鍦↖RM 902鐭跨墿娌逛腑娴告场鍚�" &&
- (inspectionItemSubclass == "鏂浼搁暱鐜囧彉鍖栫巼" ||
- inspectionItemSubclass == "鎶楀紶寮哄害鍙樺寲鐜�")
- ) {
- comResult = Math.round(comResult).toFixed(0);
- } else if (
+ if (
typeof comResult == "string" &&
(comResult.includes("鏂") || comResult.includes("鑴嗗寲"))
) {
@@ -384,15 +366,6 @@
}
if (isHaveSymbol) {
comResult = symbol + comResult;
- }
- let list3 = list2.map((item) => item + "");
- // 鍒ゆ柇濉殑妫�楠屽�兼槸鍚︿负绉戝璁℃暟娉曪紝濡傛灉涓虹瀛﹁鏁版硶锛屽垯杩涜杞寲
- isToExponential = list3.some(
- (val) => val.includes("e+") || val.includes("e-")
- );
- if (isToExponential) {
- let num2 = new Big(comResult);
- comResult = num2.toExponential(1);
}
} else {
// 濡傛灉妫�楠屽�肩被鍨嬫槸鏂囨湰杈撳叆妗嗐�佷笅鎷夋
@@ -432,45 +405,7 @@
// 鍒ゆ柇褰撳墠琛屾槸鍚︿负褰撳墠妫�楠岄」鎵�鍦ㄨ锛屽鏋滀负褰撳墠琛岋紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪��
for (var b in a) {
if (a[b].c == item.c) {
- try {
- if (comResult == 0) {
- // 鍒ゆ柇璁$畻缁撴灉鏄惁涓�0锛屽鏋滀负0锛屽垯缁欒〃鏍兼暟鎹祴鍊间负0
- a[b].v.v = 0;
- } else if (
- a[b].v.ct &&
- a[b].v.ct.fa &&
- typeof a[b].v.ct.fa == "string" &&
- a[b].v.ct.fa.includes(".")
- ) {
- // 鍒ゆ柇褰撳墠鍗曞厓鏍兼槸鍚︿繚鐣欏皬鏁扮偣锛屽鏋滀负淇濈暀灏忔暟鐐癸紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�间负淇濈暀灏忔暟鐐癸紝杩欎釜鏄牴鎹ā鏉块厤缃皬鏁扮偣鏉ョ殑
- let num = 0;
- let str = a[b].v.ct.fa.split(".")[1];
- num = str.length;
- a[b].v.v = comResult
- ? Number(comResult).toFixed(num)
- : comResult;
- } else if (
- typeof comResult == "string" &&
- (comResult.includes("e+") || comResult.includes("e-"))
- ) {
- // 鍒ゆ柇璁$畻缁撴灉鏄惁涓虹瀛﹁鏁版硶锛屽鏋滀负绉戝璁℃暟娉曪紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�间负绉戝璁℃暟娉�
- a[b].v.v = comResult;
- } else {
- const inspectionItem = findInsItem(item.i).inspectionItem;
- // 鍒ゆ柇璁$畻缁撴灉鏄惁涓烘暟瀛楋紝濡傛灉涓烘暟瀛楋紝鍒欑粰琛ㄦ牸鏁版嵁璧嬪�间负鏁板瓧
- if (inspectionItem == "閾滅嚎鐢甸樆鐜囅�20鏈�澶у��") {
- let val = parseFloat(Number(comResult).toFixed(5));
- a[b].v.v = isNaN(val) ? comResult : val;
- } else {
- let val = parseFloat(Number(comResult).toFixed(3));
- a[b].v.v = isNaN(val) ? comResult : val;
- }
- }
- } catch (error) {
- // 濡傛灉浠ヤ笂鍒ゆ柇閮戒笉鏀寔锛屽垯鐩存帴璧嬪��
- a[b].v.v = comResult;
- console.log("error---", error);
- }
+ a[b].v.v = comResult;
hasComputedWrite = true;
break;
}
--
Gitblit v1.9.3