diff --git a/admin/src/views/appointments/index.vue b/admin/src/views/appointments/index.vue index 171c845..daf0460 100644 --- a/admin/src/views/appointments/index.vue +++ b/admin/src/views/appointments/index.vue @@ -910,8 +910,15 @@ function handleCreatePaymentOrder(row) { paymentForm.serviceContent = row.service?.titleZh || row.hotService?.name_zh || row.serviceType || '' paymentForm.amountPeso = null paymentForm.amountRmb = null - // 默认设置为当前时间 - paymentForm.paymentTime = new Date().toISOString().slice(0, 19).replace('T', ' ') + // 默认设置为当前本地时间 + const now = new Date() + const year = now.getFullYear() + const month = String(now.getMonth() + 1).padStart(2, '0') + const day = String(now.getDate()).padStart(2, '0') + const hours = String(now.getHours()).padStart(2, '0') + const minutes = String(now.getMinutes()).padStart(2, '0') + const seconds = String(now.getSeconds()).padStart(2, '0') + paymentForm.paymentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` paymentForm.notes = '' paymentDialogVisible.value = true } diff --git a/admin/src/views/payment-orders/index.vue b/admin/src/views/payment-orders/index.vue index 102ea6a..1ab208c 100644 --- a/admin/src/views/payment-orders/index.vue +++ b/admin/src/views/payment-orders/index.vue @@ -316,12 +316,22 @@ function handleSizeChange(size) { } function showCreateDialog() { + // 生成当前本地时间 + const now = new Date() + const year = now.getFullYear() + const month = String(now.getMonth() + 1).padStart(2, '0') + const day = String(now.getDate()).padStart(2, '0') + const hours = String(now.getHours()).padStart(2, '0') + const minutes = String(now.getMinutes()).padStart(2, '0') + const seconds = String(now.getSeconds()).padStart(2, '0') + const currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` + Object.assign(createForm, { userId: '', amountPeso: null, amountRmb: null, serviceContent: '', - paymentTime: '', + paymentTime: currentTime, appointmentId: '', notes: '', })