From 474b5693624882985b90eb6517cd902e4af524ff Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 4 Jun 2026 09:20:48 +0800 Subject: [PATCH] =?UTF-8?q?2026-06-04=20RoHs=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/rohs/rohsRecord.vue | 42 +++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/views/modules/rohs/rohsRecord.vue b/src/views/modules/rohs/rohsRecord.vue index 67cde4d..ae84268 100644 --- a/src/views/modules/rohs/rohsRecord.vue +++ b/src/views/modules/rohs/rohsRecord.vue @@ -54,7 +54,11 @@ - + + + @@ -189,7 +193,7 @@ - + @@ -705,7 +709,7 @@ - + @@ -1307,6 +1311,28 @@ export default { canEditRohsMaterial () { return !this.showModalFlag }, + normalizeDateOnly (value) { + if (value === null || value === undefined || value === '') { + return '' + } + if (value instanceof Date && !Number.isNaN(value.getTime())) { + const year = value.getFullYear() + const month = String(value.getMonth() + 1).padStart(2, '0') + const day = String(value.getDate()).padStart(2, '0') + return year + '-' + month + '-' + day + } + const text = String(value).trim() + if (!text) { + return '' + } + if (text.includes('T')) { + return text.split('T')[0] + } + return text.length >= 10 ? text.substring(0, 10) : text + }, + getCurrentDateString () { + return this.normalizeDateOnly(new Date()) + }, normalizeValidUntilValue (value) { if (value === null || value === undefined || value === '') { return null @@ -1819,6 +1845,10 @@ export default { ? target.validUntilValue : fallbackData.validUntilValue this.$set(target, 'validUntilValue', this.normalizeValidUntilValue(validUntilValue)) + const applicationDate = target.applicationDate || fallbackData.applicationDate || '' + const plannedMassProductionDate = target.plannedMassProductionDate || fallbackData.plannedMassProductionDate || '' + this.$set(target, 'applicationDate', this.normalizeDateOnly(applicationDate)) + this.$set(target, 'plannedMassProductionDate', this.normalizeDateOnly(plannedMassProductionDate)) }, refreshCurrentTabTable () { if (this.activeTable === 'approvalInformation') { @@ -2021,11 +2051,11 @@ export default { this.modalData = { site: this.$store.state.user.site, referenceNo: tempReferenceNo, - applicant: '', - applicantName: '', + applicant: this.$store.state.user.name || '', + applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '', pm: '', pmName: '', - applicationDate: '', + applicationDate: this.getCurrentDateString(), process: '', plannedMassProductionDate: '', color: '',