*****
[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
~~~