From c62745c757f758527136e62f1d9d8e576e7bd72f Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期一, 09 三月 2026 10:42:20 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New

---
 src/views/personnelManagement/socialSecuritySet/index.vue |  101 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 93 insertions(+), 8 deletions(-)

diff --git a/src/views/personnelManagement/socialSecuritySet/index.vue b/src/views/personnelManagement/socialSecuritySet/index.vue
index 3c66656..2a1ff65 100644
--- a/src/views/personnelManagement/socialSecuritySet/index.vue
+++ b/src/views/personnelManagement/socialSecuritySet/index.vue
@@ -17,8 +17,15 @@
       </div>
     </div>
     <div class="table_list">
-      <div style="margin-bottom: 10px">
+      <div style="margin-bottom: 10px; display: flex; gap: 10px">
         <el-button type="primary" @click="openForm('add')">鏂板鏂规</el-button>
+        <el-button
+          type="danger"
+          @click="handleBatchDelete"
+          :disabled="selectedRows.length === 0"
+        >
+          鎵归噺鍒犻櫎
+        </el-button>
       </div>
       <PIMTable
         rowKey="id"
@@ -26,8 +33,10 @@
         :tableData="tableData"
         :page="page"
         :tableLoading="tableLoading"
-        @pagination="pagination"
         :total="page.total"
+        :isSelection="true"
+        @selection-change="handleSelectionChange"
+        @pagination="pagination"
       />
     </div>
     <form-dia ref="formDiaRef" @close="handleQuery" />
@@ -36,9 +45,13 @@
 
 <script setup>
 import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue";
+import { ElMessageBox, ElMessage } from "element-plus";
 import FormDia from "./components/formDia.vue";
 import PIMTable from "@/components/PIMTable/PIMTable.vue";
-import { socialSecurityListPage } from "@/api/personnelManagement/socialSecuritySet.js";
+import {
+  socialSecurityListPage,
+  socialSecurityDelete,
+} from "@/api/personnelManagement/socialSecuritySet.js";
 
 const data = reactive({
   searchForm: {
@@ -49,22 +62,35 @@
 
 const tableColumn = ref([
   { label: "涓婚", prop: "title", minWidth: 120 },
-  { label: "淇濋櫓绫诲瀷", prop: "insuranceTypeName", width: 120 },
-  { label: "浣跨敤鑼冨洿", prop: "scopeName", width: 120 },
+  { label: "淇濋櫓绫诲瀷", prop: "insuranceTypes", width: 120 },
+  { label: "浣跨敤鑼冨洿", prop: "deptNames", width: 120 },
   { label: "澶囨敞", prop: "remark", minWidth: 120 },
   { label: "鍒涘缓鏃堕棿", prop: "createTime", width: 160 },
-  { label: "鍒涘缓浜�", prop: "createBy", width: 100 },
+  { label: "鍒涘缓浜�", prop: "createUserName", width: 100 },
   {
     dataType: "action",
     label: "鎿嶄綔",
     align: "center",
     fixed: "right",
-    width: 120,
+    width: 180,
     operation: [
-      {
+    {
         name: "缂栬緫",
         type: "text",
         clickFun: (row) => openForm("edit", row),
+      },
+      {
+        name: "璇︽儏",
+        type: "text",
+        clickFun: (row) => openForm("detail", row),
+      },
+      {
+        name: "鍒犻櫎",
+        type: "text",
+        style: {
+          color: "#F56C6C",
+        },
+        clickFun: (row) => handleDelete(row),
       },
     ],
   },
@@ -72,6 +98,7 @@
 
 const tableData = ref([]);
 const tableLoading = ref(false);
+const selectedRows = ref([]);
 const page = reactive({
   current: 1,
   size: 10,
@@ -113,12 +140,70 @@
     });
 };
 
+const handleSelectionChange = (selection) => {
+  selectedRows.value = selection;
+};
+
 const openForm = (type, row) => {
   nextTick(() => {
     formDiaRef.value?.openDialog(type, row);
   });
 };
 
+// 鍒犻櫎鏂规锛岄�昏緫涓庡叾瀹冮〉闈繚鎸佷竴鑷达紙纭寮圭獥 + 璋冪敤鍒犻櫎鎺ュ彛 + 鍒锋柊鍒楄〃锛�
+const handleDelete = (row) => {
+  ElMessageBox.confirm(
+    `纭鍒犻櫎鏂规"${row.title}"鍚楋紵`,
+    "鍒犻櫎纭",
+    {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }
+  )
+    .then(() => {
+      socialSecurityDelete([row.id])
+        .then(() => {
+          ElMessage.success("鍒犻櫎鎴愬姛");
+          getList();
+        })
+        .catch(() => {
+          ElMessage.error("鍒犻櫎澶辫触");
+        });
+    })
+    .catch(() => {
+      ElMessage.info("宸插彇娑堝垹闄�");
+    });
+};
+
+// 鎵归噺鍒犻櫎
+const handleBatchDelete = () => {
+  if (!selectedRows.value.length) return;
+  ElMessageBox.confirm(
+    `纭畾瑕佸垹闄ら�変腑鐨� ${selectedRows.value.length} 鏉℃柟妗堝悧锛焋,
+    "鎵归噺鍒犻櫎纭",
+    {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }
+  )
+    .then(() => {
+      const ids = selectedRows.value.map((item) => item.id);
+      socialSecurityDelete(ids)
+        .then(() => {
+          ElMessage.success("鍒犻櫎鎴愬姛");
+          getList();
+        })
+        .catch(() => {
+          ElMessage.error("鍒犻櫎澶辫触");
+        });
+    })
+    .catch(() => {
+      ElMessage.info("宸插彇娑堝垹闄�");
+    });
+};
+
 onMounted(() => {
   getList();
 });

--
Gitblit v1.9.3