From fe167dd71a1300aeae07522db990d6b3fdb77a0e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 12 三月 2026 13:26:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_中兴实强
---
src/views/personnelManagement/socialSecuritySet/index.vue | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 212 insertions(+), 0 deletions(-)
diff --git a/src/views/personnelManagement/socialSecuritySet/index.vue b/src/views/personnelManagement/socialSecuritySet/index.vue
new file mode 100644
index 0000000..2a1ff65
--- /dev/null
+++ b/src/views/personnelManagement/socialSecuritySet/index.vue
@@ -0,0 +1,212 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <div>
+ <span class="search_title">涓婚锛�</span>
+ <el-input
+ v-model="searchForm.title"
+ style="width: 240px"
+ placeholder="璇疯緭鍏ヤ富棰�"
+ clearable
+ @keyup.enter="handleQuery"
+ />
+ <el-button type="primary" @click="handleQuery" style="margin-left: 10px">
+ 鎼滅储
+ </el-button>
+ <el-button @click="handleReset">閲嶇疆</el-button>
+ </div>
+ </div>
+ <div class="table_list">
+ <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"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :tableLoading="tableLoading"
+ :total="page.total"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ @pagination="pagination"
+ />
+ </div>
+ <form-dia ref="formDiaRef" @close="handleQuery" />
+ </div>
+</template>
+
+<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,
+ socialSecurityDelete,
+} from "@/api/personnelManagement/socialSecuritySet.js";
+
+const data = reactive({
+ searchForm: {
+ title: "",
+ },
+});
+const { searchForm } = toRefs(data);
+
+const tableColumn = ref([
+ { label: "涓婚", prop: "title", minWidth: 120 },
+ { label: "淇濋櫓绫诲瀷", prop: "insuranceTypes", width: 120 },
+ { label: "浣跨敤鑼冨洿", prop: "deptNames", width: 120 },
+ { label: "澶囨敞", prop: "remark", minWidth: 120 },
+ { label: "鍒涘缓鏃堕棿", prop: "createTime", width: 160 },
+ { label: "鍒涘缓浜�", prop: "createUserName", width: 100 },
+ {
+ dataType: "action",
+ label: "鎿嶄綔",
+ align: "center",
+ fixed: "right",
+ 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),
+ },
+ ],
+ },
+]);
+
+const tableData = ref([]);
+const tableLoading = ref(false);
+const selectedRows = ref([]);
+const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+});
+const formDiaRef = ref(null);
+
+const handleQuery = () => {
+ page.current = 1;
+ getList();
+};
+
+const handleReset = () => {
+ searchForm.value.title = "";
+ page.current = 1;
+ getList();
+};
+
+const pagination = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
+
+const getList = () => {
+ tableLoading.value = true;
+ socialSecurityListPage({
+ ...searchForm.value,
+ current: page.current,
+ size: page.size,
+ })
+ .then((res) => {
+ tableLoading.value = false;
+ tableData.value = res.data?.records ?? [];
+ page.total = res.data?.total ?? 0;
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+};
+
+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();
+});
+</script>
+
+<style scoped></style>
--
Gitblit v1.9.3