fix: 修复推广费编辑弹窗 feeDate 类型错误导致 DatePicker 报错

This commit is contained in:
小蟑螂
2026-04-17 03:00:01 +08:00
parent 55c579d304
commit ac39f5d850
@@ -6,7 +6,9 @@ import type {
} from '#/api/ecommerce/promotion-fee/types';
import type { ShopVO } from '#/api/ecommerce/shop/types';
import { onMounted, ref, watch } from 'vue';
import { nextTick, onMounted, ref, watch } from 'vue';
import dayjs from 'dayjs';
import { useVbenModal } from '@vben/common-ui';
@@ -111,8 +113,10 @@ const feeTypeListLoading = ref(false);
// 监听props变化
watch(
() => props.open,
(newVal) => {
async (newVal) => {
if (newVal) {
// 等渲染周期完成后再 open,避免 Slot 依赖追踪失效
await nextTick();
modalApi.open();
isEdit.value = !!props.promotionFeeData;
if (props.promotionFeeData) {
@@ -129,7 +133,9 @@ watch(
clickCount: props.promotionFeeData.clickCount,
impressionCount: props.promotionFeeData.impressionCount,
conversionCount: props.promotionFeeData.conversionCount,
feeDate: props.promotionFeeData.feeDate,
feeDate: props.promotionFeeData.feeDate
? dayjs(props.promotionFeeData.feeDate)
: undefined,
remark: props.promotionFeeData.remark || '',
};
} else {
@@ -140,7 +146,6 @@ watch(
modalApi.close();
}
},
{ immediate: true },
);
// 加载店铺列表