From 896fe9155c2a3cd54b0b7605a613ed7c8c9c0cfa Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 02 七月 2025 13:34:56 +0800
Subject: [PATCH] 人员管理-新增入职、新增离职页面联调

---
 src/views/personnelManagement/dimission/index.vue |  139 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 96 insertions(+), 43 deletions(-)

diff --git a/src/views/personnelManagement/dimission/index.vue b/src/views/personnelManagement/dimission/index.vue
index 3692930..01305e4 100644
--- a/src/views/personnelManagement/dimission/index.vue
+++ b/src/views/personnelManagement/dimission/index.vue
@@ -4,9 +4,9 @@
       <div>
         <span class="search_title">濮撳悕锛�</span>
         <el-input
-            v-model="searchForm.customerName"
+            v-model="searchForm.staffName"
             style="width: 240px"
-            placeholder="璇疯緭鍏ュ悕绉版悳绱�"
+            placeholder="璇疯緭鍏ュ鍚嶆悳绱�"
             @change="handleQuery"
             clearable
             :prefix-icon="Search"
@@ -17,6 +17,8 @@
       </div>
       <div>
         <el-button type="primary" @click="openForm('add')">鏂板绂昏亴</el-button>
+        <el-button @click="handleOut">瀵煎嚭</el-button>
+        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
       </div>
     </div>
     <div class="table_list">
@@ -32,50 +34,42 @@
           :total="total"
       ></PIMTable>
     </div>
-    <form-dia ref="formDia"></form-dia>
+    <form-dia ref="formDia" @close="handleQuery"></form-dia>
   </div>
 </template>
 
 <script setup>
 import { Search } from "@element-plus/icons-vue";
-import { ref } from "vue";
-import FormDia from "@/views/personnelManagement/onboarding/components/formDia.vue";
+import {onMounted, ref} from "vue";
+import FormDia from "@/views/personnelManagement/dimission/components/formDia.vue";
+import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
+import {ElMessageBox} from "element-plus";
 
 const data = reactive({
   searchForm: {
-    customerName: "",
-  },
-  form: {
-    salesLedgerId: "",
-    customerName: "",
-    salesman: "",
-    projectName: "",
-    productData: [],
-  },
-  rules: {
-    salesLedgerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+    staffName: "",
   },
 });
-const { searchForm, form, rules } = toRefs(data);
+const { searchForm } = toRefs(data);
 const tableColumn = ref([
   {
     label: "鐘舵��",
-    prop: "paymentDate",
+    prop: "staffState",
     dataType: "tag",
     formatData: (params) => {
       if (params == 0) {
-        return "鍦ㄨ亴";
-      } else if (params == 1) {
         return "绂昏亴";
+      } else if (params == 1) {
+        return "鍦ㄨ亴";
       } else {
         return null;
       }
     },
     formatType: (params) => {
       if (params == 0) {
-        return "primary";
-      } else if (params == 1) {
         return "danger";
+      } else if (params == 1) {
+        return "primary";
       } else {
         return null;
       }
@@ -83,67 +77,81 @@
   },
   {
     label: "鍛樺伐缂栧彿",
-    prop: "supplierName",
+    prop: "staffNo",
   },
   {
     label: "濮撳悕",
-    prop: "currentPaymentAmount",
+    prop: "staffName",
   },
   {
     label: "鎬у埆",
-    prop: "paymentMethod",
+    prop: "sex",
   },
   {
     label: "绫嶈疮",
-    prop: "registrant",
+    prop: "nativePlace",
   },
   {
     label: "宀椾綅",
-    prop: "registrationtDate",
+    prop: "postJob",
   },
   {
     label: "瀹跺涵浣忓潃",
-    prop: "registrationtDate",
+    prop: "adress",
   },
   {
     label: "绗竴瀛﹀巻",
-    prop: "registrationtDate",
+    prop: "firstStudy",
   },
   {
     label: "涓撲笟",
-    prop: "registrationtDate",
+    prop: "profession",
   },
   {
     label: "韬唤璇佸彿",
-    prop: "registrationtDate",
+    prop: "identityCard",
   },
   {
     label: "骞撮緞",
-    prop: "registrationtDate",
+    prop: "age",
   },
   {
     label: "鑱旂郴鐢佃瘽",
-    prop: "registrationtDate",
+    prop: "phone",
   },
   {
     label: "绱ф�ヨ仈绯讳汉",
-    prop: "registrationtDate",
+    prop: "emergencyContact",
   },
   {
     label: "鑱旂郴鐢佃瘽",
-    prop: "registrationtDate",
+    prop: "emergencyContactPhone",
   },
   {
     label: "鍚堝悓骞撮檺",
-    prop: "registrationtDate",
+    prop: "contractTerm",
   },
   {
     label: "鍚堝悓寮�濮嬫棩鏈�",
-    prop: "registrationtDate",
+    prop: "contractStartTime",
   },
   {
     label: "鍚堝悓缁撴潫鏃ユ湡",
-    prop: "registrationtDate",
+    prop: "contractEndTime",
+  },
+  {
+    dataType: "action",
+    label: "鎿嶄綔",
+    align: "center",
+    operation: [
+      {
+        name: "缂栬緫",
+        type: "text",
+        clickFun: (row) => {
+          openForm("edit", row);
+        },
+      },
+    ],
   },
 ]);
 const tableData = ref([]);
@@ -170,14 +178,17 @@
 };
 const getList = () => {
   tableLoading.value = true;
-  
+  staffJoinListPage({...page, ...searchForm.value, staffState: 0}).then(res => {
+    tableLoading.value = false;
+    tableData.value = res.data.records
+    total.value = res.data.total;
+  }).catch(err => {
+    tableLoading.value = false;
+  })
 };
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
-  console.log("selection", selection);
-  selectedRows.value = selection.filter(
-      (item) => item.salesContractNo !== undefined
-  );
+  selectedRows.value = selection;
 };
 
 // 鎵撳紑寮规
@@ -186,6 +197,48 @@
     formDia.value?.openDialog(type, row)
   })
 };
+
+// 鍒犻櫎
+const handleDelete = () => {
+  let ids = [];
+  if (selectedRows.value.length > 0) {
+    ids = selectedRows.value.map((item) => item.id);
+  } else {
+    proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+    return;
+  }
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+      .then(() => {
+        staffJoinDel(ids).then((res) => {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+};
+// 瀵煎嚭
+const handleOut = () => {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+      .then(() => {
+        proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 0}, "浜哄憳绂昏亴.xlsx");
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+};
+onMounted(() => {
+  getList();
+});
 </script>
 
 <style scoped></style>

--
Gitblit v1.9.3