From c39a0308db98f3678253f6318b125631e3eccfea Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 12 一月 2026 14:57:32 +0800
Subject: [PATCH] fix: 日期格式化修正
---
src/pages/routingInspection/detail/indexJX.vue | 13 ++++++++++++-
src/manifest.json | 2 +-
src/pages/production/twist/selfInspect/index.vue | 15 +++++++++++++--
3 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/src/manifest.json b/src/manifest.json
index f80afe1..79792d1 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -2,7 +2,7 @@
"name" : "绾跨紗涓婃姤",
"appid" : "__UNI__F64E0A4",
"description" : "",
- "versionName" : "1.0.28",
+ "versionName" : "1.0.30",
"versionCode" : "100",
"transformPx" : false,
/* 5+App鐗规湁鐩稿叧 */
diff --git a/src/pages/production/twist/selfInspect/index.vue b/src/pages/production/twist/selfInspect/index.vue
index def89d9..b563e23 100644
--- a/src/pages/production/twist/selfInspect/index.vue
+++ b/src/pages/production/twist/selfInspect/index.vue
@@ -18,7 +18,7 @@
</view>
<wd-col :span="24">
<wd-form-item label="鏃ユ湡" prop="recordDate">
- {{ formatDate(formData.recordDate) }}
+ {{ formattedRecordDate }}
</wd-form-item>
<wd-form-item label="鏈哄彴" prop="deviceModel">
{{ formatValue(formData.deviceModel) }}
@@ -197,7 +197,7 @@
import TwistApi from "@/api/product/twist";
import ManageApi from "@/api/product/manage";
import { onLoad } from "@dcloudio/uni-app";
-import { ref, reactive } from "vue";
+import { ref, reactive, computed } from "vue";
const paramsId = ref<string | number>("");
const toast = useToast();
@@ -281,6 +281,17 @@
});
};
+// 鏍煎紡鍖栨棩鏈熻绠楀睘鎬э紙鐢ㄤ簬妯℃澘鏄剧ず锛岄伩鍏嶇紪璇戝鐞嗭級
+const formattedRecordDate = computed(() => {
+ const date = formData.recordDate;
+ if (!date) return "-";
+ const d = new Date(date);
+ const year = d.getFullYear();
+ const month = String(d.getMonth() + 1).padStart(2, "0");
+ const day = String(d.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day}`;
+});
+
// 璁$畻鑺傚緞姣�
const calculatePitchRatio = (pitch: string, dia: string) => {
if (!pitch || !dia) return "-";
diff --git a/src/pages/routingInspection/detail/indexJX.vue b/src/pages/routingInspection/detail/indexJX.vue
index 03fc4a9..3fada74 100644
--- a/src/pages/routingInspection/detail/indexJX.vue
+++ b/src/pages/routingInspection/detail/indexJX.vue
@@ -50,7 +50,7 @@
</view>
<wd-col :span="24">
<wd-form-item label="鏃ユ湡" prop="recordDate">
- {{ formatDate(recordData.fixedInfo?.recordDate) }}
+ {{ formattedRecordDate }}
</wd-form-item>
<wd-form-item label="鐝" prop="workShift">
{{ formatValue(recordData.fixedInfo?.workShift) }}
@@ -641,6 +641,17 @@
});
};
+// 鏍煎紡鍖栨棩鏈熻绠楀睘鎬э紙鐢ㄤ簬妯℃澘鏄剧ず锛岄伩鍏嶇紪璇戝鐞嗭級
+const formattedRecordDate = computed(() => {
+ const date = recordData.value.fixedInfo?.recordDate;
+ if (!date) return "-";
+ const d = new Date(date);
+ const year = d.getFullYear();
+ const month = String(d.getMonth() + 1).padStart(2, "0");
+ const day = String(d.getDate()).padStart(2, "0");
+ return `${year}-${month}-${day}`;
+});
+
// 璁$畻鑺傚緞姣�
const calculatePitchRatio = (pitch: string, dia: string) => {
// 濡傛灉pitch鎴杁ia涓虹┖锛屽垯杩斿洖"-"
--
Gitblit v1.9.3