提交 6c12065e authored 作者: lidongxu's avatar lidongxu

Merge branch 'ap' into dev

...@@ -69,7 +69,7 @@ import VConsole from 'vconsole' ...@@ -69,7 +69,7 @@ import VConsole from 'vconsole'
// 创建vConsole实例 // 创建vConsole实例
// 生产环境不加载 // 生产环境不加载
if (import.meta.env.VITE_APP_ENV === 'staging') { if (import.meta.env.VITE_APP_ENV !== 'production') {
new VConsole() new VConsole()
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
is-link is-link
@click="showMonthPicker = true"> @click="showMonthPicker = true">
<template #input> <template #input>
<span>{{ queryParams.salesMonth || '请选择' }}</span> <span>{{ parseTime(queryParams.salesMonth, '{y}-{m}') || '请选择' }}</span>
</template> </template>
</van-field> </van-field>
...@@ -166,7 +166,7 @@ const confirmMonth = ({ selectedValues: value }) => { ...@@ -166,7 +166,7 @@ const confirmMonth = ({ selectedValues: value }) => {
// value 是 [2025, 2] 这种格式 // value 是 [2025, 2] 这种格式
const year = value[0] const year = value[0]
const month = String(value[1]).padStart(2, '0') const month = String(value[1]).padStart(2, '0')
props.queryParams.salesMonth = `${year}-${month}` props.queryParams.salesMonth = new Date(`${year}-${month}-01`)
showMonthPicker.value = false showMonthPicker.value = false
handleChange() handleChange()
} }
...@@ -211,15 +211,13 @@ watch(() => props.showSearch, (newVal) => { ...@@ -211,15 +211,13 @@ watch(() => props.showSearch, (newVal) => {
// 打开抽屉时初始化当前月份 // 打开抽屉时初始化当前月份
if (props.queryParams.salesMonth) { if (props.queryParams.salesMonth) {
// 如果是日期类型转成字符串 // 如果是日期类型转成字符串
if (props.queryParams.salesMonth instanceof Date) { const [year, month] = props.queryParams.salesMonth.toISOString().split('T')[0].substring(0, 7).split('-')
props.queryParams.salesMonth = props.queryParams.salesMonth.toISOString().split('T')[0].substring(0, 7)
}
const [year, month] = props.queryParams.salesMonth.split('-')
// currentMonth = [2025, 02] 这种格式 // currentMonth = [2025, 02] 这种格式
currentMonth.value = [parseInt(year), parseInt(month)] currentMonth.value = [parseInt(year), parseInt(month)]
} else { } else {
// 当前年月日 // 当前年月日,注意:getMonth()返回0-11,需要+1变成1-12
currentMonth.value = [new Date().getFullYear(), new Date().getMonth()] const now = new Date()
currentMonth.value = [now.getFullYear(), now.getMonth() + 1]
} }
} }
}) })
......
...@@ -116,8 +116,10 @@ ...@@ -116,8 +116,10 @@
/*************** 下载表格 ***************/ /*************** 下载表格 ***************/
const downloadTable = async () => { const downloadTable = async () => {
console.log(params.value, '1')
const res = await downloadDisplayScheduleTable({ const res = await downloadDisplayScheduleTable({
...params.value, ...params.value,
salesMonth: parseTime(params.value.salesMonth, '{y}-{m}'),
pageType: 'NORMAL_DISPLAY_EXPORT' pageType: 'NORMAL_DISPLAY_EXPORT'
}) })
saveAs(res, '陈列计划.xlsx') saveAs(res, '陈列计划.xlsx')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论