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
df2fe553
authored
Jul 05, 2023
by
韩达
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改上架有效期
parent
9b9308b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
src/views/Store/list.vue
src/views/User/login.vue
src/views/Store/list.vue
View file @
df2fe553
...
...
@@ -303,7 +303,7 @@
<el-table-column
prop=
"cp_time_temp"
label=
"上架有效期"
width=
"160"
:show-overflow-tooltip=
"true"
></el-table-column>
<el-table-column
label=
"修改上架有效期"
width=
"160"
>
<
template
slot-scope=
"scope"
>
<el-date-picker
v-model=
"scope.row.cp_time"
type=
"date"
placeholder=
"选择日期"
style=
"width: 128px"
value-format=
"yyyy-MM-dd"
></el-date-picker>
<el-date-picker
v-model=
"scope.row.cp_time"
type=
"date"
placeholder=
"选择日期"
style=
"width: 128px"
value-format=
"yyyy-MM-dd"
:picker-options=
"pickerOptions"
></el-date-picker>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -354,7 +354,10 @@ export default {
disabled
:
false
,
timer
:
null
,
skuStatistics
:
{},
//统计数据
skuRankList
:
{}
//sku的型号统计排名列表
skuRankList
:
{},
//sku的型号统计排名列表
pickerOptions
:
{
disabledDate
:
this
.
disabledDate
}
};
},
created
()
{
...
...
@@ -534,6 +537,23 @@ export default {
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
},
disabledDate
(
date
)
{
var
maxDate
=
new
Date
();
// 设置最大日期
var
minDate
=
new
Date
();
// 设置最小日期
var
cp_time_day
=
localStorage
.
getItem
(
'cp_time_day'
);
if
(
cp_time_day
==
-
1
){
// “无限制”,则修改上架有效期默认为:2035-01-01
var
maxDate
=
new
Date
(
'2035-01-01'
);
}
else
{
var
maxDate
=
new
Date
(
new
Date
().
getTime
()
+
cp_time_day
*
24
*
60
*
60
*
1000
);
}
return
date
>
maxDate
||
date
<
minDate
;
// 返回 true 禁用日期,返回 false 启用日期
},
/**
*
* @param date 时间类型
...
...
@@ -542,7 +562,16 @@ export default {
*/
getTimes
(
date
,
type
)
{
if
(
type
)
{
var
date
=
new
Date
(
new
Date
(
date
).
getTime
()
+
30
*
24
*
60
*
60
*
1000
);
var
cp_time_day
=
localStorage
.
getItem
(
'cp_time_day'
);
if
(
cp_time_day
==
-
1
){
// “无限制”,则修改上架有效期默认为:2035-01-01
var
date
=
new
Date
(
'2035-01-01'
);
}
else
{
var
date
=
new
Date
(
new
Date
().
getTime
()
+
cp_time_day
*
24
*
60
*
60
*
1000
);
}
// var date = new Date(new Date(date).getTime() + 30 * 24 * 60 * 60 * 1000);
}
else
{
var
date
=
new
Date
(
date
);
}
...
...
@@ -602,7 +631,6 @@ export default {
//修改上架有效期
this
.
dialogVisible3
=
true
;
let
currentTime
=
new
Date
().
getTime
();
//当前日期毫秒
let
currentTimeFormate
=
this
.
getTimes
(
new
Date
());
//当前日期格式化
for
(
let
i
=
0
;
i
<
this
.
selectData
.
length
;
i
++
)
{
this
.
selectData
[
i
].
cp_time_temp
=
this
.
selectData
[
i
].
cp_time
;
...
...
src/views/User/login.vue
View file @
df2fe553
...
...
@@ -164,7 +164,9 @@ export default {
if
(
res
.
code
===
0
)
{
sessionStorage
.
removeItem
(
'tabs'
);
localStorage
.
removeItem
(
'supplier_id'
);
localStorage
.
removeItem
(
'cp_time_day'
);
localStorage
.
setItem
(
'supplier_id'
,
res
.
data
.
supplier_id
);
localStorage
.
setItem
(
'cp_time_day'
,
res
.
data
.
cp_time_day
);
Util
.
setCookie
(
"token"
,
res
.
data
.
api_token
,
1
);
//强制要求微信绑定
if
(
!
res
.
data
.
is_bind_wechat
)
{
...
...
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