From 0d62d9184a24fdfcb43702db0dbd0cc9d3108625 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期五, 22 五月 2026 16:50:18 +0800
Subject: [PATCH] fix(product): 产品型号复制功能的进行勾选复制

---
 src/views/basicData/product/index.vue |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index fa8a203..7552721 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -47,7 +47,7 @@
                   v-if="node.level > 1"
                   type="success"
                   link
-                  @click="handleDownCopy(node, data)"
+                  @click.stop="handleDownCopy(node, data)"
                 >
                   鍚戜笅澶嶅埗
                 </el-button>
@@ -374,6 +374,11 @@
 
 // 鍚戜笅澶嶅埗
 const handleDownCopy = (node, data) => {
+  if (currentId.value !== data.id) {
+    proxy.$modal.msgWarning("璇峰厛閫変腑褰撳墠浜у搧骞跺嬀閫夐渶瑕佸鍒剁殑鍨嬪彿");
+    return;
+  }
+
   // 鑾峰彇鍚屽眰绾ц妭鐐�
   const parent = node.parent;
   const siblings = parent.childNodes || [];
@@ -387,13 +392,23 @@
     return;
   }
 
+  const modelListId = selectedRows.value.map((item) => item.id);
+  if (!modelListId.length) {
+    proxy.$modal.msgWarning("娌℃湁閫夋嫨瑕佸鍒剁殑鍨嬪彿");
+    return;
+  }
+
   ElMessageBox.confirm("纭灏嗗綋鍓嶈妭鐐圭殑瑙勬牸鍨嬪彿澶嶅埗鍒颁笅涓�琛岃妭鐐癸紵", "鍚戜笅澶嶅埗", {
     confirmButtonText: "纭",
     cancelButtonText: "鍙栨秷",
     type: "info",
   })
     .then(() => {
-      downCopyProductModel({ productId: data.id, targetProductId: nextNode.data.id }).then(() => {
+      downCopyProductModel({
+        productId: data.id,
+        targetProductId: nextNode.data.id,
+        modelListId,
+      }).then(() => {
         proxy.$modal.msgSuccess("澶嶅埗鎴愬姛");
       });
     })
@@ -406,6 +421,7 @@
   // 鍙湁鍙跺瓙鑺傜偣鎵嶆墽琛屼互涓嬮�昏緫
   currentId.value = val.id;
   currentParentId.value = val.parentId;
+  selectedRows.value = [];
   getModelList();
 };
 
@@ -440,6 +456,7 @@
 };
 const getModelList = () => {
   tableLoading.value = true;
+  selectedRows.value = [];
   modelListPage({
     id: currentId.value,
     current: page.current,

--
Gitblit v1.9.3