From 3bc3b3afb6a8a380186d3b0554f0cfedef4926d8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 16 九月 2026 15:34:38 +0800
Subject: [PATCH] 新疆——新聚lims 1.检验任务的温湿度改为每个检验模版都填单独的温湿度 2.报告编制列表操作栏功能删除 3.检验单详情检验值输入框改为可以填汉字及数值
---
src/views/business/inspectionTask/components/InspectionWord.vue | 109 +++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 87 insertions(+), 22 deletions(-)
diff --git a/src/views/business/inspectionTask/components/InspectionWord.vue b/src/views/business/inspectionTask/components/InspectionWord.vue
index 189de42..0b59485 100644
--- a/src/views/business/inspectionTask/components/InspectionWord.vue
+++ b/src/views/business/inspectionTask/components/InspectionWord.vue
@@ -26,6 +26,21 @@
</el-select>
</div>
</div>
+ <div style="text-align: left; margin-top: 8px;">
+ <el-form :inline="true" :model="currentOtherForm" class="form-inline" label-width="50px"
+ style="text-align: left; display: inline">
+ <el-form-item label="娓╁害:" style="margin-bottom: 0">
+ <el-input v-model="currentOtherForm.temperature" :disabled="state > 1" placeholder="" size="small"
+ style="width: 90px" @change="m => subOtherForm(m, 'temperature')"></el-input>
+ <span style="margin-left: 4px">鈩�</span>
+ </el-form-item>
+ <el-form-item label="婀垮害:" style="margin-bottom: 0">
+ <el-input v-model="currentOtherForm.humidity" :disabled="state > 1" placeholder="" size="small"
+ style="width: 90px" @change="m => subOtherForm(m, 'humidity')"></el-input>
+ <span style="margin-left: 4px">%RH</span>
+ </el-form-item>
+ </el-form>
+ </div>
<!-- 甯歌妫�楠屽師濮嬭褰� -->
<div id="tableBox" v-loading="tableLoading" class="center-box">
<table v-for="(item, index) in tableList" :key="index + currentTable + currentSample.id" border="1"
@@ -220,7 +235,8 @@
getInsProductUnqualifiedRetest,
search, selectUserCondition,
submitPlan,
- verifyPlan
+ verifyPlan,
+ write
} from "@/api/business/inspectionTask";
import { getUserNow, saveUnqualifiedContext } from "@/api/business/rawMaterialOrder";
import InspectionWorker from '@/workers/InspectionWorker.worker';
@@ -340,10 +356,8 @@
numOptions: [],
temperatureOptions: [],
wareTableData: [],
- otherForm: {
- humidity: null,
- temperature: null,
- },
+ // 娓╁害銆佹箍搴︽寜妯℃澘 id 鍒嗙粍锛歿 [templateId]: { temperature, humidity } }
+ otherForm: {},
equipForm: {
value0: null,
code0: null,
@@ -418,6 +432,13 @@
},
action() {
return this.javaApi + "/insOrderPlan/uploadFile";
+ },
+ // 褰撳墠妯℃澘瀵瑰簲鐨勬俯搴︺�佹箍搴�
+ currentOtherForm() {
+ return this.otherForm[this.currentTable] || {
+ temperature: null,
+ humidity: null
+ }
}
},
created() {
@@ -453,11 +474,15 @@
this.sampleProduct = res.data.sampleProduct
this.currentSample = this.HaveJson(this.sampleProduct[0])
let insProduct = this.HaveJson(this.currentSample.insProduct)
- // 娓╁害銆佹箍搴﹁祴鍊�
- this.otherForm = {
- temperature: this.insOrder.temperature ? this.insOrder.temperature : null,
- humidity: this.insOrder.humidity ? this.insOrder.humidity : null,
- }
+ // 娓╁害銆佹箍搴﹁祴鍊硷細鎸夋ā鏉� id 鍒嗙粍鍥炴樉
+ this.otherForm = {}
+ const conditionList = this.insOrder.templateConditions || []
+ conditionList.forEach(item => {
+ this.$set(this.otherForm, item.templateId, {
+ temperature: item.temperature != null ? item.temperature : null,
+ humidity: item.humidity != null ? item.humidity : null
+ })
+ })
if (this.typeSource == '1') {
this.retestTag = '1'
}
@@ -515,6 +540,8 @@
if (this.tableLists && this.tableLists.length > 0) {
this.tableList = null;
this.tableList = this.tableLists.filter(m => m.templateId == val1)
+ // 妯℃澘闆嗗悎鍙兘鍙樺寲锛岃ˉ榻愭俯搴︺�佹箍搴︽Ы浣�
+ this.tableLists.forEach(m => this.ensureOtherForm(m.templateId))
// 瀵规ā鏉胯繘琛屽鐞�
this.handleTableData()
}
@@ -846,6 +873,8 @@
this.tableList = null;
this.tableList = [this.tableLists[0]]
this.currentTable = this.tableLists[0].templateId;
+ // 琛ラ綈姣忎釜妯℃澘鐨勬俯搴︺�佹箍搴︽Ы浣�
+ this.tableLists.forEach(m => this.ensureOtherForm(m.templateId))
// 澶勭悊椤甸潰鍒楄〃鏁版嵁
this.handleTableData()
}
@@ -875,6 +904,8 @@
this.tableList = [this.tableLists[0]]
this.currentTable = this.tableLists[0].templateId;
this.currentSample.insProduct = this.HaveJson(list)
+ // 琛ラ綈姣忎釜妯℃澘鐨勬俯搴︺�佹箍搴︽Ы浣�
+ this.tableLists.forEach(m => this.ensureOtherForm(m.templateId))
// 澶勭悊椤甸潰鍒楄〃鏁版嵁
this.handleTableData()
}
@@ -1210,15 +1241,24 @@
// 瀵硅緭鍏ュ�艰繘琛屾牸寮忔牎楠�
handleInput(n) {
try {
- n.v.v = n.v.v.replace(/[^\d.^e>\-/+]/g, '');
- n.v.v = n.v.v.replace(/\.{2,}/g, "."); //鍙繚鐣欑涓�涓�. 娓呴櫎澶氫綑鐨�
- n.v.v = n.v.v.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
- n.v.v = n.v.v.replace(/\/{2,}/g, "/"); //鍙繚鐣欑涓�涓�/娓呴櫎澶氫綑鐨�
- n.v.v = n.v.v.replace("/", "$#$").replace(/\//g, "").replace("$#$", "/");
+ const v = n.v.v;
+ // 鑳藉姏鑼冨洿宸插簾寮�,妫�楠屽�肩被鍨嬩笉鍐嶄綔涓哄垽鏂緷鎹�傛暣涓插彧鐢辩畻寮忓瓧绗︾粍鎴愭椂鎵嶈鑼冨寲鏍煎紡,
+ // 鍑虹幇涓枃绛夊叾瀹冨瓧绗﹀嵆鎸夋枃鏈鐞嗗師鏍蜂繚鐣�,鍚﹀垯鏂囧瓧浼氳閫愬瓧鍒犳帀
+ if (typeof v !== "string" || /[^\d.^e>锛炩墺鈮�<锛滄柇瑁傝剢鍖朶-/+]/.test(v)) {
+ return;
+ }
+ n.v.v = v
+ .replace(/\.{2,}/g, ".") //鍙繚鐣欑涓�涓�. 娓呴櫎澶氫綑鐨�
+ .replace(".", "$#$")
+ .replace(/\./g, "")
+ .replace("$#$", ".")
+ .replace(/\/{2,}/g, "/") //鍙繚鐣欑涓�涓�/娓呴櫎澶氫綑鐨�
+ .replace("/", "$#$")
+ .replace(/\//g, "")
+ .replace("$#$", "/");
} catch (error) {
console.log(error);
}
-
},
getInspectionItemType(id) {
for (var a in this.currentSample.insProduct) {
@@ -1332,17 +1372,42 @@
this.$message.error('鏈緭鍏ヤ笉閫氳繃鍘熷洜')
}
},
+ // 淇濊瘉妯℃澘鐨勬俯搴︺�佹箍搴︽Ы浣嶅瓨鍦�
+ ensureOtherForm(templateId) {
+ if (templateId == null) return
+ if (!this.otherForm[templateId]) {
+ this.$set(this.otherForm, templateId, {
+ temperature: null,
+ humidity: null
+ })
+ }
+ },
+ // 淇濆瓨褰撳墠妯℃澘鐨勬俯搴︺�佹箍搴�
+ subOtherForm(m, type) {
+ write({
+ id: this.insOrder.id,
+ templateId: this.currentTable,
+ [type]: Number(m)
+ }).then(res => {
+ this.$message.success("淇濆瓨鎴愬姛")
+ })
+ },
submit() {
if (this.verifyUser === null || this.verifyUser === '') {
this.$message.error("璇锋寚瀹氬鏍镐汉鍛�")
return
}
- if (!this.otherForm.humidity) {
- this.$message.error("璇疯緭鍏ユ箍搴�")
- return
- }
- if (!this.otherForm.temperature) {
- this.$message.error("璇疯緭鍏ユ俯搴�")
+ const labels = { temperature: "娓╁害", humidity: "婀垮害" }
+ const keys = ["temperature", "humidity"]
+ const missing = []
+ this.tableLists.forEach(m => {
+ const form = this.otherForm[m.templateId] || {}
+ keys.forEach(key => {
+ if (!form[key]) missing.push(`銆�${m.templateName}銆嶇殑${labels[key]}`)
+ })
+ })
+ if (missing.length > 0) {
+ this.$message.error(`璇峰~鍐�${missing[0]}`)
return
}
this.submitLoading = true;
--
Gitblit v1.9.3