Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shld-databoard-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
潘自豪 Rambo Pan
shld-databoard-ui
Commits
fe7f1a53
Commit
fe7f1a53
authored
Sep 19, 2023
by
潘自豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营业额
parent
8da7109a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
229 additions
and
97 deletions
+229
-97
apiList.js
src/module/api/apiList.js
+21
-1
index.vue
src/module/databoard/index.vue
+164
-96
util.js
src/module/util/util.js
+44
-0
No files found.
src/module/api/apiList.js
View file @
fe7f1a53
...
...
@@ -20,12 +20,32 @@ export const userLogin = (username, pass, captchaSign, verificationcode, captcha
}
},
'POST'
);
//首页营业额率值 -汇总
export
const
getBusinessConditionDatas
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas'
,
{
aux
:
{
cur_day
:
cur_day
}
},
'POST'
);
//明细页营业额汇月 -汇总
export
const
getBusinessConditionDataByMonth
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas_by_month'
,
{
aux
:
{
cur_day
:
cur_dayS
}
},
'POST'
);
//明细页营业额汇年 -汇总
export
const
getBusinessConditionDatasByYear
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas_by_year'
,
{
aux
:
{
cur_day
:
cur_dayS
}
},
'POST'
);
src/module/databoard/index.vue
View file @
fe7f1a53
This diff is collapsed.
Click to expand it.
src/module/util/util.js
0 → 100644
View file @
fe7f1a53
//环比值=(当日营业额-昨日营业额)/昨日营业额*100%计算
export
const
calc_hb_str
=
function
(
cur
,
pre
)
{
return
conver_num_rate
(
formater
((
cur
-
pre
)
/
pre
*
100
));
};
//同比值=(当日营业额上个月同一日营业额)/上个月同一日营业额*100%计算
export
const
calc_tb_str
=
function
(
cur
,
pre
)
{
return
conver_num_rate
(
formater
(
cur
/
pre
*
100
));
};
//conver amont
export
const
conver_amont
=
function
(
amont
)
{
return
formater
(
amont
/
10000
);
};
//Positive and negative
export
const
conver_num_rate
=
function
(
amont
)
{
if
(
amont
>
0
)
{
return
"+"
+
amont
+
"%"
}
else
{
return
"-"
+
amont
+
"%"
}
};
//数字金额显示
function
formater
(
data
)
{
if
(
!
data
)
return
'0.00'
// 将数据分割,保留两位小数
data
=
data
.
toFixed
(
2
)
// 获取整数部分
const
intPart
=
Math
.
trunc
(
data
)
// 整数部分处理,增加,
const
intPartFormat
=
intPart
.
toString
().
replace
(
/
(\d)(?=(?:\d{3})
+$
)
/g
,
'$1,'
)
// 预定义小数部分
let
floatPart
=
'.00'
// 将数据分割为小数部分和整数部分
const
newArr
=
data
.
toString
().
split
(
'.'
)
if
(
newArr
.
length
===
2
)
{
// 有小数部分
floatPart
=
newArr
[
1
].
toString
()
// 取得小数部分
return
intPartFormat
+
'.'
+
floatPart
}
return
intPartFormat
+
floatPart
}
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