Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manage
Overview
Overview
Details
Activity
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
vanke
manage
Commits
6f1d86da
Commit
6f1d86da
authored
Jun 29, 2020
by
wangyalan-git
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理,系统设置
parent
72271050
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
152 deletions
+125
-152
user.js
src/api/user.js
+8
-1
index.js
src/router/index.js
+7
-7
InventoryChart.vue
src/views/sta/InventoryChart.vue
+38
-45
Recipients.vue
src/views/sta/Recipients.vue
+37
-44
AdminList.vue
src/views/use/AdminList.vue
+35
-55
No files found.
src/api/user.js
View file @
6f1d86da
...
...
@@ -3,7 +3,14 @@
*/
import
request
from
'@/utils/request'
// 管理员列表查询
export
function
getAdminList
(
params
)
{
return
request
({
url
:
'manage/queryPageList'
,
method
:
'get'
,
params
})
}
// 万科后台_用户分页操作
export
function
getMemberList
(
params
)
{
...
...
src/router/index.js
View file @
6f1d86da
...
...
@@ -165,16 +165,16 @@ export const asyncRouterMap = [
{
path
:
'/ums'
,
component
:
Layout
,
redirect
:
'/ums/
admin
'
,
redirect
:
'/ums/
role
'
,
name
:
'ums'
,
meta
:
{
title
:
'权限'
,
icon
:
'ums'
},
children
:
[
{
path
:
'admin'
,
name
:
'admin'
,
component
:
()
=>
import
(
'@/views/ums/admin/index'
),
meta
:
{
title
:
'用户列表'
,
icon
:
'ums-admin'
}
},
//
{
//
path: 'admin',
//
name: 'admin',
//
component: () => import('@/views/ums/admin/index'),
//
meta: { title: '用户列表', icon: 'ums-admin' }
//
},
{
path
:
'role'
,
name
:
'role'
,
...
...
src/views/sta/InventoryChart.vue
View file @
6f1d86da
...
...
@@ -124,54 +124,47 @@ export default {
}
},
methods
:
{
getDay
(
num
,
str
)
{
getDay
(
day
)
{
var
today
=
new
Date
()
var
nowTime
=
today
.
getTime
()
var
ms
=
24
*
3600
*
1000
*
num
today
.
setTime
(
parseInt
(
nowTime
+
ms
)
)
var
oYear
=
today
.
getFullYear
()
var
oMoth
=
(
today
.
getMonth
()
+
1
).
toString
()
if
(
oMoth
.
length
<=
1
)
oMoth
=
'0'
+
oMoth
var
oDay
=
today
.
getDate
().
toString
(
)
if
(
oDay
.
length
<=
1
)
oDay
=
'0'
+
oDay
return
oYear
+
str
+
oMoth
+
str
+
oDay
var
targetday_milliseconds
=
today
.
getTime
()
+
1000
*
60
*
60
*
24
*
day
today
.
setTime
(
targetday_milliseconds
)
//注意,这行是关键代码
var
tYear
=
today
.
getFullYear
(
)
var
tMonth
=
today
.
getMonth
()
var
tDate
=
today
.
getDate
()
tMonth
=
this
.
doHandleMonth
(
tMonth
+
1
)
tDate
=
this
.
doHandleMonth
(
tDate
)
console
.
log
(
'tYear +
\'
-
\'
+ tMonth +
\'
-
\'
+ tDate'
,
tYear
+
'-'
+
tMonth
+
'-'
+
tDate
)
return
tYear
+
'-'
+
tMonth
+
'-'
+
tDate
},
formatDate
(
date
)
{
date
=
new
Date
(
date
)
let
myyear
=
date
.
getFullYear
()
let
mymonth
=
date
.
getMonth
()
+
1
let
myweekday
=
date
.
getDate
()
mymonth
<
10
?
mymonth
=
'0'
+
mymonth
:
mymonth
myweekday
<
10
?
myweekday
=
'0'
+
myweekday
:
myweekday
return
`
${
myyear
}
-
${
mymonth
}
-
${
myweekday
}
`
},
mGetDate
()
{
var
date
=
new
Date
()
var
year
=
date
.
getFullYear
()
var
month
=
date
.
getMonth
()
+
1
var
d
=
new
Date
(
year
,
month
,
0
)
return
d
.
getDate
()
doHandleMonth
(
month
)
{
var
m
=
month
if
(
month
.
toString
().
length
==
1
)
{
m
=
'0'
+
month
}
return
m
},
getNowM
(
e
)
{
let
now
=
new
Date
()
let
current_month_num
=
this
.
mGetDate
()
let
current_month
=
[]
for
(
let
i
=
1
;
i
<=
current_month_num
;
i
++
)
{
let
day
=
now
.
setDate
(
i
)
let
everyDay
=
this
.
formatDate
(
day
)
current_month
.
push
(
everyDay
)
formatEveryDay
()
{
let
start1
=
this
.
getDay
(
-
7
)
let
end1
=
this
.
getDay
(
0
)
console
.
log
(
'start1'
,
'end1'
,
start1
,
end1
)
let
dateList
=
[]
var
startTime
=
this
.
getDate
(
start1
)
var
endTime
=
this
.
getDate
(
end1
)
while
((
endTime
.
getTime
()
-
startTime
.
getTime
())
>=
0
)
{
var
year
=
startTime
.
getFullYear
()
var
month
=
startTime
.
getMonth
()
+
1
<
10
?
'0'
+
(
startTime
.
getMonth
()
+
1
)
:
startTime
.
getMonth
()
+
1
var
day
=
startTime
.
getDate
().
toString
().
length
==
1
?
'0'
+
startTime
.
getDate
()
:
startTime
.
getDate
()
dateList
.
push
(
year
+
'-'
+
month
+
'-'
+
day
)
startTime
.
setDate
(
startTime
.
getDate
()
+
1
)
}
console
.
log
(
'
current_month'
,
current_month
)
return
current_month
console
.
log
(
'
dateList'
,
dateList
)
return
dateList
},
getWeekDay
()
{
let
that
=
this
let
dateString
=
that
.
formatDate
(
new
Date
())
//当天的日期,例如2020-2-28
let
presentDate
=
new
Date
(
dateString
)
let
today
=
presentDate
.
getDay
()
!==
0
?
presentDate
.
getDay
()
:
7
return
Array
.
from
(
new
Array
(
7
),
function
(
val
,
index
)
{
return
that
.
formatDate
(
new
Date
(
presentDate
.
getTime
()
-
(
today
-
index
-
1
)
*
24
*
60
*
60
*
1000
))
})
getDate
(
datestr
)
{
var
temp
=
datestr
.
split
(
'-'
)
var
date
=
new
Date
(
temp
[
0
],
temp
[
1
]
-
1
,
temp
[
2
])
console
.
log
(
'date'
,
date
)
return
date
},
handleOpenCate
(
visible
)
{
if
(
visible
)
{
...
...
@@ -206,11 +199,11 @@ export default {
},
getList
()
{
if
(
!
this
.
listQuery
.
goodsId
)
{
if
(
!
this
.
listQuery
.
goodsId
)
{
this
.
$message
.
warning
(
'请选择物品'
)
return
}
getInventoryList
({
dateList
:
this
.
getWeek
Day
(),
goodsId
:
this
.
listQuery
.
goodsId
}).
then
(
res
=>
{
getInventoryList
({
dateList
:
this
.
formatEvery
Day
(),
goodsId
:
this
.
listQuery
.
goodsId
}).
then
(
res
=>
{
this
.
chartData
.
rows
=
res
.
data
console
.
log
(
'res'
,
this
.
chartData
)
})
...
...
src/views/sta/Recipients.vue
View file @
6f1d86da
...
...
@@ -124,54 +124,47 @@ export default {
}
},
methods
:
{
getDay
(
num
,
str
)
{
getDay
(
day
)
{
var
today
=
new
Date
()
var
nowTime
=
today
.
getTime
()
var
ms
=
24
*
3600
*
1000
*
num
today
.
setTime
(
parseInt
(
nowTime
+
ms
)
)
var
oYear
=
today
.
getFullYear
()
var
oMoth
=
(
today
.
getMonth
()
+
1
).
toString
()
if
(
oMoth
.
length
<=
1
)
oMoth
=
'0'
+
oMoth
var
oDay
=
today
.
getDate
().
toString
(
)
if
(
oDay
.
length
<=
1
)
oDay
=
'0'
+
oDay
return
oYear
+
str
+
oMoth
+
str
+
oDay
var
targetday_milliseconds
=
today
.
getTime
()
+
1000
*
60
*
60
*
24
*
day
today
.
setTime
(
targetday_milliseconds
)
//注意,这行是关键代码
var
tYear
=
today
.
getFullYear
(
)
var
tMonth
=
today
.
getMonth
()
var
tDate
=
today
.
getDate
()
tMonth
=
this
.
doHandleMonth
(
tMonth
+
1
)
tDate
=
this
.
doHandleMonth
(
tDate
)
console
.
log
(
'tYear +
\'
-
\'
+ tMonth +
\'
-
\'
+ tDate'
,
tYear
+
'-'
+
tMonth
+
'-'
+
tDate
)
return
tYear
+
'-'
+
tMonth
+
'-'
+
tDate
},
formatDate
(
date
)
{
date
=
new
Date
(
date
)
let
myyear
=
date
.
getFullYear
()
let
mymonth
=
date
.
getMonth
()
+
1
let
myweekday
=
date
.
getDate
()
mymonth
<
10
?
mymonth
=
'0'
+
mymonth
:
mymonth
myweekday
<
10
?
myweekday
=
'0'
+
myweekday
:
myweekday
return
`
${
myyear
}
-
${
mymonth
}
-
${
myweekday
}
`
},
mGetDate
()
{
var
date
=
new
Date
()
var
year
=
date
.
getFullYear
()
var
month
=
date
.
getMonth
()
+
1
var
d
=
new
Date
(
year
,
month
,
0
)
return
d
.
getDate
()
doHandleMonth
(
month
)
{
var
m
=
month
if
(
month
.
toString
().
length
==
1
)
{
m
=
'0'
+
month
}
return
m
},
getNowM
(
e
)
{
let
now
=
new
Date
()
let
current_month_num
=
this
.
mGetDate
()
let
current_month
=
[]
for
(
let
i
=
1
;
i
<=
current_month_num
;
i
++
)
{
let
day
=
now
.
setDate
(
i
)
let
everyDay
=
this
.
formatDate
(
day
)
current_month
.
push
(
everyDay
)
formatEveryDay
()
{
let
start1
=
this
.
getDay
(
-
7
)
let
end1
=
this
.
getDay
(
0
)
console
.
log
(
'start1'
,
'end1'
,
start1
,
end1
)
let
dateList
=
[]
var
startTime
=
this
.
getDate
(
start1
)
var
endTime
=
this
.
getDate
(
end1
)
while
((
endTime
.
getTime
()
-
startTime
.
getTime
())
>=
0
)
{
var
year
=
startTime
.
getFullYear
()
var
month
=
startTime
.
getMonth
()
+
1
<
10
?
'0'
+
(
startTime
.
getMonth
()
+
1
)
:
startTime
.
getMonth
()
+
1
var
day
=
startTime
.
getDate
().
toString
().
length
==
1
?
'0'
+
startTime
.
getDate
()
:
startTime
.
getDate
()
dateList
.
push
(
year
+
'-'
+
month
+
'-'
+
day
)
startTime
.
setDate
(
startTime
.
getDate
()
+
1
)
}
console
.
log
(
'
current_month'
,
current_month
)
return
current_month
console
.
log
(
'
dateList'
,
dateList
)
return
dateList
},
getWeekDay
()
{
let
that
=
this
let
dateString
=
that
.
formatDate
(
new
Date
())
//当天的日期,例如2020-2-28
let
presentDate
=
new
Date
(
dateString
)
let
today
=
presentDate
.
getDay
()
!==
0
?
presentDate
.
getDay
()
:
7
return
Array
.
from
(
new
Array
(
7
),
function
(
val
,
index
)
{
return
that
.
formatDate
(
new
Date
(
presentDate
.
getTime
()
-
(
today
-
index
-
1
)
*
24
*
60
*
60
*
1000
))
})
getDate
(
datestr
)
{
var
temp
=
datestr
.
split
(
'-'
)
var
date
=
new
Date
(
temp
[
0
],
temp
[
1
]
-
1
,
temp
[
2
])
console
.
log
(
'date'
,
date
)
return
date
},
handleOpenCate
(
visible
)
{
if
(
visible
)
{
...
...
@@ -210,7 +203,7 @@ export default {
this
.
$message
.
warning
(
'请选择物品'
)
return
}
getRecipientList
({
dateList
:
this
.
getWeek
Day
(),
goodsId
:
this
.
listQuery
.
goodsId
}).
then
(
res
=>
{
getRecipientList
({
dateList
:
this
.
formatEvery
Day
(),
goodsId
:
this
.
listQuery
.
goodsId
}).
then
(
res
=>
{
this
.
chartData
.
rows
=
res
.
data
})
},
...
...
src/views/use/AdminList.vue
View file @
6f1d86da
...
...
@@ -15,16 +15,18 @@
<el-button
type=
"primary"
@
click=
"handleSearchList"
icon=
"el-icon-search"
size=
"small"
>
搜索
</el-button>
size=
"small"
>
搜索
</el-button>
<el-button
@
click=
"handleResetSearch"
icon=
"el-icon-refresh"
size=
"small"
>
重置
</el-button>
size=
"small"
>
重置
</el-button>
</el-form-item>
<!--
<el-button
class=
"btn-add"
--
>
<!-- size="small"-->
<!-- type="primary"-->
<!-- @click="handleAdd">添加管理员-->
<!--
</el-button>
-->
<!--
<el-button
class=
"btn-add"
--
>
<!-- size="small"-->
<!-- type="primary"-->
<!-- @click="handleAdd">添加管理员-->
<!--
</el-button>
-->
</el-form>
</el-card>
<!-- 表格栏 -->
...
...
@@ -40,34 +42,32 @@
width=
"50"
></el-table-column>
<el-table-column
label=
"姓名"
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
user
name
}}
</
template
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
name
}}
</
template
>
</el-table-column>
<el-table-column
label=
"AD用户"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
phon
e
||
'--'
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
departNam
e
||
'--'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"部门"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
email
||
'--'
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
departName
||
'--'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"所属库房"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
createDate
|
formatTi
me
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
stockRoomNa
me
}}
</
template
>
</el-table-column>
<el-table-column
label=
"联系方式"
align=
"center"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
|
formatStatus
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
phone
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
width=
"220"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<!--
<el-button
size=
"mini"
--
>
<!-- type="success"-->
<!-- @click="addDepot(scope.row)">添加库房
</el-button>
-->
<el-button
size=
"mini"
type=
"success"
@
click=
"lookDetail(scope.row)"
>
删除
</el-button>
@
click=
"handleDelete(scope.row.id)"
>
解绑
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -85,46 +85,28 @@
</el-pagination>
</div>
</el-card>
<!-- end -->
<!-- 弹窗 -->
<add-depot
ref=
"addDepot"
@
ok=
"getList"
></add-depot>
<!-- end -->
</div>
</template>
<
script
>
import
moment
from
'moment'
import
{
get
Supplier
,
getAuditDetail
,
updateMcht
}
from
'@/api/admin
'
import
{
get
AdminList
,
cancleAdmin
}
from
'@/api/user
'
import
AddDepot
from
'./modules/AddAdmin'
// 列表查询参数默认值
const
defaultListQuery
=
{
pageNum
:
1
,
pageSize
:
10
,
accouuntType
:
0
,
name
:
''
,
phone
:
''
,
status
:
''
condition
:
0
,
roleId
:
''
,
departId
:
''
}
// 账号状态数据
const
defaultStatusOptions
=
[
{
label
:
'启用'
,
value
:
1
},
{
label
:
'禁用'
,
value
:
0
}
]
// 管理员入驻账号列表
export
default
{
name
:
'AdminList'
,
components
:
{
AddDepot
},
components
:
{
AddDepot
},
data
()
{
return
{
listQuery
:
Object
.
assign
({},
defaultListQuery
),
statusOptions
:
defaultStatusOptions
,
list
:
[],
total
:
0
,
listLoading
:
false
,
...
...
@@ -140,18 +122,11 @@ export default {
return
'--'
}
return
moment
(
time
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
formatStatus
(
status
)
{
if
(
status
==
0
)
{
return
'禁用'
}
else
{
return
'启用'
}
}
},
methods
:
{
// 添加管理员
handleAdd
()
{
handleAdd
()
{
this
.
$refs
.
addSupplier
.
add
()
},
handleResetSearch
()
{
...
...
@@ -178,7 +153,7 @@ export default {
getList
()
{
this
.
listLoading
=
true
//请求数据
get
Supplier
(
this
.
listQuery
).
then
(
res
=>
{
get
AdminList
(
this
.
listQuery
).
then
(
res
=>
{
this
.
listLoading
=
false
this
.
list
=
res
.
data
.
list
this
.
total
=
res
.
data
.
total
...
...
@@ -186,13 +161,18 @@ export default {
this
.
listLoading
=
false
})
},
// 查看
addDepot
(
row
)
{
this
.
$refs
.
addDepot
.
add
()
},
//编辑
editDetail
(
id
)
{
this
.
$refs
.
addSupplier
.
detail
(
id
)
// 删除
handleDelete
(
id
)
{
this
.
$confirm
(
'是否取消管理员权限?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
cancleAdmin
({
id
:
id
,
deleteStatus
:
1
}).
then
(
res
=>
{
this
.
getList
()
})
}).
catch
(()
=>
{
})
}
}
}
...
...
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