|
@@ -5,10 +5,10 @@ Page({
|
|
|
data: {
|
|
|
tabIndex: 1,
|
|
|
menuList: [
|
|
|
- { name: '我的绩效', icon: 'icon-fenzu', url: '../myJx/myJx', code: 'creator admin', index: 1,color:'blue' },
|
|
|
- { name: '我参与的', icon: 'icon-canyu', url: '../participation/participation', code: 'admin employee', index: 2,color:'orange' },
|
|
|
- { name: '报表统计', icon: 'icon-tongji', url: '../statistics/statistics', code: 'creator admin', index: 3,color:'green' },
|
|
|
- { name: '全部考核', icon: 'icon-quanbu', url: '../allJx/allJx', code: 'creator admin', index: 4,color:'blue' },
|
|
|
+ { name: '我的绩效', icon: 'icon-fenzu', url: '../myJx/myJx', code: 'creator admin', index: 1, color: 'blue' },
|
|
|
+ { name: '我参与的', icon: 'icon-canyu', url: '../participation/participation', code: 'admin employee', index: 2, color: 'orange' },
|
|
|
+ { name: '报表统计', icon: 'icon-tongji', url: '../statistics/statistics', code: 'creator admin', index: 3, color: 'green' },
|
|
|
+ { name: '全部考核', icon: 'icon-quanbu', url: '../allJx/allJx', code: 'creator admin', index: 4, color: 'blue' },
|
|
|
],
|
|
|
dbList: [],
|
|
|
dbTolal: 0,
|
|
@@ -21,21 +21,38 @@ Page({
|
|
|
dd.setNavigationBar({ title: "首页" });
|
|
|
that.setData({
|
|
|
userInfo: app.globalData.userData,
|
|
|
- role:getCache('role')
|
|
|
+ role: getCache('role')
|
|
|
})
|
|
|
this.setR();
|
|
|
+ this.returnS();
|
|
|
+ this.getUserList();
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getDb()
|
|
|
- this.getUserList();
|
|
|
},
|
|
|
- setR(){
|
|
|
- if(this.data.role=='employee'){
|
|
|
+ returnS() {
|
|
|
+ let str = "绩效主管理员"
|
|
|
+ let role = this.data.role
|
|
|
+ if (role == 'masterAdministrator') {
|
|
|
+ str = "绩效主管理员"
|
|
|
+ } else if (role == 'childAdministrator') {
|
|
|
+ str = "绩效子管理员"
|
|
|
+ } else if (role == 'deptManager') {
|
|
|
+ str = "部门管理员"
|
|
|
+ } else {
|
|
|
+ str = "员工"
|
|
|
+ }
|
|
|
+ that.setData({
|
|
|
+ str: str
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setR() {
|
|
|
+ if (this.data.role == 'employee') {
|
|
|
this.setData({
|
|
|
- menuList: [
|
|
|
- { name: '我的绩效', icon: 'icon-fenzu', url: '../myJx/myJx', code: 'creator admin', index: 1,color:'blue' },
|
|
|
- { name: '我参与的', icon: 'icon-canyu', url: '../participation/participation', code: 'admin employee', index: 2,color:'orange' },
|
|
|
- ],
|
|
|
+ menuList: [
|
|
|
+ { name: '我的绩效', icon: 'icon-fenzu', url: '../myJx/myJx', code: 'admin', index: 1, color: 'blue' },
|
|
|
+ { name: '我参与的', icon: 'icon-canyu', url: '../participation/participation', code: 'admin employee', index: 2, color: 'orange' },
|
|
|
+ ],
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -48,8 +65,29 @@ Page({
|
|
|
}
|
|
|
app.globalData.usersList = data;
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
openUrl(e) {
|
|
|
+ // dd.chooseDingTalkDir({
|
|
|
+ // success: (res) => {
|
|
|
+ // /* data结构
|
|
|
+ // {"data":
|
|
|
+ // [
|
|
|
+ // {
|
|
|
+ // "spaceId": "" //被选中的空间id
|
|
|
+ // "path": "", // 被选中的文件夹路径
|
|
|
+ // "dirId": "", //被选中的文件夹id
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ // */
|
|
|
+ // },
|
|
|
+ // fail: (err) =>{
|
|
|
+ // dd.alert({
|
|
|
+ // content:JSON.stringify(err)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
var url = e.target.dataset.url;
|
|
|
if (url == 'all') {
|
|
|
dd.switchTab({
|
|
@@ -63,7 +101,7 @@ Page({
|
|
|
},
|
|
|
openDetail(e) {
|
|
|
let item = e.target.dataset.item
|
|
|
- if(this.data.tabIndex==2){
|
|
|
+ if (this.data.tabIndex == 2) {
|
|
|
let data = {
|
|
|
id: item.id,
|
|
|
type: item.type,
|
|
@@ -72,10 +110,10 @@ Page({
|
|
|
dd.navigateTo({
|
|
|
url: `../performanceDetails/performanceDetails?id=${item.remark.packageEmployee_id}&tel=${item.remark.package_name}&paths='messageInform'&data=${JSON.stringify(data)}`
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
dd.navigateTo({
|
|
|
url: `../performanceDetails/performanceDetails?id=${item.remark.packageEmployee_id}&tel=${item.remark.package_name}`
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
//代办||未读消息
|
|
@@ -85,6 +123,18 @@ Page({
|
|
|
Promise.all([http1, http2]).then(function (res) {
|
|
|
let data1 = res[0].data.data;
|
|
|
let data2 = res[1].data.data;
|
|
|
+ data1.list.forEach(item => {
|
|
|
+ if (item.remark.employee_id) {
|
|
|
+ //被考核人
|
|
|
+ item.userInfo = app.globalData.usersList[item.remark.employee_id];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ data2.list.forEach(item => {
|
|
|
+ if (item.remark.employee_id) {
|
|
|
+ //被考核人
|
|
|
+ item.userInfo = app.globalData.usersList[item.remark.employee_id];
|
|
|
+ }
|
|
|
+ });
|
|
|
that.setData({
|
|
|
dbList: data1.list,
|
|
|
dbTolal: data1.total,
|
|
@@ -101,11 +151,11 @@ Page({
|
|
|
},
|
|
|
openAll(e) {
|
|
|
let index = e.target.dataset.index
|
|
|
- if(index==1){
|
|
|
+ if (index == 1) {
|
|
|
dd.navigateTo({
|
|
|
url: `../backlog/backlog`
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
dd.navigateTo({
|
|
|
url: `../messageInform/messageInform`
|
|
|
})
|