Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
da9ec16c
Commit
da9ec16c
authored
Aug 01, 2019
by
linking2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
员工管理
parent
92ceea9c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2649 additions
and
2020 deletions
+2649
-2020
package-lock.json
package-lock.json
+2043
-2020
staff.vue
src/components/system/staff.vue
+358
-0
staffDialog.vue
src/components/system/staffDialog.vue
+226
-0
api.js
src/service/api.js
+11
-0
menuList.js
src/util/menuList.js
+11
-0
No files found.
package-lock.json
View file @
da9ec16c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/components/system/staff.vue
0 → 100644
View file @
da9ec16c
<
template
>
<div
class=
"user"
v-loading=
"loading"
>
<el-form
ref=
"searchFrom"
:model=
"searchFrom"
label-width=
"80px"
inline
>
<el-form-item
label=
"ID"
>
<el-input
v-model=
"searchFrom.id"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"姓名"
>
<el-input
v-model=
"searchFrom.name"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"手机号码"
>
<el-input
v-model=
"searchFrom.mobile"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"身份证号"
>
<el-input
v-model=
"searchFrom.id_card"
clearable
></el-input>
</el-form-item>
<el-form-item
label=
"岗位"
>
<el-select
v-model=
"searchFrom.type"
placeholder=
"请选择"
clearable
>
<el-option
v-for=
"item in type"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"状态"
>
<el-select
v-model=
"searchFrom.status"
clearable
>
<el-option
label=
"在职"
value=
"0"
></el-option>
<el-option
label=
"离职"
value=
"1"
></el-option>
</el-select>
</el-form-item>
<!--
<el-form-item
label=
"入职日期"
>
<el-date-picker
v-model=
"startTime"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
:default-time=
"['00:00:00','23:59:59']"
@
change=
"onSearch"
>
</el-date-picker>
</el-form-item>
-->
<el-form-item>
<!--
<div
class=
"flexRow"
>
-->
<el-button
@
click=
"onSearch"
type=
"primary"
plain
>
搜索
</el-button>
<el-button
@
click=
"onAdd"
type=
"success"
plain
>
添加
</el-button>
<!--
</div>
-->
</el-form-item>
</el-form>
<el-table
:data=
"tableData"
>
<el-table-column
prop=
"id"
label=
"ID"
></el-table-column>
<el-table-column
prop=
"name"
label=
"真实姓名"
></el-table-column>
<el-table-column
prop=
"mobile"
label=
"手机号码"
></el-table-column>
<el-table-column
prop=
"id_card"
label=
"身份证号"
width=
"200"
>
<template
slot-scope=
"scope"
>
<span
style=
"white-space: nowrap"
>
{{
scope
.
row
.
id_card
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"岗位"
width=
"80"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
type
==
1
?
'销售'
:
''
}}
</
template
>
</el-table-column>
<el-table-column
prop=
"in_at"
label=
"入职时间"
></el-table-column>
<el-table-column
label=
"离职时间"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
==
1
?
scope
.
row
.
over_at
:
'-'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"状态"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
status
==
0
?
'在职'
:
'离职'
}}
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
plain
type=
"primary"
@
click=
"onEdit(scope.row)"
>
编辑
</el-button>
</
template
>
</el-table-column>
</el-table>
<page
:total=
"total"
:limit=
"limit"
@
pageChange=
"onPageChange"
@
sizeChange=
"onSizeChange"
/>
<el-dialog
:title=
"dialog.title"
:visible
.
sync=
"dialog.show"
>
<el-form
ref=
"dialogForm"
:rules=
"dialog.form.rules"
:model=
"dialog.form"
label-width=
"100px"
>
<el-form-item
label=
"真实姓名:"
prop=
"name"
>
<el-input
v-model=
"dialog.form.name"
type=
"text"
></el-input>
</el-form-item>
<el-form-item
label=
"手机号码:"
prop=
"mobile"
>
<el-input
v-model=
"dialog.form.mobile"
type=
"number"
></el-input>
</el-form-item>
<el-form-item
label=
"身份证号:"
prop=
"id_card"
>
<el-input
v-model=
"dialog.form.id_card"
type=
"text"
></el-input>
</el-form-item>
<el-form-item
label=
"岗位:"
prop=
"type"
>
<el-select
v-model=
"dialog.form.type"
placeholder=
"请选择"
>
<el-option
v-for=
"item in type"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"入职日期:"
prop=
"in_at"
>
<el-date-picker
v-model=
"dialog.form.in_at"
type=
"date"
value-format=
"yyyy-MM-dd"
:clearable=
"false"
placeholder=
"选择日期"
>
</el-date-picker>
</el-form-item>
<el-form-item
v-if=
"dialog.title != '添加员工'"
label=
"离职日期:"
prop=
"over_at"
>
<el-date-picker
v-model=
"dialog.form.over_at"
type=
"date"
value-format=
"yyyy-MM-dd"
:clearable=
"true"
placeholder=
"选择日期"
>
</el-date-picker>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"dialogToggle"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"dialogSave"
>
确定
</el-button>
</span>
</el-dialog>
</div>
</template>
<
script
>
import
{
getStaffListApi
,
postStaffListApi
,
putStaffListApi
}
from
"../../service/api"
;
import
page
from
'../framework/page'
export
default
{
name
:
"index"
,
data
()
{
return
{
searchFrom
:
{
id
:
''
,
name
:
''
,
mobile
:
''
,
id_card
:
''
,
type
:
''
,
status
:
''
,
start_in
:
''
,
over_in
:
''
},
startTime
:
[],
tableData
:
[],
dialog
:
{
title
:
''
,
show
:
false
,
form
:
{
id
:
''
,
name
:
''
,
mobile
:
''
,
id_card
:
''
,
type
:
''
,
in_at
:
''
,
over_at
:
''
,
rules
:
{
name
:
[{
required
:
true
,
message
:
'请输入'
,
trigger
:
'blur'
}],
mobile
:
[{
required
:
true
,
message
:
'请输入'
,
trigger
:
'blur'
}],
id_card
:
[{
required
:
true
,
message
:
'请输入'
,
trigger
:
'blur'
}],
type
:
[{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}],
in_at
:
[{
required
:
true
,
message
:
'请选择'
,
trigger
:
'change'
}],
},
}
},
type
:
[{
value
:
1
,
label
:
'销售'
}],
dialogDetail
:
{
show
:
false
,
id
:
''
},
userList
:
[],
total
:
0
,
nowPage
:
1
,
limit
:
10
,
showDetail
:
false
,
showId
:
''
,
dialogObj
:
{
show
:
false
,
title
:
'绑定老师'
,
id
:
0
,
teacher_id
:
0
},
dialogDetailObj
:
{
show
:
false
,
id
:
''
},
loading
:
false
}
},
components
:
{
page
},
mounted
()
{
this
.
getData
()
},
methods
:
{
dialogToggle
()
{
this
.
dialog
.
show
=
!
this
.
dialog
.
show
;
if
(
!
this
.
dialog
.
show
)
{
this
.
dialogReset
();
}
},
dialogReset
()
{
/*this.dialog.title = '';
this.dialog.form.id = '';
this.dialog.form.name = '';
this.dialog.form.mobile = '';
this.dialog.form.id_card = '';
this.dialog.form.type = '';
this.dialog.form.in_at = '';*/
this
.
$nextTick
(()
=>
{
console
.
log
(
'tick'
)
this
.
$refs
[
'dialogForm'
].
resetFields
();
})
},
dialogSave
()
{
this
.
$refs
[
'dialogForm'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
var
json
=
{
name
:
this
.
dialog
.
form
.
name
,
mobile
:
this
.
dialog
.
form
.
mobile
,
id_card
:
this
.
dialog
.
form
.
id_card
,
type
:
this
.
dialog
.
form
.
type
,
in_at
:
this
.
dialog
.
form
.
in_at
};
if
(
this
.
dialog
.
form
.
id
)
{
// 编辑
json
.
id
=
this
.
dialog
.
form
.
id
;
// 离职
if
(
this
.
dialog
.
form
.
over_at
)
{
json
.
over_at
=
this
.
dialog
.
form
.
over_at
;
json
.
status
=
1
;
}
else
{
json
.
over_at
=
'0000-00-00'
;
json
.
status
=
0
}
putStaffListApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'编辑成功!'
});
this
.
dialogToggle
();
this
.
getData
();
})
}
else
{
postStaffListApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'添加成功!'
});
this
.
dialogToggle
();
this
.
getData
();
})
}
}
else
{
console
.
log
(
'error submit!!'
);
return
false
;
}
});
},
getData
()
{
let
json
=
{
limit
:
this
.
limit
,
page
:
this
.
nowPage
};
this
.
searchFrom
.
id
?
json
.
id
=
this
.
searchFrom
.
id
:
''
;
this
.
searchFrom
.
name
?
json
.
name
=
this
.
searchFrom
.
name
:
''
;
this
.
searchFrom
.
mobile
?
json
.
mobile
=
this
.
searchFrom
.
mobile
:
''
;
this
.
searchFrom
.
id_card
?
json
.
id_card
=
this
.
searchFrom
.
id_card
:
''
;
this
.
searchFrom
.
type
?
json
.
type
=
this
.
searchFrom
.
type
:
''
;
this
.
searchFrom
.
status
?
json
.
status
=
this
.
searchFrom
.
status
:
''
;
getStaffListApi
(
json
).
then
(
res
=>
{
this
.
tableData
=
res
.
list
;
this
.
total
=
res
.
total
});
},
onAdd
()
{
this
.
dialog
.
title
=
'添加员工'
;
this
.
dialogToggle
();
this
.
$nextTick
(()
=>
{
this
.
dialogReset
();
});
},
onEdit
(
item
)
{
this
.
dialogToggle
();
this
.
dialogReset
();
this
.
$nextTick
(()
=>
{
this
.
dialog
.
title
=
'编辑员工'
;
this
.
dialog
.
form
.
id
=
item
.
id
;
this
.
dialog
.
form
.
name
=
item
.
name
;
this
.
dialog
.
form
.
mobile
=
item
.
mobile
;
this
.
dialog
.
form
.
id_card
=
item
.
id_card
;
this
.
dialog
.
form
.
type
=
item
.
type
;
this
.
dialog
.
form
.
in_at
=
item
.
in_at
;
if
(
item
.
status
==
1
)
{
// 离职
this
.
dialog
.
form
.
over_at
=
item
.
over_at
;
}
else
{
this
.
dialog
.
form
.
over_at
=
''
}
});
},
onSearch
(){
this
.
getData
();
},
onPageChange
(
val
)
{
this
.
nowPage
=
val
this
.
getData
()
},
onSizeChange
(
val
)
{
this
.
limit
=
val
;
this
.
nowPage
=
1
;
this
.
getData
()
},
}
}
</
script
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
.avatar {
width: 50px;
margin-right: 5px;
border-radius: 50%;
height: 50px;
}
.user {
height: 100%;
overflow: auto;
padding: 20px 0;
.btn-content {
text-align: center;
}
}
.flexRow {
display: flex;
flex-flow: row;
justify-content: flex-start;
align-items: center;
}
</
style
>
<
style
>
.f-c
>
div
{
display
:
flex
!important
;
flex-flow
:
row
;
justify-content
:
flex-start
;
align-items
:
center
;
}
</
style
>
src/components/system/staffDialog.vue
0 → 100644
View file @
da9ec16c
<
template
>
<el-dialog
title=
"添加员工"
center
append-to-body
:visible
.
sync=
"show"
width=
"800px"
>
<div
v-loading=
"loading"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
>
<el-row>
<el-col
:span=
"4"
><label>
Key
</label></el-col>
<el-col
:span=
"8"
>
<el-form-item
prop=
"key"
>
<el-input
v-model=
"form.key"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"4"
><label>
关键词
</label></el-col>
<el-col
:span=
"8"
>
<el-form-item
prop=
"value"
>
<el-input
v-model=
"form.value"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"4"
><label>
描述
</label></el-col>
<el-col
:span=
"8"
>
<el-form-item
prop=
"desc"
>
<el-input
v-model=
"form.desc"
type=
"textarea"
></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"show = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"save"
>
确 定
</el-button>
</span>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
updateConfigApi
,
saveConfigApi
}
from
"../../service/api"
;
import
{
TEACHERTYPE
}
from
"../../util/wordbook"
;
import
page
from
'../framework/page'
export
default
{
name
:
"dialogObj"
,
props
:[
'dialogObj'
],
data
(){
return
{
show
:
false
,
id
:
''
,
loading
:
true
,
form
:{
key
:
''
,
value
:
''
,
desc
:
''
},
mediaList
:
[],
rules
:{
value
:[
{
required
:
true
,
message
:
'请输入关键词'
,
trigger
:
'change'
}
],
desc
:[
{
required
:
true
,
message
:
'请输入描述'
,
trigger
:
'change'
}
],
key
:[
{
required
:
true
,
message
:
'请输入Key'
,
trigger
:
'change'
}
]
}
}
},
components
:{
page
},
methods
:{
save
(){
if
(
this
.
dialogObj
.
id
){
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
this
.
$confirm
(
'此操作将修改该配置?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
updateConfigApi
(
this
.
id
,
this
.
form
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
this
.
$emit
(
"reflash"
);
this
.
show
=
false
;
})
})
}
});
}
else
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
){
this
.
$confirm
(
'此操作将添加新配置?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
saveConfigApi
(
this
.
form
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'新增成功!'
});
this
.
$emit
(
"reflash"
);
this
.
show
=
false
;
})
})
}
});
}
},
initDialog
(){
this
.
show
=
this
.
dialogObj
.
show
;
if
(
this
.
dialogObj
.
id
)
{
this
.
id
=
this
.
dialogObj
.
id
;
}
this
.
form
.
key
=
this
.
dialogObj
.
key
;
this
.
form
.
value
=
this
.
dialogObj
.
value
;
this
.
form
.
desc
=
this
.
dialogObj
.
desc
;
this
.
loading
=
false
}
},
watch
:{
dialogObj
:{
handler
:
function
()
{
this
.
loading
=
true
;
this
.
initDialog
()
},
deep
:
true
},
show
(
value
){
this
.
$emit
(
"changeShow"
,
value
);
}
}
}
</
script
>
<
style
scoped
lang=
"less"
>
@import "../../util/public";
/*.el-col {*/
/*height: 50px;*/
/*text-align: center;*/
/*margin-bottom: 20px;*/
/*line-height: 40px;*/
/*.el-select{*/
/*width: 100%;*/
/*}*/
/*img{*/
/*width: 50px;*/
/*border-radius: 100px;*/
/*}*/
/*label{*/
/*color: #5982e6;*/
/*}*/
/*}*/
.dialog-footer{
display: block;
text-align: center;
margin-top: 30px;
}
.msg_sender_wrp {
display: flex;
flex-flow: row wrap;
justify-content: flex-start;
align-items: center;
/*position: absolute;*/
/*left: 100%;*/
/*top: 50%;*/
width: 500px;
/*z-index: 500;*/
/*-ms-transform: translateY(-50%);*/
/*transform: translateY(-50%);*/
/*background: #FFFFFF;*/
/*box-shadow: 0 1px 20px 0 #E4E8EB;*/
/*border-radius: 2px;*/
}
.el-icon-circle-plus-outline {
font-size: 28px;
}
.weui-desktop-msg-sender__tabs {
line-height: 38px;
background-color: #FFFFFF;
}
ul, ol {
padding-left: 0;
list-style-type: none;
}
.weui-desktop-msg-sender__tab {
padding: 0 15px;
float: left;
cursor: pointer;
}
.weui-desktop-msg-sender__tab_appmsg:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_appmsg3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab:before {
content: " ";
display: inline-block;
width: 22px;
height: 20px;
vertical-align: middle;
margin: -0.2em 5px 0 0;
}
.weui-desktop-msg-sender__tab_text:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_text3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab_img:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_img3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab_audio:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_audio3f92fe.svg) no-repeat 0 0;
}
.weui-desktop-msg-sender__tab_video:before {
background: transparent url(https://mp.weixin.qq.com/mpres/en_US/htmledition/pages/modules/msg_sender/svg/default/sender_video3f92fe.svg) no-repeat 0 0;
}
</
style
>
src/service/api.js
View file @
da9ec16c
...
...
@@ -1254,3 +1254,14 @@ export const putSourceStudentApi = function (type,json) {
return
Vue
.
prototype
.
$put
(
`
${
_baseUrl
}
api/admin/source/student/edit/
${
type
}
`
,
json
)
};
// /api/admin/source/student/list
//员工
export
const
getStaffListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$fetch
(
`
${
_baseUrl
}
api/admin/staff/list`
,
json
)
};
export
const
postStaffListApi
=
function
(
json
)
{
console
.
log
(
json
)
return
Vue
.
prototype
.
$post
(
`
${
_baseUrl
}
api/admin/staff/add`
,
json
)
};
export
const
putStaffListApi
=
function
(
json
)
{
return
Vue
.
prototype
.
$put
(
`
${
_baseUrl
}
api/admin/staff/edit/
${
json
.
id
}
`
,
json
)
};
src/util/menuList.js
View file @
da9ec16c
...
...
@@ -619,6 +619,17 @@ export default [{
component
:
e
=>
require
([
'@/components/smsRecord'
],
e
),
}
},
{
value
:
'员工管理'
,
routerName
:
'staff'
,
path
:
'/staff'
,
cover
:
'10-3'
,
router
:
{
path
:
'/staff'
,
name
:
'staff'
,
component
:
e
=>
require
([
'@/components/system/staff'
],
e
),
}
},
{
value
:
'系统配置'
,
routerName
:
'config'
,
...
...
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