From f3cec0341563c2c0dd4f5df609d0689c6c450bfc Mon Sep 17 00:00:00 2001
From: ZN <zhang_12370@163.com>
Date: 星期六, 21 三月 2026 17:11:12 +0800
Subject: [PATCH] feat(采购退货): 增加退货详情查看功能并完善退货流程

---
 src/views/personnelManagement/employeeRecord/index.vue |  140 +++++++++++++++++++++++++++++-----------------
 1 files changed, 89 insertions(+), 51 deletions(-)

diff --git a/src/views/personnelManagement/employeeRecord/index.vue b/src/views/personnelManagement/employeeRecord/index.vue
index 581fdca..16445de 100644
--- a/src/views/personnelManagement/employeeRecord/index.vue
+++ b/src/views/personnelManagement/employeeRecord/index.vue
@@ -11,9 +11,25 @@
             clearable
             :prefix-icon="Search"
         />
-        <span  style="margin-left: 10px" class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span>
-        <el-date-picker  v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
-                         placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
+        <span class="search_title search_title2">閮ㄩ棬锛�</span>
+          <el-tree-select
+            v-model="searchForm.sysDeptId"
+            :data="deptOptions"
+            check-strictly
+            :render-after-expand="false"
+            style="width: 240px"
+            placeholder="璇烽�夋嫨"
+          />
+          <span class="search_title search_title2">鍏ヨ亴鏃ユ湡锛�</span>
+          <el-date-picker
+            v-model="searchForm.contractStartTime"
+            value-format="YYYY-MM-DD"
+            format="YYYY-MM-DD"
+            placeholder="璇烽�夋嫨"
+          />
+        <!-- <span  style="margin-left: 10px" class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span> -->
+        <!-- <el-date-picker  v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
+                         placeholder="璇烽�夋嫨" clearable @change="changeDaterange" /> -->
         <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
         >鎼滅储</el-button
         >
@@ -21,7 +37,7 @@
       <div>
         <el-button type="primary" @click="openFormNewOrEditFormDia('add')">鏂板鍏ヨ亴</el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
-        <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+        <!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button> -->
       </div>
     </div>
     <div class="table_list">
@@ -39,6 +55,12 @@
     </div>
     <show-form-dia ref="formDia" @close="handleQuery"></show-form-dia>
     <new-or-edit-form-dia ref="formDiaNewOrEditFormDia" @close="handleQuery"></new-or-edit-form-dia>
+    <renew-contract
+        v-if="isShowRenewContractModal"
+        v-model:visible="isShowRenewContractModal"
+        :id="id"
+        @completed="handleQuery"
+    />
   </div>
 </template>
 
@@ -46,11 +68,13 @@
 import { Search } from "@element-plus/icons-vue";
 import {onMounted, ref} from "vue";
 import {ElMessageBox} from "element-plus";
