From 104f98ed5944dc9654b810aa4d8bfe91e3ca62da Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Thu, 17 Apr 2025 17:33:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/comprehensiveQuery/index.vue | 5 +++-- src/pages/qualityInspection/upload-record/index.vue | 10 ++++++++++ src/pages/safetyViolations/upload-record/index.vue | 10 ++++++++++ vite.config.js | 3 ++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/pages/comprehensiveQuery/index.vue b/src/pages/comprehensiveQuery/index.vue index c8f258d..0341868 100644 --- a/src/pages/comprehensiveQuery/index.vue +++ b/src/pages/comprehensiveQuery/index.vue @@ -395,9 +395,10 @@ const onHandleSeniorSearch = () => { const onHandleSearch = () => { queryParams.value.searchType = 3 queryParams.value.keyWord = innerKeyWord.value + queryParams.value.pageNum = 1 getImgListData(true) rightPopupShow.value = false - resetForm() + // resetForm() } // 重置 @@ -506,7 +507,7 @@ const getImgListData = async (isTap = false) => { const res = await getImgListApi(queryParamsNew) // 更新总数 - total.value = res.data.total + total.value = res?.data?.total console.log( '%c🔍 获取照片列表出参 %c', 'background: linear-gradient(90deg, #FF6B6B, #4ECDC4); color: white; padding: 5px 10px; border-radius: 5px; font-weight: bold;', diff --git a/src/pages/qualityInspection/upload-record/index.vue b/src/pages/qualityInspection/upload-record/index.vue index 2c156bd..9710adf 100644 --- a/src/pages/qualityInspection/upload-record/index.vue +++ b/src/pages/qualityInspection/upload-record/index.vue @@ -32,6 +32,7 @@ text="修改" type="primary" @tap="onHandleEditRecord(item.id)" + v-if="!isExpire(item.rectDate)" /> @@ -178,6 +179,15 @@ const onHandleViewDetails = (id) => { }) } +const isExpire = (rectDate) => { + const targetDate = new Date(rectDate) + const currentDate = new Date() + // 去掉时间部分,只比较日期 + targetDate.setHours(0, 0, 0, 0) + currentDate.setHours(0, 0, 0, 0) + return targetDate < currentDate +} + // 点击轮播图 const onClickSwiper = (e) => {} diff --git a/src/pages/safetyViolations/upload-record/index.vue b/src/pages/safetyViolations/upload-record/index.vue index 60364f6..b0a3e7b 100644 --- a/src/pages/safetyViolations/upload-record/index.vue +++ b/src/pages/safetyViolations/upload-record/index.vue @@ -32,6 +32,7 @@ text="修改" type="primary" @tap="onHandleEditRecord(item.id)" + v-if="!isExpire(item.rectDate)" /> @@ -185,6 +186,15 @@ const onClickSwiper = (e) => {} // 点击返回顶部 const onHandleBackTop = () => {} + +const isExpire = (rectDate) => { + const targetDate = new Date(rectDate) + const currentDate = new Date() + // 去掉时间部分,只比较日期 + targetDate.setHours(0, 0, 0, 0) + currentDate.setHours(0, 0, 0, 0) + return targetDate < currentDate +}