*****
[TOC]
## 员工列表
~~~[api]
post:/user/list
string:key#排序字段名 如 id, name
string:order#排序规则
*int:page#页码
*int:limit#每页数量
string:name#名字筛选
int:type#类型 员工=0 合量=1
int:state#在职=1 离职=0
array:office#职位id ,
array:shop_id#门店id,
<<<
success
{
"code": 0,
"info": "成功",
"data": {
"count": 2,
"list": [{
"id": 1000,
"name": "老板",
"phone": "18888889999",
"identity": "",
"entry_date": "2016-12-13",
"leave_date": "2018-01-20",
"type": 0,
"shop_name": "宝鸡手机通讯3",
"title": "经理",
"state": 1,
"wechat_user_id": 568
}, {
"id": 999,
"name": "管理员",
"phone": "",
"identity": "",
"entry_date": "2016-11-01",
"leave_date": "2018-03-31",
"type": 0,
"shop_name": "宝鸡手机通讯3",
"title": "总经理",
"state": 0,
"wechat_user_id": 0
}]
}
}
<<<
error
~~~
## 重置密码
~~~[api]
post:/user/resetpassword
*string:id=默认值#用户ID
<<<
success
{
"code": 0,
"info": "成功",
"data": null
}
<<<
error
~~~
## 修改自己密码
~~~[api]
post:/user/editpassword
*string:oldpassword=默认值#旧密码
*string:newpassword=默认值#新密码
<<<
success
{
"code": 0,
"info": "成功",
"data": null
}
<<<
error
~~~
## 离职/复职
~~~[api]
post:/user/state
*int:id=默认值# 用户ID
*int:state=默认值# 1=复职 0=离职
<<<
success
{
"code": 0,
"info": "成功",
"data": null
}
<<<
error
~~~
## 添加员工
~~~[api]
post:/user/add
*string:name#名字
*string:phone#电话
*string:identity#身份证
*string:entry_date#入职时间
*int:office#职位id
*int:shop_id#门店id
<<<
success
{
"code": 0,
"info": "成功",
"data": {
"name": "王伟",
"phone": "133333333",
"identity": "22222222222",
"entry_date": "2018-9-1",
"office": "1",
"shop_id": "1",
"id": "1001"
}
}
<<<
error
~~~
## 编辑员工
~~~[api]
post:/user/edit
*int:id#ID
*string:name#名字
*string:phone#电话
*string:identity#身份证
*string:entry_date#入职时间
*int:office#职位id
*int:shop_id#门店id
*int:state=默认值# 1=复职 0=离职
<<<
success
{
"code": 0,
"info": "成功",
"data": {
"name": "王伟",
"phone": "133333333",
"identity": "22222222222",
"entry_date": "2018-9-1",
"office": "1",
"shop_id": "1",
"id": "1001"
}
}
<<<
error
~~~
## 员工详情
~~~[api]
post:/user/info
*int:id=默认值# 用户ID
<<<
success
{
"code": 0,
"info": "成功",
"data": {
"id": 999,
"name": "王伟",
"phone": "1333333331",
"identity": "222222222222",
"entry_date": "2018-09-01",
"leave_date": "2018-03-31",
"type": 0,
"shop_name": "宝鸡手机通讯3",
"title": "总经理",
"state": 1,
"wechat_user_id": 0
}
}
<<<
error
~~~
## 员工权限列表
~~~[api]
post:/user/competence
*string:id=默认值#用户ID
<<<
success
{
"code": 0,
"info": "成功",
"data": [{
"title": "公共权限",
"child": [{
"id": 1,
"title": "门店管理",
"about": null,
"state": 0,
"type": 0,
"child": [{
"id": 4,
"title": "区域管理",
"about": null,
"state": 0,
"type": 1,
"checked": true
}, {
"id": 5,
"title": "门店管理",
"about": null,
"state": 0,
"type": 1,
"checked": false
}]
}]
}, {
"title": "区域权限",
"child": [{
"id": 1,
"title": "西安2",
"child": [{
"id": 2,
"title": "员工管理",
"about": null,
"state": 1,
"type": 0,
"child": [{
"id": 6,
"title": "职务管理",
"about": null,
"state": 1,
"type": 2,
"checked": true
}, {
"id": 7,
"title": "用户组管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}, {
"id": 8,
"title": "员工管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}, {
"id": 9,
"title": "权限管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}]
}]
}, {
"id": 2,
"title": "渭南",
"child": [{
"id": 2,
"title": "员工管理",
"about": null,
"state": 1,
"type": 0,
"child": [{
"id": 6,
"title": "职务管理",
"about": null,
"state": 1,
"type": 2,
"checked": true
}, {
"id": 7,
"title": "用户组管理",
"about": null,
"state": 1,
"type": 2,
"checked": true
}, {
"id": 8,
"title": "员工管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}, {
"id": 9,
"title": "权限管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}]
}]
}, {
"id": 3,
"title": "宝鸡",
"child": [{
"id": 2,
"title": "员工管理",
"about": null,
"state": 1,
"type": 0,
"child": [{
"id": 6,
"title": "职务管理",
"about": null,
"state": 1,
"type": 2,
"checked": true
}, {
"id": 7,
"title": "用户组管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}, {
"id": 8,
"title": "员工管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}, {
"id": 9,
"title": "权限管理",
"about": null,
"state": 1,
"type": 2,
"checked": false
}]
}]
}]
}, {
"title": "门店权限",
"child": [{
"id": 1,
"shop_name": "宝鸡手机通讯3",
"child": [{
"id": 3,
"title": "商家工资",
"about": null,
"state": 2,
"type": 0,
"child": [{
"id": 10,
"title": "区域管理",
"about": null,
"state": 2,
"type": 3,
"checked": false
}, {
"id": 11,
"title": "商家管理",
"about": null,
"state": 2,
"type": 3,
"checked": true
}, {
"id": 12,
"title": "财务统计",
"about": null,
"state": 2,
"type": 3,
"checked": false
}]
}]
}, {
"id": 2,
"shop_name": "444",
"child": [{
"id": 3,
"title": "商家工资",
"about": null,
"state": 2,
"type": 0,
"child": [{
"id": 10,
"title": "区域管理",
"about": null,
"state": 2,
"type": 3,
"checked": false
}, {
"id": 11,
"title": "商家管理",
"about": null,
"state": 2,
"type": 3,
"checked": true
}, {
"id": 12,
"title": "财务统计",
"about": null,
"state": 2,
"type": 3,
"checked": false
}]
}]
}, {
"id": 3,
"shop_name": "333",
"child": [{
"id": 3,
"title": "商家工资",
"about": null,
"state": 2,
"type": 0,
"child": [{
"id": 10,
"title": "区域管理",
"about": null,
"state": 2,
"type": 3,
"checked": false
}, {
"id": 11,
"title": "商家管理",
"about": null,
"state": 2,
"type": 3,
"checked": true
}, {
"id": 12,
"title": "财务统计",
"about": null,
"state": 2,
"type": 3,
"checked": false
}]
}]
}, {
"id": 5,
"shop_name": "宝鸡手机通讯31",
"child": [{
"id": 3,
"title": "商家工资",
"about": null,
"state": 2,
"type": 0,
"child": [{
"id": 10,
"title": "区域管理",
"about": null,
"state": 2,
"type": 3,
"checked": false
}, {
"id": 11,
"title": "商家管理",
"about": null,
"state": 2,
"type": 3,
"checked": true
}, {
"id": 12,
"title": "财务统计",
"about": null,
"state": 2,
"type": 3,
"checked": false
}]
}]
}]
}]
}
<<<
error
~~~
## 查看员工区域权限
~~~[api]
post:/user/competenceregion
*array:id=默认值#区域id 数组
*user_id#员工id
*com_json# 提交json 格式:[{"competence_id": 4,"regionorshop_id": 2 }, {"competence_id": 1,"regionorshop_id": 0 }]
<<<
success
{
"code": 0,
"info": "成功",
"data": [{
"id": 15,
"state": 1,
"title": "审批权限",
"sort": 0,
"type": 0,
"about": null,
"child": [{
"id": 17,
"state": 1,
"title": "查看审批流程",
"sort": 0,
"type": 15,
"about": null,
"child": [{
"id": 1,
"title": "西安2",
"checked": true
}, {
"id": 2,
"title": "渭南",
"checked": true
}],
"indet": false,
"checkAll": true
}, {
"id": 18,
"state": 1,
"title": "编辑审批流程",
"sort": 0,
"type": 15,
"about": null,
"child": [{
"id": 1,
"title": "西安2",
"checked": true
}, {
"id": 2,
"title": "渭南",
"checked": false
}],
"indet": true,
"checkAll": false
}]
}, {
"id": 16,
"state": 1,
"title": "员工权限",
"sort": 0,
"type": 0,
"about": null,
"child": [{
"id": 19,
"state": 1,
"title": "查看员工",
"sort": 0,
"type": 16,
"about": null,
"child": [{
"id": 1,
"title": "西安2",
"checked": false
}, {
"id": 2,
"title": "渭南",
"checked": false
}],
"indet": false,
"checkAll": false
}, {
"id": 20,
"state": 1,
"title": "编辑员工",
"sort": 0,
"type": 16,
"about": null,
"child": [{
"id": 1,
"title": "西安2",
"checked": false
}, {
"id": 2,
"title": "渭南",
"checked": false
}],
"indet": false,
"checkAll": false
}]
}]
}
<<<
error
~~~
## 查看员工门店权限
~~~[api]
post:/user/competenceshop
*array:id=默认值#区域id 数组
*user_id#员工id
*com_json# 提交json 格式:[{"competence_id": 4,"regionorshop_id": 2 }, {"competence_id": 1,"regionorshop_id": 0 }]
<<<
success
<<<
error
~~~
## 查看员工仓库权限
~~~[api]
post:/user/competencedepot
*array:id=默认值#区域id 数组
*user_id#员工id
*com_json# 提交json 格式:[{"competence_id": 4,"regionorshop_id": 2 }, {"competence_id": 1,"regionorshop_id": 0 }]
<<<
success
<<<
error
~~~
## 员工权限设置提交
~~~[api]
post:/user/competenceedit
*string:id=默认值#用户id
*com_json# 提交json 格式:[{"competence_id": 4,"regionorshop_id": 2 }, {"competence_id": 1,"regionorshop_id": 0 }]
<<<
success
{
"code": 0,
"info": "成功",
"data": 2
}
<<<
error
~~~
## 获取全部
~~~[api]
post:/user/alluser
<<<
success
<<<
error
~~~
## 复制员工权限
~~~[api]
post:/user/copy
*string:id=默认值#自己的id
*user_id#要复制人的ID
<<<
success
<<<
error
~~~