From 0ce559e6195a189ccc777b0fa439906bffb12b55 Mon Sep 17 00:00:00 2001
From: zhang_12370 <z2864490065@outlook.com>
Date: 星期三, 25 六月 2025 17:58:31 +0800
Subject: [PATCH] 多页面添加查看功能

---
 src/views/procureMent/index.vue |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/views/procureMent/index.vue b/src/views/procureMent/index.vue
index 2949e2b..f692780 100644
--- a/src/views/procureMent/index.vue
+++ b/src/views/procureMent/index.vue
@@ -35,7 +35,11 @@
         @delete="handleDeleteSuccess"
         :show-selection="true"
         :border="true"
-        style="width: 100%;height: calc(100vh - 26em)"
+        style="width: 100%; height: calc(100vh - 26em)"
+        @viewRow="handleView"
+        :operations="['edit', 'viewRow']"
+        :operationsWidth="200"
+        :show-overflow-tooltip="false"
       />
       <pagination
         v-if="total > 0"
@@ -150,7 +154,7 @@
 const MatchQuery = (data, name) => {
   const list = name === "supplyRes" ? supplyRes.value.data : coalRes.value.data;
   const item = list.find((items) => items.id == data);
-  return item ? item.coal || item.supplierName  : "";
+  return item ? item.coal || item.supplierName : "";
 };
 // 鑾峰彇渚涘簲鍟嗗垪琛�
 const supplyRes = ref([]);
@@ -177,13 +181,13 @@
 const productionDialogs = ref(null); // 娣诲姞ref澹版槑
 
 const handleAddEdit = () => {
-  addOrEdit.value == "add" ? (title.value = "鏂板") : (title.value = "缂栬緫");
+  addOrEdit.value == "add" ? (title.value = "鏂板") : addOrEdit.value == "viewRow" ? (title.value = "鏌ョ湅") : (title.value = "缂栬緫");
   title.value = title.value + "閲囪喘淇℃伅";
   openDialog();
 };
 // 鎵撳紑寮圭獥
 const openDialog = () => {
-  if (addOrEdit.value === "edit") {
+  if (addOrEdit.value === "edit" || addOrEdit.value === "viewRow") {
     // 纭繚澶嶅埗涓�浠芥暟鎹紝閬垮厤鐩存帴寮曠敤
     copyForm.value = JSON.parse(JSON.stringify(form.value));
     dialogFormVisible.value = true;
@@ -229,6 +233,11 @@
   addOrEdit.value = "edit";
   handleAddEdit();
 };
+const handleView = (row) => {
+  form.value = JSON.parse(JSON.stringify(row));
+  addOrEdit.value = "viewRow";
+  handleAddEdit();
+};
 const handleDelete = () => {
   if (selectedRows.value.length === 0) {
     ElMessage.warning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");

--
Gitblit v1.9.3