From dc082351978a1e9f75d7a1471a0ca7ebeac552a5 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 01 六月 2026 11:07:50 +0800
Subject: [PATCH] opo维护
---
src/views/business/maintain/maintainInfo.vue | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 111 insertions(+), 9 deletions(-)
diff --git a/src/views/business/maintain/maintainInfo.vue b/src/views/business/maintain/maintainInfo.vue
index 78cd766..ec052b2 100644
--- a/src/views/business/maintain/maintainInfo.vue
+++ b/src/views/business/maintain/maintainInfo.vue
@@ -55,8 +55,17 @@
<el-tag
:type="scope.row.result === '闃存��' ? 'success' : 'danger'"
effect="plain"
+ @click="handleResultClick(scope.row)"
+ style="cursor: pointer;"
>
{{ scope.row.result }}
+ <i
+ v-if="
+ scope.row.result === '闃虫��' && scope.row.positiveDetails
+ "
+ class="el-icon-info"
+ style="margin-left: 4px;"
+ ></i>
</el-tag>
</template>
</el-table-column>
@@ -263,6 +272,7 @@
v-model="cultureForm.result"
placeholder="璇烽�夋嫨鍩瑰吇缁撴灉"
style="width: 100%"
+ @change="handleResultChange"
>
<el-option label="闃存��" value="闃存��" />
<el-option label="闃虫��" value="闃虫��" />
@@ -270,7 +280,19 @@
</el-form-item>
</el-col>
</el-row>
-
+ <el-form-item
+ v-if="cultureForm.result === '闃虫��'"
+ label="闃虫�ц鎯�"
+ prop="positiveDetails"
+ >
+ <el-input
+ type="textarea"
+ :rows="2"
+ v-model="cultureForm.positiveDetails"
+ placeholder="璇疯緭鍏ラ槼鎬х粨鏋滅殑璇︾粏淇℃伅"
+ clearable
+ />
+ </el-form-item>
<el-form-item label="闄勪欢">
<UploadAttachment
ref="cultureUploadAttachment"
@@ -502,6 +524,7 @@
cultureType: "",
sampleTime: "",
result: "闃存��",
+ positiveDetails: "", // 鏂板锛氶槼鎬ц鎯�
attachments: []
},
cultureFileList: [],
@@ -514,7 +537,8 @@
],
result: [
{ required: true, message: "璇烽�夋嫨鍩瑰吇缁撴灉", trigger: "change" }
- ]
+ ],
+ positiveDetails: [] // 鍔ㄦ�侀獙璇佽鍒�
},
cultureTypeOptions: [
{ value: "1", label: "琛�鍩瑰吇" },
@@ -661,7 +685,46 @@
this.recordLoading = false;
}
},
+ // 澶勭悊鍩瑰吇缁撴灉閫夋嫨鍙樺寲
+ handleResultChange(value) {
+ this.$nextTick(() => {
+ if (value === "闃虫��") {
+ this.cultureRules.positiveDetails = [
+ { required: true, message: "璇疯緭鍏ラ槼鎬ц鎯�", trigger: "blur" }
+ ];
+ } else {
+ this.cultureRules.positiveDetails = [];
+ this.cultureForm.positiveDetails = "";
+ }
+ // 娓呴櫎楠岃瘉
+ if (this.$refs.cultureForm) {
+ this.$refs.cultureForm.clearValidate("positiveDetails");
+ }
+ });
+ },
+ // 澶勭悊鐐瑰嚮鍩瑰吇缁撴灉鏍囩
+ handleResultClick(row) {
+ if (row.result === "闃虫��" && row.positiveDetails) {
+ this.$alert(
+ `<div style="padding: 10px;">
+ <h4 style="margin-bottom: 10px; color: #f56c6c;">闃虫�ц鎯咃細</h4>
+ <div style="background: #fef0f0; padding: 15px; border-radius: 4px; border-left: 4px solid #f56c6c;">
+ <p style="margin: 0; white-space: pre-wrap; line-height: 1.5;">${row.positiveDetails}</p>
+ </div>
+ </div>`,
+ "闃虫�х粨鏋滆鎯�",
+ {
+ dangerouslyUseHTMLString: true,
+ confirmButtonText: "鍏抽棴",
+ customClass: "result-details-dialog",
+ showClose: false
+ }
+ );
+ } else if (row.result === "闃虫��") {
+ this.$message.warning("璇ラ槼鎬ц褰曟殏鏃犺鎯呬俊鎭�");
+ }
+ },
// 淇濆瓨鎵�鏈夋暟鎹�
async handleSave() {
try {
@@ -747,9 +810,13 @@
});
},
+ // 5. 淇敼缂栬緫鍩瑰吇璁板綍鏂规硶
handleEditCulture(row) {
this.cultureDialogTitle = "缂栬緫鍩瑰吇璁板綍";
- this.cultureForm = { ...row };
+ this.cultureForm = {
+ ...row,
+ positiveDetails: row.positiveDetails || "" // 纭繚鏈塸ositiveDetails瀛楁
+ };
this.cultureFileList = row.attachments
? row.attachments.map(item => ({
uid: item.id || Math.random(),
@@ -763,27 +830,44 @@
this.cultureDialogVisible = true;
this.$nextTick(() => {
this.$refs.cultureForm && this.$refs.cultureForm.clearValidate();
+ // 濡傛灉缂栬緫鏃舵槸闃虫�х粨鏋滐紝璁剧疆楠岃瘉瑙勫垯
+ if (row.result === "闃虫��") {
+ this.cultureRules.positiveDetails = [
+ { required: true, message: "璇疯緭鍏ラ槼鎬ц鎯�", trigger: "blur" }
+ ];
+ }
});
},
+ // 6. 淇敼淇濆瓨鍩瑰吇璁板綍鏂规硶
handleSaveCulture() {
this.$refs.cultureForm.validate(valid => {
if (valid) {
this.cultureSaveLoading = true;
- if (this.cultureForm.id) {
+ // 鏋勫缓淇濆瓨鏁版嵁
+ const saveData = {
+ ...this.cultureForm,
+ // 濡傛灉鏄槾鎬э紝娓呯┖闃虫�ц鎯�
+ positiveDetails:
+ this.cultureForm.result === "闃虫��"
+ ? this.cultureForm.positiveDetails || ""
+ : ""
+ };
+
+ if (saveData.id) {
const index = this.cultureList.findIndex(
- item => item.id === this.cultureForm.id
+ item => item.id === saveData.id
);
if (index !== -1) {
- this.cultureList.splice(index, 1, { ...this.cultureForm });
+ this.cultureList.splice(index, 1, { ...saveData });
}
} else {
- this.cultureForm.id = Date.now();
- this.cultureList.push({ ...this.cultureForm });
+ saveData.id = Date.now();
+ this.cultureList.push({ ...saveData });
}
- this.$message.success(this.cultureForm.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
+ this.$message.success(saveData.id ? "淇敼鎴愬姛" : "鏂板鎴愬姛");
this.cultureDialogVisible = false;
this.cultureSaveLoading = false;
}
@@ -1171,4 +1255,22 @@
font-size: 13px;
margin-left: 8px;
}
+/* 7. 娣诲姞涓�浜涙牱寮� */
+.result-details-dialog {
+ width: 500px;
+}
+
+.result-details-dialog .el-message-box__content {
+ padding: 0;
+}
+
+.result-details-dialog .el-message-box__header {
+ background: #fef0f0;
+ border-bottom: 1px solid #fde2e2;
+}
+
+.result-details-dialog .el-message-box__title {
+ color: #f56c6c;
+ font-weight: bold;
+}
</style>
--
Gitblit v1.9.3