diff --git a/apps/web-antd/src/views/system/pharmacy/components/modal.vue b/apps/web-antd/src/views/system/pharmacy/components/modal.vue index d4569053..44fa3698 100644 --- a/apps/web-antd/src/views/system/pharmacy/components/modal.vue +++ b/apps/web-antd/src/views/system/pharmacy/components/modal.vue @@ -72,8 +72,18 @@ const [Modal, modalApi] = useVbenModal({ // 设置表单值,并处理时间字段(转换为dayjs对象) formApi.setValues({ ...values, - start_time: dayjs(values.start_time, 'HH:mm'), - end_time: dayjs(values.end_time, 'HH:mm') + start_time: dayjs(values.start_time || '08:00', 'HH:mm'), + end_time: dayjs(values.end_time || '20:00', 'HH:mm') + }); + } else { + console.log({ + + start_time: dayjs('08:00', 'HH:mm'), + end_time: dayjs('20:00', 'HH:mm') + }) + formApi.setValues({ + start_time: dayjs('08:00', 'HH:mm'), + end_time: dayjs('20:00', 'HH:mm') }); } } diff --git a/apps/web-antd/src/views/system/store/components/modal.vue b/apps/web-antd/src/views/system/store/components/modal.vue index 7e61b693..a1e9170e 100644 --- a/apps/web-antd/src/views/system/store/components/modal.vue +++ b/apps/web-antd/src/views/system/store/components/modal.vue @@ -56,8 +56,8 @@ const [Modal, modalApi] = useVbenModal({ values.address = [values.province_id, values.city_id]; formApi.setValues({ ...values, - start_time: dayjs(values.start_time, 'HH:mm'), - end_time: dayjs(values.end_time, 'HH:mm') + start_time: dayjs(values.start_time || '08:00', 'HH:mm'), + end_time: dayjs(values.end_time || '20:00', 'HH:mm') }); } }