From 67569b8d234da7ca2d0131226392410c6ae35635 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 05 一月 2026 11:54:47 +0800
Subject: [PATCH] 海川开心: 1.销售管理、仓储物流一些字段赋默认值 2.生产报工改成可以多个报工

---
 src/views/personnelManagement/dimission/components/formDia.vue |   85 ++++++++++++++++++++++++++----------------
 1 files changed, 53 insertions(+), 32 deletions(-)

diff --git a/src/views/personnelManagement/dimission/components/formDia.vue b/src/views/personnelManagement/dimission/components/formDia.vue
index 3dd4c8c..983aae3 100644
--- a/src/views/personnelManagement/dimission/components/formDia.vue
+++ b/src/views/personnelManagement/dimission/components/formDia.vue
@@ -4,6 +4,7 @@
         v-model="dialogFormVisible"
         :title="operationType === 'add' ? '鏂板绂昏亴' : '缂栬緫绂昏亴'"
         width="70%"
+				draggable
         @close="closeDia"
     >
       <!-- 鍛樺伐淇℃伅灞曠ず鍖哄煙 -->
@@ -13,7 +14,10 @@
           <el-col :span="12">
             <div class="info-item">
               <span class="info-label">濮撳悕锛�</span>
-              <el-select v-model="form.staffName" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">
+              <el-select v-model="form.staffName"
+												 filterable
+                         default-first-option
+                         :reserve-keyword="false" placeholder="璇烽�夋嫨浜哄憳" style="width: 100%" @change="handleSelect">
                 <el-option
                   v-for="item in personList"
                   :key="item.id"
@@ -75,12 +79,6 @@
         <el-row :gutter="30">
           <el-col :span="12">
             <div class="info-item">
-              <span class="info-label">韬唤璇佸彿锛�</span>
-              <span class="info-value">{{ form.identityCard || '-' }}</span>
-            </div>
-          </el-col>
-          <el-col :span="12">
-            <div class="info-item">
               <span class="info-label">骞撮緞锛�</span>
               <span class="info-value">{{ form.age || '-' }}</span>
             </div>
@@ -125,7 +123,7 @@
       </div>
 
       <!-- 绂昏亴淇℃伅濉啓鍖哄煙 -->
-      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef" style="margin-top: 20px">
+      <!-- <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef" style="margin-top: 20px">
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="绂昏亴鏃ユ湡锛�" prop="dimissionDate">
@@ -153,7 +151,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-      </el-form>
+      </el-form> -->
       <template #footer>
         <div class="dialog-footer">
           <el-button type="primary" @click="submitForm">纭</el-button>
@@ -166,7 +164,8 @@
 
 <script setup>
 import {ref, reactive, toRefs, getCurrentInstance} from "vue";
-import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate,getStaffOnJob} from "@/api/personnelManagement/onboarding.js";
+import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js";
+import { staffOnJobListPage } from "@/api/personnelManagement/employeeRecord.js";
 const { proxy } = getCurrentInstance()
 const emit = defineEmits(['close'])
 
@@ -182,7 +181,6 @@
     adress: "",
     firstStudy: "",
     profession: "",
-    identityCard: "",
     age: 0,
     phone: "",
     emergencyContact: "",
@@ -215,26 +213,47 @@
 }
 // 鎻愪氦浜у搧琛ㄥ崟
 const submitForm = () => {
-  proxy.$refs.formRef.validate(valid => {
-    if (valid) {
-      form.value.staffState = 0
-      if (operationType.value === "add") {
-        staffJoinAdd(form.value).then(res => {
-          proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-          closeDia();
-        })
-      } else {
-        staffJoinUpdate(form.value).then(res => {
-          proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
-          closeDia();
-        })
-      }
-    }
-  })
+  // 琛ㄥ崟宸叉敞閲婏紝鐩存帴鎻愪氦锛屼笉杩涜楠岃瘉
+  if (!form.value.staffName) {
+    proxy.$modal.msgError("璇烽�夋嫨浜哄憳");
+    return;
+  }
+  form.value.staffState = 0
+  if (operationType.value === "add") {
+    staffJoinAdd(form.value).then(res => {
+      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+      closeDia();
+    })
+  } else {
+    staffJoinUpdate(form.value).then(res => {
+      proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+      closeDia();
+    })
+  }
 }
 // 鍏抽棴寮规
 const closeDia = () => {
-  proxy.resetForm("formRef");
+  // 琛ㄥ崟宸叉敞閲婏紝鎵嬪姩閲嶇疆琛ㄥ崟鏁版嵁
+  form.value = {
+    staffNo: "",
+    staffName: "",
+    sex: "",
+    nativePlace: "",
+    postJob: "",
+    adress: "",
+    firstStudy: "",
+    profession: "",
+    age: 0,
+    phone: "",
+    emergencyContact: "",
+    emergencyContactPhone: "",
+    contractTerm: 0,
+    contractStartTime: "",
+    contractEndTime: "",
+    dimissionDate: "",
+    dimissionReason: "",
+    staffState: "",
+  };
   dialogFormVisible.value = false;
   emit('close')
 };
@@ -245,8 +264,12 @@
  * 鑾峰彇褰撳墠鍦ㄨ亴浜哄憳鍒楄〃
  */
 const getList = () => {
-  getStaffOnJob().then(res => {
-    personList.value = res.data
+  staffOnJobListPage({
+    current: -1,
+    size: -1,
+		staffState: 1
+  }).then(res => {
+    personList.value = res.data.records || []
   })
 };
 
@@ -262,7 +285,6 @@
       adress,
       firstStudy,
       profession,
-      identityCard,
       age,
       emergencyContact,
       emergencyContactPhone,
@@ -282,7 +304,6 @@
       adress,
       firstStudy,
       profession,
-      identityCard,
       age,
       emergencyContact,
       emergencyContactPhone,

--
Gitblit v1.9.3