From bc365ef47ae4e01754aeadbae26170e11c9bb80e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 22 六月 2026 16:56:12 +0800
Subject: [PATCH] 新疆马铃薯 1.删除按钮添加操作权限

---
 src/views/safeProduction/hazardousMaterialsControl/index.vue |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/views/safeProduction/hazardousMaterialsControl/index.vue b/src/views/safeProduction/hazardousMaterialsControl/index.vue
index f4f30aa..f3f739f 100644
--- a/src/views/safeProduction/hazardousMaterialsControl/index.vue
+++ b/src/views/safeProduction/hazardousMaterialsControl/index.vue
@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <div class="search_form">
+    <div class="search_form mb20">
       <div>
         <span class="search_title">鍗遍櫓婧愬悕绉帮細</span>
         <el-input v-model="searchForm.name"
@@ -30,7 +30,7 @@
                    @click="openForm('add')">鍘婚鐢�</el-button>
         <el-button type="danger"
                    plain
-                   @click="handleDelete">鍒犻櫎</el-button>
+                   @click="handleDelete" v-hasPermi="['safeProduction:hazardousMaterialsControl:remove']">鍒犻櫎</el-button>
       </div>
     </div>
     <div class="table_list">
@@ -264,7 +264,8 @@
                   @selection-change="handleSafeHazardSelectionChange"
                   style="width: 100%">
           <el-table-column type="selection"
-                           width="55" />
+                           width="55"
+                           :selectable="isSelectable" />
           <el-table-column prop="code"
                            label="鍗遍櫓婧愮紪鐮�"
                            width="180"
@@ -604,6 +605,11 @@
       });
   };
 
+  const isSelectable = row => {
+    // 鍙湁搴撳瓨鏁伴噺澶т簬0鐨勮鎵嶈兘琚�夋嫨
+    return Number(row.stockQty) > 0;
+  };
+
   const handleSafeHazardSelectionChange = selection => {
     // 鍙繚鐣欐渶鍚庝竴涓�変腑鐨勯」
     if (selection.length > 1) {
@@ -647,15 +653,7 @@
 
   // 閫夋嫨鍙樺寲澶勭悊
   const handleSelectionChange = selection => {
-    // 涓昏〃鏍间篃鍙繚鐣欐渶鍚庝竴涓�変腑鐨勯」
-    if (selection.length > 1) {
-      const lastSelected = selection[selection.length - 1];
-      selectedIds.value = [lastSelected.id];
-    } else if (selection.length === 1) {
-      selectedIds.value = [selection[0].id];
-    } else {
-      selectedIds.value = [];
-    }
+    selectedIds.value = selection.map(item => item.id);
   };
 
   // 鎵撳紑琛ㄥ崟

--
Gitblit v1.9.3