From 2b2fa317c30ee2de7a8b6f5fc964532031adea66 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期日, 20 九月 2026 13:48:54 +0800
Subject: [PATCH] fix: 优化报告功能
---
src/views/business/inspectionTask/components/InspectionWord.vue | 52 ++++++++--------------------------------------------
1 files changed, 8 insertions(+), 44 deletions(-)
diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 19b5037..d9ff99f 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -48,7 +48,7 @@
placeholder="璇疯緭鍏ユ娴嬪湴鐐�" size="small" style="width: 200px"
@change="m => subOtherForm(m, 'detectionPlace')"></el-input>
</el-form-item>
- <el-form-item v-if="isDirectTemplateOrder()" label="璁惧:">
+ <el-form-item label="璁惧:">
<el-select v-model="currentOtherForm.deviceIds" :disabled="state != 1" multiple filterable clearable
size="small" placeholder="璇烽�夋嫨璁惧" style="width: 360px"
@change="m => subOtherForm(m, 'deviceIds')">
@@ -115,9 +115,9 @@
</el-select>
</template>
<template v-else-if="n.v.ps != undefined && n.v.ps.value === '璁$畻鍊�' && state == 1"><span
- :style="`font-family:${n.v.ff} !important;`">{{ toFixed(n.v.v, n.v.ct) }}</span></template>
+ :style="`font-family:${n.v.ff} !important;`">{{ n.v.v }}</span></template>
<template v-else-if="n.v.ps != undefined && n.v.ps.value === '鏈�缁堝��' && state == 1">
- <span :style="`font-family:${n.v.ff} !important;`">{{ toFixed(n.v.v, n.v.ct) }}</span>
+ <span :style="`font-family:${n.v.ff} !important;`">{{ n.v.v }}</span>
</template>
<template v-else-if="n.v.ps != undefined && n.v.ps.value === '鏍峰搧缂栧彿'">
<div :title="currentSample.sampleCode"
@@ -523,9 +523,7 @@
this.retestTag = '1'
}
this.getEquipOptions(1)
- if (this.sonLaboratory === '鏂拌仛') {
- this.loadDeviceOptions()
- }
+ this.loadDeviceOptions()
// 鑾峰彇褰撳墠鏍峰搧鐨勬楠岄」
let list = await this.getCurrentProduct(this.currentSample.id, 0)
if (list === undefined) {
@@ -1244,13 +1242,6 @@
getValue(v) {
// 瀵归〉闈㈠睍绀烘暟鎹繘琛屽鐞�,@,浠h〃鎹㈣
let str = v.v ? v.v : (v.v === 0 ? v.v : (v.ct && v.ct.s ? v.ct.s.length > 0 && v.ct.s[0].v.replace(new RegExp('\n', 'g'), '<br/>').replace(new RegExp('@', 'g'), '<br/>') : ''))
- // 瀵规暟鎹繚鐣欏皬鏁扮偣杩涜澶勭悊
- if (v.ct && v.ct.fa && v.ct.fa.includes('.') && str) {
- let num = 0
- let str0 = v.ct.fa.split('.')[1]
- num = str0.length
- str = Number(str).toFixed(num)
- }
if (v.v && typeof v.v == 'string' && v.v.includes('@')) {
str = v.v.replace(new RegExp('@', 'g'), '<br/>')
}
@@ -1357,12 +1348,6 @@
})
}
},
- // 鏂拌仛鐩存帴缁戝畾妯℃澘鐨勫崟鎹紝璁惧鎸夋ā鏉块�夋嫨
- isDirectTemplateOrder() {
- return this.sonLaboratory === '鏂拌仛' &&
- Array.isArray(this.insOrder.templateConditions) &&
- this.insOrder.templateConditions.length > 0
- },
loadDeviceOptions() {
search({ status: 0 }).then(res => {
this.deviceOptions = (res.data || []).map(device => ({
@@ -1382,11 +1367,12 @@
upInsReview(e) {
if (e == 1) {
// 閫氳繃
+ // 姣忎釜妯℃澘閮借鏈夌粨璁猴紱鍏ㄩ儴鍚堟牸鎵嶇畻鏁村崟鍚堟牸
const insResults = this.tableLists.map(
item => (this.otherForm[item.templateId] || {}).insResult
)
const missingIndex = insResults.findIndex(result => result !== 0 && result !== 1)
- if (this.isDirectTemplateOrder() && missingIndex > -1) {
+ if (missingIndex > -1) {
this.$message.error(`璇烽�夋嫨銆�${this.tableLists[missingIndex].templateName}銆嶇殑妫�楠岀粨璁篳)
return
}
@@ -1397,9 +1383,7 @@
laboratory: this.sonLaboratory,
tell: null,
userId: this.checkUser,
- insResult: this.isDirectTemplateOrder()
- ? (insResults.every(result => result === 1) ? 1 : 0)
- : this.insOrder.insResult
+ insResult: insResults.every(result => result === 1) ? 1 : 0
}).then(res => {
if (res.code === 200) {
this.$message.success("鎿嶄綔鎴愬姛")
@@ -1481,7 +1465,7 @@
if (!form.humidity) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑婀垮害`)
if (!form.detectionTime) missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑妫�娴嬫椂闂碻)
if (!form.detectionPlace) missing.push(`璇峰~鍐欍��${m.templateName}銆嶇殑妫�娴嬪湴鐐筦)
- if (this.isDirectTemplateOrder() && (!form.deviceIds || form.deviceIds.length === 0)) {
+ if (!form.deviceIds || form.deviceIds.length === 0) {
missing.push(`璇烽�夋嫨銆�${m.templateName}銆嶇殑璁惧`)
}
})
@@ -1748,26 +1732,6 @@
}).catch(error => {
})
- },
- /**
- * 灏嗘暟鍊紇淇濈暀ct.fa涓�'##'鍚庣殑鎸囧畾灏忔暟浣嶆暟锛屽苟杩斿洖鏍煎紡鍖栧悗鐨勫瓧绗︿覆銆�
- *
- * @param v 瑕佹牸寮忓寲鐨勬暟鍊�
- * @param ct 鍖呭惈鏍煎紡鍖栭厤缃殑瀵硅薄
- * @param ct.fa 鏍煎紡鍖栭厤缃瓧绗︿覆锛岃嫢鍖呭惈'##'鍒欐寜鐓у叾鍚庣殑鍐呭纭畾灏忔暟浣嶆暟
- * @returns 鏍煎紡鍖栧悗鐨勫瓧绗︿覆鎴栧師濮嬫暟鍊硷紙鑻ラ厤缃笉绗﹀悎瑕佹眰锛�
- */
- toFixed(v, ct) {
- if (v && ct && ct.fa) {
- if (ct.fa.includes('.')) {
- let num = ct.fa.slice(4).length
- return Number(v).toFixed(num)
- } else {
- return v
- }
- } else {
- return v
- }
}
}
}
--
Gitblit v1.9.3