Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
上
上药订单生命周期升级
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sph
上药订单生命周期升级
Commits
9a89d8b8
Commit
9a89d8b8
authored
Mar 29, 2021
by
xiejb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
高级搜索时间快捷按钮 今天 7天 30天
parent
5f3d62d9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
61 deletions
+67
-61
src/views/myOrder/components/HighSearch.vue
src/views/myOrder/components/HighSearch.vue
+67
-61
No files found.
src/views/myOrder/components/HighSearch.vue
View file @
9a89d8b8
...
@@ -153,15 +153,15 @@ export default {
...
@@ -153,15 +153,15 @@ export default {
},
},
dataType
:
[
dataType
:
[
{
{
name
:
'
本日
'
,
name
:
'
今天
'
,
active
:
true
active
:
true
},
},
{
{
name
:
'
本周
'
,
name
:
'
七天
'
,
active
:
false
active
:
false
},
},
{
{
name
:
'
本月
'
,
name
:
'
30天
'
,
active
:
false
active
:
false
}
}
// {
// {
...
@@ -427,15 +427,15 @@ export default {
...
@@ -427,15 +427,15 @@ export default {
_this
.
showCustomizeDate
=
false
_this
.
showCustomizeDate
=
false
_this
.
getCurrentSeason
()
_this
.
getCurrentSeason
()
break
break
case
'
本月
'
:
case
'
30天
'
:
_this
.
showCustomizeDate
=
false
_this
.
showCustomizeDate
=
false
_this
.
getCurrentMonth
()
_this
.
getCurrentMonth
()
break
break
case
'
本周
'
:
case
'
七天
'
:
_this
.
showCustomizeDate
=
false
_this
.
showCustomizeDate
=
false
_this
.
getCurrentWeek
()
_this
.
getCurrentWeek
()
break
break
case
'
本日
'
:
case
'
今天
'
:
_this
.
showCustomizeDate
=
false
_this
.
showCustomizeDate
=
false
_this
.
getCurrentDate
()
_this
.
getCurrentDate
()
break
break
...
@@ -501,67 +501,57 @@ export default {
...
@@ -501,67 +501,57 @@ export default {
// 起止日期数组
// 起止日期数组
// var startStop = []
// var startStop = []
// 获取当前时间
// 获取当前时间
var
currentDate
=
new
Date
()
//
var currentDate = new Date()
// 获得当前月份0-11
//
//
获得当前月份0-11
var
currentMonth
=
currentDate
.
getMonth
()
//
var currentMonth = currentDate.getMonth()
// 获得当前年份4位年
//
//
获得当前年份4位年
var
currentYear
=
currentDate
.
getFullYear
()
//
var currentYear = currentDate.getFullYear()
// 求出本月第一天
//
//
求出本月第一天
var
firstDay
=
new
Date
(
currentYear
,
currentMonth
,
1
)
//
var firstDay = new Date(currentYear, currentMonth, 1)
// 当为12月的时候年份需要加1
//
//
当为12月的时候年份需要加1
// 月份需要更新为0 也就是下一年的第一个月
//
//
月份需要更新为0 也就是下一年的第一个月
if
(
currentMonth
==
11
)
{
//
if (currentMonth == 11) {
currentYear
++
//
currentYear++
currentMonth
=
0
// 就为
//
currentMonth = 0 // 就为
}
else
{
//
} else {
// 否则只是月份增加,以便求的下一月的第一天
//
// 否则只是月份增加,以便求的下一月的第一天
currentMonth
++
//
currentMonth++
}
//
}
// 一天的毫秒数
// // 一天的毫秒数
var
millisecond
=
1000
*
60
*
60
*
24
// var millisecond = 1000 * 60 * 60 * 24
// 下月的第一天
// // 下月的第一天
var
nextMonthDayOne
=
new
Date
(
currentYear
,
currentMonth
,
1
)
// var nextMonthDayOne = new Date(currentYear, currentMonth, 1)
// 求出上月的最后一天
// // 求出上月的最后一天
// var lastDay = new Date(nextMonthDayOne.getTime() - millisecond)
// // var lastDay = new Date(nextMonthDayOne.getTime() - millisecond)
var
lastDay
=
new
Date
()
// var lastDay = new Date()
// 添加至数组中返回
// // 添加至数组中返回
// startStop.push(firstDay)
// // startStop.push(firstDay)
// startStop.push(lastDay)
// // startStop.push(lastDay)
this
.
moreSearchInfo
.
time
.
start
=
getFormateDate
(
firstDay
,
'
yyyy-MM-dd
'
)
// this.moreSearchInfo.time.start = getFormateDate(firstDay, 'yyyy-MM-dd')
this
.
moreSearchInfo
.
time
.
end
=
getFormateDate
(
lastDay
,
'
yyyy-MM-dd
'
)
// this.moreSearchInfo.time.end = getFormateDate(lastDay, 'yyyy-MM-dd')
this
.
moreSearchInfo
.
time
.
start
=
this
.
getDay
(
getFormateDate
(
new
Date
(),
'
yyyy-MM-dd
'
),
-
30
)
this
.
moreSearchInfo
.
time
.
end
=
getFormateDate
(
new
Date
(),
'
yyyy-MM-dd
'
)
// 返回
// 返回
// return startStop
// return startStop
},
},
// 获得当前星期的开始与结束日期
// 获得当前星期的开始与结束日期
getCurrentWeek
()
{
getCurrentWeek
()
{
// 起止日期数组
// var startStop = []
// 获取当前时间
// 获取当前时间
var
currentDate
=
new
Date
()
// var currentDate = new Date()
// 返回date是一周中的某一天
// // 返回date是一周中的某一天
var
week
=
currentDate
.
getDay
()
// var week = currentDate.getDay()
// 返回date是一个月中的某一天
// var month = currentDate.getDate()
// 一天的毫秒数
// // 一天的毫秒数
var
millisecond
=
1000
*
60
*
60
*
24
// var millisecond = 1000 * 60 * 60 * 24
// 减去的天数
// // 减去的天数
var
minusDay
=
week
!=
0
?
week
-
1
:
6
// var minusDay = week != 0 ? week - 1 : 6
// alert(minusDay);
// // alert(minusDay);
// 本周 周一
// // 本周 周一
var
monday
=
new
Date
(
currentDate
.
getTime
()
-
(
minusDay
*
millisecond
))
// var monday = new Date(currentDate.getTime() - (minusDay * millisecond))
// 本周 周日
// var sunday = new Date(monday.getTime() + (6 * millisecond))
var
sunday
=
new
Date
()
var
sunday
=
new
Date
()
// 添加本周时间
this
.
moreSearchInfo
.
time
.
start
=
this
.
getDay
(
getFormateDate
(
sunday
,
'
yyyy-MM-dd
'
),
-
7
)
// startStop.push(monday) // 本周起始时间
// // 添加本周最后一天时间
// startStop.push(sunday) // 本周终止时间
// 返回
// return startStop
this
.
moreSearchInfo
.
time
.
start
=
getFormateDate
(
monday
,
'
yyyy-MM-dd
'
)
this
.
moreSearchInfo
.
time
.
end
=
getFormateDate
(
sunday
,
'
yyyy-MM-dd
'
)
this
.
moreSearchInfo
.
time
.
end
=
getFormateDate
(
sunday
,
'
yyyy-MM-dd
'
)
},
},
// 获取当天的日期
// 获取当天的日期
...
@@ -579,17 +569,33 @@ export default {
...
@@ -579,17 +569,33 @@ export default {
if
(
month
<
3
)
{
if
(
month
<
3
)
{
return
spring
return
spring
}
}
if
(
month
<
6
)
{
if
(
month
<
6
)
{
return
summer
return
summer
}
}
if
(
month
<
9
)
{
if
(
month
<
9
)
{
return
fall
return
fall
}
}
return
winter
return
winter
}
},
getDay
(
time
,
day
)
{
var
today
=
new
Date
(
time
);
var
targetday_milliseconds
=
today
.
getTime
()
+
1000
*
60
*
60
*
24
*
day
;
today
.
setTime
(
targetday_milliseconds
);
//注意,这行是关键代码
var
tYear
=
today
.
getFullYear
();
var
tMonth
=
today
.
getMonth
();
var
tDate
=
today
.
getDate
();
tMonth
=
this
.
doHandleMonth
(
tMonth
+
1
);
tDate
=
this
.
doHandleMonth
(
tDate
);
return
tYear
+
"
-
"
+
tMonth
+
"
-
"
+
tDate
;
},
doHandleMonth
(
month
)
{
var
m
=
month
;
if
(
month
.
toString
().
length
==
1
)
{
m
=
"
0
"
+
month
;
}
return
m
;
},
}
}
}
}
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment