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
You need to sign in or sign up before continuing.
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
...
@@ -21,7 +21,7 @@ export const userLogin = (username, pass, captchaSign, verificationcode, captcha
},
'POST'
);
},
'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
:
{
aux
:
{
cur_day
:
cur_day
cur_day
:
cur_day
}
}
...
@@ -38,7 +38,7 @@ export const getBusinessConditionDataByMonth = (cur_day) => fetch('/api/query/*/
...
@@ -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'
,
{
export
const
getBusinessConditionDatasByYear
=
(
cur_day
)
=>
fetch
(
'/api/query/*/action/get_business_condition_datas_by_year'
,
{
aux
:
{
aux
:
{
cur_day
:
cur_day
S
cur_day
:
cur_day
}
}
},
'POST'
);
},
'POST'
);
// 应收账款汇总
// 应收账款汇总
...
@@ -68,3 +68,31 @@ export const getAllTypeBusinessConditionDetailByDay = (cur_day) => fetch('/api/q
...
@@ -68,3 +68,31 @@ export const getAllTypeBusinessConditionDetailByDay = (cur_day) => fetch('/api/q
}
}
},
'POST'
);
},
'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
{
import
{
getBusinessConditionDatas
,
getBusinessConditionDatas
,
getAllTypeBusinessConditionDatas
,
getAllTypeBusinessConditionDatas
,
getAllTypeBusinessConditionDetailByDay
getAllTypeBusinessConditionDetailByDay
,
getBusinessConditionDataByMonth
,
getAllTypeBusinessConditionDatasByMonth
,
getAllTypeBusinessConditionDetailByMonth
,
getBusinessConditionDatasByYear
,
getAllTypeBusinessConditionDatasByYear
,
getAllTypeBusinessConditionDetailByYear
}
from
"../../api/apiList"
;
}
from
"../../api/apiList"
;
import
{
calc_hb_str
,
calc_tb_str
,
conver_amont
}
from
"../../utils/numUtil"
;
import
{
calc_hb_str
,
calc_tb_str
,
conver_amont
}
from
"../../utils/numUtil"
;
import
moment
from
'moment'
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
();
let
pageData
=
new
Object
();
pageData
.
head
=
await
getHeadDay
(
type
,
cur_day
)
pageData
.
head
=
await
getHead
(
dimension
,
type
,
cur_day
)
pageData
.
detail
=
await
getDetailDay
(
type
,
cur_day
)
pageData
.
detail
=
await
getDetail
(
dimension
,
type
,
cur_day
)
console
.
log
(
"pageData:"
+
JSON
.
stringify
(
pageData
))
return
pageData
;
return
pageData
;
};
};
/**
/**
* @param cur_day
* @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
headData
=
new
Object
();
let
res
=
await
reqSumData
(
cur_day
);
let
transportData
;
headData
.
营业额
=
adapterSumDataDay
(
type
,
res
);
let
res
=
await
reqDaySumData
(
dimension
,
cur_day
);
let
transportData
=
await
reqTransportData
(
cur_day
)
headData
[
pageName
]
=
adapterSumData
(
dimension
,
type
,
res
);
headData
.
汽运营业额
=
initSumDataDay
();
transportData
=
await
reqDayTransportData
(
dimension
,
cur_day
)
headData
.
水运营业额
=
initSumDataDay
();
headData
[
truck
]
=
initSumDataDay
();
headData
.
铁运营业额
=
initSumDataDay
();
headData
[
ship
]
=
initSumDataDay
();
headData
[
tran
]
=
initSumDataDay
();
if
(
transportData
[
10
])
{
if
(
transportData
[
10
])
{
headData
.
汽运营业额
=
adapterSumDataDay
(
type
,
transportData
[
10
]);
headData
[
truck
]
=
adapterSumData
(
dimension
,
type
,
transportData
[
10
]);
}
}
if
(
transportData
[
30
])
{
if
(
transportData
[
30
])
{
headData
.
水运营业额
=
adapterSumDataDay
(
type
,
transportData
[
30
]);
headData
[
ship
]
=
adapterSumData
(
dimension
,
type
,
transportData
[
30
]);
}
}
if
(
transportData
[
20
])
{
if
(
transportData
[
20
])
{
headData
.
铁运营业额
=
adapterSumDataDay
(
type
,
transportData
[
20
]);
headData
[
tran
]
=
adapterSumData
(
dimension
,
type
,
transportData
[
20
]);
}
}
return
headData
;
return
headData
;
};
};
//获取折线图明细
//获取折线图明细
export
const
getDetailDay
=
async
function
(
type
,
cur_day
)
{
export
const
getDetail
=
async
function
(
dimension
,
type
,
cur_day
)
{
let
transportDetail
=
await
reqTransportDetailDayData
(
cur_day
)
let
res
;
return
adapterDetailDataDay
(
type
,
transportDetail
)
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
)
{
export
const
reqDaySumData
=
async
function
(
dimension
,
cur_day
)
{
let
res
=
await
getBusinessConditionDatas
(
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
let
data
=
res
.
data
return
data
;
return
data
;
}
}
//获取汇总数据
//获取每个运输方式汇总数据
export
const
reqTransportData
=
async
function
(
cur_day
)
{
export
const
reqDayTransportData
=
async
function
(
dimension
,
cur_day
)
{
let
res
=
await
getAllTypeBusinessConditionDatas
(
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
let
data
=
res
.
data
return
data
;
return
data
;
}
}
//获取明细数据数据
//获取明细数据数据
export
const
reqTransportDetailDayData
=
async
function
(
cur_day
)
{
export
const
reqTransportDetailDayData
=
async
function
(
cur_day
)
{
let
res
=
await
getAllTypeBusinessConditionDetailByDay
(
moment
(
cur_day
).
format
(
'YYYY-MM'
));
let
res
=
await
getAllTypeBusinessConditionDetailByDay
(
moment
(
cur_day
).
format
(
'YYYY-MM'
));
...
@@ -64,6 +104,26 @@ export const reqTransportDetailDayData = async function (cur_day) {
...
@@ -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:毛利
* @param type yye:营业额、cb:成本、ml:毛利
...
@@ -167,7 +227,7 @@ export const initSumDataDay = function () {
...
@@ -167,7 +227,7 @@ export const initSumDataDay = function () {
* @param type
* @param type
* @param data
* @param data
*/
*/
export
const
adapterSumData
m
onth
=
function
(
type
,
data
)
{
export
const
adapterSumData
M
onth
=
function
(
type
,
data
)
{
let
turnOver
=
new
Object
()
let
turnOver
=
new
Object
()
let
hb
=
new
Array
()
let
hb
=
new
Array
()
if
(
type
==
'yye'
)
{
if
(
type
==
'yye'
)
{
...
@@ -233,6 +293,7 @@ export const adapterSumDatamonth = function (type, data) {
...
@@ -233,6 +293,7 @@ export const adapterSumDatamonth = function (type, data) {
}
}
turnOver
.
hb
=
hb
;
turnOver
.
hb
=
hb
;
}
}
return
turnOver
;
}
}
/**
/**
...
@@ -282,6 +343,7 @@ export const adapterSumDataYear = function (type, data) {
...
@@ -282,6 +343,7 @@ export const adapterSumDataYear = function (type, data) {
}
}
turnOver
.
hb
=
hb
;
turnOver
.
hb
=
hb
;
}
}
return
turnOver
;
}
}
...
@@ -291,12 +353,22 @@ export const adapterSumDataYear = function (type, data) {
...
@@ -291,12 +353,22 @@ export const adapterSumDataYear = function (type, data) {
* @param data
* @param data
* @returns {any[]}
* @returns {any[]}
*/
*/
export
const
adapterDetailData
Day
=
function
(
type
,
data
)
{
export
const
adapterDetailData
=
function
(
dimension
,
type
,
data
)
{
let
list
=
new
Array
()
let
list
=
new
Array
()
let
detail
=
null
let
detail
=
null
for
(
let
key
in
data
)
{
for
(
let
key
in
data
)
{
detail
=
detailConver
(
type
,
data
[
key
])
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
);
list
.
push
(
detail
);
}
}
return
list
;
return
list
;
...
@@ -310,7 +382,6 @@ export const adapterDetailDataDay = function (type, data) {
...
@@ -310,7 +382,6 @@ export const adapterDetailDataDay = function (type, data) {
*/
*/
export
const
detailConver
=
function
(
type
,
detailList
)
{
export
const
detailConver
=
function
(
type
,
detailList
)
{
let
detail
=
initDetail
();
let
detail
=
initDetail
();
console
.
log
(
typeof
detailList
)
for
(
let
det
in
detailList
)
{
for
(
let
det
in
detailList
)
{
let
data
=
detailList
[
det
]
let
data
=
detailList
[
det
]
//初始化
//初始化
...
...
src/module/databoard/index.vue
View file @
24aba5b6
...
@@ -170,7 +170,7 @@ export default {
...
@@ -170,7 +170,7 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
today
:
'2023-0
6
-19'
,
today
:
'2023-0
5
-19'
,
yyqk
:
{
yyqk
:
{
yye
:
{
yye
:
{
title
:
"营业额"
,
title
:
"营业额"
,
...
@@ -233,59 +233,6 @@ export default {
...
@@ -233,59 +233,6 @@ export default {
{
title
:
"XX有限公司"
,
column
:
[{
key
:
"未收款(万元)"
,
value
:
0
}]},
{
title
:
"XX有限公司"
,
column
:
[{
key
:
"未收款(万元)"
,
value
:
0
}]},
],
],
mockData
:
{
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
:
{
zqk
:
{
yszk
:
{
yszk
:
{
title
:
"应收账款"
,
title
:
"应收账款"
,
...
@@ -460,9 +407,9 @@ export default {
...
@@ -460,9 +407,9 @@ export default {
},
},
},
},
paths
:
{
paths
:
{
"营业额"
:
"
/turnover-detail
"
,
"营业额"
:
"
yye
"
,
"成本"
:
"
/turnover-detail
"
,
"成本"
:
"
cb
"
,
"毛利"
:
"
/turnover-detai
l"
,
"毛利"
:
"
m
l"
,
},
},
charts
:
{}
charts
:
{}
}
}
...
@@ -470,7 +417,6 @@ export default {
...
@@ -470,7 +417,6 @@ export default {
methods
:
{
methods
:
{
cellStyleFunction
(
data
)
{
cellStyleFunction
(
data
)
{
let
res
=
{
color
:
'#33ff66'
};
let
res
=
{
color
:
'#33ff66'
};
console
.
log
(
data
+
":"
+
data
.
indexOf
(
'+'
))
if
(
data
.
indexOf
(
'-'
)
!==
-
1
)
{
if
(
data
.
indexOf
(
'-'
)
!==
-
1
)
{
res
.
color
=
'#ff3300'
res
.
color
=
'#ff3300'
}
}
...
@@ -481,9 +427,8 @@ export default {
...
@@ -481,9 +427,8 @@ export default {
this
.
charts
[
chartsKey
].
resize
();
this
.
charts
[
chartsKey
].
resize
();
}
}
},
},
routerTo
(
path
)
{
routerTo
(
code
)
{
console
.
log
(
path
)
this
.
$router
.
push
({
path
:
"/turnover-detail"
,
query
:
{
code
:
code
}});
this
.
$router
.
push
({
path
:
path
});
},
},
//营业情况
//营业情况
showBusinessConditionDatas
()
{
showBusinessConditionDatas
()
{
...
...
src/module/index/index.vue
View file @
24aba5b6
...
@@ -23,7 +23,7 @@ export default {
...
@@ -23,7 +23,7 @@ export default {
name
:
'app'
,
name
:
'app'
,
data
()
{
data
()
{
return
{
return
{
countDown
:
10
,
countDown
:
10
000
,
isRouterAlive
:
true
,
isRouterAlive
:
true
,
countDownTimer
:
null
,
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