Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 067dc75f
authored
Jun 02, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:v4.6.1报表功能开发
1 parent
dc84c6eb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
422 additions
and
6 deletions
README.md
src/router/routes.js
src/store/modules/d2admin/modules/auth.js
src/views/index/components/outputValueDialog.vue
src/views/index/components/reportDownloads.vue
src/views/index/index.vue
README.md
View file @
067dc75
src/router/routes.js
View file @
067dc75
...
@@ -30,6 +30,16 @@ export const home = {
...
@@ -30,6 +30,16 @@ export const home = {
parentId
:
'1'
,
parentId
:
'1'
,
cache
:
false
cache
:
false
},
},
auth
:
[
{
authId
:
'90701'
,
parentId
:
'907'
,
label
:
'报表模块'
// category: '',
// type: ''
// handle: 'handleExport'
}
],
component
:
_import
(
'index'
)
component
:
_import
(
'index'
)
}
}
export
const
sys
=
[
export
const
sys
=
[
...
...
src/store/modules/d2admin/modules/auth.js
View file @
067dc75
...
@@ -57,12 +57,16 @@ export default {
...
@@ -57,12 +57,16 @@ export default {
save2db
({
state
,
dispatch
})
{
save2db
({
state
,
dispatch
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
// 设置数据
// 设置数据
dispatch
(
'd2admin/db/set'
,
{
dispatch
(
'd2admin/db/set'
,
{
dbName
:
'database'
,
dbName
:
'database'
,
path
:
'source'
,
path
:
'source'
,
value
:
state
.
source
,
value
:
state
.
source
,
user
:
true
user
:
true
},
{
root
:
true
})
},
{
root
:
true
}
)
// end
// end
resolve
()
resolve
()
})
})
...
@@ -99,11 +103,15 @@ export default {
...
@@ -99,11 +103,15 @@ export default {
load
({
state
,
dispatch
})
{
load
({
state
,
dispatch
})
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
if
(
!
state
.
source
)
{
if
(
!
state
.
source
)
{
state
.
source
=
await
dispatch
(
'd2admin/db/get'
,
{
state
.
source
=
await
dispatch
(
'd2admin/db/get'
,
{
dbName
:
'database'
,
dbName
:
'database'
,
path
:
'source'
,
path
:
'source'
,
user
:
true
user
:
true
},
{
root
:
true
})
},
{
root
:
true
}
)
}
}
// end
// end
resolve
(
state
.
source
)
resolve
(
state
.
source
)
...
@@ -127,7 +135,11 @@ export default {
...
@@ -127,7 +135,11 @@ export default {
_initRoutes
({
state
},
source
)
{
_initRoutes
({
state
},
source
)
{
return
new
Promise
(
async
resolve
=>
{
return
new
Promise
(
async
resolve
=>
{
try
{
try
{
const
{
route
,
btn
}
=
util
.
permision
.
packRoutesBtns
(
localRoutes
,
source
)
const
{
route
,
btn
}
=
util
.
permision
.
packRoutesBtns
(
localRoutes
,
source
)
console
.
log
(
btn
)
router
.
matcher
=
ResetRouter
().
matcher
// 重置基础路由 解决切换用户 保留上一个用户路由问题
router
.
matcher
=
ResetRouter
().
matcher
// 重置基础路由 解决切换用户 保留上一个用户路由问题
frameInRoutes
[
0
].
children
=
[...
route
,
...
sys
]
frameInRoutes
[
0
].
children
=
[...
route
,
...
sys
]
router
.
addRoutes
(
frameInRoutes
)
router
.
addRoutes
(
frameInRoutes
)
...
...
src/views/index/components/outputValueDialog.vue
0 → 100644
View file @
067dc75
<
template
>
<d2-dialog
:title=
"'单店目标产值'"
:isVisible=
"outputVisible"
:width=
"'1080px'"
@
closeDialog=
"handleImport"
@
confirmDialog=
"handleConfirmImport"
>
<slot>
<div
class=
"searchWrap"
>
<el-col
:span=
"13"
>
<el-date-picker
v-model=
"search.outputMonth"
type=
"month"
format=
"yyyy 年 MM 月"
value-format=
"yyyy-MM-dd"
:picker-options=
"pickerOptions"
placeholder=
"选择月"
>
</el-date-picker>
</el-col>
<el-col
:span=
"9"
>
<el-input
v-model=
"search.inputVal"
placeholder=
"输入门店名称搜索"
></el-input>
</el-col>
<el-col
:span=
"2"
class=
"btnContainer"
>
<el-button
type=
"primary"
class=
"searchBtn"
>
搜索
</el-button>
</el-col>
<!--
<div
class=
"searchInput"
>
</div>
-->
</div>
<div
class=
"yqdTableContainer"
>
<!-- border -->
<el-table
:data=
"tableData"
stripe
max-height=
"450"
:header-cell-style=
"rowClass"
style=
"width: 100%"
>
<el-table-column
label=
"序号"
type=
"index"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"date"
label=
"园区店列表"
width=
"180"
>
</el-table-column>
<el-table-column
prop=
"name"
label=
"门店列表"
>
</el-table-column>
<el-table-column
prop=
"name"
width=
"260"
label=
"产值目标"
>
<template
slot-scope=
"scope"
>
<!--
<div>
slot-scope="scope"
</div>
-->
<span
v-if=
"!scope.row['name']&&item.isEdit"
>
{{
scope
.
row
[
'name'
]
}}
</span>
<!-- @input="input($event,item)" -->
<el-input
v-else
style=
"width: 140px"
@
input=
"handleInput($event,scope)"
v-model=
"scope.row['name']"
placeholder=
""
></el-input>
<!--
<div></div>
-->
</
template
>
</el-table-column>
</el-table>
<div
class=
"tips"
>
填写后不支持修改,请谨慎输入。
</div>
</div>
</slot>
</d2-dialog>
</template>
<
script
>
import
{
limitPrice
}
from
'@/common/constants'
import
moment
from
'moment'
export
default
{
props
:
{
isShow
:
{
// 弹窗是否展示
type
:
Boolean
,
default
:
true
}
},
data
()
{
return
{
pickerOptions
:
{
disabledDate
:
(
time
)
=>
{
const
maxMonth
=
moment
().
subtract
(
-
1
,
'months'
).
endOf
(
'month'
)
const
minMonth
=
moment
().
subtract
(
5
,
'months'
).
startOf
(
'month'
)
// console.log(minMonth.valueOf())
// console.log(time.getTime())
// time.getTime() > minMonth.valueOf() ||
return
time
.
getTime
()
>
maxMonth
.
valueOf
()
||
time
.
getTime
()
<
minMonth
.
valueOf
()
}
},
nowMonth
:
moment
().
subtract
(
'months'
).
startOf
(
'month'
).
format
(
'yyyy-MM-DD'
),
nextMonth
:
moment
().
subtract
(
-
1
,
'months'
).
startOf
(
'month'
).
format
(
'yyyy-MM-DD'
),
search
:
{
inputVal
:
''
,
outputMonth
:
''
},
tableData
:
[{
date
:
'2016-05-02'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1518 弄'
},
{
date
:
'2016-05-04'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1517 弄'
},
{
date
:
'2016-05-04'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1517 弄'
},
{
date
:
'2016-05-04'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1517 弄'
},
{
date
:
'2016-05-04'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1517 弄'
},
{
date
:
'2016-05-04'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1517 弄'
},
{
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
},
{
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
},
{
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
},
{
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
},
{
date
:
'2016-05-01'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1519 弄'
},
{
date
:
'2016-05-03'
,
name
:
'王小虎'
,
address
:
'上海市普陀区金沙江路 1516 弄'
}]
// outputVisible: true
}
},
computed
:
{
outputVisible
:
{
get
()
{
return
this
.
isShow
},
set
(
val
)
{
this
.
$emit
(
'update:isShow'
,
false
)
}
}
},
mounted
()
{
console
.
log
(
this
.
nowMonth
)
this
.
search
.
outputMonth
=
this
.
nowMonth
// console.log(moment().subtract(-1, 'months').endOf('month').format('YYYY-MM-DD'))
// console.log(moment().subtract(5, 'months').startOf('month').format('YYYY-MM-DD'))
},
methods
:
{
getlist
()
{
},
handleInput
(
newValue
,
item
)
{
// console.log(newValue, item)
// let limitNum = limitPrice
this
.
tableData
[
item
.
$index
][
'name'
]
=
limitPrice
(
newValue
,
item
.
row
.
name
,
6
)
// console.log(this.tableData[item.$index]['name'])
},
// 设置表头的颜色
rowClass
({
row
,
rowIndex
})
{
console
.
log
(
rowIndex
)
// 表头行标号为0
return
'background:#F4F6FC'
},
handleConfirmImport
()
{
this
.
handleImport
()
},
handleImport
()
{
this
.
outputVisible
=
false
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.searchWrap
{
height
:
30px
;
margin-bottom
:
10px
;
.el-input__inner
{
height
:
30px
;
}
.el-input__icon
{
line-height
:
30px
;
}
.btnContainer
{
text-align
:
right
;
padding-right
:
10px
;
}
.searchBtn
{
font-size
:
12px
;
padding
:
8px
10px
;
}
}
::v-deep
.yqdTableContainer
{
.el-table
.cell
{
padding
:
0
10px
;
}
//
padding-right
:
3px
;
.el-table__body-wrapper
{
.el-table__row
td
:
nth-child
(
1
)
{
border-left
:
1px
solid
#ebeef5
;
}
.el-table__row
td
:nth-last-child
(
1
)
{
border-right
:
1px
solid
#ebeef5
;
}
}
}
.tips
{
margin-top
:
10px
;
font-size
:
12px
;
text-align
:
right
;
color
:
#f46967
;
}
</
style
>
src/views/index/components/reportDownloads.vue
0 → 100644
View file @
067dc75
<
template
>
<el-row>
<el-col
:span=
"24"
>
<el-card
:body-style=
"
{ padding: '16px' }">
<div
class=
"reportContainer box-card"
>
<div
class=
"reportTips"
>
数据日报
{{
reportDay
}}
已生成
</div>
<div
class=
"selectContainer"
>
<div>
选择日期
</div>
<div
class=
"daySelect"
>
<el-date-picker
v-model=
"dateValue"
type=
"date"
:picker-options=
"pickerOptions"
format=
"yyyy 年 MM 月 dd 日"
placeholder=
"选择日期"
>
</el-date-picker>
<!--
<el-select
v-model=
"model"
placeholder=
""
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
-->
</div>
<el-button
type=
"primary"
class=
"exportBtn"
>
导出日报
</el-button>
</div>
<div
class=
"inputTargetBtn"
@
click=
"outputVisible = true"
><i
class=
"el-icon-edit"
></i>
输入单店产值目标
</div>
</div>
</el-card>
</el-col>
<outputValueDialog
v-if=
"outputVisible"
:isShow
.
sync=
"outputVisible"
></outputValueDialog>
</el-row>
</
template
>
<
script
>
import
outputValueDialog
from
'./outputValueDialog'
import
moment
from
'moment'
export
default
{
name
:
'reportDownloadsCom'
,
components
:
{
outputValueDialog
},
data
()
{
return
{
reportDay
:
moment
().
subtract
(
1
,
'day'
).
format
(
'YYYY年MM月DD日'
),
pickerOptions
:
{
// 不能超过当前日期和业务开始日期
disabledDate
(
time
)
{
return
time
.
getTime
()
>
Date
.
now
()
-
8.64e7
||
time
.
getTime
()
<
new
Date
(
'2020-10-01'
).
getTime
()
-
1
*
24
*
60
*
60
*
1000
}
},
dateValue
:
''
,
outputVisible
:
false
}
}
}
</
script
>
<
style
lang=
"scss"
>
.reportContainer
{
display
:
flex
;
height
:
30px
;
font-size
:
14px
;
.reportTips
{
font-size
:
20px
;
font-family
:
PingFangSC-Medium
,
PingFang
SC
;
font-weight
:
500
;
color
:
#333333
;
padding-right
:
25px
;
border-right
:
1px
solid
#dcdfe6
;
}
.selectContainer
{
display
:
flex
;
align-items
:
center
;
padding-left
:
25px
;
.exportBtn
{
font-size
:
12px
;
padding
:
8px
10px
;
}
}
.daySelect
{
margin
:
0
8px
;
.el-input__inner
{
height
:
30px
;
}
.el-input__icon
{
line-height
:
30px
;
}
}
.inputTargetBtn
{
margin-left
:
auto
;
line-height
:
30px
;
cursor
:
pointer
;
.el-icon-edit
{
margin-right
:
5px
;
}
}
}
</
style
>
src/views/index/index.vue
View file @
067dc75
<!-- 总览 -->
<!-- 总览 -->
<
template
>
<
template
>
<div
class=
"indexPage"
>
<div
class=
"indexPage"
>
<reportDownloads
v-if=
"isBeSuper"
></reportDownloads>
<!--
<el-row>
<el-col
:span=
"24"
>
<el-card
:body-style=
"
{ padding: '16px' }">
<div
class=
"reportContainer box-card"
>
<div
class=
"reportTips"
>
数据日报
{{
reportDay
}}
已生成
</div>
<div
class=
"selectContainer"
>
<div>
选择日期
</div>
<div
class=
"daySelect"
>
<el-date-picker
v-model=
"dateValue"
type=
"date"
:picker-options=
"pickerOptions"
format=
"yyyy 年 MM 月 dd 日"
placeholder=
"选择日期"
>
</el-date-picker>
</div>
<el-button
type=
"primary"
class=
"exportBtn"
>
导出日报
</el-button>
</div>
<div
class=
"inputTargetBtn"
@
click=
"outputVisible = true"
><i
class=
"el-icon-edit"
></i>
输入单店产值目标
</div>
</div>
</el-card>
</el-col>
</el-row>
-->
<el-row>
<el-row>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
...
@@ -287,10 +312,12 @@
...
@@ -287,10 +312,12 @@
</el-card>
</el-card>
</el-col>
</el-col>
</el-row>
</el-row>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
reportDownloads
from
'./components/reportDownloads'
import
{
import
{
// getTodayInvite,
// getTodayInvite,
getTotalData
,
getTotalData
,
...
@@ -317,8 +344,12 @@ import { getPartnerYqListApi } from '@/api/account'
...
@@ -317,8 +344,12 @@ import { getPartnerYqListApi } from '@/api/account'
import
*
as
echarts
from
'echarts'
import
*
as
echarts
from
'echarts'
export
default
{
export
default
{
name
:
'index'
,
name
:
'index'
,
components
:
{
reportDownloads
},
data
()
{
data
()
{
return
{
return
{
// store: $store.getters['d2admin/auth/curBtns'],
id
:
''
,
id
:
''
,
isBeSuper
:
false
,
isBeSuper
:
false
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
userInfo
:
this
.
$store
.
state
.
d2admin
.
user
.
info
,
...
@@ -357,8 +388,21 @@ export default {
...
@@ -357,8 +388,21 @@ export default {
productType
:
'thisMonth'
productType
:
'thisMonth'
}
}
},
},
computed
:
{
curBtnsInfo
()
{
const
curBtns
=
this
.
$store
.
getters
[
'd2admin/auth/curBtns'
]
||
[]
return
curBtns
.
some
((
item
)
=>
{
// 路由定义的权限id
return
item
.
authId
==
'90701'
})
// return this.$store.getters['d2admin/auth/curBtns']
}
},
mounted
()
{
mounted
()
{
// console.log(this.$store.getters)
console
.
log
(
this
.
$store
.
getters
[
'd2admin/auth/curBtns'
])
// let reportDay = moment().subtract(1, 'day').format('YYYY年MM月DD日')
// console.log(moment().subtract(1, 'day').format('YYYY年MM月DD日'))
this
.
getUserId
().
then
(()
=>
{
this
.
getUserId
().
then
(()
=>
{
this
.
init
()
this
.
init
()
})
})
...
@@ -736,6 +780,7 @@ export default {
...
@@ -736,6 +780,7 @@ export default {
//
padding
:
15px
0
;
//
padding
:
15px
0
;
}
}
}
}
.top_card
{
.top_card
{
margin
:
15px
0
;
margin
:
15px
0
;
padding
:
15px
;
padding
:
15px
;
...
@@ -845,4 +890,15 @@ export default {
...
@@ -845,4 +890,15 @@ export default {
max-width
:
100%
;
max-width
:
100%
;
}
}
}
}
.a
{
.b
{
text-align
:
center
;
}
}
//
.c
{
.b
{
text-align
:
left
;
}
//
}\\
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment