From 07f9f8657d057a38792c3822acc9b08d83478967 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 07 五月 2026 14:23:10 +0800
Subject: [PATCH] 合并代码
---
src/views/safeProduction/hazardousMaterialsControl/index.vue | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/views/safeProduction/hazardousMaterialsControl/index.vue b/src/views/safeProduction/hazardousMaterialsControl/index.vue
index f4f30aa..e43b4f6 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"
@@ -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