提交 cfd7ca6a authored 作者: lidongxu's avatar lidongxu

fix(task): 修复默认显示今日任务时间

同上
上级 6354302f
......@@ -44,9 +44,9 @@ export const getTaskListAPI = (queryParams) => {
"pageSize": queryParams.pageSize,
"queryParams": {
"deptQcId": queryParams.zoneId,
"createDateStart": parseTime(queryParams.date[0], '{y}-{m}-{d}'),
"createDateStart": queryParams.date && parseTime(queryParams.date[0], '{y}-{m}-{d}'),
// "createDateStart": '2025-01-12 00:00:00',
"createDateEnd": parseTime(queryParams.date[1], '{y}-{m}-{d}'),
"createDateEnd": queryParams.date && parseTime(queryParams.date[1], '{y}-{m}-{d}'),
// "createDateEnd": '2025-01-14 23:59:59',
"province": queryParams.province,
"city": queryParams.city,
......
......@@ -7,9 +7,14 @@ export const useDatePickerOptions = (type = -1) => {
const last30Date = [new Date().setDate((new Date().getDate() - (30 - 1))), new Date().setDate((new Date().getDate() + type))]
const last7Date = [new Date().setDate((new Date().getDate() - (7 - 1))), new Date().setDate((new Date().getDate() + type))]
const lastDate = [new Date().setDate((new Date().getDate() + type)), new Date().setDate((new Date().getDate() + type))]
const todayDate = [new Date(), new Date()]
// 今年的 1.1 号到 12.31号
const thisYearDate = [new Date(new Date().getFullYear(), 0, 1), new Date(new Date().getFullYear(), 11, 31)]
const recentPickerOptions = ref([// 日期选项配置
{
text: '今天',
value: todayDate
},
{
text: '最近一周',
value() {
......@@ -50,6 +55,7 @@ export const useDatePickerOptions = (type = -1) => {
}
])
return {
todayDate, // 今天
lastDate, // 昨天
last30Date, // 前 30 天
last7Date, // 前 7 天
......
......@@ -10,7 +10,6 @@
prop="activityDate">
<el-date-picker v-model="queryParams.activityDate"
type="daterange"
value-format="YYYY-MM-DD"
clearable
range-separator="至"
start-placeholder="开始日期"
......
......@@ -9,7 +9,6 @@
prop="date">
<el-date-picker v-model="queryParams.date"
type="daterange"
value-format="YYYY-MM-DD"
clearable
range-separator="至"
start-placeholder="开始日期"
......@@ -168,9 +167,8 @@ import { parseTime } from '@/utils'
import store from '@/store'
import { ElMessage, ElMessageBox } from 'element-plus';
const { recentPickerOptions: pickerOptions, last7Date } = useDatePickerOptions(0)
const { recentPickerOptions: pickerOptions, last7Date, todayDate } = useDatePickerOptions(0)
const queryParams = reactive({
date: last7Date,
taskStatus: '',
region: '全国',
provinceId: undefined,
......@@ -179,7 +177,8 @@ const queryParams = reactive({
managerId: undefined,
storeName: undefined,
page: 1,
pageSize: 20
pageSize: 20,
date: todayDate
})
const photoDialogVisible = ref(false)
const photoDialogList = ref([])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论