Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
肖康
/
cloudSystem
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7ff86b74
authored
Mar 16, 2023
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改有效期
parent
a3cec912
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
src/views/Store/list.vue
src/views/Store/list.vue
View file @
7ff86b74
...
@@ -544,6 +544,29 @@ export default {
...
@@ -544,6 +544,29 @@ export default {
this
.
multipleSelection
=
val
;
this
.
multipleSelection
=
val
;
},
},
/**
/**
*
* @param date 时间类型
* @param type 是否加30天
* @returns {string}
*/
getTime
(
date
,
type
)
{
var
date
=
new
Date
(
date
);
var
year
=
date
.
getFullYear
();
var
month
=
date
.
getMonth
()
+
1
;
if
(
type
)
{
var
day
=
date
.
getDate
()
+
30
;
}
else
{
var
day
=
date
.
getDate
();
}
var
hour
=
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
();
var
minute
=
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
();
var
second
=
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
();
month
>=
1
&&
month
<=
9
?
(
month
=
'0'
+
month
)
:
''
;
day
>=
0
&&
day
<=
9
?
(
day
=
'0'
+
day
)
:
''
;
var
timer
=
year
+
'-'
+
month
+
'-'
+
day
+
' '
+
hour
+
':'
+
minute
+
':'
+
second
;
return
timer
;
},
/**
* 统计查看
* 统计查看
* @param val
* @param val
*/
*/
...
@@ -586,8 +609,19 @@ export default {
...
@@ -586,8 +609,19 @@ export default {
}
else
{
}
else
{
//修改上架有效期
//修改上架有效期
this
.
dialogVisible3
=
true
;
this
.
dialogVisible3
=
true
;
let
currentTime
=
new
Date
().
getTime
();
//当前日期毫秒
let
currentTimeFormate
=
this
.
getTime
(
new
Date
());
//当前日期格式化
for
(
let
i
=
0
;
i
<
this
.
selectData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
selectData
.
length
;
i
++
)
{
this
.
selectData
[
i
].
cp_time_temp
=
this
.
selectData
[
i
].
cp_time
;
this
.
selectData
[
i
].
cp_time_temp
=
this
.
selectData
[
i
].
cp_time
;
var
time
=
Date
.
parse
(
this
.
selectData
[
i
].
cp_time
);
//上架有效期
if
(
time
>
currentTime
)
{
//上架有效期大于当前日期
this
.
selectData
[
i
].
cp_time
=
this
.
getTime
(
this
.
selectData
[
i
].
cp_time
,
true
);
}
else
{
//上架有效期小于等于当前日期
this
.
selectData
[
i
].
cp_time
=
this
.
getTime
(
new
Date
(),
true
);
}
}
}
this
.
cpdata
=
this
.
selectData
;
this
.
cpdata
=
this
.
selectData
;
}
}
...
...
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