+import { deptTreeSelect } from "@/api/system/user.js";
 import {batchDeleteStaffOnJobs, staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js";
 import dayjs from "dayjs";
 
 const NewOrEditFormDia = defineAsyncComponent(() => import("@/views/personnelManagement/employeeRecord/components/NewOrEditFormDia.vue"));
 const ShowFormDia = defineAsyncComponent(() => import( "@/views/personnelManagement/employeeRecord/components/Show.vue"));
+const RenewContract = defineAsyncComponent(() => import( "@/views/personnelManagement/employeeRecord/components/RenewContract.vue"));
 
 const data = reactive({
   searchForm: {
@@ -59,8 +83,11 @@
     entryDateStart: undefined,
     entryDateEnd: undefined,
   },
+  deptOptions: { type: Array, default: () => [] },
 });
-const { searchForm } = toRefs(data);
+const { searchForm, deptOptions } = toRefs(data);
+const isShowRenewContractModal = ref(false);
+const id = ref(0);
 const tableColumn = ref([
   {
     label: "鐘舵��",
@@ -94,67 +121,45 @@
     prop: "staffName",
   },
   {
+    label: "鍒悕",
+    prop: "alias",
+  },
+  {
+    label: "鎵嬫満",
+    prop: "phone",
+    width: 150,
+  },
+  {
     label: "鎬у埆",
     prop: "sex",
   },
   {
-    label: "鎴风睄浣忓潃",
-    prop: "nativePlace",
+    label: "鍑虹敓鏃ユ湡",
+    prop: "birthDate",
+    width: 120,
   },
   {
-    label: "閮ㄩ棬",
-    prop: "deptName",
-  },
-  {
-    label: "宀椾綅",
-    prop: "postJob",
-  },
-  {
-    label: "鐜颁綇鍧�",
-    prop: "adress",
-    width:200
-  },
-  {
-    label: "绗竴瀛﹀巻",
-    prop: "firstStudy",
-  },
-  {
-    label: "涓撲笟",
-    prop: "profession",
-    width:100
+    label: "鍏ヨ亴鏃ユ湡",
+    prop: "contractStartTime",
+    width: 120,
   },
   {
     label: "骞撮緞",
     prop: "age",
   },
   {
-    label: "鑱旂郴鐢佃瘽",
-    prop: "phone",
-    width:150
+    label: "绫嶈疮",
+    prop: "nativePlace",
   },
   {
-    label: "绱ф�ヨ仈绯讳汉",
-    prop: "emergencyContact",
-    width: 120
+    label: "姘戞棌",
+    prop: "nation",
+    width: 100,
   },
   {
-    label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
-    prop: "emergencyContactPhone",
-    width:150
-  },
-  // {
-  //   label: "鍚堝悓骞撮檺",
-  //   prop: "contractTerm",
-  // },
-  // {
-  //   label: "鍚堝悓寮�濮嬫棩鏈�",
-  //   prop: "contractStartTime",
-  //   width: 120
-  // },
-  {
-    label: "鍚堝悓缁撴潫鏃ユ湡",
-    prop: "contractExpireTime",
-    width: 120
+    label: "濠氬Щ鐘跺喌",
+    prop: "maritalStatus",
+    width: 100,
   },
   {
     dataType: "action",
@@ -168,6 +173,15 @@
         type: "text",
         clickFun: (row) => {
           openFormNewOrEditFormDia("edit", row);
+        },
+      },
+      {
+        name: "缁鍚堝悓",
+        type: "text",
+        showHide: row => row.staffState === 1,
+        clickFun: (row) => {
+          isShowRenewContractModal.value = true;
+          id.value = row.id;
         },
       },
       // {
@@ -192,6 +206,25 @@
 const formDiaNewOrEditFormDia = ref()
 const { proxy } = getCurrentInstance()
 
+const fetchDeptOptions = () => {
+    deptTreeSelect().then(response => {
+      console.log(response.data)
+      deptOptions.value = filterDisabledDept(
+        JSON.parse(JSON.stringify(response.data))
+      );
+    });
+  };
+const filterDisabledDept = deptList => {
+    return deptList.filter(dept => {
+      if (dept.disabled) {
+        return false;
+      }
+      if (dept.children && dept.children.length) {
+        dept.children = filterDisabledDept(dept.children);
+      }
+      return true;
+    });
+  };
 const changeDaterange = (value) => {
   searchForm.value.entryDateStart = undefined;
   searchForm.value.entryDateEnd = undefined;
@@ -213,6 +246,7 @@
   getList();
 };
 const getList = () => {
+  fetchDeptOptions();
   tableLoading.value = true;
   const params = { ...searchForm.value, ...page };
   params.entryDate = undefined
@@ -285,4 +319,8 @@
 });
 </script>
 
-<style scoped></style>
+<style scoped>
+.search_title2 {
+  margin-left: 10px;
+}
+</style>

--
Gitblit v1.9.3