From d2fb1300564eaa8166f4db1184c521e468cd2ed3 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期五, 17 四月 2026 14:23:09 +0800
Subject: [PATCH] 不合格处理:增加字段增删改,展示

---
 src/views/qualityManagement/nonconformingManagement/index.vue |   87 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 75 insertions(+), 12 deletions(-)

diff --git a/src/views/qualityManagement/nonconformingManagement/index.vue b/src/views/qualityManagement/nonconformingManagement/index.vue
index c8b2b15..98a0731 100644
--- a/src/views/qualityManagement/nonconformingManagement/index.vue
+++ b/src/views/qualityManagement/nonconformingManagement/index.vue
@@ -1,3 +1,4 @@
+// 涓嶅悎鏍肩鐞�
 <template>
   <div class="app-container">
     <div class="search_form">
@@ -51,8 +52,36 @@
           :tableLoading="tableLoading"
           @pagination="pagination"
           :total="page.total"
-      ></PIMTable>
+      >
+        <template #reasonAnalysis="{ row }">
+          <el-button
+              link
+              type="primary"
+              @click="openTextPreviewDialog('鍘熷洜鍒嗘瀽', row?.reasonAnalysis)"
+          >
+            {{ row?.reasonAnalysis}}
+          </el-button>
+        </template>
+        <template #preventiveCorrective="{ row }">
+          <el-button
+              link
+              type="primary"
+              @click="openTextPreviewDialog('棰勯槻涓庣籂姝f帾鏂�', row?.preventiveCorrective)"
+          >
+            {{ row?.preventiveCorrective}}
+          </el-button>
+        </template>
+        <template #lossWorking="{ row }">
+          <span>{{ row?.lossWorking ?? '-' }}</span>
+        </template>
+        <template #lossMaterial="{ row }">
+          <span>{{ row?.lossMaterial ?? '-' }}</span>
+        </template>
+      </PIMTable>
     </div>
+    <el-dialog v-model="textPreviewDialogVisible" :title="textPreviewTitle" width="600px">
+      <div class="text-preview-content">{{ textPreviewContent || "鏆傛棤鍐呭" }}</div>
+    </el-dialog>
     <FormDia ref="formDia" @close="handleQuery"></FormDia>
     <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia>
   </div>
@@ -60,7 +89,7 @@
 
 <script setup>
 import { Search } from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, reactive, toRefs, nextTick, getCurrentInstance} from "vue";
 import FormDia from "@/views/qualityManagement/nonconformingManagement/components/formDia.vue";
 import {ElMessageBox} from "element-plus";
 import {qualityUnqualifiedDel, qualityUnqualifiedListPage} from "@/api/qualityManagement/nonconformingManagement.js";
@@ -173,20 +202,36 @@
     width: 120
   },
   {
+    label: "鍘熷洜鍒嗘瀽",
+    prop: "reasonAnalysis",
+    dataType: "slot",
+    slot: "reasonAnalysis",
+    width: 160
+  },
+  {
+    label: "棰勯槻涓庣籂姝f帾鏂�",
+    prop: "preventiveCorrective",
+    dataType: "slot",
+    slot: "preventiveCorrective",
+    width: 180
+  },
+  {
+    label: "宸ユ椂鎹熷け",
+    prop: "lossWorking",
+    width: 140
+  },
+  {
+    label: "鏉愭枡璐规崯澶�",
+    prop: "lossMaterial",
+    width: 140
+  },
+  {
     dataType: "action",
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 120,
+    width: 100,
     operation: [
-      {
-        name: "缂栬緫",
-        type: "text",
-        clickFun: (row) => {
-          openForm("edit", row);
-        },
-        disabled: (row) => row.inspectState === 1,
-      },
       {
         name: "澶勭悊",
         type: "text",
@@ -201,6 +246,9 @@
 const tableData = ref([]);
 const selectedRows = ref([]);
 const tableLoading = ref(false);
+const textPreviewDialogVisible = ref(false);
+const textPreviewTitle = ref("");
+const textPreviewContent = ref("");
 const page = reactive({
   current: 1,
   size: 100,
@@ -267,6 +315,12 @@
     inspectionFormDia.value?.openDialog(type, row)
   })
 };
+// 鏌ョ湅瀛楁璇︽儏
+const openTextPreviewDialog = (title, content) => {
+  textPreviewTitle.value = title;
+  textPreviewContent.value = content || "";
+  textPreviewDialogVisible.value = true;
+};
 
 // 鍒犻櫎
 const handleDelete = () => {
@@ -311,4 +365,13 @@
 });
 </script>
 
-<style scoped></style>
+<style scoped>
+.text-preview-content {
+  white-space: pre-wrap;
+  line-height: 1.6;
+  color: #606266;
+  word-break: break-word;
+  max-height: 60vh;
+  overflow-y: auto;
+}
+</style>

--
Gitblit v1.9.3