From a222a1024581067cc7823298172aaef539128d82 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 10 三月 2026 15:51:07 +0800
Subject: [PATCH] fix: 安全培训-筛选日期有误
---
src/pages/safeProduction/safetyTrainingAssessment/index.vue | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/src/pages/safeProduction/safetyTrainingAssessment/index.vue b/src/pages/safeProduction/safetyTrainingAssessment/index.vue
index 905f9e8..e13c2a8 100644
--- a/src/pages/safeProduction/safetyTrainingAssessment/index.vue
+++ b/src/pages/safeProduction/safetyTrainingAssessment/index.vue
@@ -100,7 +100,7 @@
</view>
<!-- 鎸夐挳鍖哄煙 -->
<view class="action-buttons">
- <u-button type="primary"
+ <!-- <u-button type="primary"
size="small"
class="action-btn"
:disabled="item.state !== 0"
@@ -118,7 +118,7 @@
class="action-btn"
@click="deleteVisit(item)">
鍒犻櫎
- </u-button>
+ </u-button> -->
</view>
<view class="action-buttons">
<u-button type="warning"
@@ -149,12 +149,12 @@
@cancel="handleDateCancel"
title="閫夋嫨鍩硅鏃ユ湡" />
<!-- 娴姩鏂板鎸夐挳 -->
- <view class="fab-button"
+ <!-- <view class="fab-button"
@click="addVisit">
<up-icon name="plus"
size="24"
color="#ffffff"></up-icon>
- </view>
+ </view> -->
</view>
</template>
@@ -284,8 +284,22 @@
// 澶勭悊鏃ユ湡閫夋嫨纭
const handleDateConfirm = e => {
- searchKeyword.value = dayjs(e.value).format("YYYY-MM-DD");
- searchForm.value.trainingDate = dayjs(e.value).format("YYYY-MM-DD");
+ const raw = e?.value;
+ // up-datetime-picker 鐨� value 鍙兘鏄� Date / 姣鏃堕棿鎴�(13浣�) / 绉掓椂闂存埑(10浣�) / 瀛楃涓�
+ const normalized =
+ typeof raw === "number"
+ ? raw < 1e12
+ ? raw * 1000
+ : raw
+ : typeof raw === "string" && /^\d+$/.test(raw)
+ ? raw.length === 10
+ ? Number(raw) * 1000
+ : Number(raw)
+ : raw;
+
+ const formatted = dayjs(normalized).format("YYYY-MM-DD");
+ searchKeyword.value = formatted;
+ searchForm.value.trainingDate = formatted;
trainingDateVisible.value = false;
getList();
};
--
Gitblit v1.9.3