Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
06d91f86
Commit
06d91f86
authored
Sep 27, 2021
by
季圣华
Browse files
增加服务到期提示
parent
81b0be25
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-web/src/views/dashboard/IndexChart.vue
View file @
06d91f86
...
...
@@ -54,6 +54,7 @@
<a-tag
v-if=
"tenant.type==0"
color=
"blue"
>
试用用户:
{{
tenant
.
userCurrentNum
}}
/
{{
tenant
.
userNumLimit
}}
</a-tag>
<a-tag
v-if=
"tenant.type==1"
color=
"blue"
>
服务到期:
{{
tenant
.
expireTime
}}
</a-tag>
<a-tag
v-if=
"tenant.type==1"
color=
"blue"
>
授权用户:
{{
tenant
.
userCurrentNum
}}
/
{{
tenant
.
userNumLimit
}}
</a-tag>
<a
v-if=
"hasExpire"
style=
"color: red;"
:href=
"payFeeUrl"
target=
"_blank"
>
立即续费
</a>
</a-card>
</a-col>
</a-row>
...
...
@@ -70,7 +71,7 @@
import
LineChartMultid
from
'
@/components/chart/LineChartMultid
'
import
HeadInfo
from
'
@/components/tools/HeadInfo.vue
'
import
Trend
from
'
@/components/Trend
'
import
{
getBuyAndSaleStatistics
,
buyOrSalePrice
}
from
'
@/api/api
'
import
{
getBuyAndSaleStatistics
,
buyOrSalePrice
,
getPlatformConfigByKey
}
from
'
@/api/api
'
import
{
getAction
}
from
'
../../api/manage
'
export
default
{
...
...
@@ -99,6 +100,8 @@
salePriceData
:
[],
visitFields
:[
'
ip
'
,
'
visit
'
],
visitInfo
:[],
hasExpire
:
false
,
payFeeUrl
:
''
,
tenant
:
{
type
:
''
,
expireTime
:
''
,
...
...
@@ -127,11 +130,24 @@
this
.
salePriceData
=
res
.
data
.
salePriceList
;
}
})
getPlatformConfigByKey
({
"
platformKey
"
:
"
pay_fee_url
"
}).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
200
)
{
this
.
payFeeUrl
=
res
.
data
.
platformValue
}
})
},
initWithTenant
()
{
getAction
(
"
/user/infoWithTenant
"
,{}).
then
(
res
=>
{
if
(
res
&&
res
.
code
===
200
)
{
this
.
tenant
=
res
.
data
let
currentTime
=
new
Date
();
//新建一个日期对象,默认现在的时间
let
expireTime
=
new
Date
(
res
.
data
.
expireTime
);
//设置过去的一个时间点,"yyyy-MM-dd HH:mm:ss"格式化日期
let
difftime
=
expireTime
-
currentTime
;
//计算时间差
//如果距离到期还剩5天就进行提示续费
if
(
difftime
<
86400000
*
5
)
{
this
.
hasExpire
=
true
this
.
$message
.
warning
(
'
您好,服务即将到期,请及时续费!
'
,
5
)
}
}
})
}
...
...
Write
Preview
Supports
Markdown
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