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
24aba5b6
Commit
24aba5b6
authored
Sep 21, 2023
by
潘自豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
营业额明细
parent
4169eb02
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
161 additions
and
268 deletions
+161
-268
apiList.js
src/module/api/apiList.js
+30
-2
turnover-detail.vue
src/module/databoard/databoard/turnover-detail.vue
+24
-175
turnoverDetail.js
src/module/databoard/databoard/turnoverDetail.js
+100
-29
index.vue
src/module/databoard/index.vue
+6
-61
index.vue
src/module/index/index.vue
+1
-1
No files found.
src/module/api/apiList.js
View file @
24aba5b6
...
...
@@ -21,7 +21,7 @@ export const userLogin = (username, pass, captchaSign, verificationcode, captcha
},
'POST'
);
//首页营业额率值 -汇总
export
const
getBusinessConditionDatas
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas'
,
{
export
const
getBusinessConditionDatas
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas'
,
{
aux
:
{
cur_day
:
cur_day
}
...
...
@@ -38,7 +38,7 @@ export const getBusinessConditionDataByMonth = (cur_day) => fetch('/api/query/*/
//明细页营业额汇年 -汇总
export
const
getBusinessConditionDatasByYear
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas_by_year'
,
{
aux
:
{
cur_day
:
cur_day
S
cur_day
:
cur_day
}
},
'POST'
);
// 应收账款汇总
...
...
@@ -68,3 +68,31 @@ export const getAllTypeBusinessConditionDetailByDay = (cur_day) => fetch('/api/q
}
},
'POST'
);
//明细页各种运输类型营业额汇总-月维度
export
const
getAllTypeBusinessConditionDatasByMonth
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_all_type_business_condition_datas_by_month'
,
{
aux
:
{
cur_day
:
cur_day
}
},
'POST'
);
//明细页各种运输类型营业额汇总-年维度
export
const
getAllTypeBusinessConditionDatasByYear
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_all_type_business_condition_datas_by_year'
,
{
aux
:
{
cur_day
:
cur_day
}
},
'POST'
);
//明细页各种运输类型营业额明细-月维度
export
const
getAllTypeBusinessConditionDetailByMonth
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_all_type_business_condition_detail_by_month'
,
{
aux
:
{
cur_day
:
cur_day
}
},
'POST'
);
//明细页各种运输类型营业额明细-年维度
export
const
getAllTypeBusinessConditionDetailByYear
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_all_type_business_condition_detail_by_year'
,
{
aux
:
{
cur_day
:
cur_day
}
},
'POST'
);
src/module/databoard/databoard/turnover-detail.vue
View file @
24aba5b6
This diff is collapsed.
Click to expand it.
src/module/databoard/databoard/turnoverDetail.js
View file @
24aba5b6
import
{
getBusinessConditionDatas
,
getAllTypeBusinessConditionDatas
,
getAllTypeBusinessConditionDetailByDay
getAllTypeBusinessConditionDetailByDay
,
getBusinessConditionDataByMonth
,
getAllTypeBusinessConditionDatasByMonth
,
getAllTypeBusinessConditionDetailByMonth
,
getBusinessConditionDatasByYear
,
getAllTypeBusinessConditionDatasByYear
,
getAllTypeBusinessConditionDetailByYear
}
from
"../../api/apiList"
;
import
{
calc_hb_str
,
calc_tb_str
,
conver_amont
}
from
"../../utils/numUtil"
;
import
moment
from
'moment'
//天维度数据转换
export
const
getTrunOver
DayDetail
=
async
function
(
type
,
cur_day
)
{
export
const
getTrunOver
=
async
function
(
dimension
,
type
,
cur_day
)
{
let
pageData
=
new
Object
();
pageData
.
head
=
await
getHeadDay
(
type
,
cur_day
)
pageData
.
detail
=
await
getDetailDay
(
type
,
cur_day
)
console
.
log
(
"pageData:"
+
JSON
.
stringify
(
pageData
))
pageData
.
head
=
await
getHead
(
dimension
,
type
,
cur_day
)
pageData
.
detail
=
await
getDetail
(
dimension
,
type
,
cur_day
)
return
pageData
;
};
/**
* @param cur_day
*/
export
const
getHeadDay
=
async
function
(
type
,
cur_day
)
{
export
const
getHead
=
async
function
(
dimension
,
type
,
cur_day
)
{
let
typeName
=
new
Object
({
"yye"
:
"营业额"
,
"cb"
:
"成本"
,
"ml"
:
"毛利"
});
let
pageName
=
typeName
[
type
]
let
truck
=
"汽运"
+
pageName
;
let
ship
=
"水运"
+
pageName
;
let
tran
=
"铁运"
+
pageName
;
let
headData
=
new
Object
();
let
res
=
await
reqSumData
(
cur_day
);
headData
.
营业额
=
adapterSumDataDay
(
type
,
res
);
let
transportData
=
await
reqTransportData
(
cur_day
)
headData
.
汽运营业额
=
initSumDataDay
();
headData
.
水运营业额
=
initSumDataDay
();
headData
.
铁运营业额
=
initSumDataDay
();
let
transportData
;
let
res
=
await
reqDaySumData
(
dimension
,
cur_day
);
headData
[
pageName
]
=
adapterSumData
(
dimension
,
type
,
res
);
transportData
=
await
reqDayTransportData
(
dimension
,
cur_day
)
headData
[
truck
]
=
initSumDataDay
();
headData
[
ship
]
=
initSumDataDay
();
headData
[
tran
]
=
initSumDataDay
();
if
(
transportData
[
10
])
{
headData
.
汽运营业额
=
adapterSumDataDay
(
type
,
transportData
[
10
]);
headData
[
truck
]
=
adapterSumData
(
dimension
,
type
,
transportData
[
10
]);
}
if
(
transportData
[
30
])
{
headData
.
水运营业额
=
adapterSumDataDay
(
type
,
transportData
[
30
]);
headData
[
ship
]
=
adapterSumData
(
dimension
,
type
,
transportData
[
30
]);
}
if
(
transportData
[
20
])
{
headData
.
铁运营业额
=
adapterSumDataDay
(
type
,
transportData
[
20
]);
headData
[
tran
]
=
adapterSumData
(
dimension
,
type
,
transportData
[
20
]);
}
return
headData
;
};
//获取折线图明细
export
const
getDetailDay
=
async
function
(
type
,
cur_day
)
{
let
transportDetail
=
await
reqTransportDetailDayData
(
cur_day
)
return
adapterDetailDataDay
(
type
,
transportDetail
)
export
const
getDetail
=
async
function
(
dimension
,
type
,
cur_day
)
{
let
res
;
if
(
dimension
==
'day'
)
{
res
=
await
getAllTypeBusinessConditionDetailByDay
(
moment
(
cur_day
).
format
(
'YYYY-MM'
));
}
if
(
dimension
==
'month'
)
{
res
=
await
getAllTypeBusinessConditionDetailByMonth
(
cur_day
)
}
if
(
dimension
==
'year'
)
{
res
=
await
getAllTypeBusinessConditionDetailByYear
(
cur_day
)
}
let
data
=
res
.
data
return
adapterDetailData
(
dimension
,
type
,
data
)
};
//获取汇总数据
export
const
reqSumData
=
async
function
(
cur_day
)
{
let
res
=
await
getBusinessConditionDatas
(
cur_day
);
//获取全部汇总数据
export
const
reqDaySumData
=
async
function
(
dimension
,
cur_day
)
{
let
res
;
if
(
dimension
==
'day'
)
{
res
=
await
getBusinessConditionDatas
(
cur_day
);
}
if
(
dimension
==
'month'
)
{
res
=
await
getBusinessConditionDataByMonth
(
cur_day
);
}
if
(
dimension
==
'year'
)
{
res
=
await
getBusinessConditionDatasByYear
(
cur_day
);
}
let
data
=
res
.
data
return
data
;
}
//获取汇总数据
export
const
reqTransportData
=
async
function
(
cur_day
)
{
let
res
=
await
getAllTypeBusinessConditionDatas
(
cur_day
);
//获取每个运输方式汇总数据
export
const
reqDayTransportData
=
async
function
(
dimension
,
cur_day
)
{
let
res
;
if
(
dimension
==
'day'
)
{
res
=
await
getAllTypeBusinessConditionDatas
(
cur_day
);
}
if
(
dimension
==
'month'
)
{
res
=
await
getAllTypeBusinessConditionDatasByMonth
(
cur_day
);
}
if
(
dimension
==
'year'
)
{
res
=
await
getAllTypeBusinessConditionDatasByYear
(
cur_day
);
}
let
data
=
res
.
data
return
data
;
}
//获取明细数据数据
export
const
reqTransportDetailDayData
=
async
function
(
cur_day
)
{
let
res
=
await
getAllTypeBusinessConditionDetailByDay
(
moment
(
cur_day
).
format
(
'YYYY-MM'
));
...
...
@@ -64,6 +104,26 @@ export const reqTransportDetailDayData = async function (cur_day) {
}
/**
* 数据匹配
* @param type
* @param data
*/
export
const
adapterSumData
=
function
(
dimension
,
type
,
data
)
{
let
res
;
if
(
dimension
==
'day'
)
{
res
=
adapterSumDataDay
(
type
,
data
);
}
if
(
dimension
==
'month'
)
{
res
=
adapterSumDataMonth
(
type
,
data
);
}
if
(
dimension
==
'year'
)
{
res
=
adapterSumDataYear
(
type
,
data
);
}
return
res
;
}
/**
*日维度汇总
* @param type yye:营业额、cb:成本、ml:毛利
...
...
@@ -167,7 +227,7 @@ export const initSumDataDay = function () {
* @param type
* @param data
*/
export
const
adapterSumData
m
onth
=
function
(
type
,
data
)
{
export
const
adapterSumData
M
onth
=
function
(
type
,
data
)
{
let
turnOver
=
new
Object
()
let
hb
=
new
Array
()
if
(
type
==
'yye'
)
{
...
...
@@ -233,6 +293,7 @@ export const adapterSumDatamonth = function (type, data) {
}
turnOver
.
hb
=
hb
;
}
return
turnOver
;
}
/**
...
...
@@ -282,6 +343,7 @@ export const adapterSumDataYear = function (type, data) {
}
turnOver
.
hb
=
hb
;
}
return
turnOver
;
}
...
...
@@ -291,12 +353,22 @@ export const adapterSumDataYear = function (type, data) {
* @param data
* @returns {any[]}
*/
export
const
adapterDetailData
Day
=
function
(
type
,
data
)
{
export
const
adapterDetailData
=
function
(
dimension
,
type
,
data
)
{
let
list
=
new
Array
()
let
detail
=
null
for
(
let
key
in
data
)
{
detail
=
detailConver
(
type
,
data
[
key
])
detail
.
date
=
moment
(
key
).
format
(
'MM月DD日'
);
let
date
;
if
(
dimension
==
'day'
)
{
date
=
moment
(
key
).
format
(
'MM月DD日'
)
}
if
(
dimension
==
'month'
)
{
date
=
moment
(
key
).
format
(
'MM月'
)
}
if
(
dimension
==
'year'
)
{
date
=
moment
(
key
).
format
(
'YYYY年'
)
}
detail
.
date
=
date
;
list
.
push
(
detail
);
}
return
list
;
...
...
@@ -310,7 +382,6 @@ export const adapterDetailDataDay = function (type, data) {
*/
export
const
detailConver
=
function
(
type
,
detailList
)
{
let
detail
=
initDetail
();
console
.
log
(
typeof
detailList
)
for
(
let
det
in
detailList
)
{
let
data
=
detailList
[
det
]
//初始化
...
...
src/module/databoard/index.vue
View file @
24aba5b6
...
...
@@ -170,7 +170,7 @@ export default {
},
data
()
{
return
{
today
:
'2023-0
6
-19'
,
today
:
'2023-0
5
-19'
,
yyqk
:
{
yye
:
{
title
:
"营业额"
,
...
...
@@ -233,59 +233,6 @@ export default {
{
title
:
"XX有限公司"
,
column
:
[{
key
:
"未收款(万元)"
,
value
:
0
}]},
],
mockData
:
{
yyqk
:
{
yye
:
{
title
:
"营业额"
,
amount
:
"20,303"
,
unit
:
"万元"
,
hb
:
[
{
title
:
"昨天"
,
amount
:
"21,000"
,
rate
:
"-3.32%"
,
},
{
title
:
"上月"
,
amount
:
"20,000"
,
rate
:
"+4.92%"
,
},
],
},
cb
:
{
title
:
"成本"
,
amount
:
"10,303"
,
unit
:
"万元"
,
hb
:
[
{
title
:
"昨日"
,
amount
:
"11,000"
,
rate
:
"-2.68%"
,
},
{
title
:
"上月"
,
amount
:
"10,000"
,
rate
:
"+5.71%"
,
},
],
},
ml
:
{
title
:
"毛利"
,
amount
:
"10,000"
,
unit
:
"万元"
,
hb
:
[
{
title
:
"昨日"
,
amount
:
"10,000"
,
rate
:
"0.00%"
,
},
{
title
:
"上月"
,
amount
:
"10,000"
,
rate
:
"0.00%"
,
},
],
},
},
zqk
:
{
yszk
:
{
title
:
"应收账款"
,
...
...
@@ -460,9 +407,9 @@ export default {
},
},
paths
:
{
"营业额"
:
"
/turnover-detail
"
,
"成本"
:
"
/turnover-detail
"
,
"毛利"
:
"
/turnover-detai
l"
,
"营业额"
:
"
yye
"
,
"成本"
:
"
cb
"
,
"毛利"
:
"
m
l"
,
},
charts
:
{}
}
...
...
@@ -470,7 +417,6 @@ export default {
methods
:
{
cellStyleFunction
(
data
)
{
let
res
=
{
color
:
'#33ff66'
};
console
.
log
(
data
+
":"
+
data
.
indexOf
(
'+'
))
if
(
data
.
indexOf
(
'-'
)
!==
-
1
)
{
res
.
color
=
'#ff3300'
}
...
...
@@ -481,9 +427,8 @@ export default {
this
.
charts
[
chartsKey
].
resize
();
}
},
routerTo
(
path
)
{
console
.
log
(
path
)
this
.
$router
.
push
({
path
:
path
});
routerTo
(
code
)
{
this
.
$router
.
push
({
path
:
"/turnover-detail"
,
query
:
{
code
:
code
}});
},
//营业情况
showBusinessConditionDatas
()
{
...
...
src/module/index/index.vue
View file @
24aba5b6
...
...
@@ -23,7 +23,7 @@ export default {
name
:
'app'
,
data
()
{
return
{
countDown
:
10
,
countDown
:
10
000
,
isRouterAlive
:
true
,
countDownTimer
:
null
,
}
...
...
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