From 6809fa6209c3a9e546e6d2e010dcf97ce20e8f8a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期六, 19 九月 2026 23:42:21 +0800
Subject: [PATCH] fix: 登录日志的访问日期只保留时分秒

---
 src/views/productionManagement/workOrderEdit/index.vue |   65 +++++++++++++++++++++++++++++---
 1 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/src/views/productionManagement/workOrderEdit/index.vue b/src/views/productionManagement/workOrderEdit/index.vue
index 64fd087..3468597 100644
--- a/src/views/productionManagement/workOrderEdit/index.vue
+++ b/src/views/productionManagement/workOrderEdit/index.vue
@@ -73,6 +73,18 @@
                title="鎸囧畾鎶ュ伐浜�"
                width="800px">
       <div class="assign-reporter-content">
+        <div class="search-box">
+          <el-input
+            v-model="employeeSearchKeyword"
+            placeholder="鎼滅储浜哄憳濮撳悕"
+            clearable
+            @input="handleEmployeeSearch"
+            style="width: 350px">
+            <template #prefix>
+              <i class="el-icon-search"></i>
+            </template>
+          </el-input>
+        </div>
         <div class="selected-tags-box"
              v-if="selectedEmployeeIds.length > 0">
           <div class="tags-label">宸查�夋嫨锛�</div>
@@ -90,7 +102,7 @@
              v-loading="employeeTableLoading">
           <el-checkbox-group v-model="selectedEmployeeIds">
             <div class="employee-grid">
-              <div v-for="item in employeeTableData"
+              <div v-for="item in filteredEmployeeList"
                    :key="item.userId"
                    class="employee-item">
                 <el-checkbox :label="item.userId"
@@ -103,9 +115,9 @@
               </div>
             </div>
           </el-checkbox-group>
-          <div v-if="employeeTableData.length === 0"
+          <div v-if="filteredEmployeeList.length === 0"
                class="empty-text">
-            鏆傛棤鍖归厤浜哄憳
+            {{ employeeSearchKeyword ? '鏃犲尮閰嶄汉鍛�' : '鏆傛棤浜哄憳鏁版嵁' }}
           </div>
         </div>
       </div>
@@ -121,7 +133,7 @@
 </template>
 
 <script setup>
-  import { getCurrentInstance, onMounted, reactive, ref, toRefs } from "vue";
+  import { getCurrentInstance, onMounted, reactive, ref, toRefs, computed } from "vue";
   import { ElMessageBox } from "element-plus";
   import {
     productWorkOrderPage,
@@ -187,21 +199,25 @@
       label: "璁″垝寮�濮嬫椂闂�",
       prop: "planStartTime",
       width: "140",
+      dataType: "date",
     },
     {
       label: "璁″垝缁撴潫鏃堕棿",
       prop: "planEndTime",
       width: "140",
+      dataType: "date",
     },
     {
       label: "瀹為檯寮�濮嬫椂闂�",
       prop: "actualStartTime",
       width: "140",
+      dataType: "date",
     },
     {
       label: "瀹為檯缁撴潫鏃堕棿",
       prop: "actualEndTime",
       width: "140",
+      dataType: "date",
     },
     {
       label: "鎸囧畾鎶ュ伐浜�",
@@ -253,8 +269,24 @@
   const employeeSearchForm = reactive({
     staffName: "",
   });
+  const employeeSearchKeyword = ref("");
   const selectedEmployeeIds = ref([]);
   const currentWorkOrder = ref(null);
+
+  const filteredEmployeeList = computed(() => {
+    const keyword = employeeSearchKeyword.value.trim().toLowerCase();
+    if (!keyword) {
+      return employeeTableData.value;
+    }
+    return employeeTableData.value.filter(item => {
+      const name = (item.nickName || "").toLowerCase();
+      const dept = (item.dept?.deptName || "").toLowerCase();
+      return name.includes(keyword) || dept.includes(keyword);
+    });
+  });
+
+  const handleEmployeeSearch = () => {
+  };
 
   const data = reactive({
     searchForm: {
@@ -269,7 +301,7 @@
     if (!Number.isFinite(n)) return 0;
     if (n <= 0) return 0;
     if (n >= 100) return 100;
-    return Math.round(n);
+    return parseFloat(n.toFixed(2));
   };
 
   const progressColor = percentage => {
@@ -307,11 +339,26 @@
 
   const handleEdit = row => {
     editrow.value = JSON.parse(JSON.stringify(row));
+    // 鍘绘帀鏃跺垎绉掞紝鍙繚鐣欐棩鏈熺敤浜庨�夋嫨鍣ㄥ洖鏄�
+    if (editrow.value.planStartTime) {
+      editrow.value.planStartTime = editrow.value.planStartTime.split(" ")[0];
+    }
+    if (editrow.value.planEndTime) {
+      editrow.value.planEndTime = editrow.value.planEndTime.split(" ")[0];
+    }
     editDialogVisible.value = true;
   };
 
   const handleUpdate = () => {
-    updateProductWorkOrder(editrow.value)
+    const updateData = { ...editrow.value };
+    // 鍚庣鎺ュ彛闇�瑕佹椂鍒嗙鏍煎紡锛岄殣寮忔嫾鎺ワ細寮�濮嬫椂闂磋ˉ 00:00:00锛岀粨鏉熸椂闂磋ˉ 23:59:59
+    if (updateData.planStartTime) {
+      updateData.planStartTime = `${updateData.planStartTime} 00:00:00`;
+    }
+    if (updateData.planEndTime) {
+      updateData.planEndTime = `${updateData.planEndTime} 23:59:59`;
+    }
+    updateProductWorkOrder(updateData)
       .then(() => {
         proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
         editDialogVisible.value = false;
@@ -416,6 +463,12 @@
   }
 
   .assign-reporter-content {
+    .search-box {
+      margin-bottom: 16px;
+      display: flex;
+      justify-content: center;
+    }
+
     .selected-tags-box {
       margin-bottom: 16px;
       padding: 12px;

--
Gitblit v1.9.3