diff --git a/src/utils/DateUtils.ts b/src/utils/DateUtils.ts index 1f51f0b..9b2a237 100644 --- a/src/utils/DateUtils.ts +++ b/src/utils/DateUtils.ts @@ -33,6 +33,14 @@ class DateUtils { }; } + static MonthStrToDate(dateStr: string): Date { + const year = parseInt(dateStr.split('年')[0]); + const month = parseInt(dateStr.split('年')[1].split('月')[0]) - 1; // 月份从0开始 + + const date = new Date(year, month, 1); + return date; + } + /** * 获取指定年份和月的范围 * @param year 年份 diff --git a/src/views/property-marketing/assignment-management/index.vue b/src/views/property-marketing/assignment-management/index.vue index 2200bd9..9cd4f3e 100644 --- a/src/views/property-marketing/assignment-management/index.vue +++ b/src/views/property-marketing/assignment-management/index.vue @@ -15,6 +15,7 @@ v-else-if="choseType === '周'" @change="onChangeWeek" v-model="weekModel" + format="YYYY年MM月DD日" />