From 2075144baf459fe5ef89892d189784636f27f862 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 22 一月 2026 14:04:58 +0800
Subject: [PATCH] 湟水峡 1.发货分开类型货车和快递,并可以上传图片

---
 src/views/personnelManagement/employeeRecord/components/formDia.vue |  167 +++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 136 insertions(+), 31 deletions(-)

diff --git a/src/views/personnelManagement/employeeRecord/components/formDia.vue b/src/views/personnelManagement/employeeRecord/components/formDia.vue
index 3c9674c..c20877d 100644
--- a/src/views/personnelManagement/employeeRecord/components/formDia.vue
+++ b/src/views/personnelManagement/employeeRecord/components/formDia.vue
@@ -6,16 +6,57 @@
         width="70%"
         @close="closeDia"
     >
-      <PIMTable
-          rowKey="id"
-          :column="tableColumn"
-          :tableData="tableData"
-          :tableLoading="tableLoading"
-          height="600"
-      ></PIMTable>
+      <!-- 鎸夌収鍏ヨ亴鏂板寮圭獥瀛楁灞曠ず鍩虹淇℃伅鍜屽悎鍚屼俊鎭� -->
+      <el-descriptions class="detail-descriptions" :column="2" border size="small">
+        <el-descriptions-item label="鍛樺伐缂栧彿">
+          {{ formData.staffNo || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="濮撳悕">
+          {{ formData.staffName || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鎬у埆">
+          {{ formData.sex || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="骞撮緞">
+          {{ formData.age || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鎴风睄浣忓潃" :span="2">
+          {{ formData.nativePlace || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鐜颁綇鍧�" :span="2">
+          {{ formData.adress || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="宀椾綅">
+          {{ formData.postJob || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="绗竴瀛﹀巻">
+          {{ formData.firstStudy || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="涓撲笟">
+          {{ formData.profession || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鑱旂郴鐢佃瘽">
+          {{ formData.phone || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="绱ф�ヨ仈绯讳汉">
+          {{ formData.emergencyContact || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="绱ф�ヨ仈绯讳汉鐢佃瘽">
+          {{ formData.emergencyContactPhone || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鍚堝悓寮�濮嬫棩鏈�">
+          {{ formData.contractStartTime || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鍚堝悓缁撴潫鏃ユ湡">
+          {{ formData.contractExpireTime || '-' }}
+        </el-descriptions-item>
+        <el-descriptions-item label="鍚堝悓骞撮檺">
+          {{ formattedContractTerm }}
+        </el-descriptions-item>
+      </el-descriptions>
       <template #footer>
         <div class="dialog-footer">
-          <el-button @click="closeDia">鍙栨秷</el-button>
+          <el-button @click="closeDia">鍏抽棴</el-button>
         </div>
       </template>
     </el-dialog>
@@ -23,38 +64,82 @@
 </template>
 
 <script setup>
-import {ref} from "vue";
-import {staffOnJobInfo} from "@/api/personnelManagement/employeeRecord.js";
-const { proxy } = getCurrentInstance()
+import {ref, reactive, computed} from "vue";
+import dayjs from "dayjs";
 const emit = defineEmits(['close'])
 
 const dialogFormVisible = ref(false);
 const operationType = ref('')
-const tableColumn = ref([
-  // {
-  //   label: "鍚堝悓骞撮檺",
-  //   prop: "contractTerm",
-  // },
-  {
-    label: "鍚堝悓寮�濮嬫棩鏈�",
-    prop: "contractStartTime",
-  },
-  {
-    label: "鍚堝悓缁撴潫鏃ユ湡",
-    prop: "contractEndTime",
-  },
-]);
-const tableData = ref([]);
-const tableLoading = ref(false);
+const formData = reactive({
+  staffNo: "",
+  staffName: "",
+  sex: "",
+  identityCard: "",
+  nativePlace: "",
+  postJob: "",
+  adress: "",
+  firstStudy: "",
+  profession: "",
+  age: 0,
+  phone: "",
+  emergencyContact: "",
+  emergencyContactPhone: "",
+  dateSelect: "",
+  trialStartDate: "",
+  trialEndDate: "",
+  proSalary: null,
+  signDate: "",
+  salarySelect: "",
+  contractStartTime: "",
+  contractExpireTime: "",
+  contractTerm: null,
+  remark: "",
+});
+
+const formattedContractTerm = computed(() => {
+  const value = formData.contractTerm;
+  if (value === null || value === undefined || value === "") {
+    return "-";
+  }
+  const numberValue = Number(value);
+  if (!isNaN(numberValue)) {
+    return `${numberValue}骞碻;
+  }
+  return value;
+});
+
+const calculatedContractStart = computed(() => {
+  const endDate = formData.contractExpireTime;
+  const termValue = formData.contractTerm;
+  const numberValue = Number(termValue);
+  if (!endDate || isNaN(numberValue)) {
+    return formData.contractStartTime || "-";
+  }
+  const start = dayjs(endDate).subtract(numberValue, "year");
+  if (!start.isValid()) {
+    return formData.contractStartTime || "-";
+  }
+  return start.format("YYYY-MM-DD");
+});
 
 // 鎵撳紑寮规
 const openDialog = (type, row) => {
   operationType.value = type;
   dialogFormVisible.value = true;
-  if (operationType.value === 'edit') {
-    staffOnJobInfo({staffNo: row.staffNo}).then(res => {
-      tableData.value = res.data
-    })
+  // 閲嶇疆琛ㄥ崟鏁版嵁
+  Object.keys(formData).forEach(key => {
+    if (key === 'age') {
+      formData[key] = 0;
+    } else if (["proSalary", "contractTerm"].includes(key)) {
+      formData[key] = null;
+    } else {
+      formData[key] = "";
+    }
+  });
+  
+  if (operationType.value === 'edit' && row) {
+    // 鐩存帴浣跨敤 row 鏁版嵁璧嬪��
+    Object.assign(formData, row);
   }
 }
 
@@ -69,5 +154,25 @@
 </script>
 
 <style scoped>
+.detail-descriptions {
+  margin-bottom: 16px;
+  border-radius: 6px;
+  overflow: hidden;
+}
 
+.detail-descriptions :deep(.el-descriptions__cell) {
+  padding: 12px 16px !important;
+}
+
+.detail-descriptions :deep(.el-descriptions__label) {
+  width: 140px;
+  color: #606266;
+  background-color: #f7f9fc;
+  font-weight: 500;
+}
+
+.detail-descriptions :deep(.el-descriptions__content) {
+  color: #303133;
+  line-height: 20px;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3