From 682124f3e573a24523dd643f23d16bb7d3c7e08d Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 29 九月 2026 18:22:17 +0800
Subject: [PATCH] fix(inventory): 移除不合格库存相关字段并修复日期时间处理

---
 src/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue        |   10 -----
 src/views/equipmentManagement/inspectionManagement/components/formDia.vue |    8 +++
 src/views/equipmentManagement/calibration/index.vue                       |   15 ++++++-
 src/views/equipmentManagement/upkeep/Form/formDia.vue                     |    7 ++-
 src/utils/index.js                                                        |   26 +++++++++++++
 src/views/inventoryManagement/stockManagement/Record.vue                  |    6 ---
 src/views/safeProduction/dangerInvestigation/index.vue                    |   31 ++++++++++-----
 src/views/collaborativeApproval/approvalManagement/index.vue              |    6 ++
 8 files changed, 77 insertions(+), 32 deletions(-)

diff --git a/src/utils/index.js b/src/utils/index.js
index 73f6b5f..aee9fa7 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -41,6 +41,32 @@
 }
 
 /**
+ * 琛ュ叏鏃跺垎绉掞紝杈撳嚭 YYYY-MM-DD HH:mm:ss锛岀敤浜庡悗绔� LocalDateTime 瀛楁銆�
+ * 鍏煎 Date 瀵硅薄銆�"YYYY-MM-DD"銆�"YYYY-MM-DD HH:mm"銆�"YYYY-MM-DDTHH:mm:ss" 绛夎緭鍏ワ紱
+ * 绌哄�煎師鏍疯繑鍥炪��
+ */
+export function toDateTimeString(value) {
+  if (value == null || value === "") return value;
+  if (value instanceof Date) {
+    if (Number.isNaN(value.getTime())) return "";
+    const pad = (num) => String(num).padStart(2, "0");
+    return `${value.getFullYear()}-${pad(value.getMonth() + 1)}-${pad(
+      value.getDate()
+    )} ${pad(value.getHours())}:${pad(value.getMinutes())}:${pad(
+      value.getSeconds()
+    )}`;
+  }
+  const [datePart, timePart = ""] = String(value)
+    .trim()
+    .replace("T", " ")
+    .split(/\s+/);
+  const timeUnits = timePart.split(":").filter((unit) => unit !== "");
+  while (timeUnits.length < 3) timeUnits.push("00");
+  const time = timeUnits.map((unit) => unit.padStart(2, "0")).join(":");
+  return `${datePart} ${time}`;
+}
+
+/**
  * @param {number} time
  * @param {string} option
  * @returns {string}
diff --git a/src/views/collaborativeApproval/approvalManagement/index.vue b/src/views/collaborativeApproval/approvalManagement/index.vue
index 4638392..3466c4f 100644
--- a/src/views/collaborativeApproval/approvalManagement/index.vue
+++ b/src/views/collaborativeApproval/approvalManagement/index.vue
@@ -186,7 +186,7 @@
 import {
   Plus, ArrowLeft, Delete, Check, RefreshLeft, Setting,
   Suitcase, Calendar, Location, Money, ShoppingCart, DocumentChecked,
-  Van, ArrowRight, User, InfoFilled
+  Van, ArrowRight, User, InfoFilled, Warning
 } from '@element-plus/icons-vue';
 import { getApproveProcessConfigNodeList, addApproveProcessConfigNode } from '@/api/collaborativeApproval/approvalManagement';
 import { userListNoPage } from '@/api/system/user';
@@ -203,6 +203,7 @@
   { value: '5', label: '閲囪喘瀹℃壒', icon: 'ShoppingCart', color: '#909399' },
   { value: '6', label: '鎶ヤ环瀹℃壒', icon: 'DocumentChecked', color: '#9B59B6' },
   { value: '7', label: '鍙戣揣瀹℃壒', icon: 'Van', color: '#1ABC9C' },
+  { value: '8', label: '鍗遍櫓浣滀笟瀹℃壒', icon: 'Warning', color: '#FF7D00' },
 ];
 
 // 瀹℃壒绫诲瀷鍚嶇О鏄犲皠
@@ -214,6 +215,7 @@
   5: '閲囪喘瀹℃壒',
   6: '鎶ヤ环瀹℃壒',
   7: '鍙戣揣瀹℃壒',
+  8: '鍗遍櫓浣滀笟瀹℃壒',
 };
 
 // 瀹℃壒绫诲瀷鍥炬爣鏄犲皠
@@ -225,6 +227,7 @@
   5: 'ShoppingCart',
   6: 'DocumentChecked',
   7: 'Van',
+  8: 'Warning',
 };
 
 // 瀹℃壒绫诲瀷棰滆壊鏄犲皠
@@ -236,6 +239,7 @@
   5: '#909399',
   6: '#9B59B6',
   7: '#1ABC9C',
+  8: '#FF7D00',
 };
 
 // 澶村儚棰滆壊姹�
diff --git a/src/views/equipmentManagement/calibration/index.vue b/src/views/equipmentManagement/calibration/index.vue
index 0d5b9cf..d1ce0bb 100644
--- a/src/views/equipmentManagement/calibration/index.vue
+++ b/src/views/equipmentManagement/calibration/index.vue
@@ -69,8 +69,16 @@
 import useUserStore from "@/store/modules/user.js";
 import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue";
 import {ledgerRecordListPage, ledgerRecordDelete} from "@/api/equipmentManagement/calibration.js";
+import {userListNoPageByTenantId} from "@/api/system/user.js";
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore()
+
+const userList = ref([]);
+const getUserName = (userId) => {
+	if (!userId) return "--";
+	const user = userList.value.find(u => String(u.userId) === String(userId));
+	return user ? user.nickName : userId;
+};
 
 const data = reactive({
 	searchForm: {
@@ -164,8 +172,9 @@
 	},
 	{
 		label: "纭浜�",
-		prop: "confirmerName",
+		prop: "confirmerId",
 		width: 120,
+		formatData: (cell) => getUserName(cell),
 	},
 	{
 		label: "褰曞叆浜�",
@@ -305,7 +314,9 @@
 			proxy.$modal.msg("宸插彇娑�");
 		});
 };
-onMounted(() => {
+onMounted(async () => {
+	const { data } = await userListNoPageByTenantId();
+	userList.value = data || [];
 	getList();
 });
 </script>
diff --git a/src/views/equipmentManagement/inspectionManagement/components/formDia.vue b/src/views/equipmentManagement/inspectionManagement/components/formDia.vue
index 74cbb58..65c652b 100644
--- a/src/views/equipmentManagement/inspectionManagement/components/formDia.vue
+++ b/src/views/equipmentManagement/inspectionManagement/components/formDia.vue
@@ -120,6 +120,7 @@
 import {addOrEditTimingTask} from "@/api/inspectionManagement/index.js";
 import {userListNoPageByTenantId} from "@/api/system/user.js";
 import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
+import { toDateTimeString } from "@/utils/index.js";
 
 const { proxy } = getCurrentInstance()
 const emit = defineEmits()
@@ -279,7 +280,12 @@
       try {
         form.value.inspectorIds = form.value.inspector.join(',')
         delete form.value.inspector
-        
+
+        // 鍚庣 LocalDateTime 瀛楁搴忓垪鍖栧悗鍙繑鍥炲勾鏈堟棩锛屽洖浼犳椂闇�琛ュ叏鏃跺垎绉�
+        ['createTime', 'updateTime', 'nextExecutionTime', 'lastExecutionTime'].forEach(key => {
+          if (form.value[key]) form.value[key] = toDateTimeString(form.value[key])
+        })
+
         if (form.value.frequencyType === 'WEEKLY') {
           let frequencyDetail = ''
           frequencyDetail = form.value.week + ',' + form.value.time
diff --git a/src/views/equipmentManagement/upkeep/Form/formDia.vue b/src/views/equipmentManagement/upkeep/Form/formDia.vue
index 08c0a83..1a0f400 100644
--- a/src/views/equipmentManagement/upkeep/Form/formDia.vue
+++ b/src/views/equipmentManagement/upkeep/Form/formDia.vue
@@ -188,7 +188,7 @@
 import {userListNoPageByTenantId} from "@/api/system/user.js";
 import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
 import { deviceMaintenanceTaskAdd, deviceMaintenanceTaskEdit } from "@/api/equipmentManagement/upkeep";
-import { getCurrentDate } from "@/utils/index.js";
+import { getCurrentDate, toDateTimeString } from "@/utils/index.js";
 import useUserStore from "@/store/modules/user.js";
 
 const { proxy } = getCurrentInstance()
@@ -334,7 +334,10 @@
 					payload.frequencyDetail = frequencyDetail
 				}
 				
-				// 褰曞叆鏃ユ湡锛氱洿鎺ヤ娇鐢ㄨ〃鍗曢噷鐨� registrationDate 瀛楁
+				// 鍚庣 LocalDateTime 瀛楁搴忓垪鍖栧悗鍙繑鍥炲勾鏈堟棩锛屽洖浼犳椂闇�琛ュ叏鏃跺垎绉�
+				['createTime', 'updateTime', 'nextExecutionTime', 'lastExecutionTime'].forEach(key => {
+					if (payload[key]) payload[key] = toDateTimeString(payload[key])
+				})
 				// 涓�浜涢粯璁ょ姸鎬佸瓧娈�
 				if (payload.status === undefined || payload.status === null || payload.status === '') {
 					payload.status = '0' // 榛樿鐘舵�侊紝鍙寜瀹為檯鏋氫妇璋冩暣
diff --git a/src/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue b/src/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue
index 41a321f..157e477 100644
--- a/src/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue
+++ b/src/views/inventoryManagement/stockManagement/BatchNoQtyDetail.vue
@@ -30,18 +30,8 @@
             show-overflow-tooltip
           />
           <el-table-column
-            label="涓嶅悎鏍煎簱瀛樻暟閲�"
-            prop="unQualifiedQuantity"
-            show-overflow-tooltip
-          />
-          <el-table-column
             label="鍚堟牸鍐荤粨鏁伴噺"
             prop="qualifiedLockedQuantity"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            label="涓嶅悎鏍煎喕缁撴暟閲�"
-            prop="unQualifiedLockedQuantity"
             show-overflow-tooltip
           />
           <el-table-column
diff --git a/src/views/inventoryManagement/stockManagement/Record.vue b/src/views/inventoryManagement/stockManagement/Record.vue
index 3faee27..6ecac27 100644
--- a/src/views/inventoryManagement/stockManagement/Record.vue
+++ b/src/views/inventoryManagement/stockManagement/Record.vue
@@ -90,14 +90,8 @@
         <el-table-column label="鍚堟牸搴撳瓨鏁伴噺"
                          prop="qualifiedQuantity"
                          show-overflow-tooltip />
-        <el-table-column label="涓嶅悎鏍煎簱瀛樻暟閲�"
-                         prop="unQualifiedQuantity"
-                         show-overflow-tooltip />
         <el-table-column label="鍚堟牸鍐荤粨鏁伴噺"
                          prop="qualifiedLockedQuantity"
-                         show-overflow-tooltip />
-        <el-table-column label="涓嶅悎鏍煎喕缁撴暟閲�"
-                         prop="unQualifiedLockedQuantity"
                          show-overflow-tooltip />
         <el-table-column label="搴撳瓨棰勮鏁伴噺"
                          prop="warnNum"
diff --git a/src/views/safeProduction/dangerInvestigation/index.vue b/src/views/safeProduction/dangerInvestigation/index.vue
index 92436b1..4538bca 100644
--- a/src/views/safeProduction/dangerInvestigation/index.vue
+++ b/src/views/safeProduction/dangerInvestigation/index.vue
@@ -486,7 +486,7 @@
       hiddenDesc: "", // 闅愭偅鎻忚堪
       createUser: "", // 涓婃姤浜�
       createUserName: "",
-      createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // 涓婃姤鏃堕棿
+      createTime: dayjs().format("YYYY-MM-DD"), // 涓婃姤鏃堕棿
       rectifyUserId: "", // 鏁存敼璐d换浜�
       rectifyUserName: "",
       rectifyTime: "", // 鏁存敼瀹屾垚鏈熼檺
@@ -703,7 +703,7 @@
         hiddenDesc: "", // 闅愭偅鎻忚堪
         createUser: Number(currentUserId.value), // 涓婃姤浜�
         createUserName: currentUserName.value,
-        createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"), // 涓婃姤鏃堕棿
+        createTime: dayjs().format("YYYY-MM-DD"), // 涓婃姤鏃堕棿
         rectifyUserId: "", // 鏁存敼璐d换浜�
         rectifyUserName: "",
         rectifyTime: "", // 鏁存敼瀹屾垚鏈熼檺
@@ -803,6 +803,13 @@
     }
   };
 
+  // 鍚庣 createTime/updateTime 涓� LocalDateTime 涓旀爣娉� @JsonFormat("yyyy-MM-dd")锛�
+  // 璇ユ牸寮忚В鏋愪笉浜嗕换浣曟椂闂村瓧绗︿覆锛堢函鏃ユ湡鍚屾牱鎶ラ敊锛夛紝鍙兘涓嶅洖浼狅紝鐢卞悗绔嚜鍔ㄥ~鍏�/淇濈暀鍘熷��
+  const withoutAuditTime = obj => {
+    const { createTime, updateTime, ...rest } = obj;
+    return rest;
+  };
+
   // 鎻愪氦琛ㄥ崟
   const submitForm = () => {
     console.log("operationType.value", operationType.value);
@@ -810,7 +817,7 @@
     if (operationType.value == "add") {
       proxy.$refs["formRef"].validate(valid => {
         if (valid) {
-          safeHiddenAdd(form.value).then(res => {
+          safeHiddenAdd(withoutAuditTime(form.value)).then(res => {
             proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
             closeDia();
             getList();
@@ -820,7 +827,7 @@
     } else if (operationType.value == "edit") {
       proxy.$refs["formRef"].validate(valid => {
         if (valid) {
-          safeHiddenUpdate(form.value).then(res => {
+          safeHiddenUpdate(withoutAuditTime(form.value)).then(res => {
             proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
             closeDia();
             getList();
@@ -831,7 +838,9 @@
       console.log("form2.value", form2.value);
       proxy.$refs["formRef2"].validate(valid => {
         if (valid) {
-          safeHiddenUpdate({ ...form2.value, ...form.value }).then(res => {
+          safeHiddenUpdate(
+            withoutAuditTime({ ...form2.value, ...form.value })
+          ).then(res => {
             proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
             closeDia();
             getList();
@@ -841,11 +850,13 @@
     } else if (operationType.value == "edit3") {
       proxy.$refs["formRef3"].validate(valid => {
         if (valid) {
-          safeHiddenUpdate({
-            ...form3.value,
-            ...form2.value,
-            ...form.value,
-          }).then(res => {
+          safeHiddenUpdate(
+            withoutAuditTime({
+              ...form3.value,
+              ...form2.value,
+              ...form.value,
+            })
+          ).then(res => {
             proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
             closeDia();
             getList();

--
Gitblit v1.9.3