From 4ca375b2e3dae98d6ececc1b7b421a12f3fa8a26 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期二, 01 七月 2025 09:00:38 +0800
Subject: [PATCH] 修改bug,验收通过

---
 laboratory/src/views/deliveryAssessment/assayTaskList/components/CraftDialog.vue |   50 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/laboratory/src/views/deliveryAssessment/assayTaskList/components/CraftDialog.vue b/laboratory/src/views/deliveryAssessment/assayTaskList/components/CraftDialog.vue
index 478a8fb..2cd1101 100644
--- a/laboratory/src/views/deliveryAssessment/assayTaskList/components/CraftDialog.vue
+++ b/laboratory/src/views/deliveryAssessment/assayTaskList/components/CraftDialog.vue
@@ -59,6 +59,7 @@
 </template>
 
 <script>
+import {getDetailById} from '../service'
 export default {
     name: 'CraftDialog',
     props: {
@@ -69,7 +70,11 @@
         reportData: {
             type: Object,
             default: () => { }
-        }
+        },id: {
+      type: [String, Number],
+      default: "",
+    //   required: true,
+    },
     },
     data() {
         return {
@@ -121,20 +126,45 @@
         modelValue: {
             handler(val) {
                 this.dialogVisible = val;
+                if (val && this.id) {
+          this.fetchDetail();
+        }
             },
             immediate: true
         },
-        reportData: {
-            handler(val) {
-                if (val) {
-                    this.form.reportNo = val.reportNo || '';
-                    this.form.reportName = val.reportName || '';
-                }
-            },
-            immediate: true
-        }
+        id(val) {
+      if (this.modelValue && val) {
+        this.fetchDetail();
+      }
+    },
     },
     methods: {
+        async fetchDetail() {
+      try {
+        const res = await getDetailById({ id: this.id });
+        if (res) {
+          this.evaluateInfo = { ...res };
+          this.form.reportNo = res.reportCode || "";
+          this.form.reportName = res.reportTitle || "";
+          // 详情回显分数
+          if (res.evaluateScore) {
+            if (
+              this.type === "detail" &&
+              typeof res.evaluateScore === "string"
+            ) {
+              const scoreArr = res.evaluateScore
+                .split(",")
+                .map((s) => Number(s));
+              this.criteriaList.forEach((item, idx) => {
+                item.score = scoreArr[idx] || 0;
+              });
+            }
+          }
+        }
+      } catch (e) {
+        this.$message && this.$message.error("获取详情失败");
+      }
+    },
         handleClose() {
             this.$emit('update:modelValue', false);
         },

--
Gitblit v1.7.1