|
@@ -14,24 +14,41 @@ Page({
|
|
rankingList: [],
|
|
rankingList: [],
|
|
getRole_four: app.globalData.isCreator,//是否创始人
|
|
getRole_four: app.globalData.isCreator,//是否创始人
|
|
setECharts: [],//柱形图数据
|
|
setECharts: [],//柱形图数据
|
|
- pieTotal: 1
|
|
|
|
|
|
+ pieTotal: 1,
|
|
|
|
+ total:188,
|
|
|
|
+ menuList: [
|
|
|
|
+ { name: '审批', imgUrl: '../../../image/sp.png', url: '../my_approve/my_approve', code: 'creator admin employee' },
|
|
|
|
+ { name: '任务', imgUrl: '../../../image/a7.png', url: '../../statistics/my_task/my_task', code: 'admin employee' },
|
|
|
|
+ { name: '奖扣B分', imgUrl: '../../../image/point_entry.png', url: '../jk_B/jk_B?type=B', code: 'creator admin' },
|
|
|
|
+ { name: '指派任务', imgUrl: '../../../image/my_publish.png', url: '../../statistics/assaign/assaign', code: 'creator admin' },
|
|
|
|
+ { name: '申请积分', imgUrl: '../../../image/a_apply.png', url: '../apply/apply', code: 'admin employee' },
|
|
|
|
+ { name: '奖扣A分', imgUrl: '../../../image/a_entry.png', url: '../jk_B/jk_B?type=A', code: 'creator admin' },
|
|
|
|
+ { name: '领任务', imgUrl: '../../../image/task_hall.png', url: '../../statistics/getTask/getTask', code: 'admin employee' },
|
|
|
|
+ { name: '发布悬赏', imgUrl: '../../../image/caback6.png', url: '../../statistics/offerAreward/offerAreward', code: 'creator admin' },
|
|
|
|
+ { name: '发放奖票', imgUrl: '../../../image/add_ticket.png', url: '../../statistics/grant/grant', code: 'creator admin' },
|
|
|
|
+ { name: '全部', imgUrl: '../../../image/all.png', url: 'all', code: 'creator admin employee' },
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
that = this;
|
|
that = this;
|
|
chart1, chart2, chart3 = '';
|
|
chart1, chart2, chart3 = '';
|
|
},
|
|
},
|
|
|
|
+
|
|
onShow(query) {
|
|
onShow(query) {
|
|
if (app.globalData.userData) {
|
|
if (app.globalData.userData) {
|
|
- that.getUserData();
|
|
|
|
- // that.getIncidentLsit();
|
|
|
|
- // that.getIncidentNum();
|
|
|
|
|
|
+ // that.getUserData();
|
|
that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
|
|
that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
|
|
} else {
|
|
} else {
|
|
app.login(app.globalData.corpId, function (is) {
|
|
app.login(app.globalData.corpId, function (is) {
|
|
if (is) {
|
|
if (is) {
|
|
- that.getUserData();
|
|
|
|
- // that.getIncidentLsit();
|
|
|
|
- // that.getIncidentNum();
|
|
|
|
|
|
+ if(app.globalData.isCreator){
|
|
|
|
+ that.setMenuList("creator");
|
|
|
|
+ }else if(app.globalData.isAdministrator){
|
|
|
|
+ that.setMenuList("admin");
|
|
|
|
+ }else if(!app.globalData.isCreator&&!app.globalData.isAdministrator){
|
|
|
|
+ that.setMenuList("employee");
|
|
|
|
+ }
|
|
|
|
+ // that.getUserData();
|
|
that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
|
|
that.setData({ isAdministrator: app.globalData.isAdministrator, getRole_four: app.globalData.isCreator })
|
|
} else {
|
|
} else {
|
|
dd.reLaunch({
|
|
dd.reLaunch({
|
|
@@ -41,6 +58,29 @@ Page({
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ openUrl(e){
|
|
|
|
+ var url = e.target.dataset.url;
|
|
|
|
+ if(url=='all'){
|
|
|
|
+ dd.switchTab({
|
|
|
|
+ url: '../../statistics/index/index'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ dd.navigateTo({
|
|
|
|
+ url: url
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ setMenuList(str){
|
|
|
|
+ var arr=[];
|
|
|
|
+ that.data.menuList.forEach(item=>{
|
|
|
|
+ if(item.code.indexOf(str)>=0){
|
|
|
|
+ arr.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ that.setData({
|
|
|
|
+ menuList:arr
|
|
|
|
+ })
|
|
|
|
+ },
|
|
showText() {
|
|
showText() {
|
|
this.setData({ isBh: !this.data.isBh })
|
|
this.setData({ isBh: !this.data.isBh })
|
|
},
|
|
},
|
|
@@ -52,7 +92,7 @@ Page({
|
|
} else if (item.type == 'all') {
|
|
} else if (item.type == 'all') {
|
|
url = '../../statistics/B_ranking/B_ranking';
|
|
url = '../../statistics/B_ranking/B_ranking';
|
|
} else {
|
|
} else {
|
|
- url = '../../statistics/C_ranking/C_ranking?id=' + item.target_id + '&name=' + item.group_name+'&date_interval='+item.date_interval;
|
|
|
|
|
|
+ url = '../../statistics/C_ranking/C_ranking?id=' + item.target_id + '&name=' + item.group_name + '&date_interval=' + item.date_interval;
|
|
}
|
|
}
|
|
dd.navigateTo({
|
|
dd.navigateTo({
|
|
url: url
|
|
url: url
|
|
@@ -173,7 +213,7 @@ Page({
|
|
chart3.source(that.data.setECharts, {
|
|
chart3.source(that.data.setECharts, {
|
|
date: { tickCount: 5 }
|
|
date: { tickCount: 5 }
|
|
});
|
|
});
|
|
- chart3.axis('field',{
|
|
|
|
|
|
+ chart3.axis('field', {
|
|
grid: {
|
|
grid: {
|
|
lineDash: null,
|
|
lineDash: null,
|
|
stroke: '#e8e8e8',
|
|
stroke: '#e8e8e8',
|
|
@@ -200,7 +240,6 @@ Page({
|
|
date2.setDate(date1.getDate() - 30);
|
|
date2.setDate(date1.getDate() - 30);
|
|
var start_date = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
|
|
var start_date = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
|
|
var incident = app.$get2("api/integral/statistics/b", { employee_id: 0, start_date: start_date, end_date: app.globalData.day, show_type: '1' });
|
|
var incident = app.$get2("api/integral/statistics/b", { employee_id: 0, start_date: start_date, end_date: app.globalData.day, show_type: '1' });
|
|
- // var pei = app.$get2("api/integral/statistics/pie/b", { employee_id: 0, month: that.data.date });
|
|
|
|
Promise.all([incident]).then(resArr => {
|
|
Promise.all([incident]).then(resArr => {
|
|
if (resArr[0].data.code == 1) {
|
|
if (resArr[0].data.code == 1) {
|
|
const { b, chart, good, bad } = resArr[0].data.data
|
|
const { b, chart, good, bad } = resArr[0].data.data
|
|
@@ -214,18 +253,6 @@ Page({
|
|
data_bad: bad,
|
|
data_bad: bad,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- // if (resArr[1].data.code == 1) {
|
|
|
|
- // const pieData = resArr[1].data.data.list.map((item) => {
|
|
|
|
- // return { name: item.name, percent: item.point < 0 ? 0 : item.point, a: '1', point: item.point }
|
|
|
|
- // })
|
|
|
|
- // var isData = pieData.every(itme => {
|
|
|
|
- // return itme.percent == 0;
|
|
|
|
- // })
|
|
|
|
- // that.setData({
|
|
|
|
- // pieData: isData ? [] : pieData
|
|
|
|
- // });
|
|
|
|
- // chart2.changeData(pieData);
|
|
|
|
- // }
|
|
|
|
}).catch(e => {
|
|
}).catch(e => {
|
|
console.error(e)
|
|
console.error(e)
|
|
})
|
|
})
|