From 87d7ba9e0d91aa6e6072d9d4dc37a5255b8b12e5 Mon Sep 17 00:00:00 2001 From: woody Date: Wed, 28 May 2025 16:00:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(addTikcet):=20=E6=97=B6=E9=97=B4=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/marketing/ticket/addTicket.vue | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/views/marketing/ticket/addTicket.vue b/src/views/marketing/ticket/addTicket.vue index 115b922..ab08726 100644 --- a/src/views/marketing/ticket/addTicket.vue +++ b/src/views/marketing/ticket/addTicket.vue @@ -256,21 +256,29 @@ export default { this.$set(this.ruleForm, 'actExplain', res.data.actExplain) this.$set(this.ruleForm, 'actCover', res.data.actCover) this.ruleForm.pkId = res.data.pkId - this.ruleForm.actStartDate = res.data.actStartDate - this.ruleForm.actEndDate = res.data.actEndDate - this.ruleForm.disStartDate = res.data.disStartDate - this.ruleForm.disEndDate = res.data.disEndDate + + // 处理时间字段,去掉时分秒部分,只保留日期 + const formatDateOnly = (datetime) => { + if (!datetime) return '' + return datetime.split(' ')[0] // 去掉时分秒,只保留日期部分 + } + + this.ruleForm.actStartDate = formatDateOnly(res.data.actStartDate) + this.ruleForm.actEndDate = formatDateOnly(res.data.actEndDate) + this.ruleForm.disStartDate = formatDateOnly(res.data.disStartDate) + this.ruleForm.disEndDate = formatDateOnly(res.data.disEndDate) + this.ruleForm.payMoney = res.data.payMoney this.ruleForm.quantity = res.data.quantity this.ruleForm.limitQuantity = res.data.limitQuantity this.ruleForm.pkVertex = res.data.pkVertex ? res.data.pkVertex.split(',').map(item => Number(item)) : [] this.$set(this.ruleForm, 'ruleFormTime', [ - res.data.actStartDate, - res.data.actEndDate + this.ruleForm.actStartDate, + this.ruleForm.actEndDate ]) this.$set(this.ruleForm, 'ruleFormTime1', [ - res.data.disStartDate, - res.data.disEndDate + this.ruleForm.disStartDate, + this.ruleForm.disEndDate ]) // let that = this; // setTimeout(() => {